/* Reset the Tx and Rx FIFO of smartcard module.  */
void SC_ClearFIFO(SC_T *sc)
/* Reset the Tx and Rx FIFO of smartcard module.  */
void SC_ClearFIFO(SC_T *sc)
{
    uint32_t u32TimeOutCount = SC_TIMEOUT;
    while ((sc->ALTCTL & SC_ALTCTL_SYNC_Msk) == SC_ALTCTL_SYNC_Msk)
    {
        if (--u32TimeOutCount == 0) break;
    }
    sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk);
}