|
哪位朋友做过I2S的音频驱动呀?下面这段代码的意思是:void _WrL3AddrData(unsigned char Addr,DWORD data)
{
unsigned short WriteData =(unsigned short)data;
int i;//j;
unsigned short temp = Addr;
// CS---GPE12/SPIMOSIO
// SDIN---GPG5/SPIMOSO1
// SCLK---GPE11/SPIMISO0
WriteData |=(temp << 9);
g_pIOPregs->GPECON &= (~((3<<22)|(3<<24)));
g_pIOPregs->GPECON |= ((1<<22)|(1<<24));
g_pIOPregs->GPEUP &= (~((1<<11)|(1<<12)));
g_pIOPregs->GPGCON &= (~(3<<10));
g_pIOPregs->GPGCON |= (1<<10);
g_pIOPregs->GPGUP &= (~(1<<5));
g_pIOPregs->GPEDAT &= (~(1<<11)); //L3CLK = H;
_DelayTime(1);
g_pIOPregs->GPEDAT &=(~(1<<12)); //CS = L ,data transmit start
_DelayTime(10);
for(i = 0;i<16;i++)
{
g_pIOPregs->GPEDAT &=~(1<<11);
_DelayTime(1);
if(WriteData & (1<<(0x0F - i)))
g_pIOPregs->GPGDAT |= (1<<5); //L3DATA =1;
else
g_pIOPregs->GPGDAT &= (~(1<<5)); //L3DATA =0;
_DelayTime(1);
g_pIOPregs->GPEDAT |=(1<<11); //L3CLK = H;
_DelayTime(3);
}
_DelayTime(10);
g_pIOPregs->GPEDAT |=(1<<12); //CS = H ,data transmit Stop;
_DelayTime(10);
g_pIOPregs->GPGDAT &=(~(1<<5));
g_pIOPregs->GPEDAT &= (~(1<<11)); //L3DATA =0;
_DelayTime(20);
}什么呀?这个好像是往UDA1314这个音频IC上写数据以控制这个IC,这个IC有SPI的接口吗?怎么它通过S3C2440的SPI接口来写数据呢?谢谢了呀!
|
|