/* This function use to configure smartcard UART mode line setting.  */
uint32_t SCUART_SetLineConfig(SC_T *sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits)
/* This function use to configure smartcard UART mode line setting.  */
uint32_t SCUART_SetLineConfig(SC_T *sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits)
{
    uint32_t u32Clk = SCUART_GetClock(sc), u32Div;
    if (u32Baudrate == 0UL)
    {
        u32Div = sc->ETUCTL & SC_ETUCTL_ETURDIV_Msk;
    }
    else
    {
        u32Div = (u32Clk + (u32Baudrate >> 1) - 1UL) / u32Baudrate - 1UL;
        sc->ETUCTL = u32Div;
    }
    sc->CTL = u32StopBits | SC_CTL_SCEN_Msk;
    sc->UARTCTL = u32Parity | u32DataWidth | SC_UARTCTL_UARTEN_Msk;
    return (u32Clk / (u32Div + 1UL));
}