Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
UART Exported Functions
[UART Driver]
Functions | |
| __STATIC_INLINE void | UART_CLEAR_RTS (UART_T *uart) |
| Set RTS pin to low. | |
| __STATIC_INLINE void | UART_SET_RTS (UART_T *uart) |
| Set RTS pin to high. | |
| void | UART_ClearIntFlag (UART_T *uart, uint32_t u32InterruptFlag) |
| Clear UART specified interrupt flag. | |
| void | UART_Close (UART_T *uart) |
| Disable UART interrupt. | |
| void | UART_DisableFlowCtrl (UART_T *uart) |
| Disable UART auto flow control function. | |
| void | UART_DisableInt (UART_T *uart, uint32_t u32InterruptFlag) |
| Disable UART specified interrupt. | |
| void | UART_EnableFlowCtrl (UART_T *uart) |
| Enable UART auto flow control function. | |
| void | UART_EnableInt (UART_T *uart, uint32_t u32InterruptFlag) |
| The function is used to enable UART specified interrupt and enable NVIC UART IRQ. | |
| void | UART_Open (UART_T *uart, uint32_t u32baudrate) |
| Open and set UART function. | |
| uint32_t | UART_Read (UART_T *uart, uint8_t pu8RxBuf[], uint32_t u32ReadBytes) |
| Read UART data. | |
| 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_SetTimeoutCnt (UART_T *uart, uint32_t u32TOC) |
| Set Rx timeout count. | |
| void | UART_SelectIrDAMode (UART_T *uart, uint32_t u32Buadrate, uint32_t u32Direction) |
| Select and configure IrDA function. | |
| 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. | |
| uint32_t | UART_Write (UART_T *uart, uint8_t pu8TxBuf[], uint32_t u32WriteBytes) |
| Write UART data. | |
Function Documentation
| __STATIC_INLINE void UART_CLEAR_RTS | ( | UART_T * | uart ) |
Set RTS pin to low.
- Parameters:
-
[in] uart The pointer of the specified UART module
- Returns:
- None
This macro set RTS pin to low.
Definition at line 449 of file m480_uart.h.
| void UART_ClearIntFlag | ( | UART_T * | uart, |
| uint32_t | u32InterruptFlag | ||
| ) |
Clear UART specified interrupt flag.
- Parameters:
-
[in] uart The pointer of the specified UART module. [in] u32InterruptFlag The specified interrupt of UART module. - UART_INTSTS_LININT_Msk : LIN bus interrupt
- UART_INTEN_WKIEN_Msk : Wake-up interrupt
- UART_INTSTS_BUFERRINT_Msk : Buffer Error interrupt
- UART_INTSTS_MODEMINT_Msk : Modem Status interrupt
- UART_INTSTS_RLSINT_Msk : Receive Line Status interrupt
- Returns:
- None
The function is used to clear UART specified interrupt flag.
Definition at line 62 of file m480_uart.c.
| void UART_Close | ( | UART_T * | uart ) |
Disable UART interrupt.
- Parameters:
-
[in] uart The pointer of the specified UART module.
- Returns:
- None
The function is used to disable UART interrupt.
Definition at line 102 of file m480_uart.c.
| void UART_DisableFlowCtrl | ( | UART_T * | uart ) |
Disable UART auto flow control function.
- Parameters:
-
[in] uart The pointer of the specified UART module.
- Returns:
- None
The function is used to disable UART auto flow control.
Definition at line 117 of file m480_uart.c.
| void UART_DisableInt | ( | UART_T * | uart, |
| uint32_t | u32InterruptFlag | ||
| ) |
Disable UART specified interrupt.
- Parameters:
-
[in] uart The pointer of the specified UART module. [in] u32InterruptFlag The specified interrupt of UART module. - UART_INTEN_WKIEN_Msk : Wake-up interrupt
- UART_INTEN_LINIEN_Msk : Lin bus interrupt
- UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt
- UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt
- UART_INTEN_MODEMIEN_Msk : Modem status interrupt
- UART_INTEN_RLSIEN_Msk : Receive Line status interrupt
- UART_INTEN_THREIEN_Msk : Tx empty interrupt
- UART_INTEN_RDAIEN_Msk : Rx ready interrupt *
- Returns:
- None
The function is used to disable UART specified interrupt and disable NVIC UART IRQ.
Definition at line 141 of file m480_uart.c.
| void UART_EnableFlowCtrl | ( | UART_T * | uart ) |
Enable UART auto flow control function.
- Parameters:
-
[in] uart The pointer of the specified UART module.
- Returns:
- None
The function is used to Enable UART auto flow control.
Definition at line 157 of file m480_uart.c.
| void UART_EnableInt | ( | UART_T * | uart, |
| uint32_t | u32InterruptFlag | ||
| ) |
The function is used to enable UART specified interrupt and enable NVIC UART IRQ.
- Parameters:
-
[in] uart The pointer of the specified UART module. [in] u32InterruptFlag The specified interrupt of UART module: - UART_INTEN_WKIEN_Msk : Wake-up interrupt
- UART_INTEN_LINIEN_Msk : Lin bus interrupt
- UART_INTEN_BUFERRIEN_Msk : Buffer Error interrupt
- UART_INTEN_RXTOIEN_Msk : Rx time-out interrupt
- UART_INTEN_MODEMIEN_Msk : Modem status interrupt
- UART_INTEN_RLSIEN_Msk : Receive Line status interrupt
- UART_INTEN_THREIEN_Msk : Tx empty interrupt
- UART_INTEN_RDAIEN_Msk : Rx ready interrupt *
- Returns:
- None
The function is used to enable UART specified interrupt and enable NVIC UART IRQ.
Definition at line 186 of file m480_uart.c.
| void UART_Open | ( | UART_T * | uart, |
| uint32_t | u32baudrate | ||
| ) |
Open and set UART function.
- Parameters:
-
[in] uart The pointer of the specified UART module. [in] u32baudrate The baudrate of UART module.
- Returns:
- None
This function use to enable UART function and set baud-rate.
Definition at line 203 of file m480_uart.c.
| uint32_t UART_Read | ( | UART_T * | uart, |
| uint8_t | pu8RxBuf[], | ||
| uint32_t | u32ReadBytes | ||
| ) |
Read UART data.
- Parameters:
-
[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.
- Returns:
- u32Count Receive byte count
The function is used to read Rx data from RX FIFO and the data will be stored in pu8RxBuf.
Definition at line 277 of file m480_uart.c.
| void UART_SelectIrDAMode | ( | UART_T * | uart, |
| uint32_t | u32Buadrate, | ||
| uint32_t | u32Direction | ||
| ) |
Select and configure IrDA function.
- Parameters:
-
[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: - UART_IRDA_TXEN
- UART_IRDA_RXEN
- Returns:
- None
The function is used to configure IrDA relative settings. It consists of TX or RX mode and baudrate.
Definition at line 424 of file m480_uart.c.
| void UART_SelectLINMode | ( | UART_T * | uart, |
| uint32_t | u32Mode, | ||
| uint32_t | u32BreakLength | ||
| ) |
Select and configure LIN function.
- Parameters:
-
[in] uart The pointer of the specified UART module. [in] u32Mode The LIN direction : - UART_ALTCTL_LINTXEN_Msk
- UART_ALTCTL_LINRXEN_Msk
[in] u32BreakLength The break field length.
- Returns:
- None
The function is used to set LIN relative setting.
Definition at line 528 of file m480_uart.c.
| void UART_SelectRS485Mode | ( | UART_T * | uart, |
| uint32_t | u32Mode, | ||
| uint32_t | u32Addr | ||
| ) |
Select and configure RS485 function.
- Parameters:
-
[in] uart The pointer of the specified UART module. [in] u32Mode The operation mode(NMM/AUD/AAD). - UART_ALTCTL_RS485NMM_Msk
- UART_ALTCTL_RS485AUD_Msk
- UART_ALTCTL_RS485AAD_Msk
[in] u32Addr The RS485 address.
- Returns:
- None
The function is used to set RS485 relative setting.
Definition at line 505 of file m480_uart.c.
| __STATIC_INLINE void UART_SET_RTS | ( | UART_T * | uart ) |
Set RTS pin to high.
- Parameters:
-
[in] uart The pointer of the specified UART module
- Returns:
- None
This macro set RTS pin to high.
Definition at line 465 of file m480_uart.h.
| void UART_SetLineConfig | ( | UART_T * | uart, |
| uint32_t | u32baudrate, | ||
| uint32_t | u32data_width, | ||
| uint32_t | u32parity, | ||
| uint32_t | u32stop_bits | ||
| ) |
Set UART line configuration.
- Parameters:
-
[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. - UART_WORD_LEN_5
- UART_WORD_LEN_6
- UART_WORD_LEN_7
- UART_WORD_LEN_8
[in] u32parity The parity setting (none/odd/even/mark/space) 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
- Returns:
- None
This function use to config UART line setting.
Definition at line 332 of file m480_uart.c.
| void UART_SetTimeoutCnt | ( | UART_T * | uart, |
| uint32_t | u32TOC | ||
| ) |
Set Rx timeout count.
- Parameters:
-
[in] uart The pointer of the specified UART module. [in] u32TOC Rx timeout counter.
- Returns:
- None
This function use to set Rx timeout count.
Definition at line 402 of file m480_uart.c.
| uint32_t UART_Write | ( | UART_T * | uart, |
| uint8_t | pu8TxBuf[], | ||
| uint32_t | u32WriteBytes | ||
| ) |
Write UART data.
- Parameters:
-
[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.
- Returns:
- u32Count transfer byte count
The function is to write data into TX buffer to transmit data by UART.
Definition at line 549 of file m480_uart.c.
Generated on Tue Jul 12 2022 15:37:35 by
1.7.2