32#define SCUART_CHAR_LEN_5 (0x3ul << SC_UARTCTL_WLS_Pos)
33#define SCUART_CHAR_LEN_6 (0x2ul << SC_UARTCTL_WLS_Pos)
34#define SCUART_CHAR_LEN_7 (0x1ul << SC_UARTCTL_WLS_Pos)
35#define SCUART_CHAR_LEN_8 (0)
37#define SCUART_PARITY_NONE (SC_UARTCTL_PBOFF_Msk)
38#define SCUART_PARITY_ODD (SC_UARTCTL_OPE_Msk)
39#define SCUART_PARITY_EVEN (0)
41#define SCUART_STOP_BIT_1 (SC_CTL_NSB_Msk)
42#define SCUART_STOP_BIT_2 (0)
44#define SCUART_TIMEOUT_ERR (-1L)
63#define SCUART_WRITE(sc, u8Data) ((sc)-> DAT = (u8Data))
75#define SCUART_GET_TX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_TXEMPTY_Msk)
85#define SCUART_GET_TX_FULL(sc) ((sc)->STATUS & SC_STATUS_TXFULL_Msk)
95#define SCUART_WAIT_TX_EMPTY(sc) while((sc)->STATUS & SC_STATUS_TXACT_Msk)
106#define SCUART_IS_TX_FULL(sc) ((sc)->STATUS & SC_STATUS_TXFULL_Msk ? 1 : 0)
116#define SCUART_IS_TX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_TXACT_Msk ? 0 : 1)
128#define SCUART_READ(sc) ((sc)->DAT)
139#define SCUART_GET_RX_EMPTY(sc) ((sc)->STATUS & SC_STATUS_RXEMPTY_Msk)
150#define SCUART_GET_RX_FULL(sc) ((sc)->STATUS & SC_STATUS_RXFULL_Msk)
161#define SCUART_IS_RX_READY(sc) ((sc)->INTSTS & SC_INTSTS_RDAIF_Msk ? 1 : 0)
171#define SCUART_IS_RX_FULL(sc) ((sc)->STATUS & SC_STATUS_RXFULL_Msk ? 1 : 0)
188#define SCUART_ENABLE_INT(sc, u32Mask) ((sc)->INTEN |= (u32Mask))
203#define SCUART_DISABLE_INT(sc, u32Mask) ((sc)->INTEN &= ~(u32Mask))
220#define SCUART_GET_INT_FLAG(sc, u32Type) ((sc)->INTSTS & (u32Type) ? 1 : 0)
234#define SCUART_CLR_INT_FLAG(sc, u32Type) ((sc)->INTSTS = (u32Type))
247#define SCUART_GET_ERR_FLAG(sc) ((sc)->STATUS & (SC_STATUS_PEF_Msk | SC_STATUS_FEF_Msk | SC_STATUS_BEF_Msk))
261#define SCUART_CLR_ERR_FLAG(sc, u32Mask) ((sc)->STATUS = (u32Mask))
265uint32_t
SCUART_Read(
SC_T* sc, uint8_t *pu8RxBuf, uint32_t u32ReadBytes);
266uint32_t
SCUART_SetLineConfig(
SC_T* sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits);
int32_t g_SCUART_i32ErrCode
void SCUART_SetTimeoutCnt(SC_T *sc, uint32_t u32TOC)
This function use to set receive timeout count.
uint32_t SCUART_Read(SC_T *sc, uint8_t *pu8RxBuf, uint32_t u32ReadBytes)
Read data from smartcard UART interface.
uint32_t SCUART_SetLineConfig(SC_T *sc, uint32_t u32Baudrate, uint32_t u32DataWidth, uint32_t u32Parity, uint32_t u32StopBits)
This function use to config smartcard UART mode line setting.
uint32_t SCUART_Open(SC_T *sc, uint32_t u32baudrate)
Enable smartcard uart interface.
uint32_t SCUART_Write(SC_T *sc, uint8_t *pu8TxBuf, uint32_t u32WriteBytes)
Write data to smartcard UART interface.
void SCUART_Close(SC_T *sc)
Disable smartcard uart interface.