S3C2440之IIS操作MDK
时间:11-19
来源:互联网
点击:
.h"#include "iis.h"/ÄÄâUDA1314µÄ3Ïß²Ù×÷¬Óë2440ͨÐÅ*//data : Ðè´«ÊäµÄÊý¾Ý//address : ÊǵØÖ·Äʽ»¹ÊÇÊý¾ÝÄʽ/void WriteL3(unsigned char data,unsigned char address) { int i,j; / *µØÖ·ÄʽʱÐò¬ÕÆÎÕ¼¸¸öÒªµã *Êý¾Ý´«ÊäµÄʱºò±Ö¤L3MODEΪµÍ *Êý¾Ý´«Ê俪ʼµÄÐźÅÊDZ֤L3MODEΪµÍL3CLOCKΪ¸ß *Êý¾Ý´«Êä½áÊøµÄÐźÅÊDZ֤L3MODEΪ¸ßL3CLOCKΪ¸ß *Êý¾Ý´«Êä¹ý³ÌÖÐÒ»¸öL3CLOCKµÄÖÜÆÚ´«Ò»¸öÊý¾Ýλ *Êý¾ÝÄʽʱÐò¬ÕÆÎÕ¼¸¸öÒªµã *Êý¾Ý´«ÊäµÄʱºò±Ö¤L3MODEΪµÍ *Êý¾Ý´«Ê俪ʼµÄÐźÅÊDZ֤L3MODEΪ¸ßL3CLOCKΪ¸ß *Êý¾Ý´«Êä½áÊøµÄÐźÅÊDZ֤L3MODEΪ¸ßL3CLOCKΪ¸ß *Êý¾Ý´«Êä¹ý³ÌÖÐÒ»¸öL3CLOCKµÄÖÜÆÚ´«Ò»¸öÊý¾Ýλ / if(1 == address) rGPBDAT = (rGPBDAT & (~(L3D | L3M | L3C))) | L3C; else rGPBDAT = (rGPBDAT & (~(L3D | L3M | L3C))) | (L3C | L3M); for(i = 0;i < 10;i++); for(i = 0;i < 8;i++) { if(data & 0x01) { rGPBDAT &= ~L3C; rGPBDAT |= L3D; for(j = 0;j < 5;j++); rGPBDAT |= L3C; rGPBDAT |= L3D; for(j = 0;j < 5;j++); } else{ rGPBDAT &= ~L3C; rGPBDAT &= ~L3D; for(j = 0;j < 5;j++); rGPBDAT |= L3C; rGPBDAT &= ~L3D; for(j = 0;j < 5;j++); } data >>= 1; } rGPBDAT = (rGPBDAT & (~(L3D | L3M | L3C))) | (L3C | L3M); } void playsound(unsigned char *buffer, int length){int count,i;char flag;rGPBDAT = rGPBDAT & ~(L3M|L3C|L3D) |(L3M|L3C); //L3¿ªÊ¼´«ÊäºL3M=H, L3C=H//ÅäÖÃUDA1341WriteL3(0x14 + 2,1); //״̬Äʽ(000101xx+10)WriteL3(0x60,0); //0,1,10, 000,0 : ״̬0,¸´Î»WriteL3(0x14 + 2,1); //״̬Äʽ (000101xx+10)WriteL3(0x10,0); //0,0,01, 000,0 : ״̬0, 384fs,IIS,no DC-filteringWriteL3(0x14 + 2,1); //״̬Äʽ (000101xx+10)WriteL3(0xc1,0); //1,0,0,0, 0,0,01:״̬1,//Gain of DAC 6 dB,Gain of ADC 0dB,ADC non-inverting,//DAC non-inverting,Single speed playback,ADC-Off DAC-On//ÅäÖÃ
S3C2440IIS操作MD 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)