|
Sound Byte Libs 1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Sound Byte Libs uses a structured namespace hierarchy to separate generated code from static implementations.
| Namespace | Purpose | Location |
|---|---|---|
sbl::driver:: | MCU driver implementations | sbl-hardware/mcu/*/driver/ |
sbl::hw:: | Generated hardware configuration | build/generated/sbl/hw/config/ |
sbl::hw::gpio:: | Generated GPIO handles | build/generated/sbl/hw/config/gpio.hpp |
sbl::hw::adc:: | Generated ADC handles | build/generated/sbl/hw/config/adc.hpp |
sbl::hw::mcu:: | MCU metadata | build/generated/sbl/hw/config/mcu.hpp |
sbl::gpio:: | GPIO types (PinMode) | src/sbl/hal/gpio/types.hpp |
sbl::adc:: | ADC convenience functions | src/sbl/hal/adc/driver.hpp |
sbl::log:: | Logging utilities (Logger, Level) | src/sbl/log/ |
sbl::defaults:: | Sensible buffer size constants | src/sbl/common/defaults.hpp |
sbl::version:: | Library version info (CMake-generated) | build/include/sbl/version.hpp |
sbl::meta:: | Hardware metadata (sloth-generated) | build/generated/sbl/hw/meta.hpp |
sbl:: | Non-generated types (handles) | src/sbl/types.hpp |
MCU-specific driver implementations. These are static files maintained in the sbl-hardware repository and included via CMake.
Individual driver headers are also available:
Contents:
Gpio - GPIO read/write/mode/toggle operations (handle-first API)Timer - Delay functions and millis counterUart - UART output for debuggingAdc - ADC initialization and reading (STM32H7)init() - MCU initializationConvenience namespace for ADC operations:
GPIO-related types defined in src/sbl/hal/gpio/types.hpp:
Build-time generated headers containing hardware-specific constants resolved from manifests by sloth.
Generated files in build/generated/sbl/hw/config/:
gpio.hpp - GPIO handlesadc.hpp - ADC handles (if any ADC claims)mcu.hpp - MCU metadatasystem.hpp - System configurationSub-namespaces:
sbl::hw::gpio:: - GPIO handles (e.g., status_led)sbl::hw::adc:: - ADC handlessbl::hw::system:: - Configuration values (e.g., sysclk_mhz)sbl::hw::mcu:: - MCU metadata (e.g., name, family)Handle types defined in static headers for IDE/LSP support. These types are used by both generated and driver code.
Handles are passed directly to driver functions (handle-first API):
For shorter code, include <sbl/aliases.hpp>:
This is opt-in. The explicit sbl::driver:: form is recommended for clarity in embedded code.
Pre-defined buffer size constants for embedded contexts:
CMake-generated version info from git tags:
sloth-generated metadata about the target hardware:
Lightweight, zero-overhead logging for embedded development:
Log levels (compile-time constants for #if compatibility):
SBL_LOG_LEVEL_OFF (0) - Disable all loggingSBL_LOG_LEVEL_ERROR (1)SBL_LOG_LEVEL_WARN (2)SBL_LOG_LEVEL_INFO (3)SBL_LOG_LEVEL_DEBUG (4)SBL_LOG_LEVEL_TRACE (5)Output format: I 12345 main.cpp:42| Message