![]() |
NUC472_NUC442_BSP V3.03.004
The Board Support Package for NUC472/NUC442
|
Macros | |
#define | UART_BAUD_MODE0_DIVIDER(u32SrcFreq, u32BaudRate) |
Calculate UART baudrate mode0 divider. More... | |
#define | UART_BAUD_MODE2_DIVIDER(u32SrcFreq, u32BaudRate) |
Calculate UART baudrate mode2 divider. More... | |
#define | UART_WRITE(uart, u8Data) |
Write Data to Tx data register. More... | |
#define | UART_READ(uart) |
Read Rx data register. More... | |
#define | UART_GET_TX_EMPTY(uart) |
Get Tx empty register value. More... | |
#define | UART_GET_RX_EMPTY(uart) |
Get Rx empty register value. More... | |
#define | UART_IS_TX_EMPTY(uart) |
Check specified uart port transmission is over. More... | |
#define | UART_WAIT_TX_EMPTY(uart) |
Wait specified uart port transmission is over. More... | |
#define | UART_IS_RX_READY(uart) |
Check RDA_IF is set or not. More... | |
#define | UART_IS_TX_FULL(uart) |
Check TX FIFO is full or not. More... | |
#define | UART_IS_RX_FULL(uart) |
Check RX FIFO is full or not. More... | |
#define | UART_GET_TX_FULL(uart) |
Get Tx full register value. More... | |
#define | UART_GET_RX_FULL(uart) |
Get Rx full register value. More... | |
#define | UART_ENABLE_INT(uart, u32eIntSel) |
Enable specified interrupt. More... | |
#define | UART_DISABLE_INT(uart, u32eIntSel) |
Disable specified interrupt. More... | |
#define | UART_GET_INT_FLAG(uart, u32eIntTypeFlag) |
Get specified interrupt flag/status. More... | |
#define | UART_RS485_CLEAR_ADDR_FLAG(uart) |
Clear RS-485 Address Byte Detection Flag. More... | |
#define | UART_RS485_GET_ADDR_FLAG(uart) |
Get RS-485 Address Byte Detection Flag. More... | |
Functions | |
__STATIC_INLINE void | UART_CLEAR_RTS (UART_T *uart) |
Set RTS pin is low. More... | |
__STATIC_INLINE void | UART_SET_RTS (UART_T *uart) |
Set RTS pin is high. More... | |
void | UART_ClearIntFlag (UART_T *uart, uint32_t u32InterruptFlag) |
The function is used to clear UART specified interrupt flag. More... | |
void | UART_Close (UART_T *uart) |
The function is used to disable UART. More... | |
void | UART_DisableFlowCtrl (UART_T *uart) |
The function is used to disable UART auto flow control. More... | |
void | UART_DisableInt (UART_T *uart, uint32_t u32InterruptFlag) |
The function is used to disable UART specified interrupt and disable NVIC UART IRQ. More... | |
void | UART_EnableFlowCtrl (UART_T *uart) |
The function is used to Enable UART auto flow control. More... | |
void | UART_EnableInt (UART_T *uart, uint32_t u32InterruptFlag) |
The function is used to enable UART specified interrupt and disable NVIC UART IRQ. More... | |
void | UART_Open (UART_T *uart, uint32_t u32baudrate) |
This function use to enable UART function and set baud-rate. More... | |
uint32_t | UART_Read (UART_T *uart, uint8_t *pu8RxBuf, uint32_t u32ReadBytes) |
The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf. More... | |
void | UART_SetLine_Config (UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) |
This function use to config UART line setting. More... | |
void | UART_SetTimeoutCnt (UART_T *uart, uint32_t u32TOC) |
This function use to set Rx timeout count. More... | |
void | UART_SelectIrDAMode (UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction) |
The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate. More... | |
void | UART_SelectRS485Mode (UART_T *uart, uint32_t u32Mode, uint32_t u32Addr) |
The function is used to set RS485 relative setting. More... | |
uint32_t | UART_Write (UART_T *uart, uint8_t *pu8TxBuf, uint32_t u32WriteBytes) |
The function is to write data into TX buffer to transmit data by UART. More... | |
#define UART_BAUD_MODE0_DIVIDER | ( | u32SrcFreq, | |
u32BaudRate | |||
) |
#define UART_BAUD_MODE2_DIVIDER | ( | u32SrcFreq, | |
u32BaudRate | |||
) |
#define UART_DISABLE_INT | ( | uart, | |
u32eIntSel | |||
) |
Disable specified interrupt.
[in] | uart | The base address of UART module |
[in] | u32eIntSel | Interrupt type select
|
#define UART_ENABLE_INT | ( | uart, | |
u32eIntSel | |||
) |
Enable specified interrupt.
[in] | uart | The base address of UART module |
[in] | u32eIntSel | Interrupt type select
|
#define UART_GET_INT_FLAG | ( | uart, | |
u32eIntTypeFlag | |||
) |
Get specified interrupt flag/status.
[in] | uart | The base address of UART module |
[in] | u32eIntTypeFlag | Interrupt type select
|
#define UART_GET_RX_EMPTY | ( | uart | ) |
#define UART_GET_RX_FULL | ( | uart | ) |
#define UART_GET_TX_EMPTY | ( | uart | ) |
#define UART_GET_TX_FULL | ( | uart | ) |
#define UART_IS_RX_FULL | ( | uart | ) |
#define UART_IS_RX_READY | ( | uart | ) |
#define UART_IS_TX_EMPTY | ( | uart | ) |
#define UART_IS_TX_FULL | ( | uart | ) |
#define UART_READ | ( | uart | ) |
#define UART_RS485_CLEAR_ADDR_FLAG | ( | uart | ) |
#define UART_RS485_GET_ADDR_FLAG | ( | uart | ) |
#define UART_WAIT_TX_EMPTY | ( | uart | ) |
#define UART_WRITE | ( | uart, | |
u8Data | |||
) |
__STATIC_INLINE void UART_CLEAR_RTS | ( | UART_T * | uart | ) |
void UART_ClearIntFlag | ( | UART_T * | uart, |
uint32_t | u32InterruptFlag | ||
) |
void UART_Close | ( | UART_T * | uart | ) |
void UART_DisableFlowCtrl | ( | UART_T * | uart | ) |
void UART_DisableInt | ( | UART_T * | uart, |
uint32_t | u32InterruptFlag | ||
) |
The function is used to disable UART specified interrupt and disable NVIC UART IRQ.
[in] | uart | The base address of UART module. |
[in] | u32InterruptFlag | The specified interrupt of UART module.
|
void UART_EnableFlowCtrl | ( | UART_T * | uart | ) |
void UART_EnableInt | ( | UART_T * | uart, |
uint32_t | u32InterruptFlag | ||
) |
The function is used to enable UART specified interrupt and disable NVIC UART IRQ.
[in] | uart | The base address of UART module. |
[in] | u32InterruptFlag | The specified interrupt of UART module:
|
void UART_Open | ( | UART_T * | uart, |
uint32_t | u32baudrate | ||
) |
uint32_t UART_Read | ( | UART_T * | uart, |
uint8_t * | pu8RxBuf, | ||
uint32_t | u32ReadBytes | ||
) |
The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf.
[in] | uart | The base address of UART module. |
[out] | pu8RxBuf | The buffer to receive the data of receive FIFO. |
[in] | u32ReadBytes | The the read bytes number of data. |
void UART_SelectIrDAMode | ( | UART_T * | uart, |
uint32_t | u32Buadrate, | ||
uint32_t | u32Direction | ||
) |
The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate.
[in] | uart | The base address of UART module. |
[in] | u32Buadrate | The baudrate of UART module. |
[in] | u32Direction | The direction(transmit:1/receive:0) of UART module in IrDA mode. |
Definition at line 280 of file uart.c.
void UART_SelectRS485Mode | ( | UART_T * | uart, |
uint32_t | u32Mode, | ||
uint32_t | u32Addr | ||
) |
The function is used to set RS485 relative setting.
[in] | uart | The base address of UART module. |
[in] | u32Mode | The operation mode( UART_ALTCTL_RS485NMM_Msk / UART_ALTCTL_RS485AUD_Msk / UART_ALTCTL_RS485AAD_Msk). |
[in] | u32Addr | The RS485 address. |
__STATIC_INLINE void UART_SET_RTS | ( | UART_T * | uart | ) |
void UART_SetLine_Config | ( | UART_T * | uart, |
uint32_t | u32baudrate, | ||
uint32_t | u32data_width, | ||
uint32_t | u32parity, | ||
uint32_t | u32stop_bits | ||
) |
This function use to config UART line setting.
[in] | uart | The base address of UART module. |
[in] | u32baudrate | The register value of baudrate of UART module. if u32baudrate = 0, UART baudrate will not change. |
[in] | u32data_width | The data length of UART module. [ UART_WORD_LEN_5 / UART_WORD_LEN_6 / UART_WORD_LEN_7 / UART_WORD_LEN_8] |
[in] | u32parity | The parity setting (odd/even/none) of UART module. [ UART_PARITY_NONE / UART_PARITY_ODD / UART_PARITY_EVEN / UART_PARITY_MARK / UART_PARITY_SPACE] |
[in] | u32stop_bits | The stop bit length (1/1.5/2 bit) of UART module. [ UART_STOP_BIT_1 / UART_STOP_BIT_1_5 / UART_STOP_BIT_2] |
Definition at line 229 of file uart.c.
void UART_SetTimeoutCnt | ( | UART_T * | uart, |
uint32_t | u32TOC | ||
) |
uint32_t UART_Write | ( | UART_T * | uart, |
uint8_t * | pu8TxBuf, | ||
uint32_t | u32WriteBytes | ||
) |
The function is to write data into TX buffer to transmit data by UART.
[in] | uart | The base address of UART module. |
[in] | pu8TxBuf | The buffer to send the data to UART transmission FIFO. |
[in] | u32WriteBytes | The byte number of data. |