47static uint32_t SCUART_GetClock(
SC_T *sc)
118 uint32_t u32Clk = SCUART_GetClock(sc), u32Div;
121 u32Div = (u32Clk + (u32baudrate >> 1) - 1) / u32baudrate - 1;
127 return(u32Clk / (u32Div + 1));
142 for(u32Count = 0; u32Count < u32ReadBytes; u32Count++)
180 uint32_t u32Clk = SCUART_GetClock(sc), u32Div;
189 u32Div = (u32Clk + (u32Baudrate >> 1) - 1)/ u32Baudrate - 1;
196 return(u32Clk / (u32Div + 1));
231 for(u32Count = 0; u32Count != u32WriteBytes; u32Count++)
244 sc->
DAT = pu8TxBuf[u32Count];
NANO103 peripheral access layer header file. This file contains all the peripheral register's definit...
#define SC_ETUCTL_ETURDIV_Msk
#define SC_UARTCTL_UARTEN_Msk
#define CLK_CLKSEL2_SC0SEL_HXT
#define CLK_CLKSEL2_SC0SEL_PLL
#define CLK_CLKSEL2_SC0SEL_HIRC
#define CLK_CLKSEL2_SC0SEL_MIRC
uint32_t CLK_GetPLLClockFreq(void)
This function get PLL frequency. The frequency unit is Hz.
#define CLK_CLKSEL2_SC1SEL_Pos
#define CLK_CLKDIV1_SC1DIV_Pos
#define CLK_CLKDIV0_SC0DIV_Msk
#define CLK_CLKSEL2_SC0SEL_Msk
#define CLK_CLKSEL2_SC1SEL_Msk
#define CLK_CLKSEL2_SC0SEL_Pos
#define CLK_CLKDIV1_SC1DIV_Msk
#define CLK_CLKDIV0_SC0DIV_Pos
#define CLK_CLKSEL0_HIRCSEL_Msk
#define CLK
Pointer to CLK register structure.
#define SC0
Pointer to SC0 register structure.
int32_t g_SCUART_i32ErrCode
#define SCUART_CHAR_LEN_8
#define SCUART_PARITY_NONE
#define SCUART_TIMEOUT_ERR
void SCUART_SetTimeoutCnt(SC_T *sc, uint32_t u32TOC)
This function use to set receive timeout count.
#define SCUART_GET_TX_FULL(sc)
Get TX FIFO full flag status from register.
uint32_t SCUART_Read(SC_T *sc, uint8_t *pu8RxBuf, uint32_t u32ReadBytes)
The function is used to read Rx data from RX FIFO.
#define SCUART_GET_RX_EMPTY(sc)
Get RX FIFO empty flag status from register.
#define SCUART_READ(sc)
Read Rx data register.
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)
This function use to enable smartcard module UART mode and set baudrate.
uint32_t SCUART_Write(SC_T *sc, uint8_t *pu8TxBuf, uint32_t u32WriteBytes)
This function is to write data into transmit FIFO to send data out.
void SCUART_Close(SC_T *sc)
The function is used to disable smartcard interface UART mode.