32#define SC_INTERFACE_NUM 2
33#define SC_PIN_STATE_HIGH 1
34#define SC_PIN_STATE_LOW 0
35#define SC_PIN_STATE_IGNORE 0xFFFFFFFF
39#define SC_TMR_MODE_0 (0ul << SC_TMR0_MODE_Pos)
40#define SC_TMR_MODE_1 (1ul << SC_TMR0_MODE_Pos)
41#define SC_TMR_MODE_2 (2ul << SC_TMR0_MODE_Pos)
42#define SC_TMR_MODE_3 (3ul << SC_TMR0_MODE_Pos)
43#define SC_TMR_MODE_4 (4ul << SC_TMR0_MODE_Pos)
44#define SC_TMR_MODE_5 (5ul << SC_TMR0_MODE_Pos)
45#define SC_TMR_MODE_6 (6ul << SC_TMR0_MODE_Pos)
46#define SC_TMR_MODE_7 (7ul << SC_TMR0_MODE_Pos)
47#define SC_TMR_MODE_8 (8ul << SC_TMR0_MODE_Pos)
48#define SC_TMR_MODE_F (0xF << SC_TMR0_MODE_Pos)
76#define SC_ENABLE_INT(sc, u32Mask) ((sc)->IER |= (u32Mask))
96#define SC_DISABLE_INT(sc, u32Mask) ((sc)->IER &= ~(u32Mask))
105#define SC_SET_VCC_PIN(sc, u32State) \
108 (sc)->PINCSR |= SC_PINCSR_POW_EN_Msk;\
110 (sc)->PINCSR &= ~SC_PINCSR_POW_EN_Msk;\
121#define SC_SET_CLK_PIN(sc, u32OnOff)\
124 (sc)->PINCSR |= SC_PINCSR_CLK_KEEP_Msk;\
126 (sc)->PINCSR &= ~(SC_PINCSR_CLK_KEEP_Msk);\
136#define SC_SET_IO_PIN(sc, u32State)\
139 (sc)->PINCSR |= SC_PINCSR_SC_DATA_O_Msk;\
141 (sc)->PINCSR &= ~SC_PINCSR_SC_DATA_O_Msk;\
151#define SC_SET_RST_PIN(sc, u32State)\
154 (sc)->PINCSR |= SC_PINCSR_SC_RST_Msk;\
156 (sc)->PINCSR &= ~SC_PINCSR_SC_RST_Msk;\
165#define SC_READ(sc) ((char)((sc)->RBR))
174#define SC_WRITE(sc, u8Data) ((sc)->THR = (u8Data))
184#define SC_SET_STOP_BIT_LEN(sc, u32Len) ((sc)->CTL = ((sc)->CTL & ~SC_CTL_SLEN_Msk) | (u32Len == 1 ? SC_CTL_SLEN_Msk : 0))
222void SC_Open(
SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR);
227void SC_StartTimer(
SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount);
#define SC_CTL_TX_ERETRY_EN_Msk
#define SC_CTL_RX_ERETRY_EN_Msk
#define SC_CTL_TX_ERETRY_Pos
#define SC_CTL_TX_ERETRY_Msk
#define SC_CTL_RX_ERETRY_Pos
#define SC_CTL_RX_ERETRY_Msk
void SC_SetBlockGuardTime(SC_T *sc, uint32_t u32BGT)
This function block guard time (BGT) of specified smartcard module.
void SC_SetCharGuardTime(SC_T *sc, uint32_t u32CGT)
This function character guard time (CGT) of specified smartcard module.
void SC_ResetReader(SC_T *sc)
This function reset specified smartcard module to its default state for activate smartcard.
void SC_Open(SC_T *sc, uint32_t u32CardDet, uint32_t u32PWR)
This function initialized smartcard module.
void SC_StopAllTimer(SC_T *sc)
This function stop all smartcard timer of specified smartcard module.
uint32_t SC_IsCardInserted(SC_T *sc)
This function indicates specified smartcard slot status.
void SC_StopTimer(SC_T *sc, uint32_t u32TimerNum)
This function stop a smartcard timer of specified smartcard module.
void SC_StartTimer(SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount)
This function configure and start a smartcard timer of specified smartcard module.
__STATIC_INLINE void SC_SetRxRetry(SC_T *sc, uint32_t u32Count)
Enable/Disable Rx error retry, and set Rx error retry count.
void SC_ClearFIFO(SC_T *sc)
This function reset both transmit and receive FIFO of specified smartcard module.
__STATIC_INLINE void SC_SetTxRetry(SC_T *sc, uint32_t u32Count)
Enable/Disable Tx error retry, and set Tx error retry count.
void SC_Close(SC_T *sc)
This function disable specified smartcard module.