亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? main.c

?? 合眾達(dá)的MCASP口的開發(fā)例程
?? C
字號(hào):
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/*
 *  ======== main.c ========
 * 
 *  This example demonstrates the use of IOM drivers with SIOs and tasks by 
 *  using the DIO class driver with a user defined device mini-driver 
 *  called "codec" and a class driver DIO instance called "dio_codec". This is 
 *  the loopback application where audio is read from an input SIO, then sent 
 *  back via an output SIO.

 *  The following objects need to be created in the DSP/BIOS
 *  configuration for this application:
 *
 *  * A UDEV object, which links in a user device driver. In this
 *    case the UDEV is a codec based IOM device driver.
 *  * A DIO object, which links the UDEV object.
 *  * A TSK object, with the function to run set to the function demo
 *    defined in this file.
 *  * A LOG named trace for debug and status output.
 */
#include <std.h>

#include <log.h>
#include <sys.h>
#include <mem.h>
#include <sio.h>
#include <csl.h>
#include <csl_cache.h>

#include "seeddm642.h"
#include <evmdm642_edma_aic23.h>

#define NUM_CODEC_CHANNELS	 8	/* stereo: left + right		*/
#define SAMPLEING_RATE		48	/* 48 samples/ms			*/
#define FRAME_SIZE			10	/* 10 ms					*/
#define	NFRAMES				100	/* 100 frames = 1 second	*/
#define	BUFLEN		(NUM_CODEC_CHANNELS*SAMPLEING_RATE*FRAME_SIZE)

#ifdef _6x_
extern far LOG_Obj trace;

/* 
 * Buffers placed in external memory are aligned on a 128 bytes boundary.
 * In addition, the buffer should be of a size multiple of 128 bytes for 
 * the cache work optimally on the C6x.
 */
#define BUFALIGN 128    /* alignment of buffer to allow use of L2 cache */
#else
extern LOG_Obj trace;
#define BUFALIGN 1
#endif

#define BUFSIZE (BUFLEN * sizeof(short)) 

/*
 *  ======== EVMDM642_DEVPARAMS ========
 *  This static initialization defines the default parameters used for
 *  EVMDM642_EDMA_AIC23 IOM driver
 */
EVMDM642_EDMA_AIC23_DevParams EVMDM642_CODEC_DEVPARAMS =
        EVMDM642_EDMA_AIC23_DEFAULT_DEVPARAMS;

/* inStream and outStream are SIO handles created in main */
SIO_Handle inStream, outStream;

/* Function prototype */
static Void createStreams();
static Void prime();


/*
 * ======== main ========
 */
Void main()
{
    LOG_printf(&trace, "echo started");
}

short *pEchoBuf;
const int echoBufSize = NFRAMES * BUFLEN;
int echoBufOffset = 0;
int delayTime = 500;
int echoAtt = 64;

/*
 *  ======== initEchoBuffer ========
 * Allocate echo buffer and fill with silence
 */
int initEchoBuffer()
{
	pEchoBuf = MEM_calloc(0, echoBufSize * sizeof(short), BUFALIGN);
	return (pEchoBuf == MEM_ILLEGAL) ? -1 : 0;
}

/*
 *  ======== copyWithEcho ========
 * Copy an incoming buffer with stereo audio samples into an outgoing
 * buffer, mixing with samples from the echo buffer indexed by
 * the parameter timeDelay.  The parameter "a" indicates the mix
 * attenuation * 256 (i.e. 64 = 0.25).
 */
void copyWithEcho(short *inBuf, short *outBuf, int timeDelay, int a)
{
	int i;
	int srcSample;

	for(i = 0;i<BUFLEN;i++)
	{
		srcSample = (int) *inBuf++;
		*outBuf++ = srcSample;
	}
}

/*
 * ======== createStreams ========
 */
static Void createStreams()
{
    SIO_Attrs attrs;
    
    /* align the buffer to allow it to be used with L2 cache */
    attrs = SIO_ATTRS;
    attrs.align = BUFALIGN;
    attrs.model = SIO_ISSUERECLAIM;

    /* open the I/O streams */
    inStream = SIO_create("/dio_codec", SIO_INPUT, BUFSIZE, &attrs);
    if (inStream == NULL) {
        SYS_abort("Create input stream FAILED.");
    }

    outStream = SIO_create("/dio_codec", SIO_OUTPUT, BUFSIZE, &attrs);
    if (outStream == NULL) {
        SYS_abort("Create output stream FAILED.");
    }
}

/*
 * ======== prime ========
 */
static Void prime()
{
    Ptr buf0, buf1, buf2, buf3;

    LOG_printf(&trace, "Allocate buffers started");

    /* Allocate buffers for the SIO buffer exchanges */
    buf0 = (Ptr)MEM_calloc(0, BUFSIZE, BUFALIGN);
    buf1 = (Ptr)MEM_calloc(0, BUFSIZE, BUFALIGN);
    buf2 = (Ptr)MEM_calloc(0, BUFSIZE, BUFALIGN);
    buf3 = (Ptr)MEM_calloc(0, BUFSIZE, BUFALIGN);
    if (buf0 == NULL || buf1 == NULL || buf2 == NULL || buf3 == NULL) {
        SYS_abort("MEM_calloc failed.");
    } 
    
    /* Issue the first & second empty buffers to the input stream */
    if (SIO_issue(inStream, buf0, SIO_bufsize(inStream), NULL) != SYS_OK) {
        SYS_abort("Error issuing buffer to the input stream");
    }
    if (SIO_issue(inStream, buf1, SIO_bufsize(inStream), NULL) != SYS_OK) {
        SYS_abort("Error issuing buffer to the input stream");
    }

    /* Issue the first & second empty buffers to the output stream */
    if (SIO_issue(outStream, buf2, SIO_bufsize(outStream), NULL) != SYS_OK) {
        SYS_abort("Error issuing buffer to the output stream");
    }
    if (SIO_issue(outStream, buf3, SIO_bufsize(outStream), NULL) != SYS_OK) {
        SYS_abort("Error issuing buffer to the output stream");
    }
}

/*
 * ======== tskAudioDemo ========
 * This function copies from the input SIO to the output SIO. You could
 * easily replace the copy function with a signal processing algorithm. 
 */
Void tskAudioDemo()
{
    Int nmadus;         /* number of minimal addressable units */
    short *inbuf, *outbuf;

	/* Call createStream function to create I/O streams */
    createStreams();
    
    /* Call prime function to do priming */
    prime();
    
    initEchoBuffer();

    /* Loop forever looping back buffers */
    for (;;) {
        /* Reclaim full buffer from the input stream */
        if ((nmadus = SIO_reclaim(inStream, (Ptr *)&inbuf, NULL)) < 0) {
            SYS_abort("Error reclaiming full buffer from the input stream");
        }

        /* Reclaim empty buffer from the output stream to be reused */
        if (SIO_reclaim(outStream, (Ptr *)&outbuf, NULL) < 0) {
            SYS_abort("Error reclaiming empty buffer from the output stream");
        }

		/* process echo algorithm */
		copyWithEcho(inbuf, outbuf, delayTime, echoAtt);
//		EVMDM642_LED_toggle(0);

        /* Issue full buffer to the output stream */
        if (SIO_issue(outStream, outbuf, nmadus, NULL) != SYS_OK) {
            SYS_abort("Error issuing full buffer to the output stream");
        }

        /* Issue an empty buffer to the input stream */
        if (SIO_issue(inStream, inbuf, SIO_bufsize(inStream), NULL) != SYS_OK) {
            SYS_abort("Error issuing empty buffer to the input stream");
        }
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
顶级嫩模精品视频在线看| 日韩高清国产一区在线| va亚洲va日韩不卡在线观看| 国产精品久久久久精k8| 99久久久无码国产精品| 亚洲网友自拍偷拍| 制服丝袜av成人在线看| 黑人巨大精品欧美黑白配亚洲| 亚洲国产精品ⅴa在线观看| 99精品视频一区| 三级久久三级久久| 精品国产乱码久久久久久夜甘婷婷 | 久久免费的精品国产v∧| 国产91精品久久久久久久网曝门 | 精品成人一区二区三区四区| 成人在线综合网站| 一区二区三国产精华液| 91精品国产高清一区二区三区蜜臀 | 性做久久久久久| 久久蜜桃香蕉精品一区二区三区| 成人av网站在线| 亚洲高清不卡在线| 国产日产欧美精品一区二区三区| 色综合天天天天做夜夜夜夜做| 无吗不卡中文字幕| 欧美国产国产综合| 欧美高清dvd| 亚洲黄色片在线观看| av在线一区二区| 天堂久久一区二区三区| 久久精品男人的天堂| 欧美性猛交xxxx乱大交退制版 | 午夜精品在线视频一区| 国产日本一区二区| 337p亚洲精品色噜噜狠狠| 成人黄页毛片网站| 蜜桃精品视频在线观看| 亚洲人成在线播放网站岛国| 精品毛片乱码1区2区3区| 国产欧美一区二区精品性色| 欧美精品在线观看一区二区| 99久久99久久精品国产片果冻| 日本美女一区二区| 亚洲综合一区二区精品导航| 亚洲国产精品ⅴa在线观看| 日韩欧美中文字幕精品| 在线观看免费一区| 成人动漫一区二区三区| 久久av老司机精品网站导航| 亚洲一二三级电影| 日韩毛片一二三区| 国产欧美日韩在线看| 欧美哺乳videos| 欧美一区二区三区播放老司机| 91官网在线免费观看| 成人激情小说网站| 国产精品一区一区三区| 激情综合网天天干| 麻豆精品在线播放| 日本视频在线一区| 热久久免费视频| 日韩av电影一区| 婷婷综合五月天| 天天色天天操综合| 午夜亚洲国产au精品一区二区| 自拍偷自拍亚洲精品播放| 国产精品美女久久久久久久久 | 91麻豆精品国产91久久久| 色激情天天射综合网| 一本色道亚洲精品aⅴ| 99国产精品国产精品久久| 欧美成人在线直播| 日韩欧美国产1| 欧美一区二区福利视频| 日韩午夜激情av| 91精品国产福利| 欧美videos大乳护士334| 欧美变态凌虐bdsm| 国产亚洲欧美在线| 欧美韩日一区二区三区| 欧美激情一区二区三区四区| 国产精品欧美精品| 亚洲精品日日夜夜| 亚洲风情在线资源站| 五月天激情综合网| 久久精品国产亚洲一区二区三区| 狠狠狠色丁香婷婷综合激情| 国产精品一区一区| 91亚洲国产成人精品一区二三| 91麻豆精品在线观看| 欧美日韩一区在线观看| 欧美一级搡bbbb搡bbbb| 久久久美女毛片| 日韩一区中文字幕| 五月激情丁香一区二区三区| 久久91精品国产91久久小草| 成人午夜大片免费观看| 欧美专区亚洲专区| 精品国产一区二区国模嫣然| 国产精品久久久一本精品| 亚洲综合色视频| 黄页网站大全一区二区| 97se亚洲国产综合自在线不卡 | 国产偷v国产偷v亚洲高清| 日韩理论片一区二区| 亚洲一卡二卡三卡四卡无卡久久| 日本女优在线视频一区二区| 成人免费看黄yyy456| 欧美羞羞免费网站| 国产亚洲一区二区在线观看| 亚洲色图19p| 美女性感视频久久| 94色蜜桃网一区二区三区| 91精品婷婷国产综合久久性色| 国产视频911| 亚洲成av人片| 成人不卡免费av| 欧美一区二区日韩| 日韩毛片高清在线播放| 激情综合网最新| 欧美午夜一区二区| 日本一区二区不卡视频| 日韩中文字幕91| 91在线小视频| 国产亚洲欧美激情| 午夜视黄欧洲亚洲| jvid福利写真一区二区三区| 日韩限制级电影在线观看| 亚洲精品伦理在线| 成人免费视频国产在线观看| 欧美另类videos死尸| 亚洲人成精品久久久久| 91精品久久久久久久99蜜桃| 欧美韩国一区二区| 韩日av一区二区| 56国语精品自产拍在线观看| 亚洲天堂中文字幕| 国产成人高清在线| 日韩午夜中文字幕| 婷婷成人综合网| 欧美一a一片一级一片| 亚洲人成7777| 99精品欧美一区二区三区综合在线| 欧美大片在线观看一区| 丝袜美腿亚洲一区| 欧美最新大片在线看 | 中文字幕一区二区三区在线不卡| 久久99精品国产.久久久久久 | 欧美伊人久久大香线蕉综合69| 国产日韩欧美高清| 国产伦精品一区二区三区免费| 日韩一级片在线观看| 日韩在线a电影| 欧美日韩欧美一区二区| 亚洲精品视频在线观看网站| av激情亚洲男人天堂| 国产人成亚洲第一网站在线播放 | 亚洲狠狠爱一区二区三区| 91在线无精精品入口| 国产精品久久福利| 成人蜜臀av电影| 国产精品私房写真福利视频| 国产乱码精品一区二区三区av| 精品少妇一区二区三区| 久久国产精品一区二区| 欧美zozo另类异族| 狠狠色2019综合网| 国产欧美一区二区在线| 成人午夜在线播放| 亚洲欧洲日韩在线| 99re视频这里只有精品| 亚洲免费三区一区二区| 在线视频欧美精品| 亚洲成a人在线观看| 亚洲男女毛片无遮挡| 一本久道中文字幕精品亚洲嫩| 亚洲免费观看高清| 欧美日韩精品系列| 秋霞午夜鲁丝一区二区老狼| 欧美精品一区二区三区高清aⅴ | 日韩欧美在线1卡| 国精产品一区一区三区mba桃花| 久久久五月婷婷| 99视频精品全部免费在线| 一区二区三区在线观看动漫| 欧美久久久久久久久久| 久久91精品国产91久久小草| 国产香蕉久久精品综合网| 91免费视频网址| 午夜激情一区二区三区| 久久婷婷国产综合国色天香 | 国产精品自在在线| 亚洲色图欧美偷拍| 欧美一区二区三区思思人| 黄页视频在线91| 亚洲欧美日韩久久| 91精品国产综合久久久久久久久久 | 欧美日韩一区二区三区免费看| 精品一区二区三区在线播放| 中文字幕在线不卡|