|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
RAII wrapper around an oveRTOS UART peripheral. More...
#include <uart.hpp>
Public Member Functions | |
| Uart (const struct ove_uart_cfg &cfg) | |
Construct and initialise a UART port from cfg. | |
| Uart (const Uart &)=delete | |
| Uart & | operator= (const Uart &)=delete |
| Uart (Uart &&o) noexcept | |
| Move constructor — transfers handle; source becomes empty. | |
| Uart & | operator= (Uart &&o) noexcept |
Move-assignment — destroys current port, then takes o's handle. | |
| Result< size_t > | write (const void *data, size_t len, std::chrono::nanoseconds timeout=wait_forever) noexcept |
| Write bytes to the port. | |
| Result< size_t > | read (void *buf, size_t len, std::chrono::nanoseconds timeout=wait_forever) noexcept |
| Read bytes from the RX buffer. | |
| size_t | bytes_available () const |
| Bytes currently available in the RX buffer. | |
| Result< void > | flush () noexcept |
| Block until all pending TX bytes have been drained. | |
| ove_uart_t | handle () const |
| Returns the underlying C handle. | |
RAII wrapper around an oveRTOS UART peripheral.
In zero-heap mode the RX buffer is stored inline.
| RxBufSize | Compile-time RX buffer capacity in bytes. |
Not copyable. Move-only when heap allocation is enabled.
|
inlineexplicit |
Construct and initialise a UART port from cfg.
| [in] | cfg | Port configuration (baud, parity, stop bits, flow control). |
|
inlinenoexcept |
Write bytes to the port.
unexpected Error.
|
inlinenoexcept |
Read bytes from the RX buffer.
unexpected Error.