void I2S_TX_Init( void )
{
PCONP |= (1 << 27);
PCLKSEL1 &= ~(0x03 << 22); // Clear I2S Clock register
PCLKSEL1 |= (0x01 << 22); // Set I2S Clock register
/*connect the I2S sigals to port pins(P0.4-P0.9)*/
PINSEL0 &= ~0x000FC000; /* clear port pins */
PINSEL0 |= 0x00054000; /* set port pins */
I2S_TXRATE=0x25; //Frequency sample rage was about 44.1K
I2S_DAO = ( 1 << 0)| //Wordwidth :2 Bit
( 1 << 2)| //Mono :1 Bit
( 1 << 3)| //Stop :1 Bit
( 0 << 4)| //Reset :1 Bit
( 0 << 5)| //Ws_sel :1 Bit
(0x10<< 6)| //Ws_halfperiod :9 Bit
( 0 << 15); //Mute :1 Bit
I2S_DMA1 = ( 0 << 0)| //Enables DMA1 for I2S RX.
( 1 << 1)| //Enables DMA1 for I2S TX.
(0x00<< 8)| //RX_depth_DMA1
(0x02<< 16); //TX_depth_DMA1
}
主时钟频率为12MHZ,CCLK为72MHZ,那PCLK是多少呢,看配置文件,PCLK = CCLK / 4。I2S_TXRATE=0x25这个是怎么计算的呢?求解,它是用哪个时钟呢?算了很久,都没有,求大神帮帮忙 |