S3C2440之IIS操作MDK
时间:11-19
来源:互联网
点击:
s3c2440µÄIIS¼Ä´æÆ÷//Ô¤·ÖƵÆ÷Ϊ5¬ËùÒÔCDCLK=PCLK/(5+1)=384fs=384*22.05khz=50Mhz/N+1 ----> N=5rIISPSR = 5<5|5;//ÎÞЧDMA¬ÊäÈë¿ÕÏЬԤ·ÖƵÆ÷ÓÐЧ,²¥·ÅÏÖÓеÄÒôƵÊý¾Ý¬ËùÒÔ²»ÐèÒª´ÓUDA1314ÖнÓÊÕÈκÎÊý¾Ý¬ËùÒÔÉèÖÃÊäÈë¿ÕÏÐrIISCON = (0<5)|(0<4)|(0<3)|(1<2)|(1<1); //PCLKΪʱÖÓÔ´¬Êä³öÄʽ¬IISÄʽ¬Ã¿¸öÉùµÀ16λ¬CODECLK=384fs¬SCLK=32fsrIISMOD = (0<9)|(0<8)|(2<6)|(0<5)|(0<4)|(1<3)|(1<2)|(1<0); rIISFCON = (0<15)|(1<13); //Êä³öFIFOÕý³Äʽ¬Êä³öFIFOʹÄÜflag=1;count=0;//¿ªÆôIISrIISCON |= 0x1;while(flag){if((rIISCON & (1<7))==0) //¼ì²éÊä³öFIFOÊÇ·ñΪ¿Õ{ //FIFOÖеÄÊý¾ÝΪ16λ¬Éî¶ÈΪ32//µ±Êä³öFIFOΪ¿Õʱ¬Ò»´ÎÐÔÏòFIFOдÈë32¸ö16λÊý¾Ýfor(i=0;i<32;i++){rIISFIFO=(buffer[2*i+count])+(buffer[2*i+1+count]<8);} count+=64;if(count>length)flag=0; //ÒôƵÊý¾Ý´«ÊäÍê¬ÔòÍ˳ö}}rIISCON = 0x0; //¹Ø±ÕIIS}
main.c文件
scatter文件:
main.c文件
int main(void){ init_uart0();NF_Init();NF_Read((u8*)0x33000000, (ulong)0x1000, 0x100000);printf("\r\ntest music......\r\n");playsound(music + 44,sizeof(music) - 44);}
scatter文件:
; *
; * Scatter-Loading Description File generated by uVision *
; *
LR_ROM1 0x00000000 0x00100000 { ; load region size_region
ER_ROM1 0x00000000 0x000001000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_RAM1 0x30000000 0x40000000 { ; RW data
.ANY (+RW +ZI)
}
OTHERS 0x31000000{
uart.o(*)
iis.o(*)
}
HEAP 0x32000800 {
S3C2440A.o(HEAP)
}
STACK 0x32000c00{
S3C2440A.o(STACK)
}
}
LD_ROM2 0x1000
{
MUSIC 0x33000000{
*(wav)
}
}
scatter文件中采用了2个加载域,单独把音频数据放到了4k后,运行在0x33000000.
烧写到nandflash中,可以正常运行,播放歌曲。
S3C2440IIS操作MD 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)