oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
uart.h File Reference
#include "ove/types.h"
#include "ove_config.h"
#include "ove/storage.h"
Include dependency graph for uart.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ove_uart_cfg
 UART configuration descriptor. More...
 

Enumerations

enum  ove_uart_parity_t { OVE_UART_PARITY_NONE = 0 , OVE_UART_PARITY_ODD = 1 , OVE_UART_PARITY_EVEN = 2 }
 UART parity mode.
 
enum  ove_uart_stop_t { OVE_UART_STOP_1 = 0 , OVE_UART_STOP_1_5 = 1 , OVE_UART_STOP_2 = 2 }
 UART stop-bit count.
 
enum  ove_uart_flow_t { OVE_UART_FLOW_NONE = 0 , OVE_UART_FLOW_RTS_CTS = 1 }
 UART hardware flow control.
 

Functions

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.
 
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.
 
void ove_uart_destroy (ove_uart_t uart)
 Destroy a UART handle previously created with ove_uart_create.
 
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_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.
 
size_t ove_uart_bytes_available (ove_uart_t uart)
 Query the number of bytes available in the RX buffer.
 
int ove_uart_flush (ove_uart_t uart)
 Flush the TX hardware buffer.
 
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.
 
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.