37#include "ove_config.h"
48 OVE_UART_PARITY_NONE = 0,
49 OVE_UART_PARITY_ODD = 1,
50 OVE_UART_PARITY_EVEN = 2,
56 OVE_UART_STOP_1_5 = 1,
62 OVE_UART_FLOW_NONE = 0,
63 OVE_UART_FLOW_RTS_CTS = 1,
134 size_t *bytes_written);
struct ove_uart * ove_uart_t
Opaque handle for a UART peripheral.
Definition types.h:262
void(* ove_notify_cb)(void *user_data)
Notify-callback signature used by the _set_notify variants of the comm primitives (stream / queue / e...
Definition types.h:298
@ OVE_ERR_NOT_SUPPORTED
Definition types.h:98
size_t ove_uart_bytes_available(ove_uart_t uart)
Query the number of bytes available in the RX buffer.
int ove_uart_read(ove_uart_t uart, void *buf, size_t len, uint64_t timeout_ns, size_t *bytes_read)
Read data from the UART RX buffer.
int ove_uart_init(ove_uart_t *uart, ove_uart_storage_t *storage, void *rx_buf, const struct ove_uart_cfg *cfg)
Initialise a UART using caller-provided static storage.
void ove_uart_deinit(ove_uart_t uart)
Release a UART handle previously created with ove_uart_init.
void ove_uart_rx_isr_push(ove_uart_t uart, const void *data, size_t len)
Push received bytes from ISR into the portable RX buffer.
void ove_uart_destroy(ove_uart_t uart)
Destroy a UART handle previously created with ove_uart_create.
ove_uart_stop_t
UART stop-bit count.
Definition uart.h:54
int ove_uart_flush(ove_uart_t uart)
Flush the TX hardware buffer.
ove_uart_parity_t
UART parity mode.
Definition uart.h:47
int ove_uart_write(ove_uart_t uart, const void *data, size_t len, uint64_t timeout_ns, size_t *bytes_written)
Write data to the UART.
int ove_uart_set_rx_notify(ove_uart_t uart, ove_notify_cb cb, void *user_data)
Register a notify callback fired after every byte (or chunk) received into the RX buffer.
int ove_uart_create(ove_uart_t *uart, const struct ove_uart_cfg *cfg)
Heap-mode counterpart of ove_uart_init() — allocates storage and RX buffer.
ove_uart_flow_t
UART hardware flow control.
Definition uart.h:61
UART configuration descriptor.
Definition uart.h:71
uint32_t baudrate
Definition uart.h:73
unsigned int instance
Definition uart.h:72
ove_uart_flow_t flow_control
Definition uart.h:77
size_t rx_buf_size
Definition uart.h:78
ove_uart_stop_t stop_bits
Definition uart.h:76
ove_uart_parity_t parity
Definition uart.h:75
uint8_t data_bits
Definition uart.h:74