35#include "ove_config.h"
36#include "ove/storage.h"
45 OVE_UART_PARITY_NONE = 0,
46 OVE_UART_PARITY_ODD = 1,
47 OVE_UART_PARITY_EVEN = 2,
52 OVE_UART_STOP_1_5 = 1,
57 OVE_UART_FLOW_NONE = 0,
58 OVE_UART_FLOW_RTS_CTS = 1,
89int ove_uart_init(
ove_uart_t *uart, ove_uart_storage_t *storage,
97#elif !defined(__ZIG_CIMPORT__)
98#define ove_uart_create(puart, cfg) \
99 ({ static ove_uart_storage_t _ove_stor_; \
100 static uint8_t _ove_buf_[(cfg)->rx_buf_size]; \
101 ove_uart_init((puart), &_ove_stor_, _ove_buf_, (cfg)); })
102#define ove_uart_destroy(uart) ove_uart_deinit(uart)
120int ove_uart_write(
ove_uart_t uart,
const void *data,
size_t len,
121 uint32_t timeout_ms,
size_t *bytes_written);
135int ove_uart_read(
ove_uart_t uart,
void *buf,
size_t len,
136 uint32_t timeout_ms,
size_t *bytes_read);
144size_t ove_uart_bytes_available(
ove_uart_t uart);
168void ove_uart_rx_isr_push(
ove_uart_t uart,
const void *data,
size_t len);
173static inline void ove_uart_destroy(
ove_uart_t u) { (void)u; }
174static inline int ove_uart_write(
ove_uart_t u,
const void *d,
size_t l, uint32_t t,
size_t *bw) { (void)u; (void)d; (void)l; (void)t; (void)bw;
return OVE_ERR_NOT_SUPPORTED; }
175static inline int ove_uart_read(
ove_uart_t u,
void *b,
size_t l, uint32_t t,
size_t *br) { (void)u; (void)b; (void)l; (void)t; (void)br;
return OVE_ERR_NOT_SUPPORTED; }
176static inline size_t ove_uart_bytes_available(
ove_uart_t u) { (void)u;
return 0; }
178static inline void ove_uart_rx_isr_push(
ove_uart_t u,
const void *d,
size_t l) { (void)u; (void)d; (void)l; }
#define OVE_ERR_NOT_SUPPORTED
The requested feature is not supported by the active backend.
Definition types.h:38
struct ove_uart * ove_uart_t
Opaque handle for a UART peripheral.
Definition types.h:136
UART configuration descriptor.
Definition uart.h:66
uint32_t baudrate
Definition uart.h:68
unsigned int instance
Definition uart.h:67
ove_uart_flow_t flow_control
Definition uart.h:72
size_t rx_buf_size
Definition uart.h:73
ove_uart_stop_t stop_bits
Definition uart.h:71
ove_uart_parity_t parity
Definition uart.h:70
uint8_t data_bits
Definition uart.h:69