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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tone.c

?? 硬件是5502的evm板
?? C
字號:
/*
 *  Copyright 2003 by Spectrum Digital Incorporated.
 *  All rights reserved. Property of Spectrum Digital Incorporated.
 */

/*
 *  ======== tone.c ========
 *
 *  This example uses the AIC23 codec module of the 5502 EVM Board Support
 *  Library to generate a 1KHz sine wave on the audio outputs for 5 seconds.
 *  The sine wave data is pre-calculated in an array called sinetable.  The
 *  codec operates at 48KHz by default.  Since the sine wave table has 48
 *  entries per period, each pass through the inner loop takes 1 millisecond.
 *  5000 passes through the inner loop takes 5 seconds.
 *
 *  Please see the 5502 EVM help file under Software/Examples for more
 *  detailed information.
 */

/*
 *  DSP/BIOS is configured using the DSP/BIOS configuration tool.  Settings
 *  for this example are stored in a configuration file called tone.cdb.  At
 *  compile time, Code Composer will auto-generate DSP/BIOS related files
 *  based on these settings.  A header file called tonecfg.h contains the
 *  results of the autogeneration and must be included for proper operation.
 *  The name of the file is taken from tone.cdb and adding cfg.h.
 */


/*
 *  The 5502 EVM Board Support Library is divided into several modules, each
 *  of which has its own include file.  The file evm5502.h must be included
 *  in every program that uses the BSL.  This example also includes
 *  evm5502_aic23.h because it uses the AIC23 codec module.
 */
	#include "stdio.h"
	#include "tonecfg.h"
	#include "evm5502.h"
	#include "evm5502_aic23.h"
	#include "evm5502_led.h"
	#include "evm5502_dip.h"
	#include <csl_irq.h>
	#include <csl_dma.h>
	#include <csl_mcbsp.h>
	#include <csl.h>
	#include <log.h>
/* Length of sine wave table */
	#define SINE_TABLE_SIZE   48
	#define BUFFSIZE          96



/*  Handles  */
DMA_Handle hDmaRcv;




	/* Function prototypes */
	void initIrq(void);
	void initDma(void);
//	void copyData(Int16 *inbuf, Int16 *outbuf, Int16 length);
//	void processBuffer(void);
//	void blinkLED(void);
//	void blinkLED0(void);
//	void load(void);
//	void powerDown(void);
//	void dmaHwi(void);





/*  Config Structures */
/* CSL config structure for DMAs */
static DMA_Config dmaCfgReceive = {
    DMA_DMACSDP_RMK(
        DMA_DMACSDP_DSTBEN_NOBURST,
        DMA_DMACSDP_DSTPACK_OFF,
        DMA_DMACSDP_DST_DARAMPORT1,
        DMA_DMACSDP_SRCBEN_NOBURST,
        DMA_DMACSDP_SRCPACK_OFF,
        DMA_DMACSDP_SRC_PERIPH,
        DMA_DMACSDP_DATATYPE_16BIT
    ),                    /* DMACDSP */
    DMA_DMACCR_RMK(
        DMA_DMACCR_DSTAMODE_POSTINC,
        DMA_DMACCR_SRCAMODE_CONST,
        DMA_DMACCR_ENDPROG_OFF,
		DMA_DMACCR_WP_DEFAULT,  /*Write Posting: Buffering Writes to Internal Memory
						The DMA controller can take advantage of the write-posting capability of the
						internal memory interface. When the write posting bit is set (WP = 1 in
						DMACCR), the DMA controller can initiate a write and then can receive
						acknowledgement from the internal memory interface before the data is
						actually written to memory. The DMA controller is free to begin the next
						operation while the internal memory interface assumes control of the posted
						data.
						When write posting is disabled (WP = 0), the DMA controller waits for the
						internal memory interface to finish the memory access before continuing with
						the next operation. It might be useful during debugging to disable write posting.*/
        DMA_DMACCR_REPEAT_OFF,
        DMA_DMACCR_AUTOINIT_OFF,
        DMA_DMACCR_EN_STOP,
        DMA_DMACCR_PRIO_HI,
        DMA_DMACCR_FS_DISABLE,
        DMA_DMACCR_SYNC_REVT1
    ),                    /* DMACCR */         
    DMA_DMACICR_RMK(
		DMA_DMACICR_AERRIE_OFF,/*Address Error Condition
						If the DMA controller accesses a reserved address in the I/O space of the DSP,
						an address error signal is generated in the DMA controller. In response, activity
						in the effected DMA channel stops. If the corresponding interrupt enable bit is
						set (AERRIE = 1 in DMACICR), the DMA controller also sets the address error
						status bit (AERR = 1 in DMACSR) and sends a channel interrupt request to
						the CPU. The CPU can respond to the interrupt request or ignore the interrupt
						request.
						Before the next DMA transfer is initiated, the CPU must clear the address error
						condition by making EN = 0 in DMACCR.*/
        DMA_DMACICR_BLOCKIE_OFF,
        DMA_DMACICR_LASTIE_OFF,
        DMA_DMACICR_FRAMEIE_ON,
        DMA_DMACICR_FIRSTHALFIE_OFF,
        DMA_DMACICR_DROPIE_OFF,
        DMA_DMACICR_TIMEOUTIE_OFF
    ),                   /* DMACICR */     
    (DMA_AdrPtr)((Uint32)(_MCBSP_DRR11_ADDR<<1)), /* DMACSSAL */
    0,                   /* DMACSSAU                      */
    NULL,                /* DMACDSAL, to be loaded by submit  */
    0,                   /* DMACDSAU                      */
    BUFFSIZE,            /* DMACEN                        */
    1,                   /* DMACFN                        */
    0,                   /* DMACFI                        */
    0                    /* DMACEI                        */
};



	Int16 gBufferRcvPing[BUFFSIZE];  // Receive PING buffer
	#pragma DATA_SECTION (gBufferRcvPong, "buffer_sect");
	Int16 gBufferRcvPong[BUFFSIZE];  // Receive PONG buffer





/*
 *  initDma() - Initialize the DMA controller.
 */
void initDma(void)
{
    volatile Int16 i;

    /* Set transmit and receive buffer addresses in config structures */
    dmaCfgReceive.dmacdsal = (DMA_AdrPtr)(((Uint32)(&gBufferRcvPing) << 1) & 0xFFFF);
    dmaCfgReceive.dmacdsau = (Uint16)((Uint32)(&gBufferRcvPing) >> 15);
    

    /* Open DMA channels */
    hDmaRcv = DMA_open(DMA_CHA4, DMA_OPEN_RESET);
       
    /* Configure DMA channels */
    DMA_config(hDmaRcv, &dmaCfgReceive);
        
    /* Clear the DMA status registers to receive new interrupts */
    i = DMA_RGETH(hDmaRcv, DMACSR);


    DMA_RSET(DMAGCR, 0x0);
    
    /* Clear any garbage from the codec data port */
    if (MCBSP_rrdy(EVM5502_AIC23_DATAHANDLE))
        MCBSP_read16(EVM5502_AIC23_DATAHANDLE);
        
    // Start the DMA
    DMA_start(hDmaRcv);
}




Uint16 eventIdRcv;

void initIrq(void)
{
    // Get Event ID associated with DMA channel interrupt.  Event IDs are a
    // CSL abstraction that lets code describe a logical event that gets
    // mapped to a real physical event at run time.  This helps to improve
    // code portability.
    eventIdRcv = DMA_getEventId(hDmaRcv);

    
    // Clear any pending receive channel interrupts (IFR)
    IRQ_clear(eventIdRcv);

 
    // Enable receive DMA interrupt (IMR)
    IRQ_enable(eventIdRcv); 
    
    // Make sure global interrupts are enabled
    IRQ_globalEnable();
}












	extern LOG_Obj trace;

/* Codec configuration settings */
EVM5502_AIC23_Config config = { \
    0x001a,  /* 0 EVM5502_AIC23_LEFTINVOL  Left line input channel volume */ \
    0x001a,  /* 1 EVM5502_AIC23_RIGHTINVOL Right line input channel volume */\
    0x01c0,  /* 2 EVM5502_AIC23_LEFTHPVOL  Left channel headphone volume */  \
    0x01c0,  /* 3 EVM5502_AIC23_RIGHTHPVOL Right channel headphone volume */ \
    0x0011,  /* 4 EVM5502_AIC23_ANAPATH    Analog audio path control */      \
    0x0000,  /* 5 EVM5502_AIC23_DIGPATH    Digital audio path control */     \
    0x0000,  /* 6 EVM5502_AIC23_POWERDOWN  Power down control */             \
    0x0043,  /* 7 EVM5502_AIC23_DIGIF      Digital audio interface format */ \
    0x0023,  /* 8 EVM5502_AIC23_SAMPLERATE Sample rate control */            \
    0x0001   /* 9 EVM5502_AIC23_DIGACT     Digital interface activation */   \
};

/* The eighth register of CODEC determine the Codec sample rate
 * Refrence the following table:
 *       Sample Rate     REG VALUE          
 * ---------------------------------------------
 *			96KHz		0X001D/0X009D
 *			48KHz		0X0001/0X0081
 *			44.1KHz		0X0023/0X00A3
 *			32KHz		0X0019/0X0099
 *			24KHz		0X0041/0X00C1
 *			16KHz		0X0059/0X00D9
 *			8KHz		0X000D/0X008D
 * ----------------------------------------------
 */



// Pre-generated sine wave data, 16-bit signed samples

Int16 sinetable[SINE_TABLE_SIZE] = {
    0x0000, 0x10b4, 0x2120, 0x30fb, 0x3fff, 0x4dea, 0x5a81, 0x658b,
    0x6ed8, 0x763f, 0x7ba1, 0x7ee5, 0x7ffd, 0x7ee5, 0x7ba1, 0x76ef,
    0x6ed8, 0x658b, 0x5a81, 0x4dea, 0x3fff, 0x30fb, 0x2120, 0x10b4,
    0x0000, 0xef4c, 0xdee0, 0xcf06, 0xc002, 0xb216, 0xa57f, 0x9a75,
    0x9128, 0x89c1, 0x845f, 0x811b, 0x8002, 0x811b, 0x845f, 0x89c1,
    0x9128, 0x9a76, 0xa57f, 0xb216, 0xc002, 0xcf06, 0xdee0, 0xef4c
};

 /**/
/*		   
 *  main() - Main code routine, initializes BSL and generates tone
 */



void main()
{
    
	EVM5502_AIC23_CodecHandle hCodec;

	Int16  y,i,j,hundun;
	Int16 *data;
	double x,xishu;
	Uint16 dip0,dip1,dip3;      
	x=0.00265741465465;



	xishu=3.8945687457554;




    /* Initialize the board support library, must be called first */
    EVM5502_init();
    EVM5502_LED_init();
    EVM5502_DIP_init();
    /* Start the codec */

    hCodec = EVM5502_AIC23_openCodec(0, &config);
    	
	printf("Hello world\n");


    while (1)
    {

    		/* Switch 0 pressed, turn LED #0 on and encode the information
			Switch 1 pressed, turn LED #1 on and decode the information
			switch 2 pressed, turn on the LED#3 to choose witch channel to sellect:0->aic23;1->sinetable
    		 */
		if (EVM5502_DIP_get(3)){
		    EVM5502_LED_on(3);
			dip3=1;
		}
		else {
			EVM5502_LED_off(3);
			dip3=0;
		}
		if (EVM5502_DIP_get(0)){
		    EVM5502_LED_on(0);
			dip0=1;
			
			if (EVM5502_DIP_get(1)){
				EVM5502_LED_on(1);
				dip1=1;
			}
			else{
				EVM5502_LED_off(1);
				dip1=0;
			}
		}
		else{
			EVM5502_LED_off(0);
			EVM5502_LED_off(1);
			dip0=0;
			dip1=0;
		}

		for (j=0;j<SINE_TABLE_SIZE;j++){

			if (dip3){
				while (!EVM5502_AIC23_write16(hCodec, sinetable[j]));
				y=sinetable[j];
			}
			else{
				while(!EVM5502_AIC23_read16(hCodec,data));
				y=*data;

		        while (!EVM5502_AIC23_write16(hCodec, y));
			}
			



						
			/* Check DIP switch  to decide which sound is sellected and if it need encode and decode   */

            if (dip3) y=sinetable[j];
			else{
				while(!EVM5502_AIC23_read16(hCodec,data));
				y=*data;
				}
	    	if (dip0 == 1){
	        /* calculate the hundun */
				hundun=0;
				for(i=1;i<=16;i++){					
					x=xishu*x*(1-x);
					if (x>0.5)
						hundun=(hundun<<1)+1;
					else
						hundun=(hundun<<1);
				}

				y=hundun^y;
				if (dip1)	y=hundun^y;
			}

			LOG_printf(&trace,"y=%d\n",y);

		    while (!EVM5502_AIC23_write16(hCodec, y));   
	    } 
	}

    /* Close the codec */
//    EVM5502_AIC23_closeCodec(hCodec);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美综合在线| 精品国产污网站| 国产91富婆露脸刺激对白| 久久精品国产亚洲aⅴ| 日韩电影在线观看电影| 亚洲综合色噜噜狠狠| 中文字幕佐山爱一区二区免费| 中文字幕在线不卡一区二区三区| 中文字幕欧美日韩一区| 欧美国产日韩一二三区| 亚洲欧洲av色图| 亚洲在线观看免费| 三级欧美韩日大片在线看| 美女免费视频一区二区| 国产美女精品在线| 成人免费视频一区二区| 色悠悠久久综合| 538在线一区二区精品国产| 欧美一区二区三区视频在线| 精品区一区二区| 欧美激情在线看| 亚洲激情图片小说视频| 日韩影视精彩在线| 国产乱子伦一区二区三区国色天香| 国产一区在线精品| 99精品欧美一区| 91精品国产福利| 国产亚洲人成网站| 亚洲综合无码一区二区| 久久精品久久99精品久久| 成a人片亚洲日本久久| 在线观看一区二区精品视频| 9191久久久久久久久久久| 久久婷婷色综合| 亚洲视频在线观看一区| 日韩va亚洲va欧美va久久| 国产成人8x视频一区二区| 欧美日韩一级片网站| 欧美激情一区二区三区不卡| 亚洲视频图片小说| 激情小说亚洲一区| 欧美日韩高清一区二区不卡| 国产欧美日韩另类一区| 视频在线观看91| 99久久精品国产导航| 欧美一卡在线观看| 亚洲日本乱码在线观看| 国产在线一区观看| 欧美日韩成人综合天天影院| 中文字幕欧美区| 蜜桃免费网站一区二区三区| 在线免费观看日本欧美| 国产日产欧美一区| 激情亚洲综合在线| 国产偷国产偷精品高清尤物| 首页亚洲欧美制服丝腿| 欧洲激情一区二区| 最近中文字幕一区二区三区| 激情综合色播五月| 欧美另类一区二区三区| 亚洲视频免费观看| av中文字幕不卡| 久久综合久久鬼色| 蜜桃精品视频在线观看| 欧美日韩免费在线视频| 亚洲美女视频一区| 99久久99久久精品免费看蜜桃 | 亚洲色图在线视频| 精品综合免费视频观看| 7777精品伊人久久久大香线蕉最新版| 中文字幕欧美一| av在线这里只有精品| 欧美激情一区二区三区四区 | 国产视频一区二区三区在线观看 | 久久综合色综合88| 亚洲午夜激情网页| 欧美亚洲国产一卡| 亚洲一区二区视频| 日本精品视频一区二区| 最近日韩中文字幕| av一区二区三区在线| 国产精品国产精品国产专区不蜜 | 欧美一级片在线| 视频一区二区三区中文字幕| 欧美久久免费观看| 蜜臀精品久久久久久蜜臀| 91精品国产一区二区| 免费高清在线一区| 国产无人区一区二区三区| 成人免费电影视频| 国产精品私人自拍| 99精品视频一区| 午夜精品视频在线观看| 日韩午夜在线播放| 成人三级在线视频| 国内精品伊人久久久久影院对白| 日韩一区二区三区免费看| 精东粉嫩av免费一区二区三区| 2020国产精品自拍| 色综合天天综合网天天看片| 亚洲成a人v欧美综合天堂| 日韩一级黄色大片| 成人国产精品免费网站| 一级日本不卡的影视| 欧美一区二区精品| 94-欧美-setu| 日本免费新一区视频| 国产精品视频线看| 91精品国产免费久久综合| 豆国产96在线|亚洲| 亚洲一区二区精品3399| 久久无码av三级| 欧洲亚洲国产日韩| 国产高清精品网站| 日韩主播视频在线| 成人欧美一区二区三区小说| 日韩欧美一级精品久久| 波多野结衣精品在线| 亚洲成人av电影| 国产精品毛片久久久久久| 欧美艳星brazzers| 国产成人在线免费| 日日夜夜一区二区| 亚洲视频在线一区二区| 26uuu亚洲综合色欧美| 91久久一区二区| 国产精品中文有码| 日韩高清在线一区| 亚洲三级在线免费观看| 2014亚洲片线观看视频免费| 欧美日韩中文另类| 不卡电影免费在线播放一区| 狠狠色丁香九九婷婷综合五月| 亚洲午夜久久久久| 亚洲免费av在线| 国产精品乱码一区二三区小蝌蚪| 91精品久久久久久蜜臀| 欧美日韩色一区| 欧美日韩情趣电影| 91国偷自产一区二区三区成为亚洲经典| 久久精品国产精品亚洲红杏| 亚洲成人av一区二区| 亚洲午夜免费电影| 亚洲综合免费观看高清在线观看| 男男成人高潮片免费网站| 一区二区三区在线观看视频| 亚洲视频 欧洲视频| 国产精品丝袜在线| 综合欧美一区二区三区| 中文字幕一区在线观看视频| 国产欧美一区二区精品性| 久久人人爽人人爽| 国产欧美精品一区二区三区四区| 久久综合五月天婷婷伊人| 久久亚洲免费视频| 国产视频一区二区三区在线观看| 亚洲精品在线观| 欧美国产视频在线| 18成人在线观看| 一区二区三区在线视频免费| 亚洲国产日韩a在线播放性色| 一区二区三区中文在线| 亚洲在线成人精品| 日韩高清在线一区| 国产精品一卡二卡在线观看| 国产.精品.日韩.另类.中文.在线.播放| 国产在线播放一区三区四| 国产精品性做久久久久久| 国产91在线观看| 色综合久久综合| 678五月天丁香亚洲综合网| 日韩三级视频在线看| 久久精品人人做人人综合| 国产日韩欧美精品一区| 亚洲摸摸操操av| 亚洲图片欧美色图| 激情久久久久久久久久久久久久久久| 狠狠色丁香久久婷婷综| 欧美军同video69gay| wwww国产精品欧美| 亚洲精品自拍动漫在线| 午夜精品久久久久久久| 风间由美中文字幕在线看视频国产欧美 | 久久九九影视网| 亚洲乱码一区二区三区在线观看| 亚洲chinese男男1069| 久久福利视频一区二区| 成人黄色av网站在线| 欧美午夜精品免费| 久久久久久久免费视频了| 亚洲色图欧美偷拍| 日韩精品乱码免费| 成人免费精品视频| 欧美一区二区三区四区高清| 中文字幕免费一区| 日本免费在线视频不卡一不卡二| aaa国产一区| 日韩一级二级三级| 亚洲综合一二三区| 岛国一区二区在线观看|