1.TLV320AIC23çåºç¨
TLV320AIC23çåºç¨
TLVAICçåºç¨:åºäºDDKçTLVAICåç¼è§£ç å¨ç驱å¨è®¾è®¡
DSP/BIOS Driver Developerâs Kit(DDK)æ¯TI为ç®å驱å¨ç¨åºå¼å为TMSç³»åDSPåå ¶EVMæ¿çæä¾ç驱å¨ç¨åºå¼åå¥ä»¶ã该å¥ä»¶ä¸ºTMSç³»ååç§å¤å´å¨ä»¶æä¾å®æ´çæ åå驱å¨ç¨åºæ¨¡åï¼ä½¿å¾é©±å¨ç¨åºå¯ä»¥å¾æ¹ä¾¿å°ç§»æ¤å°å ¶ä»åºç¨ä¸ï¼å¤§å¤§æé«é©±å¨ç¨åºå¼åçæçãDDKæ¯å¯¹æ¯ç§TMSç³»åDSPé½æä¾çè¯çæ¯æåº(Chip Support LibraryâCSL)çè¡¥å ï¼CSLæä¾å¯¹å¤å´å¨ä»¶å¯åå¨é ç½®ååå§åççä½çº§æ§å¶ï¼DDKå®å ¨éè¿CSLæ¥å¯¹å¤å´å¨ä»¶è¿è¡æ§å¶ãç®åå°è¯´ãDDK建ç«å¨CSLä¸å±ï¼æ以ç¨DDKæ¥å¼å驱å¨ç¨åºå°æ´ä¸ºå¿«æ·ä¸å¯ç§»æ¤æ§æ´å¥½ã
DDK为å¼å驱å¨ç¨åºå®ä¹äºæ å模ååä¸ç³»åçAPIã为ç®åç¨åºè®¾è®¡ãæ å模åå被å为äºä¸ªå±æ¬¡ï¼å ¶ä¸é«å±ç§°ä¸ºClass driverï¼ä½å±ç§°ä¸ºMiniâdriverãClass driveiä¸å¨ä»¶ç¸å¯¹ç¬ç«ï¼å®æ诸å¦ç¼å²åºç®¡çå请æ±åæ¥çåè½ï¼åæ¶æ®æ¼çä¸APIåMiniâdriveräºè æ¥å£çè§è²ãMiniâdriverå®æç¹å®çå¨ä»¶åå§ååæ§å¶åè½ï¼å®ç¬¦åIOM(I/O Miniâdriver)çæ¥å£æ åãDDKçè¿ç§åå±ç»æ使å¾é©±å¨å¼å人åä» éäºè§£åä¸çMiniâdriver APIå°±å¯ä»¥å®ææ´ä½å¤å´å¨ä»¶ç驱å¨è®¾è®¡ï¼èä¸è¿ä¸è¿ç¨æ¯è®¾è®¡æ´ä¸ªé©±å¨ç¨åºè¦ç®åå¾å¤ï¼å 为Class driveræ§å¶äºç¼å²åºç®¡çååæ¥çãDDKæä¾3ç§Class driverï¼åå«ä¸ºSIO/DIOãPIP/PIOåGIOï¼å®ä»¬é½å¯ä»¥åä»»ä½Miniâdriverç»å使ç¨ã
2 TLVAICç驱å¨è®¾è®¡åºç¡
DDKçæ å模åç»æå¦å¾1æ示ãé«å±çåºç¨ååºå±é©±å¨ç¸äºæ²¡æç´æ¥çå ³èï¼å¼åä¸åªééè¿Class driveræ§å¶Miniâdriverã
ä¸é¢ä»¥DM EVMæ¿ä¸ºä¾ï¼è¯´æåºäºDDKçTLVAICç驱å¨ç¨åºè®¾è®¡æ¹æ³ã
é¦å ï¼éè¦ä½¿ç¨é ç½®å·¥å ·å»ºç«é©±å¨ç¨åºçå ¥å£ãå¨DSP/BIOS con_figä¸çcdbæ件ä¸ï¼ä¾æ¬¡éæ©In-puffOutplut---Deviee DriversâUserâdefined Driversï¼å¨è¿äºä¾ç¨ä¸ä¸è¬å·²ç»æ·»å äºudevCodecï¼å¦æéè¦çè¯ï¼ç¨æ·å¯ä»¥èªè¡æ·»å æç¼è¾ãå³é®åå»éæ©Propertiesé项æ¥ç¼è¾å ¶å±æ§ï¼å ¶å±æ§åºè®¾ç½®å¦ä¸ï¼
Commentï¼å¯ä»¥å å ¥èªå·±ç注é
lnit functionï¼é®å ¥EVMDM_EDMA_AICä¸init
Function table ptrï¼é®å ¥ EVMDM_EDMA_A-ICä¸Fxn8
Function table typeï¼éæ©IOM_Fxns
Deviceidï¼è¯¥é¡¹ä¼è¢«èªå¨å¿½ç¥ï¼å 为DM EVMæ¿ä¸åªæä¸åTLVAIC
Device params ptrï¼TLVAICåæ°ç»æçå ¥å£æéï¼ä½¿ç¨ç¼ºçåæ°æ¶è®¾ä¸º0x0
Device global data ptrï¼å¿ 须设置为OxO
æ£ç¡®é 置驱å¨ç¨åºå ¥å£åï¼å°±è¦æç §éè¦è®¾ç½®ç¸å ³çåæ°ãä¸é¢å ·ä½è®¨è®ºTLVAICåæ°ç设置ã
TLVAICçåæ°ç»æä½ååå¦ä¸ï¼
typedef struct
å¨ä¸è¬åºç¨ä¸ãä¸è¿°ç»æä½ç大å¤æ°åæ°æ éæ´æ¹ï¼éè¦ä¿®æ¹ç主è¦æ¯aieConfigï¼å®æ¯TLVAICæ§å¶å¯åå¨å¼ï¼éè¦éè¿å®æ¥æ§å¶TLVAICçå·¥ä½æ¨¡å¼ãè¾å ¥/è¾åºéæ©ãéæ ·ççéè¦åæ°ã
é¤äºå¤ä½å¯åå¨å¤ï¼TLVAICå ±æ9个æ§å¶å¯åå¨ï¼æ¯ä¸ªå¯åå¨æ§å¶åé¿ä¸º9bitï¼å°åä½ä¸º7bitï¼å ±æbitãå°åä½ä¸ºé«7ä½èæ§å¶åå¨ä½9ä½ãå ·ä½å¦ä¸ï¼
Register0:左声éè¾å ¥é³éæ§å¶ï¼ç¼ºçå¼ä¸º 0x
Register1:å³å£°éè¾å ¥é³éæ§å¶ï¼ç¼ºçå¼ä¸º 0x
Register 2ï¼å·¦å£°éè¾åºé³éæ§å¶ã缺çå¼ä¸ºOxF9
Register 3ï¼å³å£°éè¾åºé³éæ§å¶ï¼ç¼ºçå¼ä¸ºOxF9
Register 4ï¼æ¨¡æé³é¢éé设置ï¼ç¼ºçå¼ä¸ºOx
Register 5ï¼æ°åé³é¢éé设置ã缺çå¼ä¸º0x
Register 6ï¼èçµæ¨¡å¼æ§å¶ï¼ç¼ºçå¼ä¸º0x
Register 7ï¼æ°åé³é¢æ¥å£æ ¼å¼æ§å¶ï¼ç¼ºçå¼ä¸º0x
Register 8ï¼éæ ·çæ§å¶ï¼ç¼ºç为kHzï¼å¯¹DMEVMæ¿ï¼ç¼ºçå¼ä¸ºOx
Register 9ï¼æ°åé³é¢æ¥å£æ¿æ´»å¼å ³ï¼ç¼ºçå¼ä¸º0x
é常æ åµä¸éè¦ä¿®æ¹çå¯åå¨å æ¬4å·å8å·å¯åå¨ï¼å³éæ©æ¯ç±micè¾å ¥è¿æ¯ç±line inè¾å ¥åæ ¹æ®éè¦éæ©éæ ·çãè¿2个å¯åå¨ç详ç»é ç½®å¦ä¸ï¼
4å·å¯åå¨é ç½®è§è¡¨1ï¼å ¶ä¸ï¼D2ä½ãINSEL(In-put select for ADC)æ¯è¾å ¥éæ©ï¼âOâ为line inï¼âlâ为mic.D1ä½MICM(Microphone mute)æ¯micéé³å¼å ³ï¼ä¸ºâlâ表示éé³ãDOä½MICB(Microphone boost)å¦è®¾ç½®ä¸ºâ1âå°ä¸ºmicè¾å ¥æä¾dBçå¢çã8å·å¯åå¨é ç½®è§è¡¨2ï¼å ¶ä¸ï¼éæ ·çæ§å¶ä½ä¸ºD5~D2çSR[3ï¼O]ã对äºDM EVMæ¿ï¼è®¾ç½®æ¹å¼è§è¡¨3ã
å¯è§ï¼éè¦éè¿4å·å¯åå¨çD2æ¥éæ©è¾å ¥ï¼åæ¶èèDlåDO对micçæ§å¶ï¼éæ ·ççæ§å¶éè¿è®¾ç½®8å·å¯åå¨çSR[3ï¼0]æ¥å®ç°ã
3 TLVAICç驱å¨é ç½®æ¹æ³
å¾å¤åå¦è å¨è¿è¡DM EVMçechoæå ¶ä»é³é¢ä¾ç¨æ¶ï¼æ容æ碰å°çé®é¢æ¯éè¿line inè¾å ¥æ¶æè¾åºï¼èéè¿micè¾å ¥æ¶æ²¡æè¾åºï¼æ´ä¸è¦è¯´æ¹åéæ ·çäºãå³ä½¿åèèµæç¼è¾aic-håemvdm_edma_aicï¼hä¿®æ¹Dcfauhåæ°ä»ç¶æ æ³è§£å³ã
åºç°è¿æ ·çé®é¢æ¶ãé¦å è¦äºè§£TLVAICç模æé³é¢è¾å ¥ä¸ºmicåline inäºéä¸çï¼å ¶æ¬¡è¦ç¥éå¦ä½è½å¤æ£ç¡®é ç½®TLVAICçåæ°ä½¿ä¹æ»¡è¶³ç¹å®åºç¨çéè¦ãå¦æä»ç»åæechoä¾ç¨åå ¶ä»é³é¢ä¾ç¨çè¯ï¼å¯ä»¥åç°åªæå¨echoä¾ç¨ä¸å å«äºaie.håemvdm_edma_aieï¼h 2个头æ件ãå ¶å®å¨echoä¾ç¨ä¸ï¼æå å«çè¿2个头æ件åTLVAICçåå§åè¯å¥å®é 并æªä½¿ç¨ãå¦æå±è½æ对è¿2个头æ件çå å«ä»¥åTLVAICçåå§åè¯å¥ï¼ä¼åç°ç¼è¯åä»ç¶è½å¤æ£å¸¸è¿è¡ãå®é ä¸echoä¾ç¨ä¸çTLVAICåå§åè¯å¥åªæ¯æä¾äºå¯¹â ¡,自动填写vb源码VAICè¿è¡é ç½®çä¸ç§æ¹æ³è并æªç´æ¥ä½¿ç¨ã该æ¹æ³å¨DDKå çemvdmé¨å说ææ件ä¸ä¹å·²æåã
ç±äºå¨echoä¾ç¨ä¸åå§å驱å¨ç¨åºäººå£åå ¶ä»çé³é¢ä¾ç¨ä¸æ ·ä½¿ç¨äºé»è®¤åæ°ï¼èé»è®¤åæ°æ¯éè¿è°ç¨DDKå ä¸çevmdm_edma_aicï¼åºè·å¾çï¼è¯¥åºä¸ååé ç½®ä¹ä¸åï¼äºæ¯å°±ä¼åºç°ä¸è¿°é®é¢ã
å¨æç¡®äºä»¥ä¸åçåï¼éè¿å®è·µè¯æï¼æ¬ææä¾ç以ä¸ä¸ç§é ç½®æ¹æ³å¯ä»¥éåºåç§åºç¨ã
æ¹æ³ä¸
æ¢ç¶é»è®¤åæ°æ¯éè¿è°ç¨evmdm_edlna_a-icï¼åºè·å¾çï¼é£ä¹èªç¶å¯ä»¥éè¿ä¿®æ¹è¯¥åºæ¥è¾¾å°ä¿®æ¹åæ°çç®çãTIæä¾çDDKå ä¸å å«äºåç§åºçæºä»£ç ï¼è¿ä½¿å¾ä¿®æ¹åºæ件æ为å¯è½ãæ¬æç¨å°çåºçæå·¥ç¨æ¯tiddksrc\audio\evmdmç®å½ä¸çevmdm_edma_mc_ï¼pjtï¼åªéè¦æå¼è¯¥å·¥ç¨ï¼ä¿®æ¹å ¶ä¸aicï¼hä¸çé»è®¤åæ°ï¼éæ°ç¼è¯å°±è½çææ°çåºæ件ãè¿æ ·ï¼ææçé³é¢ä¾ç¨é½ä¼é»è®¤æä¿®æ¹è¿çåæ°è¿è¡ã
è¿ç§æ¹æ³éåTLVAICåæ°é ç½®ç¸å¯¹åºå®çåºç¨åºåãé ç½®å®å ¨éè¿è°ç¨evmdm_ed_ma_aicï¼åºåå§åæ¶è¿è¡ï¼ä¸ç¨å¨åºç¨å·¥ç¨æ件ä¸æ·»å ä»»ä½éå 代ç ï¼ä½¿å¾å·¥ç¨æ件æ´ç®æ´ï¼å¯ç§»æ¤æ§æ´é«ã
æ¹æ³äº
èªå®ä¹ç¬¦åæ åç»æEVMDM_EDMA_Aï¼ICä¸DevParamsçç»æä½ï¼ä¾å¦ï¼
ç¶åå°â_myParmsâä½ä¸ºDevice params ptrå¨æå®äººå£æéæ¶æ¿ä»£é»è®¤ç0x0ãè¿å°±ç¬¦åTIæ¨èçæ¹æ³ï¼å¨echoä¾ç¨ä¸çç¸å ³ä»£ç ä¹è¯´æäºè¿ç§æ¹æ³ã
è¿ç§æ¹æ³è½å¤éåºå ä¹ä»»ä½ä½¿ç¨æ åµï¼åå§ååæ°èªå®ä¹é常æç¡®ï¼ä»£ç æ读æ§è¾é«ãä½æ¯ä¸å»ºè®®åechoä¾ç¨ä¸é£æ ·ç´æ¥å å«é»è®¤åæ°ç头æ件ï¼æ好åç §è¯¥å¤´æ件å®ä¹èªå·±çç»æä½ã
æ¹æ³ä¸
éè¿ä»ç»åæçæevmdm_edma_aicï¼åºçæºä»£ç ï¼å¯ä»¥åç°å¯¹TLVAICå¯åå¨ç设置æ¯éè¿AIC_setParams()å½æ°æ¥å®æçãå¨å¤§å¤æ°æ åµä¸ï¼åªè¦ä¿®æ¹å¯åå¨å¼èä¸å¿ ä¿®æ¹æ åç»æEVMDM_EDMA_AIC_DevParamsç»æä½ä¸çå ¶ä»åéãæ以å¯ä»¥è°ç¨AIC_setParams()å½æ°æ¥å®æ对TLVAICåæ°çé ç½®ãè¿æ ·å°±åªéè¦å®ä¹1个符åæ åçå¯åå¨æ°ç»ï¼å°æ°ç»åä½ä¸ºåæ°æ¥è°ç¨AIC_setParamsf()å½æ°å°±å¯ä»¥è¾¾å°ç®çã
è¿ç§æ¹æ³ä½¿ç¨çµæ´»ï¼ä»£ç é¿åº¦å¾çï¼å«ä¹é常æç¡®ï¼å¯ä»¥ç¨ä¸ååæ°å¤æ¬¡è°ç¨ï¼å°¤å ¶éç¨äºTLVAICåæ°å¯åçç¹æ®åºåã
å¨å®é å·¥ä½åºç¡ä¸å¯¹TLVAICåæ°é ç½®æåºäº3ç§æ¹æ³ï¼åæç¹ç¹ä¸é½ååå®ç¨ãå¨è¿è¡åºäºDDKçTLVAIC驱å¨ç¨åºè®¾è®¡æ¶ï¼å¯ä»¥æ ¹æ®éè¦æ¹ä¾¿å°éç¨ã