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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? audioinit.c

?? 基于實(shí)時(shí)嵌入式系統(tǒng)的voip系統(tǒng)(real time embeded system)。主要難點(diǎn)在實(shí)時(shí)處理語(yǔ)音信號(hào)。語(yǔ)音信號(hào)基于其自身特點(diǎn)
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/***************************************************************************  AudioInit.c - Initializes and changes configuration*        of CS4281 card for VxWorks.**  Author - Ed Hursey*  Date - December 2005**  Note - This file is based on the driver provided on the*    course web site.**************************************************************************//* VxWorks API includes */#include "vxWorks.h"#include "stdio.h"#include "stdlib.h"#include "ioLib.h"#include "semLib.h"#include "intLib.h"#include "iv.h"#include "voip.h"/* VxWorks 5.4 PCI driver interface includes */#include "drv/pci/pciConfigLib.h"#include "drv/pci/pciConfigShow.h"#include "drv/pci/pciHeaderDefs.h"#include "drv/pci/pciLocalBus.h"#include "drv/pci/pciIntLib.h"/* pcPentium BSP includes */#include "sysLib.h"/* Cystal cs4281 and ac97 hardware */#include "cs4281Registers.h"/* Local definition of CS4281 values */#define PCI_VENDOR_ID_CIRRUS         0X1013#define PCI_DEVICE_ID_CRYSTAL_CS4281 0X6005#define CS4281_pBA0       0x04000000   /*DMA locations*/#define CS4281_pBA1       0x05000000#define INT_NUM_IRQ0      0x20/* Interrupt Service Related*/unsigned char cs4281_irq;int CNT_DMA_Playback, CNT_DMA_Record; /* debug counter *//***************************************************************************   Function - readl*   Parameters - offset - the address to read from*   Returns - the value read./**************************************************************************/UINT32 readl(UINT32 offset){	UINT32 result;	PCI_READ(offset, 0x0, &result);	return result;}/***************************************************************************   Function - writel*   Parameters - value - the value to be written*                offset - the address to write to*   Returns - 0./**************************************************************************/int writel(UINT32 value, UINT32 offset){	PCI_WRITE(offset,0x0, value);	return 0;}/***************************************************************************   Function - cs4281_read_ac97*   Parameters - offset - the offset to read from*                value - the value read*   Returns - 0 = OK, 1 = ERROR*   Purpose -  read a word from the CS4281 address space (based on BA0)*     step-1: write ACCAD (Commond Address Register) 46C h*     step-2: write ACCDA (Command Data    Register) 470 h, 0 for read*     step-3: write ACCTL (Control         Register) 460 h, initiating op*     step-4: read  ACCTL , until DCV is reset and [460h] = 17h*     step-5: if DCV not cleared, error*     step-6: read  ACSTS (Status          Register) 464 h, check VSTS bit****************************************************************************/int cs4281_read_ac97(UINT32 offset, UINT32 *value){	UINT32 count, status;	/* Make sure there is no data in ACSDA[47Ch] */	status = readl(CS4281_pBA0 + BA0_ACSDA);	/* Get the actual offset, and read ... */	writel( offset - BA0_AC97_RESET, CS4281_pBA0 + BA0_ACCAD );	writel( 0, CS4281_pBA0 + BA0_ACCDA );	writel( ACCTL_DCV | ACCTL_CRW | ACCTL_VFRM | ACCTL_ESYN, CS4281_pBA0 + BA0_ACCTL );	/* Wait fo the read to occur */	for( count = 0; count < 10; count ++ )	{		taskDelay(25);		/* check if read is complete */		if(! (readl(CS4281_pBA0 + BA0_ACCTL) & ACCTL_DCV) )			break;	}	if( readl(CS4281_pBA0 + BA0_ACCTL) & ACCTL_DCV )		return 1;	/* Wait for the valid status bit to go active */	for( count = 0; count < 10; count ++ )	{		status = readl(CS4281_pBA0 + BA0_ACSTS);		if(status & ACSTS_VSTS)			break;		taskDelay(25);	}	if(!(status & ACSTS_VSTS))		return 1;	/* Read data from the AC97 register 474h */	*value = readl( CS4281_pBA0 + BA0_ACSDA );	return 0;}/***************************************************************************   Function - cs4281_write_ac97*   Parameters - offset - the offset to write to*                value - the value to*   Returns - 0 = OK, 1 = ERROR*   Purpose - write a word to the cs4281 address space*      step-1: write ACCAD (Command Address Register) 46C h*      step-2: write ACCDA (Command Data    Register) 470 h*      step-3: write ACCTL (Control         Register) 460 h*      step-4: read  ACCTL,  DCV should be reset and [460h] = 07h*      step-5: if DCV not cleared, error*****************************************************************************/int cs4281_write_ac97(UINT32 offset, UINT32 value ){	UINT32 count, status;	/* write to the actual AC97 register */	writel(offset - BA0_AC97_RESET, CS4281_pBA0 + BA0_ACCAD);	writel(value, CS4281_pBA0 + BA0_ACCDA);	writel(ACCTL_DCV | ACCTL_VFRM |ACCTL_ESYN, CS4281_pBA0 + BA0_ACCTL);	/* Wait for write to finish ... */	for(count=0; count<10; count ++)	{		taskDelay(25);		/* check if write complete */		status = readl(CS4281_pBA0 + BA0_ACCTL);		if(!(status & ACCTL_DCV))		break;	}	if(status & ACCTL_DCV)		return 1;	return 0;}/***************************************************************************   Function - cs4281_hw_init*   Parameters - none*   Returns - 0 = OK, -1 = ERROR*   Purpose - Bring up the part*****************************************************************************/int cs4281_hw_init( void ){	UINT32 ac97_slotid;	UINT32 temp1, temp2;	/****************************************************	*      set up the Sound System configuration	****************************************************/	printf("\nCS4281 HardWare Initialization ...\n");	/* ease the 'write protect' */	writel(0x4281, CS4281_pBA0 + BA0_CWPR);	/* Blast the clock control register to 0, so that PLL starts out	Blast the master serial port cntl register to 0, so that serial port	starts out	*/	writel(0, CS4281_pBA0 + BA0_CLKCR1);	writel(0, CS4281_pBA0 + BA0_SERMC);	/***** <1> Make ESYN go to 0, to turn off the Sync pulse */	writel(0, CS4281_pBA0 + BA0_ACCTL);	taskDelay(50);	/***** <2> Drive ARST# pin low for 1uS, then drive high, so that the	external logic are reset	*/	writel(0, CS4281_pBA0 + BA0_SPMC);	taskDelay(100);	writel(SPMC_RSTN, CS4281_pBA0 + BA0_SPMC);	taskDelay(500);	/***** <3> Turn on the Sound System clocks */	writel(CLKCR1_PLLP, CS4281_pBA0 + BA0_CLKCR1);	taskDelay(500);	writel(CLKCR1_PLLP | CLKCR1_SWCE, CS4281_pBA0 + BA0_CLKCR1);	/***** <4> Power on everything for now */	writel(0x7e, CS4281_pBA0 + BA0_SSPM);	/***** <5> Wait for clock stabilization */	for(temp1=0; temp1<1000; temp1++)	{		taskDelay(1);		if( readl(CS4281_pBA0 + BA0_CLKCR1) & CLKCR1_DLLRDY )			break;	}	if(!(readl(CS4281_pBA0 + BA0_CLKCR1) & CLKCR1_DLLRDY))	{		printf("cs4281: DLLRDY failed! \n");		return -1;	}	/***** <6> Enable ASYNC generation */	writel(ACCTL_ESYN, CS4281_pBA0 +BA0_ACCTL);	/* wait for a while to start generating bit clock */	taskDelay(500);	/* Set the serial port timing configuration */	writel( SERMC_PTC_AC97, CS4281_pBA0 + BA0_SERMC );	/***** <7> Wait for the codec ready signal from the AC97 codec */	for(temp1=0; temp1<1000; temp1++)	{		taskDelay(1);		if(readl(CS4281_pBA0 + BA0_ACSTS) & ACSTS_CRDY )		break;	}	if(!(readl(CS4281_pBA0 + BA0_ACSTS)& ACSTS_CRDY))	{		printf("cs4281: ACTST never came ready!\n");		return -1;	}	/***** <8> Assert the 'valid frame' signal to begin sending	commands to AC97 codec */	writel(ACCTL_VFRM |ACCTL_ESYN, CS4281_pBA0 + BA0_ACCTL);	/***** <9> Wait until CODEC calibration is finished.*/	for(temp1=0; temp1<1000; temp1++)	{		taskDelay(10);		if(cs4281_read_ac97(BA0_AC97_POWERDOWN, &temp2) )			return -1;		if( (temp2 & 0x0000000F) == 0x0000000F )			break;	}	if( (temp2 & 0x0000000F) != 0x0000000F )	{		printf("cs4281: Codec failed to calibrate\n");		return -1;	}	/***** <12> Start digital data transfer of audio data to codec */	writel(ACOSV_SLV3 | ACOSV_SLV4, CS4281_pBA0 + BA0_ACOSV );	/************************************************	*    Unmute the Master and	*    Alternate (headphone) volumes, to max.	************************************************/	cs4281_write_ac97(BA0_AC97_HEADPHONE_VOLUME, 0);	cs4281_write_ac97(BA0_AC97_MASTER_VOLUME, 0); /*3870 turned volume way down*/	cs4281_write_ac97(BA0_AC97_MASTER_VOLUME_MONO, 0);	cs4281_write_ac97(BA0_AC97_PC_BEEP_VOLUME, 0);	cs4281_write_ac97(BA0_AC97_PHONE_VOLUME, 0);	cs4281_write_ac97(BA0_AC97_CD_VOLUME, 0);	cs4281_write_ac97(BA0_AC97_VIDEO_VOLUME, 0);	cs4281_write_ac97(BA0_AC97_AUX_VOLUME, 0);	cs4281_write_ac97(BA0_AC97_PCM_OUT_VOLUME, 0);   /*machine 1 use mic in*/   if( g_machine_number == 1 )   {		cs4281_write_ac97(BA0_AC97_RECORD_SELECT, 0); /*select line 1028 in as input*/   }	else /*machine 2 use line in*/	{		cs4281_write_ac97(BA0_AC97_RECORD_SELECT, 1028); /*select line 1028 in as input*/	}	cs4281_write_ac97(BA0_AC97_RECORD_GAIN, 0);	cs4281_write_ac97(BA0_AC97_RECORD_GAIN_MIC, 0); /*seems to have no effect*/ 	/*cs4281_write_ac97(BA0_AC97_MIC_VOLUME,0);  /*either this one or the one below	causes loopback out the speaker of the input seems to have no effect*/	/*cs4281_write_ac97(BA0_AC97_LINE_IN_VOLUME,0); /*set to lowest and doesn't see to	have affect, now changed to 0 db to see what it does*/	/************************************************	*    POWER on the DAC	************************************************/	cs4281_read_ac97(BA0_AC97_POWERDOWN, &temp1);	cs4281_write_ac97(BA0_AC97_POWERDOWN, temp1 &= 0xfdff);	/* Wait until we sample a DAC ready state */	for(temp2=0; temp2<32; temp2++)	{		taskDelay(1);		cs4281_read_ac97(BA0_AC97_POWERDOWN, &temp1);		if(temp1 & 0x2)			break;	}	/******************************************	*Power on the ADC	*******************************************/	cs4281_read_ac97(BA0_AC97_POWERDOWN, &temp1);	cs4281_write_ac97(BA0_AC97_POWERDOWN, temp1 &= 0xfeff);	/* Wait until we sample ADC ready state.*/	for(temp2=0; temp2<32; temp2++)	{		taskDelay(1);		cs4281_read_ac97(BA0_AC97_POWERDOWN, &temp1);		if(temp1 & 0x1)			break;	}	/*	For playback, we map AC97 slot 3 and 4(Left	& Right PCM playback) to DMA Channel 0.	Set the fifo to be 15 bytes at offset zero.	*/	ac97_slotid = 0x01000f00;	writel(ac97_slotid, CS4281_pBA0 + BA0_FCR0);	writel(ac97_slotid | FCRn_FEN, CS4281_pBA0 + BA0_FCR0);	/*For record, we map AC97 slot 10 and 11 (Left & Right PCM playback) to	DMA Channel 1, Set the fifo to be 15 bytes at offset 16.	*/	ac97_slotid = 0x0b0a0f10;	writel(ac97_slotid, CS4281_pBA0 + BA0_FCR1);	writel(ac97_slotid | FCRn_FEN, CS4281_pBA0 + BA0_FCR1);	/*	Map the Playback SRC to the same AC97 slots(3 & 4--	--Playback left & right)as DMA channel 0.	Map the record SRC to the same AC97 slots(10 & 11--	-- Record left & right) as DMA channel 1.	*/	ac97_slotid = 0x0b0a0100;	writel(ac97_slotid, CS4281_pBA0 + BA0_SRCSA);	/*	Set 'Half Terminal Count Interrupt Enable' and 'Terminal	Count Interrupt Enable' in DMA Control Registers 0 & 1.	Set 'MSK' flag to 1 to keep the DMA engines paused.	*/	temp1 = (DCRn_HTCIE | DCRn_TCIE | DCRn_MSK);	writel(temp1, CS4281_pBA0 + BA0_DCR0);	writel(temp1, CS4281_pBA0 + BA0_DCR1);	/*	Set 'Auto-Initialize Control' to 'enabled'; For playback,	set 'Transfer Type Control'(TR[1:0]) to 'read transfer',	for record, set Transfer Type Control to 'write transfer'.	All other bits set to zero;  Some will be changed @ transfer start.	*/	temp1 = (DMRn_DMA | DMRn_AUTO | DMRn_TR_READ);	writel(temp1, CS4281_pBA0 + BA0_DMR0);	temp1 = (DMRn_DMA | DMRn_AUTO | DMRn_TR_WRITE);	writel(temp1, CS4281_pBA0 + BA0_DMR1);	/*	Enable DMA interrupts generally, and	DMA0 & DMA1 interrupts specifically.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美中文字幕一二三区视频| 欧美日韩aaaaa| 欧美日韩精品三区| 欧美经典一区二区三区| 亚洲午夜久久久久久久久电影网 | 91精品国产日韩91久久久久久| 2023国产一二三区日本精品2022| 亚洲欧美日韩久久精品| 久久99精品久久久久久国产越南| 色欲综合视频天天天| 欧美mv日韩mv国产| 亚洲成人在线网站| 91小视频免费观看| 久久久久久影视| 日本视频中文字幕一区二区三区| 97久久精品人人做人人爽| 久久久亚洲综合| 免费欧美日韩国产三级电影| 欧美无砖专区一中文字| 国产精品成人免费在线| 国产乱码精品一区二区三| 日韩午夜小视频| 天天操天天综合网| 欧美在线制服丝袜| 亚洲最新在线观看| 91福利精品第一导航| 中文字幕一区三区| 东方aⅴ免费观看久久av| 久久综合九色综合欧美98| 日本不卡视频在线| 日韩欧美在线网站| 奇米色777欧美一区二区| 欧美日韩视频在线第一区| 一区二区三区在线视频观看| 在线一区二区观看| 一区二区高清视频在线观看| 色88888久久久久久影院按摩| 亚洲色图另类专区| 色视频一区二区| 亚洲最大成人网4388xx| 欧美在线免费观看视频| 亚洲午夜激情网页| 欧美精品第一页| 日本aⅴ亚洲精品中文乱码| 91精品国产综合久久久蜜臀图片| 午夜精品一区二区三区免费视频| 欧美日本在线播放| 奇米在线7777在线精品| 亚洲欧美一区二区视频| 高清国产一区二区| 亚洲精品国产品国语在线app| 色婷婷综合久久久久中文| 亚洲激情图片一区| 91精品午夜视频| 韩国女主播一区二区三区| 国产婷婷色一区二区三区在线| 成人激情视频网站| 亚洲午夜三级在线| 日韩手机在线导航| 国产精品亚洲第一区在线暖暖韩国 | 国产日韩欧美综合在线| 成人一区在线观看| 亚洲国产精品久久人人爱| 欧美一区二区三区四区视频| 国产永久精品大片wwwapp| 亚洲欧美怡红院| 欧美一区三区四区| 国产在线看一区| 亚洲卡通欧美制服中文| 日韩一区二区不卡| 成人三级伦理片| 日本成人在线电影网| 中文在线资源观看网站视频免费不卡 | 久久99精品国产.久久久久| 日本一区二区免费在线观看视频 | 久久久国产精华| 欧美三电影在线| 国产精品一区二区果冻传媒| 亚洲午夜私人影院| 国产精品国产成人国产三级| 国产拍欧美日韩视频二区| 欧美性色综合网| 不卡的av网站| 麻豆91在线播放免费| 亚洲人午夜精品天堂一二香蕉| 日韩欧美中文一区二区| 91在线无精精品入口| 久久国产免费看| 亚洲电影你懂得| 亚洲三级免费观看| 久久精品视频网| 日韩一区二区在线看片| 色综合av在线| av在线不卡观看免费观看| 国产在线播放一区二区三区| 亚洲一区二区视频| 国产精品女主播av| 久久精品一级爱片| 日韩区在线观看| 欧美精品亚洲二区| 日本久久电影网| av动漫一区二区| 丁香一区二区三区| 国产a久久麻豆| 国产在线视频不卡二| 免费在线成人网| 日本强好片久久久久久aaa| 亚洲一区二区视频| 一区二区三区视频在线看| 国产精品国产三级国产有无不卡| 久久婷婷色综合| 久久久一区二区| 精品播放一区二区| 精品国产一区二区三区不卡 | 欧美视频在线播放| 在线免费观看日韩欧美| 91社区在线播放| 99re这里只有精品6| 成人国产精品免费观看动漫| 成人精品在线视频观看| 国产一区视频导航| 国产91丝袜在线播放九色| 国产成人精品免费视频网站| 国产成人在线免费观看| 国产乱子轮精品视频| 国产成人在线色| 成年人国产精品| 色婷婷久久综合| 欧美在线观看一区| 欧美在线视频你懂得| 91精品麻豆日日躁夜夜躁| 欧美大黄免费观看| 欧美激情一区二区三区在线| 国产精品乱码人人做人人爱 | 视频一区视频二区中文| 久久精品噜噜噜成人av农村| 国产中文一区二区三区| 成人av综合在线| 欧美性生活一区| 日韩一区二区电影在线| 国产三级精品三级在线专区| 最新国产の精品合集bt伙计| 亚洲线精品一区二区三区八戒| 日韩中文字幕麻豆| 国产美女在线观看一区| 色美美综合视频| 日韩视频免费直播| 中文av字幕一区| 亚洲高清在线精品| 国产成人在线色| 欧美日韩一区二区在线观看视频| 欧美一区二区播放| 国产精品素人视频| 日韩中文欧美在线| 成人精品国产免费网站| 欧美三级中文字幕在线观看| 精品久久久久一区| 亚洲精品视频自拍| 激情久久五月天| 在线国产电影不卡| 亚洲国产高清不卡| 免费观看在线色综合| thepron国产精品| 日韩午夜在线影院| 亚洲最快最全在线视频| 国产成人高清视频| 91精品一区二区三区在线观看| 国产精品蜜臀在线观看| 免费成人在线网站| 在线看国产一区二区| 国产日韩精品一区| 免费观看30秒视频久久| 色综合久久88色综合天天| 国产亚洲女人久久久久毛片| 青青草视频一区| 欧美丝袜丝交足nylons| 亚洲视频一区二区在线| 国产成人免费9x9x人网站视频| 欧美一区二区人人喊爽| 亚洲福利视频三区| 91美女在线视频| 亚洲国产精品精华液ab| 国产一区二区三区久久久| 欧美一区二区三区视频| 亚洲国产毛片aaaaa无费看 | 成人av网站在线| 久久九九久久九九| 日韩 欧美一区二区三区| 欧美性色黄大片| 亚洲免费资源在线播放| 国产白丝精品91爽爽久久| 精品国产sm最大网站免费看| 一区二区三区中文在线观看| 青青草一区二区三区| 色欧美88888久久久久久影院| 国产精品国产三级国产三级人妇 | 亚洲一区二区精品3399| 国产99久久久久| 国产精品你懂的在线| 久久99精品网久久|