![]() |
M480 BSP V3.05.006
The Board Support Package for M480 Series
|
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 UART data. More... | |
#define | UART_READ(uart) |
Read UART data. More... | |
#define | UART_GET_TX_EMPTY(uart) |
Get Tx empty. More... | |
#define | UART_GET_RX_EMPTY(uart) |
Get Rx empty. 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 RX is ready 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 UART interrupt. More... | |
#define | UART_DISABLE_INT(uart, u32eIntSel) |
Disable specified UART 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... | |
#define | UART_PDMA_ENABLE(uart, u32FuncSel) |
Enable specified UART PDMA function. More... | |
#define | UART_PDMA_DISABLE(uart, u32FuncSel) |
Disable specified UART PDMA function. More... | |
Functions | |
__STATIC_INLINE void | UART_CLEAR_RTS (UART_T *uart) |
Set RTS pin to low. More... | |
__STATIC_INLINE void | UART_SET_RTS (UART_T *uart) |
Set RTS pin to high. More... | |
void | UART_ClearIntFlag (UART_T *uart, uint32_t u32InterruptFlag) |
Clear UART specified interrupt flag. More... | |
void | UART_Close (UART_T *uart) |
Disable UART interrupt. More... | |
void | UART_DisableFlowCtrl (UART_T *uart) |
Disable UART auto flow control function. More... | |
void | UART_DisableInt (UART_T *uart, uint32_t u32InterruptFlag) |
Disable UART specified interrupt. More... | |
void | UART_EnableFlowCtrl (UART_T *uart) |
Enable UART auto flow control function. More... | |
void | UART_EnableInt (UART_T *uart, uint32_t u32InterruptFlag) |
The function is used to enable UART specified interrupt and enable NVIC UART IRQ. More... | |
void | UART_Open (UART_T *uart, uint32_t u32baudrate) |
Open and set UART function. More... | |
uint32_t | UART_Read (UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) |
Read UART data. More... | |
void | UART_SetLineConfig (UART_T *uart, uint32_t u32baudrate, uint32_t u32data_width, uint32_t u32parity, uint32_t u32stop_bits) |
Set UART line configuration. More... | |
void | UART_SetTimeoutCnt (UART_T *uart, uint32_t u32TOC) |
Set Rx timeout count. More... | |
void | UART_SelectIrDAMode (UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction) |
Select and configure IrDA function. More... | |
void | UART_SelectRS485Mode (UART_T *uart, uint32_t u32Mode, uint32_t u32Addr) |
Select and configure RS485 function. More... | |
void | UART_SelectLINMode (UART_T *uart, uint32_t u32Mode, uint32_t u32BreakLength) |
Select and configure LIN function. More... | |
uint32_t | UART_Write (UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) |
Write UART data. More... | |
#define UART_BAUD_MODE0_DIVIDER | ( | u32SrcFreq, | |
u32BaudRate | |||
) |
#define UART_BAUD_MODE2_DIVIDER | ( | u32SrcFreq, | |
u32BaudRate | |||
) |
#define UART_DISABLE_INT | ( | uart, | |
u32eIntSel | |||
) |
Disable specified UART interrupt.
[in] | uart | The pointer of the specified UART module |
[in] | u32eIntSel | Interrupt type select
|
This macro enable specified UART interrupt.
#define UART_ENABLE_INT | ( | uart, | |
u32eIntSel | |||
) |
Enable specified UART interrupt.
[in] | uart | The pointer of the specified UART module |
[in] | u32eIntSel | Interrupt type select
|
This macro enable specified UART interrupt.
#define UART_GET_INT_FLAG | ( | uart, | |
u32eIntTypeFlag | |||
) |
Get specified interrupt flag/status.
[in] | uart | The pointer of the specified UART module |
[in] | u32eIntTypeFlag | Interrupt Type Flag, should be
|
0 | The specified interrupt is not happened. 1 The specified interrupt is happened. |
This macro get specified interrupt flag or interrupt indicator status.
#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 | ) |
Check RX is ready or not.
[in] | uart | The pointer of the specified UART module |
0 | The number of bytes in the RX FIFO is less than the RFITL |
1 | The number of bytes in the RX FIFO equals or larger than RFITL |
This macro check receive data available interrupt flag is set or not.
#define UART_IS_TX_EMPTY | ( | uart | ) |
Check specified UART port transmission is over.
[in] | uart | The pointer of the specified UART module |
0 | Tx transmission is not over |
1 | Tx transmission is over |
This macro return Transmitter Empty Flag register bit value. It indicates if specified UART port transmission is over nor not.
#define UART_IS_TX_FULL | ( | uart | ) |
#define UART_PDMA_DISABLE | ( | uart, | |
u32FuncSel | |||
) |
Disable specified UART PDMA function.
[in] | uart | The pointer of the specified UART module |
[in] | u32FuncSel | Combination of following functions |
#define UART_PDMA_ENABLE | ( | uart, | |
u32FuncSel | |||
) |
Enable specified UART PDMA function.
[in] | uart | The pointer of the specified UART module |
[in] | u32FuncSel | Combination of following functions |
#define UART_READ | ( | uart | ) |
#define UART_RS485_CLEAR_ADDR_FLAG | ( | uart | ) |
#define UART_RS485_GET_ADDR_FLAG | ( | uart | ) |
Get RS-485 Address Byte Detection Flag.
[in] | uart | The pointer of the specified UART module |
0 | Receiver detects a data that is not an address bit. |
1 | Receiver detects a data that is an address bit. |
This macro get RS-485 address byte detection flag.
#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 | ||
) |
Clear UART specified interrupt flag.
[in] | uart | The pointer of the specified UART module. |
[in] | u32InterruptFlag | The specified interrupt of UART module.
|
The function is used to clear UART specified interrupt flag.
void UART_Close | ( | UART_T * | uart | ) |
void UART_DisableFlowCtrl | ( | UART_T * | uart | ) |
void UART_DisableInt | ( | UART_T * | uart, |
uint32_t | u32InterruptFlag | ||
) |
Disable UART specified interrupt.
[in] | uart | The pointer of the specified UART module. |
[in] | u32InterruptFlag | The specified interrupt of UART module.
|
The function is used to disable UART specified interrupt and disable NVIC UART IRQ.
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 enable NVIC UART IRQ.
[in] | uart | The pointer of the specified UART module. |
[in] | u32InterruptFlag | The specified interrupt of UART module:
|
The function is used to enable UART specified interrupt and enable NVIC UART IRQ.
void UART_Open | ( | UART_T * | uart, |
uint32_t | u32baudrate | ||
) |
uint32_t UART_Read | ( | UART_T * | uart, |
uint8_t | pu8RxBuf[], | ||
uint32_t | u32ReadBytes | ||
) |
Read UART data.
[in] | uart | The pointer of the specified UART module. |
[in] | pu8RxBuf | The buffer to receive the data of receive FIFO. |
[in] | u32ReadBytes | The the read bytes number of data. |
The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf.
void UART_SelectIrDAMode | ( | UART_T * | uart, |
uint32_t | u32Buadrate, | ||
uint32_t | u32Direction | ||
) |
Select and configure IrDA function.
[in] | uart | The pointer of the specified UART module. |
[in] | u32Buadrate | The baudrate of UART module. |
[in] | u32Direction | The direction of UART module in IrDA mode: |
The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate.
void UART_SelectLINMode | ( | UART_T * | uart, |
uint32_t | u32Mode, | ||
uint32_t | u32BreakLength | ||
) |
Select and configure LIN function.
[in] | uart | The pointer of the specified UART module. |
[in] | u32Mode | The LIN direction : |
[in] | u32BreakLength | The break field length. |
The function is used to set LIN relative setting.
void UART_SelectRS485Mode | ( | UART_T * | uart, |
uint32_t | u32Mode, | ||
uint32_t | u32Addr | ||
) |
Select and configure RS485 function.
[in] | uart | The pointer of the specified UART module. |
[in] | u32Mode | The operation mode(NMM/AUD/AAD). |
[in] | u32Addr | The RS485 address. |
The function is used to set RS485 relative setting.
__STATIC_INLINE void UART_SET_RTS | ( | UART_T * | uart | ) |
void UART_SetLineConfig | ( | UART_T * | uart, |
uint32_t | u32baudrate, | ||
uint32_t | u32data_width, | ||
uint32_t | u32parity, | ||
uint32_t | u32stop_bits | ||
) |
Set UART line configuration.
[in] | uart | The pointer of the specified 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. |
[in] | u32parity | The parity setting (none/odd/even/mark/space) of UART module. |
[in] | u32stop_bits | The stop bit length (1/1.5/2 bit) of UART module. |
This function use to config UART line setting.
void UART_SetTimeoutCnt | ( | UART_T * | uart, |
uint32_t | u32TOC | ||
) |
uint32_t UART_Write | ( | UART_T * | uart, |
uint8_t | pu8TxBuf[], | ||
uint32_t | u32WriteBytes | ||
) |
Write UART data.
[in] | uart | The pointer of the specified UART module. |
[in] | pu8TxBuf | The buffer to send the data to UART transmission FIFO. |
[out] | u32WriteBytes | The byte number of data. |
The function is to write data into TX buffer to transmit data by UART.