|
Sound Byte Libs 1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
UART driver interface - canonical types for MCU driver implementations. More...
#include <cstdint>#include <cstddef>Go to the source code of this file.
Namespaces | |
| namespace | sbl |
| Root namespace for all Sound Byte Libs functionality. | |
| namespace | sbl::uart |
| Standard baud rates for UART communication. | |
Variables | |
| constexpr uint32_t | sbl::uart::BAUD_9600 = 9600 |
| constexpr uint32_t | sbl::uart::BAUD_19200 = 19200 |
| constexpr uint32_t | sbl::uart::BAUD_38400 = 38400 |
| constexpr uint32_t | sbl::uart::BAUD_57600 = 57600 |
| constexpr uint32_t | sbl::uart::BAUD_115200 = 115200 |
| constexpr uint32_t | sbl::uart::BAUD_230400 = 230400 |
| constexpr uint32_t | sbl::uart::BAUD_460800 = 460800 |
| constexpr uint32_t | sbl::uart::BAUD_921600 = 921600 |
| constexpr uint32_t | sbl::uart::BAUD_MIDI = 31250 |
UART driver interface - canonical types for MCU driver implementations.
This header documents the UART driver interface that MCU drivers implement.
Drivers implement the following static interface: static void init(uint32_t baud_rate); static void write_byte(uint8_t byte); static void write(const uint8_t* data, size_t len);
Optional methods for bidirectional communication: static bool available(); static uint8_t read_byte();
Usage in driver: #include <sbl/hal/uart/driver.hpp>
UART is designed as a simple debug output interface. The initial implementation focuses on TX-only operation for debug logging. RX support can be added later for MIDI input or debug console features.
The driver uses polling/blocking mode for simplicity. Interrupt-driven or DMA modes can be added as separate driver variants (UartAsync, UartDma) if needed.
Definition in file driver.hpp.