/* param base I2S base pointer. param config pointer to I2S configuration structure.  */
void I2S_TxInit(I2S_Type *base, const i2s_config_t *config)
/* param base I2S base pointer. param config pointer to I2S configuration structure.  */
void I2S_TxInit(I2S_Type *base, const i2s_config_t *config)
{
    uint32_t cfg  = 0U;
    uint32_t trig = 0U;
    (void)FLEXCOMM_Init(base, FLEXCOMM_PERIPH_I2S_TX);
    I2S_Config(base, config);
    cfg |= I2S_FIFOCFG_ENABLETX(1U);
    cfg |= I2S_FIFOCFG_EMPTYTX(1U);
    cfg |= I2S_FIFOCFG_TXI2SE0(config->txEmptyZero);
    cfg |= I2S_FIFOCFG_PACK48(config->pack48);
    trig |= I2S_FIFOTRIG_TXLVLENA(1U);
    trig |= I2S_FIFOTRIG_TXLVL(config->watermark);
    base->FIFOCFG  = cfg;
    base->FIFOTRIG = trig;
}