rt685 tried to drive I2S3, found that only WS signal output, no BCLK signal output!
Here is the code:
1、
CLOCK_AttachClk(kAUDIO_PLL_to_FLEXCOMM3);
2、
const uint32_t port0_pin21_config = (/* Pin is configured as FC3_SCK */
IOPCTL_PIO_FUNC1 |
/* Disable pull-up / pull-down function */
IOPCTL_PIO_PUPD_DI |
/* Enable pull-down function */
IOPCTL_PIO_PULLDOWN_EN |
/* Disable input buffer function */
IOPCTL_PIO_INBUF_DI |
/* Normal mode */
IOPCTL_PIO_SLEW_RATE_NORMAL |
/* Normal drive */
IOPCTL_PIO_FULLDRIVE_DI |
/* Analog mux is disabled */
IOPCTL_PIO_ANAMUX_DI |
/* Pseudo Output Drain is disabled */
IOPCTL_PIO_PSEDRAIN_DI |
/* Input function is not inverted */
IOPCTL_PIO_INV_DI);
/* PORT0 PIN21 (coords: C7) is configured as FC3_SCK */
IOPCTL_PinMuxSet(IOPCTL, 0U, 21U, port0_pin21_config); //I2S3 BCLK
const uint32_t port0_pin22_config = (/* Pin is configured as FC3_TXD_SCL_MISO_WS */
IOPCTL_PIO_FUNC1 |
/* Disable pull-up / pull-down function */
IOPCTL_PIO_PUPD_DI |
/* Enable pull-down function */
IOPCTL_PIO_PULLDOWN_EN |
/* Enables input buffer function */
IOPCTL_PIO_INBUF_DI |
/* Normal mode */
IOPCTL_PIO_SLEW_RATE_NORMAL |
/* Normal drive */
IOPCTL_PIO_FULLDRIVE_DI |
/* Analog mux is disabled */
IOPCTL_PIO_ANAMUX_DI |
/* Pseudo Output Drain is disabled */
IOPCTL_PIO_PSEDRAIN_DI |
/* Input function is not inverted */
IOPCTL_PIO_INV_DI);
/* PORT0 PIN22 (coords: D8) is configured as FC3_TXD_SCL_MISO_WS */
IOPCTL_PinMuxSet(IOPCTL, 0U, 22U, port0_pin22_config); //I2S3 WS
const uint32_t port0_pin23_config = (/* Pin is configured as FC3_RXD_SDA_MOSI_DATA */
IOPCTL_PIO_FUNC1 |
/* Disable pull-up / pull-down function */
IOPCTL_PIO_PUPD_DI |
/* Enable pull-down function */
IOPCTL_PIO_PULLDOWN_EN |
/* Enables input buffer function */
IOPCTL_PIO_INBUF_DI |
/* Normal mode */
IOPCTL_PIO_SLEW_RATE_NORMAL |
/* Full drive enable */
IOPCTL_PIO_FULLDRIVE_DI |
/* Analog mux is disabled */
IOPCTL_PIO_ANAMUX_DI |
/* Pseudo Output Drain is disabled */
IOPCTL_PIO_PSEDRAIN_DI |
/* Input function is not inverted */
IOPCTL_PIO_INV_DI);
/* PORT0 PIN23 (coords: C9) is configured as FC3_RXD_SDA_MOSI_DATA */
IOPCTL_PinMuxSet(IOPCTL, 0U, 23U, port0_pin23_config); //I2S3 SDA RX
3、
DMA_EnableChannel(AUDIO_CODEC_DMA , AUDIO_CODEC_I2S_RX_CHANNEL);
DMA_SetChannelPriority(AUDIO_CODEC_DMA , AUDIO_CODEC_I2S_RX_CHANNEL, kDMA_ChannelPriority2);
DMA_CreateHandle(&s_Audio_CodecDmaRxHandle, AUDIO_CODEC_DMA, AUDIO_CODEC_I2S_RX_CHANNEL);
I2S_RxGetDefaultConfig(&s_Audio_CodecRxConfig);
/**************AUX I2S RX***********************/
s_Audio_CodecRxConfig.divider = AUDIO_CODEC_I2S_CLOCK_DIVIDER;
s_Audio_CodecRxConfig.masterSlave = AUDIO_CODEC_I2S_RX_MODE;
//s_Audio_CodecRxConfig.oneChannel = true; //mono
s_Audio_CodecRxConfig.leftJust = true;
s_Audio_CodecRxConfig.frameLength = 64U;
I2S_RxInit(AUDIO_CODEC_I2S_RX, &s_Audio_CodecRxConfig);
/*********AUX I2S RX data buff Config**********/
s_Audio_CodecRxTransfer.data = &s_Audio_CodecBuffer[0];
s_Audio_CodecRxTransfer.dataSize = sizeof(s_Audio_CodecBuffer);
I2S_RxTransferCreateHandleDMA(AUDIO_CODEC_I2S_RX, &s_Audio_CodecRxHandle, &s_Audio_CodecDmaRxHandle, Audio_CodecRxCallback, (void *)&s_Audio_CodecRxTransfer);
I2S_RxTransferReceiveDMA(AUDIO_CODEC_I2S_RX, &s_Audio_CodecRxHandle, s_Audio_CodecRxTransfer);
I2S_RxTransferReceiveDMA(AUDIO_CODEC_I2S_RX, &s_Audio_CodecRxHandle, s_Audio_CodecRxTransfer);