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
rgb_led.hpp File Reference

RGB LED component — state holder with 8-bit color depth. More...

Detailed Description

RGB LED component — state holder with 8-bit color depth.

RgbLed stores per-channel duty cycle (0-255). The output backend (SoftPwm for BCM, or GPIO for bang-bang) reads state via state().

The 3-bit Color enum provides the 8 RGB cube corners at full brightness. For intermediate colors, use set_rgb().

Usage: sbl::components::display::RgbLed led; led.set_color(sbl::components::display::Color::Red); led.set_rgb(128, 0, 255); // purple at half red auto s = led.state(); // {128, 0, 255}

Definition in file rgb_led.hpp.

#include <cstdint>

Go to the source code of this file.

Classes

struct  sbl::components::display::RgbLedState
 
class  sbl::components::display::RgbLed
 RGB LED state holder with 8-bit per-channel duty cycle. More...
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::components
 Functional hardware components.
 
namespace  sbl::components::display
 RGB LEDs and displays.
 

Enumerations

enum class  sbl::components::display::Color : uint8_t {
  sbl::components::display::Off = 0 , sbl::components::display::Blue = 1 , sbl::components::display::Green = 2 , sbl::components::display::Cyan = 3 ,
  sbl::components::display::Red = 4 , sbl::components::display::Magenta = 5 , sbl::components::display::Yellow = 6 , sbl::components::display::White = 7
}
 3-bit color enum — all 8 RGB combinations More...