46 uint32_t u32ClkSrc, u32Num, u32Clk;
68 else if(u32ClkSrc == 1UL)
72 else if(u32ClkSrc == 2UL)
114 u32Div = (u32Clk + (u32baudrate >> 1) - 1UL) / u32baudrate - 1UL;
122 return(u32Clk / (u32Div + 1UL));
137 for(u32Count = 0UL; u32Count < u32ReadBytes; u32Count++)
177 if(u32Baudrate == 0UL)
184 u32Div = (u32Clk + (u32Baudrate >> 1) - 1UL)/ u32Baudrate - 1UL;
192 return(u32Clk / (u32Div + 1UL));
223 for(u32Count = 0UL; u32Count != u32WriteBytes; u32Count++)
231 sc->
DAT = pu8TxBuf[u32Count];
#define SCUART_PARITY_NONE
static uint32_t SCUART_GetClock(SC_T *sc)
#define SCUART_GET_TX_FULL(sc)
Get TX FIFO full flag status from register.
#define SC_ETUCTL_ETURDIV_Msk
void SCUART_Close(SC_T *sc)
The function is used to disable smartcard interface UART mode.
NuMicro peripheral access layer header file.
uint32_t CLK_GetPCLK1Freq(void)
Get PCLK1 frequency.
uint32_t CLK_GetPCLK0Freq(void)
Get PCLK0 frequency.
#define SC_UARTCTL_UARTEN_Msk
#define SCUART_GET_RX_EMPTY(sc)
Get RX FIFO empty flag status from register.
#define SCUART_READ(sc)
Read Rx data register.
uint32_t CLK_GetPLLClockFreq(void)
Get PLL clock frequency.
#define CLK_CLKSEL3_SC0SEL_Msk
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)
The function is used to read Rx data from RX FIFO.
void SCUART_Write(SC_T *sc, uint8_t pu8TxBuf[], uint32_t u32WriteBytes)
This function is to write data into transmit FIFO to send data out.
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_Open(SC_T *sc, uint32_t u32baudrate)
This function use to enable smartcard module UART mode and set baudrate.
#define SCUART_CHAR_LEN_8
#define CLK_CLKDIV1_SC0DIV_Msk