/* This function is used to get I2S source clock frequency.  */
static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s)
/* This function is used to get I2S source clock frequency.  */
static uint32_t I2S_GetSourceClockFreq(I2S_T *i2s)
{
    (void)i2s;
    uint32_t u32Freq, u32ClkSrcSel;
    u32ClkSrcSel = CLK_GetModuleClockSource(I2S0_MODULE) << CLK_CLKSEL3_I2S0SEL_Pos;
    switch(u32ClkSrcSel)
    {
        case CLK_CLKSEL3_I2S0SEL_HXT:
            u32Freq = __HXT;
            break;
        case CLK_CLKSEL3_I2S0SEL_PLL:
            u32Freq = CLK_GetPLLClockFreq();
            break;
        case CLK_CLKSEL3_I2S0SEL_HIRC:
            u32Freq = __HIRC;
            break;
        case CLK_CLKSEL3_I2S0SEL_PCLK0:
            u32Freq = CLK_GetPCLK0Freq();
            break;
        default:
            u32Freq = CLK_GetPCLK0Freq();
            break;
    }
    return u32Freq;
}