MCPcopy Create free account
hub / github.com/FastLED/FastLED / PowerModelRGBW

Class PowerModelRGBW

src/power_mgt.h:56–86  ·  view source on GitHub ↗

RGBW LED power consumption model @note Future API enhancement - not yet implemented in power calculations @note Currently forwards to PowerModelRGB, ignoring white channel

Source from the content-addressed store, hash-verified

54/// @note Future API enhancement - not yet implemented in power calculations
55/// @note Currently forwards to PowerModelRGB, ignoring white channel
56struct PowerModelRGBW {
57 fl::u8 red_mW; ///< Red channel power at full brightness (255), in milliwatts
58 fl::u8 green_mW; ///< Green channel power at full brightness (255), in milliwatts
59 fl::u8 blue_mW; ///< Blue channel power at full brightness (255), in milliwatts
60 fl::u8 white_mW; ///< White channel power at full brightness (255), in milliwatts
61 fl::u8 dark_mW; ///< Dark LED baseline power consumption, in milliwatts
62 float exponent; ///< Brightness-to-power response exponent (1.0 = linear)
63
64 /// Default constructor - SK6812 RGBW @ 5V estimate, linear response
65 constexpr PowerModelRGBW()
66 : red_mW(90), green_mW(70), blue_mW(90), white_mW(100), dark_mW(5),
67 exponent(1.0f) {}
68
69 /// Custom RGBW power model
70 /// @param r Red channel power (mW)
71 /// @param g Green channel power (mW)
72 /// @param b Blue channel power (mW)
73 /// @param w White channel power (mW)
74 /// @param d Dark state power (mW)
75 /// @param e Brightness-to-power response exponent. See PowerModelRGB for details.
76 constexpr PowerModelRGBW(fl::u8 r, fl::u8 g, fl::u8 b, fl::u8 w, fl::u8 d,
77 float e = 1.0f)
78 : red_mW(r), green_mW(g), blue_mW(b), white_mW(w), dark_mW(d),
79 exponent(e) {}
80
81 /// Convert to RGB model (extracts RGB components, preserves exponent)
82 /// @note Used internally until RGBW power calculations are implemented
83 constexpr PowerModelRGB toRGB() const {
84 return PowerModelRGB(red_mW, green_mW, blue_mW, dark_mW, exponent);
85 }
86};
87
88/// RGBWW LED power consumption model (RGB + Cool White + Warm White)
89/// @note Future API enhancement - not yet implemented in power calculations

Callers 1

FL_TEST_FILEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected