|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2017-5-1 22:01:15
|
显示全部楼层
void tda1543_I2S_Init(void)
{
I2S_MODEConf_Type I2S_ClkConfig;
I2S_CFG_Type I2S_ConfigStruct;
/* Initialize I2S peripheral ------------------------------------*/
scu_pinmux(3,0, MD_PLN_FAST, FUNC2); //I2S_TX_CLK
scu_pinmux(7,1, MD_PLN_FAST, FUNC2); //I2S_TX_WS
scu_pinmux(7,2, MD_PLN_FAST, FUNC2); //I2S_TX_SDA
scu_pinmux(3,3, MD_PLN_FAST, FUNC6); //I2S0_TX_MCLK
I2S_Init(LPC_I2S0);
/* setup:
* - wordwidth: 16 bits
* - stereo mode
* - master mode for I2S_TX
* - Frequency = 44.1 kHz
*/
/* Audio Config*/
I2S_ConfigStruct.wordwidth = I2S_WORDWIDTH_16;
I2S_ConfigStruct.mono = I2S_STEREO;
I2S_ConfigStruct.stop = I2S_STOP_DISABLE;
I2S_ConfigStruct.reset = I2S_RESET_ENABLE;
I2S_ConfigStruct.ws_sel = I2S_MASTER_MODE;
//I2S_ConfigStruct.ws_sel = I2S_SLAVE_MODE;
I2S_ConfigStruct.mute = I2S_MUTE_DISABLE;
I2S_Config(LPC_I2S0,I2S_TX_MODE,&I2S_ConfigStruct);
/* Clock Mode Config*/
I2S_ClkConfig.clksel = I2S_CLKSEL_FRDCLK;
I2S_ClkConfig.fpin = I2S_4PIN_DISABLE;
LPC_SCU->SFSCLK_2 = 0x06;
I2S_ClkConfig.mcena = I2S_MCLK_ENABLE;
I2S_ModeConfig(LPC_I2S0,&I2S_ClkConfig,I2S_TX_MODE);
I2S_FreqConfig(LPC_I2S0, 44100, I2S_TX_MODE);
I2S_Stop(LPC_I2S0, I2S_TX_MODE);
/* TX FIFO depth is 4 */
I2S_IRQConfig(LPC_I2S0,I2S_TX_MODE,4);
I2S_IRQCmd(LPC_I2S0,I2S_TX_MODE,ENABLE);
NVIC_ClearPendingIRQ(I2S0_IRQn);
I2S_Start(LPC_I2S0);
NVIC_EnableIRQ(I2S0_IRQn);
}
配置没有问题,问题是不能满足我的功能要求,已放弃这个芯片。
|
|