ChibiOS/HAL  6.1.0
hal_uart.h File Reference

UART Driver macros and structures. More...

#include "hal_uart_lld.h"

Go to the source code of this file.

Macros

UART status flags
#define UART_NO_ERROR   0
 No pending conditions. More...
 
#define UART_PARITY_ERROR   4
 Parity error happened. More...
 
#define UART_FRAMING_ERROR   8
 Framing error happened. More...
 
#define UART_OVERRUN_ERROR   16
 Overflow happened. More...
 
#define UART_NOISE_ERROR   32
 Noise on the line. More...
 
#define UART_BREAK_DETECTED   64
 Break detected. More...
 
UART error conditions
#define UART_ERR_NOT_ACTIVE   (size_t)-1
 
UART configuration options
#define UART_USE_WAIT   FALSE
 Enables synchronous APIs. More...
 
#define UART_USE_MUTUAL_EXCLUSION   FALSE
 Enables the uartAcquireBus() and uartReleaseBus() APIs. More...
 
Low level driver helper macros
#define _uart_wakeup_tx1_isr(uartp)
 Wakes up the waiting thread in case of early TX complete. More...
 
#define _uart_wakeup_tx2_isr(uartp)
 Wakes up the waiting thread in case of late TX complete. More...
 
#define _uart_wakeup_rx_complete_isr(uartp)
 Wakes up the waiting thread in case of RX complete. More...
 
#define _uart_wakeup_rx_error_isr(uartp)
 Wakes up the waiting thread in case of RX error. More...
 
#define _uart_wakeup_rx_cm_isr(uartp)
 Wakes up the waiting thread in case of RX character match. More...
 
#define _uart_wakeup_rx_timeout_isr(uartp)
 Wakes up the waiting thread in case of RX timeout. More...
 
#define _uart_tx1_isr_code(uartp)
 Common ISR code for early TX. More...
 
#define _uart_tx2_isr_code(uartp)
 Common ISR code for late TX. More...
 
#define _uart_rx_complete_isr_code(uartp)
 Common ISR code for RX complete. More...
 
#define _uart_rx_error_isr_code(uartp, errors)
 Common ISR code for RX error. More...
 
#define _uart_rx_idle_code(uartp)
 Common ISR code for RX on idle. More...
 
#define _uart_timeout_isr_code(uartp)
 Timeout ISR code for receiver. More...
 
#define _uart_rx_char_match_isr_code(uartp)
 Character match ISR code for receiver. More...
 

Enumerations

Functions

void uartInit (void)
 UART Driver initialization. More...
 
void uartObjectInit (UARTDriver *uartp)
 Initializes the standard part of a UARTDriver structure. More...
 
void uartStart (UARTDriver *uartp, const UARTConfig *config)
 Configures and activates the UART peripheral. More...
 
void uartStop (UARTDriver *uartp)
 Deactivates the UART peripheral. More...
 
void uartStartSend (UARTDriver *uartp, size_t n, const void *txbuf)
 Starts a transmission on the UART peripheral. More...
 
void uartStartSendI (UARTDriver *uartp, size_t n, const void *txbuf)
 Starts a transmission on the UART peripheral. More...
 
size_t uartStopSend (UARTDriver *uartp)
 Stops any ongoing transmission. More...
 
size_t uartStopSendI (UARTDriver *uartp)
 Stops any ongoing transmission. More...
 
void uartStartReceive (UARTDriver *uartp, size_t n, void *rxbuf)
 Starts a receive operation on the UART peripheral. More...
 
void uartStartReceiveI (UARTDriver *uartp, size_t n, void *rxbuf)
 Starts a receive operation on the UART peripheral. More...
 
size_t uartStopReceive (UARTDriver *uartp)
 Stops any ongoing receive operation. More...
 
size_t uartStopReceiveI (UARTDriver *uartp)
 Stops any ongoing receive operation. More...
 
msg_t uartSendTimeout (UARTDriver *uartp, size_t *np, const void *txbuf, sysinterval_t timeout)
 Performs a transmission on the UART peripheral. More...
 
msg_t uartSendFullTimeout (UARTDriver *uartp, size_t *np, const void *txbuf, sysinterval_t timeout)
 Performs a transmission on the UART peripheral. More...
 
msg_t uartReceiveTimeout (UARTDriver *uartp, size_t *np, void *rxbuf, sysinterval_t timeout)
 Performs a receive operation on the UART peripheral. More...
 
void uartAcquireBus (UARTDriver *uartp)
 Gains exclusive access to the UART bus. More...
 
void uartReleaseBus (UARTDriver *uartp)
 Releases exclusive access to the UART bus. More...
 

Detailed Description

UART Driver macros and structures.

Definition in file hal_uart.h.