新手上路
- 积分
- 45
- 金钱
- 45
- 注册时间
- 2015-7-17
- 在线时间
- 3 小时
|
5金钱
已经把VS1053配置完毕了,芯片的测试也成功了,可是往里面送音频文件的数据却没有声音,已经纠结很久了,求救助?
DIR dirs;
FILINFO finfo;
FATFS FatFs; // Work area (file system object) for logical drive
FIL fsrc, fdst,fsrca; // file objects
BYTE buffer[512]; // file copy buffer
int a = 0;
FRESULT res; // FatFs function common result code
UINT br, bw; // File R/W count
char path[512]="";
uint8_t textFileBuffer[] = "wellcome to use Development board";
void SD_information(void);
FRESULT scan_files (char* path);
FILINFO finfo;
int count;
u8 i;
void mp3_play(void)
{
br = 1;
f_mount(&FatFs,"0:",0);
res = f_open(&fsrc,"1.mp3", FA_OPEN_EXISTING | FA_READ ); /* ??????·????ò?? */
VS_SPI_SpeedHigh(); //????
VS_Restart_Play(); //??????·?
VS_Set_All(); //?è????????????
VS_Reset_DecodeTime(); //???è?????±??
for (;;)
{
res = f_read( &fsrc, buffer, sizeof(buffer), &br );
if ( res == 0 )
{
count=0;
while(count<512)
{
VS_XDCS=0; /* ????VS1003?????????? */
for(i=0;i<32;i++)
{
VS_SPI_ReadWriteByte(buffer[count]);
count++;
}
VS_XDCS=1; /* ??±?VS1003???????? */
}
}
if (res || br == 0) break;
}
f_close(&fsrc);
f_mount(NULL, "0:", 0);
}
|
|