/* This function use to enable smartcard module UART mode and set baudrate. 
HIDDEN_SYMBOLS  */
uint32_t SCUART_Open(SC_T *sc, uint32_t u32baudrate)
/* This function use to enable smartcard module UART mode and set baudrate. 
HIDDEN_SYMBOLS  */
uint32_t SCUART_Open(SC_T *sc, uint32_t u32baudrate)
{
    uint32_t u32Clk = SCUART_GetClock(sc), u32Div;
    u32Div = (u32Clk + (u32baudrate >> 1) - 1UL) / u32baudrate - 1UL;
    sc->CTL = SC_CTL_SCEN_Msk | SC_CTL_NSB_Msk;
    sc->UARTCTL = SCUART_CHAR_LEN_8 | SCUART_PARITY_NONE | SC_UARTCTL_UARTEN_Msk;
    sc->ETUCTL = u32Div;
    return (u32Clk / (u32Div + 1UL));
}