Sound Byte Libs 0.5.1-340-gab5b79a
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). An output backend reads it with state() and drives the LED.

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

Usage:

led.set_color(sbl::control::display::Color::Red);
led.set_rgb(128, 0, 255); // purple at half red
auto s = led.state(); // {128, 0, 255}
RGB LED state holder with 8-bit per-channel duty cycle.
Definition rgb_led.hpp:55
void set_rgb(uint8_t r, uint8_t g, uint8_t b)
Set per-channel duty cycle (0-255)
Definition rgb_led.hpp:60
void set_color(Color color)
Set from Color enum (full brightness per active channel)
Definition rgb_led.hpp:67
RgbLedState state() const
Current state.
Definition rgb_led.hpp:82

Definition in file rgb_led.hpp.

#include <cstdint>

Go to the source code of this file.

Classes

struct  sbl::control::display::RgbLedState
 
class  sbl::control::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::control
 The control stack: scheduler, event queue, merge, CC mapping, calibration.
 
namespace  sbl::control::display
 Indicators: RGB LED state and colors.
 

Enumerations

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