37#ifndef SBL_HW_VALIDATION_UART_REQUIREMENTS_HPP_
38#define SBL_HW_VALIDATION_UART_REQUIREMENTS_HPP_
51template<
typename UartDriver>
61 "SBL ERROR: UART driver missing init() method.\n"
62 "Required: static void/bool init(const sbl::UartHandle& handle)");
65 "SBL ERROR: UART driver missing init_rx() method.\n"
66 "Required: static void/bool init_rx(const sbl::UartHandle& handle)");
69 "Required: static void write_byte(uint8_t byte)");
72 "SBL ERROR: UART driver missing write() method.\n"
73 "Required: static void write(const uint8_t* data, size_t len)");
76 "SBL ERROR: UART driver missing write_string() method.\n"
77 "Required: static void write_string(const char* str)");
80 "Required: static bool available()");
83 "Required: static uint8_t read_byte()");
90 "SBL ERROR: UART read_byte() must return uint8_t.");
96 "SBL ERROR: If UART provides try_write_byte(), it must return bool.");
111template<
typename UartDriver>
UART driver requirements validator.
static constexpr bool validate()
Validate all required UART methods.
Method and interface detection for driver validation.
constexpr bool uart_driver_valid
Helper to validate a UART driver implementation.
Root namespace for all Sound Byte Libs code.
True if T::available() is a valid static call.
True if T::init_rx(const UartHandle&) is a valid static call.
True if T::init(const UartHandle&) is a valid static call.
True if T::read_byte() is a valid static call.
True if T::try_write_byte(uint8_t) is a valid static call (optional)
True if T::write_byte(uint8_t) is a valid static call.
True if T::write_string(const char*) is a valid static call.
True if T::write(const uint8_t*, std::size_t) is a valid static call.
True if T::available() returns bool.
True if T::read_byte() returns uint8_t.
True if T::try_write_byte(uint8_t) returns bool.