Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
output.hpp File Reference

RGB LED output convenience functions. More...

Detailed Description

RGB LED output convenience functions.

Composes RgbLed state with a driver backend in a single call. Two overloads:

  • GPIO backend: bang-bang write (on/off via GpioHandle)
  • SoftPwm backend: 8-bit duty cycle via channel indices

Usage: // GPIO (bang-bang) sbl::led::write<sbl::driver::Gpio>(led, handle_r, handle_g, handle_b);

// SoftPwm (8-bit BCM) sbl::led::write<sbl::driver::SoftPwm>(led, ch_r, ch_g, ch_b);

Definition in file output.hpp.

#include <cstdint>
#include <sbl/types.hpp>
#include <sbl/hw/components/display/rgb_led.hpp>

Go to the source code of this file.

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::led
 Convenience layer: write an RGB LED.
 

Typedefs

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

Functions

template<typename Driver >
void sbl::led::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 sbl::led::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)