194 uint32_t u32UartClkSrcSel=0ul, u32UartClkDivNum=0ul;
196 uint32_t u32Baud_Div = 0ul;
266 if(u32UartClkSrcSel == 1ul)
272 if(u32baudrate != 0ul)
276 if(u32Baud_Div > 0xFFFFul)
301 uint32_t u32Count, u32delayno;
302 uint32_t u32Exit = 0ul;
304 for(u32Count = 0ul; u32Count < u32ReadBytes; u32Count++)
311 if(u32delayno >= 0x40000000ul)
327 pu8RxBuf[u32Count] = (uint8_t)uart->
DAT;
364 uint32_t u32UartClkSrcSel=0ul, u32UartClkDivNum=0ul;
366 uint32_t u32Baud_Div = 0ul;
427 if(u32UartClkSrcSel == 1ul)
436 if(u32baudrate != 0ul)
440 if(u32Baud_Div > 0xFFFFul)
451 uart->
LINE = u32data_width | u32parity | u32stop_bits;
468 uart->
TOUT = (uart->
TOUT & ~UART_TOUT_TOIC_Msk) | (u32TOC);
490 uint32_t u32UartClkSrcSel=0ul, u32UartClkDivNum=0ul;
492 uint32_t u32Baud_Div;
556 if(u32UartClkSrcSel == 1ul)
565 if(u32Buadrate != 0ul)
569 if(u32Baud_Div < 0xFFFFul)
582 uart->
IRDA &= ~UART_IRDA_TXEN_Msk;
586 uart->
IRDA &= ~UART_IRDA_TXINV_Msk;
655 uint32_t u32Count, u32delayno;
656 uint32_t u32Exit = 0ul;
658 for(u32Count = 0ul; u32Count != u32WriteBytes; u32Count++)
664 if(u32delayno >= 0x40000000ul)
680 uart->
DAT = pu8TxBuf[u32Count];
NuMicro peripheral access layer header file.
uint32_t CLK_GetPLLClockFreq(void)
Get PLL clock frequency.
#define CLK_CLKDIV4_UART4DIV_Pos
#define UART_FIFOSTS_BIF_Msk
#define SYS_CSERVER_VERSION_Msk
#define CLK_CLKSEL1_UART0SEL_Msk
#define UART_FIFOSTS_TXOVIF_Msk
#define UART_FIFOSTS_RXOVIF_Msk
#define CLK_CLKDIV4_UART5DIV_Msk
#define CLK_CLKDIV0_UART1DIV_Pos
#define CLK_CLKSEL3_UART5SEL_Msk
#define CLK_CLKDIV4_UART3DIV_Msk
#define UART_ALTCTL_LINTXEN_Msk
#define UART_INTEN_ATORTSEN_Msk
#define CLK_CLKSEL1_UART1SEL_Msk
#define CLK_CLKDIV4_UART6DIV_Msk
#define CLK_CLKSEL3_UART7SEL_Msk
#define UART_INTSTS_BUFERRINT_Msk
#define UART_WKSTS_DATWKF_Msk
#define UART_ALTCTL_ADDRMV_Msk
#define CLK_CLKDIV4_UART2DIV_Pos
#define CLK_CLKSEL3_UART4SEL_Msk
#define UART_FIFOSTS_TXFULL_Msk
#define CLK_CLKDIV4_UART7DIV_Msk
#define UART_ALTCTL_ADDRMV_Pos
#define UART_LINSTS_SLVHEF_Msk
#define UART_INTSTS_LINIF_Msk
#define UART_FIFOSTS_ADDRDETF_Msk
#define UART_ALTCTL_RS485AUD_Msk
#define CLK_CLKDIV0_UART1DIV_Msk
#define CLK_CLKDIV4_UART2DIV_Msk
#define CLK_CLKDIV4_UART4DIV_Msk
#define UART_ALTCTL_BRKFL_Pos
#define UART_IRDA_RXINV_Msk
#define UART_ALTCTL_LINRXEN_Msk
#define UART_FIFO_RFITL_Msk
#define UART_LINSTS_SLVHDETF_Msk
#define UART_INTSTS_MODEMINT_Msk
#define CLK_CLKSEL3_UART2SEL_Pos
#define UART_LINSTS_BRKDETF_Msk
#define CLK_CLKDIV4_UART3DIV_Pos
#define UART_INTEN_ATOCTSEN_Msk
#define CLK_CLKSEL3_UART3SEL_Msk
#define UART_INTSTS_RLSINT_Msk
#define UART_LINSTS_SLVSYNCF_Msk
#define UART_WKSTS_TOUTWKF_Msk
#define CLK_CLKSEL3_UART6SEL_Pos
#define UART_MODEM_RTSACTLV_Msk
#define UART_INTSTS_LININT_Msk
#define CLK_CLKDIV4_UART5DIV_Pos
#define UART_ALTCTL_RS485NMM_Msk
#define UART_WKSTS_CTSWKF_Msk
#define CLK_CLKSEL1_UART1SEL_Pos
#define UART_LINSTS_BITEF_Msk
#define UART_FIFOSTS_RXEMPTY_Msk
#define UART_FIFOSTS_PEF_Msk
#define CLK_CLKSEL1_UART0SEL_Pos
#define CLK_CLKSEL3_UART5SEL_Pos
#define UART_MODEMSTS_CTSDETF_Msk
#define UART_FIFOSTS_FEF_Msk
#define CLK_CLKDIV0_UART0DIV_Pos
#define CLK_CLKDIV4_UART6DIV_Pos
#define UART_LINSTS_SLVIDPEF_Msk
#define CLK_CLKSEL3_UART7SEL_Pos
#define CLK_CLKDIV4_UART7DIV_Pos
#define CLK_CLKSEL3_UART3SEL_Pos
#define UART_WKSTS_RFRTWKF_Msk
#define UART_FIFO_RTSTRGLV_Msk
#define CLK_CLKSEL3_UART4SEL_Pos
#define CLK_CLKDIV0_UART0DIV_Msk
#define UART_INTSTS_WKINT_Msk
#define CLK_CLKSEL3_UART6SEL_Msk
#define UART_ALTCTL_BRKFL_Msk
#define UART_ALTCTL_RS485AAD_Msk
#define UART_IRDA_TXEN_Msk
#define UART_MODEMSTS_CTSACTLV_Msk
#define UART_INTEN_TOCNTEN_Msk
#define CLK_CLKSEL3_UART2SEL_Msk
#define UART_WKSTS_RS485WKF_Msk
#define UART_FUNCSEL_IrDA
#define UART_FUNCSEL_RS485
#define UART_FUNCSEL_UART
void UART_SelectRS485Mode(UART_T *uart, uint32_t u32Mode, uint32_t u32Addr)
Select and configure RS485 function.
void UART_SelectLINMode(UART_T *uart, uint32_t u32Mode, uint32_t u32BreakLength)
Select and configure LIN function.
void UART_EnableInt(UART_T *uart, uint32_t u32InterruptFlag)
The function is used to enable UART specified interrupt and enable NVIC UART IRQ.
uint32_t UART_Write(UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes)
Write UART data.
void UART_SetTimeoutCnt(UART_T *uart, uint32_t u32TOC)
Set Rx timeout count.
void UART_Close(UART_T *uart)
Disable UART interrupt.
#define UART_BAUD_MODE0_DIVIDER(u32SrcFreq, u32BaudRate)
Calculate UART baudrate mode0 divider.
#define UART_DISABLE_INT(uart, u32eIntSel)
Disable specified UART interrupt.
void UART_ClearIntFlag(UART_T *uart, uint32_t u32InterruptFlag)
Clear UART specified interrupt flag.
void UART_DisableFlowCtrl(UART_T *uart)
Disable UART auto flow control function.
void UART_EnableFlowCtrl(UART_T *uart)
Enable UART auto flow control function.
#define UART_BAUD_MODE2_DIVIDER(u32SrcFreq, u32BaudRate)
Calculate UART baudrate mode2 divider.
void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits)
Set UART line configuration.
void UART_DisableInt(UART_T *uart, uint32_t u32InterruptFlag)
Disable UART specified interrupt.
void UART_SelectIrDAMode(UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction)
Select and configure IrDA function.
uint32_t UART_Read(UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes)
Read UART data.
void UART_Open(UART_T *uart, uint32_t u32baudrate)
Open and set UART function.
#define UART_ENABLE_INT(uart, u32eIntSel)
Enable specified UART interrupt.