在驱动中调用 I2S_OPEN()函数,可是I2S 的采样率LRCLK总是不能配置正确,用示波器采样总是和BCLK一样的频率。在驱动程序中也没有找到LRCLK的配置寄存器,求高手解答。我的I2S_config()函数如下:void I2S_config(void)
{I2S_DATA_T st;
MFP_I2S_TO_PORTC();
I2S_Init();
st.u32SampleRate
= 16000;
st.u32WordWidth
= I2S_DATABIT_16;
st.u32AudioFormat
= I2S_STEREO;
st.u32DataFormat
= I2S_FORMAT_I2S;
st.u32Mode
= I2S_MODE_MASTER;
st.u32TxFIFOThreshold = I2S_FIFO_TX_LEVEL_WORD_8;
st.u32RxFIFOThreshold = I2S_FIFO_RX_LEVEL_WORD_8;
I2S_Open(&st);
// select source from HXT(12MHz)
SYS_SelectIPClockSource_2(CLK_CLKSEL2_I2S_MASK, CLK_CLKSEL2_I2S_PLL);
// div = 0
SYS_SetClockDivider_0(CLK_CLKDIV0_I2S_MASK, I2S_CLK_DIVIDER(2));
/* Set MCLK and enable MCLK */
I2S_SetMCLKFreq(4096000);
I2S_EnableMCLK();
//I2S_SetBCLKFreq(512000);
I2S_EnableInt_TxThreshold();
I2S_EnableTx();
} |