Sound Byte Libs 1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Namespaces | Variables
driver.hpp File Reference

UART driver interface - canonical types for MCU driver implementations. More...

#include <cstdint>
#include <cstddef>
Include dependency graph for driver.hpp:

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
 

Detailed Description

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>

Design Notes

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.