Go to the documentation of this file.
65 #include "periph_cpu.h"
66 #include "periph_conf.h"
83 #define UART_UNDEF (UINT_MAX)
90 #define UART_DEV(x) (x)
104 #ifndef HAVE_UART_ISR_CTX_T
125 #ifndef HAVE_UART_PARITY_T
138 #ifndef HAVE_UART_DATA_BITS_T
150 #ifndef HAVE_UART_STOP_BITS_T
183 #if defined(MODULE_PERIPH_UART_RECONFIGURE) || DOXYGEN
@ UART_NODEV
invalid UART device given
@ UART_PARITY_NONE
no parity
@ UART_DATA_BITS_5
5 data bits
uart_stop_bits_t
Definition of possible stop bits lengths in a UART frame.
@ UART_NOMODE
given mode is not applicable
int uart_mode(uart_t uart, uart_data_bits_t data_bits, uart_parity_t parity, uart_stop_bits_t stop_bits)
Setup parity, data and stop bits for a given UART device.
@ UART_STOP_BITS_2
2 stop bits
@ UART_DATA_BITS_8
8 data bits
gpio_t uart_pin_tx(uart_t uart)
Get the TX pin of the given UART.
Interrupt context for a UART device.
void uart_deinit_pins(uart_t uart)
Change the pins of the given UART back to plain GPIO functionality.
@ UART_DATA_BITS_6
6 data bits
@ UART_INTERR
all other internal errors
uart_parity_t
Definition of possible parity modes.
@ UART_NOBAUD
given baudrate is not applicable
unsigned int uart_t
Define default UART type identifier.
void uart_poweroff(uart_t uart)
Power off the given UART device.
void uart_poweron(uart_t uart)
Power on the given UART device.
gpio_t uart_pin_rx(uart_t uart)
Get the RX pin of the given UART.
void * arg
argument to both callback routines
@ UART_PARITY_SPACE
space parity
uart_rx_cb_t rx_cb
data received interrupt callback
void uart_init_pins(uart_t uart)
Initialize the used UART pins, i.e.
@ UART_PARITY_EVEN
even parity
@ UART_OK
everything in order
@ UART_DATA_BITS_7
7 data bits
@ UART_PARITY_MARK
mark parity
@ UART_STOP_BITS_1
1 stop bit
uart_data_bits_t
Definition of possible data bits lengths in a UART frame.
@ UART_PARITY_ODD
odd parity
void uart_write(uart_t uart, const uint8_t *data, size_t len)
Write data from the given buffer to the specified UART device.
void(* uart_rx_cb_t)(void *arg, uint8_t data)
Signature for receive interrupt callback.
int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
Initialize a given UART device.