66#include "periph_cpu.h"
67#include "periph_conf.h"
77#ifndef CONFIG_UART_DMA_THRESHOLD_BYTES
78#define CONFIG_UART_DMA_THRESHOLD_BYTES 8
92#define UART_UNDEF (UINT_FAST8_MAX)
99#define UART_DEV(x) (x)
120#ifndef HAVE_UART_ISR_CTX_T
124#ifdef MODULE_PERIPH_UART_RXSTART_IRQ
147#ifndef HAVE_UART_PARITY_T
160#ifndef HAVE_UART_DATA_BITS_T
172#ifndef HAVE_UART_STOP_BITS_T
205#if defined(MODULE_PERIPH_UART_RECONFIGURE) || DOXYGEN
293#if defined(MODULE_PERIPH_UART_RXSTART_IRQ) || DOXYGEN
332#if defined(MODULE_PERIPH_UART_COLLISION) || DOXYGEN
#define ENOTSUP
Not supported (may be the same value as [EOPNOTSUPP]).
#define ENODEV
No such device.
void uart_enable_tx(uart_t uart)
Enable the TX line one the given UART.
void uart_poweroff(uart_t uart)
Power off the given UART device.
void uart_rxstart_irq_configure(uart_t uart, uart_rxstart_cb_t cb, void *arg)
Configure the function that will be called when a start condition is detected.
void uart_deinit_pins(uart_t uart)
Change the pins of the given UART back to plain GPIO functionality.
void(* uart_rxstart_cb_t)(void *arg)
Signature for receive start condition interrupt callback.
void uart_collision_detect_enable(uart_t uart)
Enables collision detection check of the UART.
int uart_init(uart_t uart, uint32_t baud, uart_rx_cb_t rx_cb, void *arg)
Initialize a given UART device.
void uart_disable_tx(uart_t uart)
Disable the TX line one the given UART.
void uart_rxstart_irq_disable(uart_t uart)
Disable the RX start interrupt.
uart_parity_t
Definition of possible parity modes.
uart_stop_bits_t
Definition of possible stop bits lengths in a UART frame.
uint_fast8_t uart_t
Define default UART type identifier.
void uart_poweron(uart_t uart)
Power on the given UART device.
bool uart_collision_detected(uart_t uart)
Disables collision detection check of the UART.
gpio_t uart_pin_tx(uart_t uart)
Get the TX pin of the given UART.
gpio_t uart_pin_cts(uart_t uart)
Get the CTS pin of the given UART.
void uart_init_pins(uart_t uart)
Initialize the used UART pins, i.e.
void(* uart_rx_cb_t)(void *arg, uint8_t data)
Signature for receive interrupt callback.
void uart_rxstart_irq_enable(uart_t uart)
Enable the RX start interrupt.
gpio_t uart_pin_rts(uart_t uart)
Get the RTS pin of the given UART.
gpio_t uart_pin_rx(uart_t uart)
Get the RX pin of the given UART.
uart_data_bits_t
Definition of possible data bits lengths in a UART frame.
void uart_write(uart_t uart, const uint8_t *data, size_t len)
Write data from the given buffer to the specified UART device.
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.
void uart_collision_detect_disable(uart_t uart)
Disables collision detection check of the UART.
@ UART_PARITY_SPACE
space parity
@ UART_PARITY_NONE
no parity
@ UART_PARITY_EVEN
even parity
@ UART_PARITY_ODD
odd parity
@ UART_PARITY_MARK
mark parity
@ UART_STOP_BITS_2
2 stop bits
@ UART_STOP_BITS_1
1 stop bit
@ UART_NOBAUD
given symbol rate is not applicable
@ UART_OK
everything in order
@ UART_NODEV
invalid UART device given
@ UART_INTERR
all other internal errors
@ UART_NOMODE
given mode is not applicable
@ UART_DATA_BITS_6
6 data bits
@ UART_DATA_BITS_5
5 data bits
@ UART_DATA_BITS_7
7 data bits
@ UART_DATA_BITS_8
8 data bits
uart_parity_t
Definition of possible parity modes.
uart_stop_bits_t
Definition of possible stop bits lengths.
uart_data_bits_t
Definition of possible data bits lengths in a UART frame.
Interrupt context for a UART device.
uart_rx_cb_t rx_cb
data received interrupt callback
void * arg
argument to data received callback