/* I2S peripheral configuration */ I2S_InitStructure.I2S_Standard = I2S_Standard_Phillips; I2S_InitStructure.I2S_DataFormat = I2S_DataFormat_16b/*extended*/; I2S_InitStructure.I2S_MCLKOutput = I2S_MCLKOutput_Disable; I2S_InitStructure.I2S_AudioFreq = I2S_AudioFreq_8k; I2S_InitStructure.I2S_CPOL = I2S_CPOL_Low;
/* I2S2 Master Transmitter to I2S3 Slave Receiver communication -----------*/ /* I2S2 configuration */ I2S_InitStructure.I2S_Mode = I2S_Mode_SlaveTx;//I2S_Mode_SlaveTx; I2S_Init(SPI3, &I2S_InitStructure);
//I2S_InitStructure.I2S_Mode = I2S_Mode_SlaveRx; //I2S_Init(SPI2, &I2S_InitStructure);
/* Enable the I2S3 */ I2S_Cmd(SPI3, ENABLE); //I2S_Cmd(SPI2, ENABLE);
wm8753_config(MIC_1, 24, SIDETONE_DISABLE, 8000, DAC_MUSIC_ONLY);
while (1) { int len = 36494/2, i = 0, cflag; unsigned short *p = (unsigned short *)&testdata[0]; while (i < len) { /* Wait the Tx buffer to be empty */ while (SPI_I2S_GetFlagStatus(SPI3, SPI_I2S_FLAG_TXE) == RESET) {} /* Send a data from I2S3 */ SPI_I2S_SendData(SPI3, 0xAAAA/*p[i++]*/); while (SPI_I2S_GetFlagStatus(SPI3, SPI_I2S_FLAG_TXE) == RESET) {} /* Send a data from I2S3 */ SPI_I2S_SendData(SPI3, 0x5555/*p[i++]*/); //i += 2; } //i = 0; while (1); } I2S_Cmd(SPI3, DISABLE); //I2S_Cmd(SPI2, DISABLE);
while (1) { } }
|