/* Configure PCM(TDM) function parameters, such as channel width, channel number and sync pulse width.  */
void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth)
/* Configure PCM(TDM) function parameters, such as channel width, channel number and sync pulse width.  */
void I2S_ConfigureTDM(I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth)
{
    i2s->CTL0 = (i2s->CTL0 & ~(I2S_CTL0_TDMCHNUM_Msk | I2S_CTL0_CHWIDTH_Msk | I2S_CTL0_PCMSYNC_Msk)) |
                (u32ChannelWidth << I2S_CTL0_CHWIDTH_Pos) |
                (u32ChannelNum << I2S_CTL0_TDMCHNUM_Pos) |
                (u32SyncWidth << I2S_CTL0_PCMSYNC_Pos);
}