Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Typedefs | Functions
sbl::led Namespace Reference

Typedefs

using RgbLed = sbl::components::display::RgbLed
 
using RgbLedState = sbl::components::display::RgbLedState
 
using Color = sbl::components::display::Color
 

Functions

template<typename Driver >
void write (const RgbLed &led, const GpioHandle &r, const GpioHandle &g, const GpioHandle &b)
 Write RgbLed state to GPIO pins (bang-bang)
 
template<typename Driver >
void write (const RgbLed &led, uint8_t r_ch, uint8_t g_ch, uint8_t b_ch)
 Write RgbLed state via SoftPwm channels (8-bit BCM)
 

Typedef Documentation

◆ Color

Definition at line 31 of file output.hpp.

◆ RgbLed

Definition at line 29 of file output.hpp.

◆ RgbLedState

Definition at line 30 of file output.hpp.

Function Documentation

◆ write() [1/2]

template<typename Driver >
void sbl::led::write ( const RgbLed led,
const GpioHandle r,
const GpioHandle g,
const GpioHandle b 
)
inline

Write RgbLed state to GPIO pins (bang-bang)

Reads the LED's current state and writes each channel to its GPIO pin. Duty values > 0 are treated as ON. Gpio::write() handles active_low.

Template Parameters
DriverGPIO driver type (e.g., sbl::driver::Gpio)
Parameters
ledRGB LED instance to read state from
rGPIO handle for red channel
gGPIO handle for green channel
bGPIO handle for blue channel
Note
ISR-safe — three GPIO register writes

Definition at line 48 of file output.hpp.

References sbl::components::display::RgbLed::state().

Here is the call graph for this function:

◆ write() [2/2]

template<typename Driver >
void sbl::led::write ( const RgbLed led,
uint8_t  r_ch,
uint8_t  g_ch,
uint8_t  b_ch 
)
inline

Write RgbLed state via SoftPwm channels (8-bit BCM)

Pushes per-channel duty cycles to the BCM engine. The Driver must provide set_duty(uint8_t channel, uint8_t duty).

Template Parameters
DriverSoftPwm-compatible driver type (e.g., sbl::driver::SoftPwm)
Parameters
ledRGB LED instance to read state from
r_chSoftPwm channel index for red
g_chSoftPwm channel index for green
b_chSoftPwm channel index for blue
Note
ISR-safe — three register writes to SoftPwm duty array

Definition at line 71 of file output.hpp.

References sbl::components::display::RgbLed::state().

Here is the call graph for this function: