FastLED 3.9.15
Loading...
Searching...
No Matches
FastLED.h
Go to the documentation of this file.
1#pragma once
2
3// IWYU pragma: private // no IWYU recommend for internal apis, obviously you can use this
4#ifndef __INC_FASTSPI_LED2_H
5#define __INC_FASTSPI_LED2_H
6
7
8
9#include "fl/stl/stdint.h"
10#include "fl/system/dll.h" // Will optionally compile in.
11#include "platforms/is_platform.h"
12
13// Include Arduino.h early and immediately normalize its math macros (min, max, abs,
14// round, radians, degrees, map). On Arduino platforms the IDE injects Arduino.h
15// before the sketch, so those macros are already active by the time FastLED.h is
16// processed. Pulling fl/system/arduino.h in here — before any internal FastLED headers —
17// ensures all subsequent headers see a clean, macro-free environment.
18// fl/stl/undef.h (included by fl/system/arduino.h) is intentionally re-includable, so a
19// second cleanup in fl/math/math.h (included later, after platform headers) will
20// catch any macros re-introduced by those platform headers.
21#if defined(ARDUINO)
22#include "fl/system/arduino.h"
23#endif
24
27
28#if defined(FL_IS_GCC) || defined(FL_IS_CLANG)
29#define FASTLED_HAS_PRAGMA_MESSAGE
30#endif
31
37#define FASTLED_VERSION 3010004
38#ifndef FASTLED_INTERNAL
39# ifdef FASTLED_SHOW_VERSION
40# ifdef FASTLED_HAS_PRAGMA_MESSAGE
41# pragma message "FastLED version 3.010.003"
42# else
43# warning FastLED version 3.010.003 (Not really a warning, just telling you here.)
44# endif
45# endif
46#endif
47// ESP32 I2S Driver compatibility warning
48#if defined(FASTLED_ESP32_I2S) && !defined(FASTLED_INTERNAL)
49#include "platforms/esp/esp_version.h" // ok platform headers
50#if defined(ESP_IDF_VERSION_MAJOR) && ESP_IDF_VERSION_MAJOR >= 5
51#warning "ESP32 I2S Driver: ESP-IDF 5.x detected. This driver may not work reliably with ESP-IDF 5.x+. Consider using RMT driver instead or staying on ESP-IDF 4.x. See ESP32_I2S_ISSUES.md for details. Report issues at: https://github.com/FastLED/FastLED/issues"
52#endif
53#endif
54
55// ESP32 RMT Driver conflict prevention
56// Arduino ESP32 Core 3.x (ESP-IDF 5.x+) includes a neopixelWrite() function that uses the RMT driver,
57// which conflicts with FastLED's legacy RMT4 driver (FASTLED_RMT5=0).
58// Disable Arduino's built-in RGB LED support to prevent the conflict.
59// This is only needed for ESP-IDF 5.x+ with legacy RMT4 driver, not earlier versions or RMT5 driver.
60// Only applies to platforms that actually have RMT hardware (excludes ESP32-C2 which lacks RMT).
61// Reference: https://github.com/espressif/arduino-esp32/issues/9866
62#if defined(FL_IS_ESP32)
63#include "platforms/esp/esp_version.h" // ok platform headers
64#include "platforms/esp/32/feature_flags/enabled.h" // ok platform headers
65#if FASTLED_RMT5 == 0 && FASTLED_ESP32_HAS_RMT && !defined(ESP32_ARDUINO_NO_RGB_BUILTIN)
66#error "ESP-IDF 5.x+ with legacy RMT4 driver detected: Please define ESP32_ARDUINO_NO_RGB_BUILTIN=1 to prevent conflicts with Arduino's neopixelWrite() function. Add '-DESP32_ARDUINO_NO_RGB_BUILTIN=1' to your build flags or use '-DFASTLED_RMT5=1' to enable RMT5 driver."
67#endif
68#endif
69
70
71#if !defined(FASTLED_FAKE_SPI_FORWARDS_TO_FAKE_CLOCKLESS)
72#if defined(FL_IS_WASM)
73#define FASTLED_FAKE_SPI_FORWARDS_TO_FAKE_CLOCKLESS 1
74#else
75#define FASTLED_FAKE_SPI_FORWARDS_TO_FAKE_CLOCKLESS 0
76#endif
77#endif
78
79// Platforms that register real hardware channel drivers (clockless and/or SPI).
80// User-overridable: define before including FastLED.h to force on/off.
81#if !defined(FASTLED_HAS_CHANNELS)
82#if defined(FL_IS_ESP32) || defined(FL_IS_TEENSY_4X) || \
83 defined(FL_IS_RP) || defined(FL_IS_STM32) || \
84 defined(FL_IS_SAMD) || defined(FL_IS_NRF52)
85#define FASTLED_HAS_CHANNELS 1
86#else
87#define FASTLED_HAS_CHANNELS 0
88#endif
89#endif
90
91// Route SPI chipsets (APA102, SK9822, etc.) through the Channel API instead of
92// legacy APA102Controller/SPIOutput. Only enabled on platforms where
93// DATA_RATE_MHZ() returns Hz (not clock dividers) so that the SPI_DATA_RATE
94// template parameter can be passed directly to the channel encoder.
95#if !defined(FASTLED_SPI_USES_CHANNEL_API)
96#if FASTLED_HAS_CHANNELS && (defined(FL_IS_ESP32) || defined(FL_IS_TEENSY_4X))
97#define FASTLED_SPI_USES_CHANNEL_API 1
98#else
99#define FASTLED_SPI_USES_CHANNEL_API 0
100#endif
101#endif
102
103#ifndef __PROG_TYPES_COMPAT__
107#define __PROG_TYPES_COMPAT__
108#endif
109
110#ifdef FL_IS_WASM
111#include "platforms/wasm/js.h" // ok platform headers
112#include "platforms/wasm/led_sysdefs_wasm.h" // ok platform headers
113#include "platforms/wasm/compiler/Arduino.h" // ok platform headers
114#include "platforms/wasm/js_fetch.h" // ok platform headers
115#endif
116
117#ifdef SmartMatrix_h
118// IWYU pragma: begin_keep
119#include <SmartMatrix.h>
120// IWYU pragma: end_keep
121#endif
122
123#ifdef DmxSimple_h
124// IWYU pragma: begin_keep
125#include <DmxSimple.h>
126// IWYU pragma: end_keep
127#endif
128
129#ifdef DmxSerial_h
130// IWYU pragma: begin_keep
131#include <DMXSerial.h>
132// IWYU pragma: end_keep
133#endif
134
135#ifdef USE_OCTOWS2811
136// IWYU pragma: begin_keep
137#include <OctoWS2811.h>
138// IWYU pragma: end_keep
139#endif
140
141// Convenience includes for sketch inclusion
142#include "fl/task/executor.h"
144#include "fl/channels/rx.h"
145#include "fl/stl/array.h"
146#include "fl/stl/vector.h"
147#include "fl/stl/cstring.h"
148#include "fl/system/pin.h"
149
150
152#include "fl/stl/static_assert.h"
153#include "cpp_compat.h"
154
155#include "fastled_config.h"
156#include "led_sysdefs.h"
157
158// Include the internal FastLED header (provides core types without cycles)
159#include "fl/system/fastled.h"
160
161#include "fl/channels/channel.h"
163#include "fl/wdt/watchdog.h" // for fl::Watchdog (FastLED.watchdog() accessor)
164#include "fl/channels/manager.h"
165#include "fl/channels/config.h" // for ChannelConfig, MultiChannelConfig
166#include "fl/channels/bus.h" // for fl::Bus, fl::DefaultBus (Phase 3b, #2428)
167#include "fl/channels/bus_traits.h" // for fl::BusTraits, fl::BusSupports (Phase 3b, #2428)
168#include "fl/channels/channel_typed.h" // for fl::TypedChannel<B, Chipset> (Phase 3b, #2428)
170
171#include "fl/audio/input.h"
173#include "fl/ui/ui.h" // for UIAudio (needed for CFastLED::add(UIAudio&) overload)
174
175// ============================================================================
176// C STRING FUNCTION USING DECLARATIONS
177// ============================================================================
178
184
185// Utility functions
186#include "fastled_delay.h"
187#include "bitswap.h"
188
189#include "lib8tion.h"
190
191// ============================================================================
192// MATH FUNCTION USING DECLARATIONS
193// ============================================================================
194
195// Arduino macros (min, max, abs, etc.) are cleaned up in two passes:
196// Pass 1 — top of FastLED.h (above): fl/system/arduino.h cleans up before internal headers.
197// Pass 2 — fl/math/math.h (below): cleans up any macros re-introduced by platform headers.
198// fl/stl/undef.h is intentionally re-includable to support both passes.
199
200#include "controller.h"
201#include "fastpin.h"
202#include "fastspi_types.h"
203#include "dmx.h"
204
205#include "platforms.h"
206
207// PlatformIO Library Dependency Finder (LDF) hint headers
208// These headers use #if 0 blocks to hint library dependencies to PlatformIO's LDF scanner
209// without actually compiling the code. This works around LDF's limitation of scanning
210// headers without evaluating preprocessor paths.
211#include "platforms/ldf_headers.h"
212
213// Pass 2 macro cleanup: fl/math/math.h includes fl/stl/undef.h which undefs any
214// min/max/abs/round/radians/degrees/map macros re-introduced by platform headers above.
215// Then provides type-safe fl:: replacements brought into global scope via using below.
216#include "fl/math/math.h"
217
218// Bring fl:: math functions into global namespace for Arduino compatibility
219// Teensy platforms define their own template min/max in wiring.h (global namespace),
220// so we skip bringing fl::min/fl::max into global scope to avoid ambiguity.
221#if !defined(FL_IS_TEENSY)
222using fl::min;
223using fl::max;
224#endif
225using fl::abs;
226using fl::radians;
227using fl::degrees;
228
229// Note: Arduino map() function is defined in global namespace (platforms/stub/Arduino.h)
230// fl::map refers to the map container (red-black tree) and our map() function delegate.
231#include "fastled_progmem.h"
232#include "pixeltypes.h"
233#include "hsv2rgb.h"
234#include "colorutils.h"
235#include "pixelset.h"
236#include "colorpalettes.h"
237
238#include "noise.h"
239#include "power_mgt.h"
240
241#include "fastspi.h"
242#include "chipsets.h"
244
245#include "fl/gfx/leds.h"
246#include "fl/gfx/rgbw.h" // DiodeProfile + InputGamut (wrapped on CFastLED below)
247
248// clockless.h removed - BulkClockless API has been superseded by Channel API
249
250// SPI chipset enumeration (modern type-safe enum class)
252
256 LPD6803 = static_cast<int>(fl::SpiChipset::LPD6803),
257 LPD8806 = static_cast<int>(fl::SpiChipset::LPD8806),
258 WS2801 = static_cast<int>(fl::SpiChipset::WS2801),
259 WS2803 = static_cast<int>(fl::SpiChipset::WS2803),
260 SM16716 = static_cast<int>(fl::SpiChipset::SM16716),
261 P9813 = static_cast<int>(fl::SpiChipset::P9813),
262 APA102 = static_cast<int>(fl::SpiChipset::APA102),
263 SK9822 = static_cast<int>(fl::SpiChipset::SK9822),
264 SK9822HD = static_cast<int>(fl::SpiChipset::SK9822HD),
265 DOTSTAR = static_cast<int>(fl::SpiChipset::DOTSTAR),
267 APA102HD = static_cast<int>(fl::SpiChipset::APA102HD),
268 HD107 = static_cast<int>(fl::SpiChipset::HD107),
269 HD107HD = static_cast<int>(fl::SpiChipset::HD107HD),
270 HD108 = static_cast<int>(fl::SpiChipset::HD108),
271};
272
276
281
286
287#ifdef HAS_PIXIE
288template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER> class PIXIE : public PixieController<DATA_PIN, RGB_ORDER> {};
289#endif
290
291#ifdef FL_CLOCKLESS_CONTROLLER_DEFINED
296
299template<fl::u8 DATA_PIN> class NEOPIXEL : public WS2812Controller800Khz<DATA_PIN, GRB> {};
300
303template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
304class SM16703 : public SM16703Controller<DATA_PIN, RGB_ORDER> {};
305
308template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
309class SM16824E : public SM16824EController<DATA_PIN, RGB_ORDER> {};
310
313template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
314class TM1829 : public TM1829Controller800Khz<DATA_PIN, RGB_ORDER> {};
315
321template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
322class TX1813N1 : public TM1829Controller800Khz<DATA_PIN, RGB_ORDER> {};
323
326template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
327class TM1812 : public TM1809Controller800Khz<DATA_PIN, RGB_ORDER> {};
328
331template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
332class TM1809 : public TM1809Controller800Khz<DATA_PIN, RGB_ORDER> {};
333
336template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
337class TM1804 : public TM1809Controller800Khz<DATA_PIN, RGB_ORDER> {};
338
341template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
342class TM1803 : public TM1803Controller400Khz<DATA_PIN, RGB_ORDER> {};
343
346template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
347class UCS1903 : public UCS1903Controller400Khz<DATA_PIN, RGB_ORDER> {};
348
351template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
352class UCS1903B : public UCS1903BController800Khz<DATA_PIN, RGB_ORDER> {};
353
356template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
357class UCS1904 : public UCS1904Controller800Khz<DATA_PIN, RGB_ORDER> {};
358
361template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
362class UCS2903 : public UCS2903Controller<DATA_PIN, RGB_ORDER> {};
363
366template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
367class UCS7604 : public UCS7604Controller8bit<DATA_PIN, RGB_ORDER> {};
368
371template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
372class UCS7604HD : public UCS7604Controller16bit<DATA_PIN, RGB_ORDER> {};
373
377template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
378class UCS7604HD_1600 : public UCS7604Controller16bit1600<DATA_PIN, RGB_ORDER> {};
379
382template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
383class WS2812 : public WS2812Controller800Khz<DATA_PIN, RGB_ORDER> {};
384
386template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
387class WS2815 : public WS2815Controller<DATA_PIN, RGB_ORDER> {};
388
390template <fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
391class WS2816 : public WS2816Controller<DATA_PIN, RGB_ORDER> {};
392
395template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
396class WS2852 : public WS2812Controller800Khz<DATA_PIN, RGB_ORDER> {};
397
400template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
401class WS2812B : public WS2812Controller800Khz<DATA_PIN, RGB_ORDER> {};
402
405template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
406class WS2812BMiniV3 : public WS2812BMiniV3Controller<DATA_PIN, RGB_ORDER> {};
407
410template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
411class WS2812BV5 : public WS2812BV5Controller<DATA_PIN, RGB_ORDER> {};
412
415template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
416class GS1903 : public WS2812Controller800Khz<DATA_PIN, RGB_ORDER> {};
417
420template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
421class SK6812 : public SK6812Controller<DATA_PIN, RGB_ORDER> {};
422
432template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
433class SK6812WWA : public SK6812Controller<DATA_PIN, RGB_ORDER> {};
434
437template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
438class SK6822 : public SK6822Controller<DATA_PIN, RGB_ORDER> {};
439
442template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
443class APA106 : public SK6822Controller<DATA_PIN, RGB_ORDER> {};
444
447template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
448class PL9823 : public PL9823Controller<DATA_PIN, RGB_ORDER> {};
449
452template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
453class WS2811 : public WS2811Controller800Khz<DATA_PIN, RGB_ORDER> {};
454
457template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
458class WS2813 : public WS2813Controller<DATA_PIN, RGB_ORDER> {};
459
462template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
463class APA104 : public WS2811Controller800Khz<DATA_PIN, RGB_ORDER> {};
464
467template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
468class WS2811_400 : public WS2811Controller400Khz<DATA_PIN, RGB_ORDER> {};
469
472template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
473class GE8822 : public GE8822Controller800Khz<DATA_PIN, RGB_ORDER> {};
474
477template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
478class GW6205 : public GW6205Controller800Khz<DATA_PIN, RGB_ORDER> {};
479
482template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
483class GW6205_400 : public GW6205Controller400Khz<DATA_PIN, RGB_ORDER> {};
484
487template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
488class LPD1886 : public LPD1886Controller1250Khz<DATA_PIN, RGB_ORDER> {};
489
492template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
493class LPD1886_8BIT : public LPD1886Controller1250Khz_8bit<DATA_PIN, RGB_ORDER> {};
494
496template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
497class UCS1912 : public UCS1912Controller<DATA_PIN, RGB_ORDER> {};
498
499#if defined(DmxSimple_h) || defined(FASTLED_DOXYGEN)
501template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER> class DMXSIMPLE : public DMXSimpleController<DATA_PIN, RGB_ORDER> {};
502#endif
503#if defined(DmxSerial_h) || defined(FASTLED_DOXYGEN)
505template<fl::EOrder RGB_ORDER> class DMXSERIAL : public DMXSerialController<RGB_ORDER> {};
506#endif
507#endif
510
511
514#ifdef PORTA_FIRST_PIN
515 WS2811_PORTA,
516 WS2813_PORTA,
517 WS2811_400_PORTA,
518 TM1803_PORTA,
519 UCS1903_PORTA,
520#endif
521#ifdef PORTB_FIRST_PIN
522 WS2811_PORTB,
523 WS2813_PORTB,
524 WS2811_400_PORTB,
525 TM1803_PORTB,
526 UCS1903_PORTB,
527#endif
528#ifdef PORTC_FIRST_PIN
529 WS2811_PORTC,
530 WS2813_PORTC,
531 WS2811_400_PORTC,
532 TM1803_PORTC,
533 UCS1903_PORTC,
534#endif
535#ifdef PORTD_FIRST_PIN
536 WS2811_PORTD,
537 WS2813_PORTD,
538 WS2811_400_PORTD,
539 TM1803_PORTD,
540 UCS1903_PORTD,
541#endif
542#ifdef HAS_PORTDC
543 WS2811_PORTDC,
544 WS2813_PORTDC,
545 WS2811_400_PORTDC,
546 TM1803_PORTDC,
547 UCS1903_PORTDC,
548#endif
549};
550
551
558typedef fl::u8 (*power_func)(fl::u8 scale, fl::u32 data);
559
578enum class ClearFlags : fl::u32 {
579 NONE = 0,
580 CHANNELS = 1 << 0,
581 POWER_SETTINGS = 1 << 1,
582 BRIGHTNESS = 1 << 2,
583 REFRESH_RATE = 1 << 3,
584 FPS_COUNTER = 1 << 4,
586};
587
590 return static_cast<ClearFlags>(static_cast<fl::u32>(a) | static_cast<fl::u32>(b));
591}
592
595 return static_cast<ClearFlags>(static_cast<fl::u32>(a) & static_cast<fl::u32>(b));
596}
597
600 a = a | b;
601 return a;
602}
603
610class CFastLED {
611 // int m_nControllers;
613 fl::u16 mNFPS;
614 fl::u32 mNMinMicros;
615 fl::u32 mNPowerData;
618
619public:
620 CFastLED();
621
633 void init();
634
635 // Useful when you want to know when an event like onFrameBegin or onFrameEnd is happening.
636 // This is disabled on AVR to save space.
639
647
662 static fl::Watchdog& watchdog();
663
668
671 void onBeginFrame() ;
672
675 void onEndShowLeds() ;
676
678
690 static ::CLEDController &addLeds(::CLEDController *pLed, CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0);
691
694
709 static void add(fl::ChannelPtr channel);
710
729 static fl::ChannelPtr add(const fl::ChannelConfig& config);
730
750
767 static fl::vector<fl::ChannelPtr> add(fl::initializer_list<fl::ChannelConfig> configs);
768
787 static fl::vector<fl::ChannelPtr> add(const fl::MultiChannelConfig& multiConfig);
788
797 static fl::RxChannelPtr addRx(const fl::RxChannelConfig& config);
798
820
837
852
877 static void enableAllDrivers();
878
895 static void remove(fl::ChannelPtr channel);
896
905 static void remove(fl::shared_ptr<fl::audio::Processor> processor);
906
908
928
929
930 // Base template: Causes a compile-time error if an unsupported CHIPSET is used
931 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN>
933 // Default implementation, will be specialized for supported chipsets
934 static const bool IS_VALID = false;
935 };
936
937 // Macro to define a mapping from the ESPIChipeset enum to the controller class
938 // in it's various template configurations.
939 #define _FL_MAP_CLOCKED_CHIPSET(CHIPSET_ENUM, CONTROLLER_CLASS) \
940 template<fl::u8 DATA_PIN, fl::u8 CLOCK_PIN> \
941 struct ClockedChipsetHelper<CHIPSET_ENUM, DATA_PIN, CLOCK_PIN> { \
942 static const bool IS_VALID = true; \
943 typedef CONTROLLER_CLASS<DATA_PIN, CLOCK_PIN> ControllerType; \
944 /* Controller type with RGB_ORDER specified */ \
945 template<fl::EOrder RGB_ORDER> \
946 struct CONTROLLER_CLASS_WITH_ORDER { \
947 typedef CONTROLLER_CLASS<DATA_PIN, CLOCK_PIN, RGB_ORDER> ControllerType; \
948 }; \
949 /* Controller type with RGB_ORDER and spi frequency specified */ \
950 template<fl::EOrder RGB_ORDER, fl::u32 FREQ> \
951 struct CONTROLLER_CLASS_WITH_ORDER_AND_FREQ { \
952 typedef CONTROLLER_CLASS<DATA_PIN, CLOCK_PIN, RGB_ORDER, FREQ> ControllerType; \
953 }; \
954 };
955
956 // Define specializations for each supported CHIPSET
957 // Note: Using unscoped enum values for backwards compatibility
964
965 // Both DOTSTAR and APA102 use the same controller class
968
969 // Both DOTSTARHD and APA102HD use the same controller class
972
975
977
980
981
982 #if FASTLED_FAKE_SPI_FORWARDS_TO_FAKE_CLOCKLESS
986 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::u32 SPI_DATA_RATE, fl::Bus B = fl::Bus::AUTO> ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
987 // Instantiate the controller using ClockedChipsetHelper
988 // Always USE WS2812 clockless controller since it's the common path.
989 return addLeds<WS2812, DATA_PIN, RGB_ORDER, B>(data, nLedsOrOffset, nLedsIfOffset);
990 }
991
993 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::Bus B = fl::Bus::AUTO> static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
994 // Always USE WS2812 clockless controller since it's the common path.
995 return addLeds<WS2812, DATA_PIN, B>(data, nLedsOrOffset, nLedsIfOffset);
996 }
997
998
999 // The addLeds function using ChipsetHelper
1000 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1001 ::CLEDController& addLeds(CRGB* data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1002 // Always USE WS2812 clockless controller since it's the common path.
1003 return addLeds<WS2812, DATA_PIN, RGB_ORDER, B>(data, nLedsOrOffset, nLedsIfOffset);
1004 }
1005
1006 #elif FASTLED_SPI_USES_CHANNEL_API
1007
1009 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::u32 SPI_DATA_RATE, fl::Bus B = fl::Bus::AUTO>
1010 ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1012 int nOffset = (nLedsIfOffset > 0) ? nLedsOrOffset : 0;
1013 int nLeds = (nLedsIfOffset > 0) ? nLedsIfOffset : nLedsOrOffset;
1014 fl::SpiEncoder encoder = fl::SpiEncoder::spiEncoderForChipset(
1015 static_cast<fl::SpiChipset>(CHIPSET), SPI_DATA_RATE);
1016 fl::SpiChipsetConfig spiCfg(DATA_PIN, CLOCK_PIN, encoder);
1017 fl::ChannelConfig config(spiCfg, fl::span<CRGB>(data + nOffset, nLeds), RGB_ORDER);
1018 config.options.mBus = B;
1019 static fl::ChannelPtr sChannel;
1020 if (!sChannel) {
1021 sChannel = add(config);
1022 }
1023 return *sChannel;
1024 }
1025
1027 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::Bus B = fl::Bus::AUTO>
1028 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1030 int nOffset = (nLedsIfOffset > 0) ? nLedsOrOffset : 0;
1031 int nLeds = (nLedsIfOffset > 0) ? nLedsIfOffset : nLedsOrOffset;
1032 fl::SpiEncoder encoder = fl::SpiEncoder::spiEncoderForChipset(
1033 static_cast<fl::SpiChipset>(CHIPSET));
1034 fl::SpiChipsetConfig spiCfg(DATA_PIN, CLOCK_PIN, encoder);
1035 // HD108 defaults to GRB; all other SPI chipsets default to RGB.
1036 constexpr fl::EOrder order =
1038 ? GRB : RGB;
1039 fl::ChannelConfig config(spiCfg, fl::span<CRGB>(data + nOffset, nLeds), order);
1040 config.options.mBus = B;
1041 static fl::ChannelPtr sChannel;
1042 if (!sChannel) {
1043 sChannel = add(config);
1044 }
1045 return *sChannel;
1046 }
1047
1049 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1050 ::CLEDController& addLeds(CRGB* data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1052 int nOffset = (nLedsIfOffset > 0) ? nLedsOrOffset : 0;
1053 int nLeds = (nLedsIfOffset > 0) ? nLedsIfOffset : nLedsOrOffset;
1054 fl::SpiEncoder encoder = fl::SpiEncoder::spiEncoderForChipset(
1055 static_cast<fl::SpiChipset>(CHIPSET));
1056 fl::SpiChipsetConfig spiCfg(DATA_PIN, CLOCK_PIN, encoder);
1057 fl::ChannelConfig config(spiCfg, fl::span<CRGB>(data + nOffset, nLeds), RGB_ORDER);
1058 config.options.mBus = B;
1059 static fl::ChannelPtr sChannel;
1060 if (!sChannel) {
1061 sChannel = add(config);
1062 }
1063 return *sChannel;
1064 }
1065
1066 #else
1067
1069 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::u32 SPI_DATA_RATE, fl::Bus B = fl::Bus::AUTO> ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1071 // Instantiate the controller using ClockedChipsetHelper
1073 FL_STATIC_ASSERT(CHIP::IS_VALID, "Unsupported chipset");
1074 typedef typename CHIP::template CONTROLLER_CLASS_WITH_ORDER_AND_FREQ<RGB_ORDER, SPI_DATA_RATE>::ControllerType ControllerTypeWithFreq;
1075 static ControllerTypeWithFreq c;
1076 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1077 }
1078
1080 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::Bus B = fl::Bus::AUTO> static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1083 FL_STATIC_ASSERT(CHIP::IS_VALID, "Unsupported chipset");
1084 typedef typename CHIP::ControllerType ControllerType;
1085 static ControllerType c;
1086 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1087 }
1088
1090 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1091 ::CLEDController& addLeds(CRGB* data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1094 FL_STATIC_ASSERT(CHIP::IS_VALID, "Unsupported chipset");
1095 typedef typename CHIP::template CONTROLLER_CLASS_WITH_ORDER<RGB_ORDER>::ControllerType ControllerTypeWithOrder;
1096 static ControllerTypeWithOrder c;
1097 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1098 }
1099 #endif
1100
1101
1102#ifdef SPI_DATA
1103 template<ESPIChipsets CHIPSET, fl::Bus B = fl::Bus::AUTO> static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1104 return addLeds<CHIPSET, SPI_DATA, SPI_CLOCK, RGB, B>(data, nLedsOrOffset, nLedsIfOffset);
1105 }
1106
1107 template<ESPIChipsets CHIPSET, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO> static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1108 return addLeds<CHIPSET, SPI_DATA, SPI_CLOCK, RGB_ORDER, B>(data, nLedsOrOffset, nLedsIfOffset);
1109 }
1110
1111 template<ESPIChipsets CHIPSET, fl::EOrder RGB_ORDER, fl::u32 SPI_DATA_RATE, fl::Bus B = fl::Bus::AUTO> static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1112 return addLeds<CHIPSET, SPI_DATA, SPI_CLOCK, RGB_ORDER, SPI_DATA_RATE, B>(data, nLedsOrOffset, nLedsIfOffset);
1113 }
1114
1115#endif
1117
1118#ifdef FL_CLOCKLESS_CONTROLLER_DEFINED
1122 template<typename ControllerType>
1123 static inline ::CLEDController& addLedsImpl(ControllerType* controller, CRGB *data, int nLedsOrOffset, int nLedsIfOffset) {
1124 ::CLEDController* pLed = static_cast<::CLEDController*>(controller);
1125 return addLeds(pLed, data, nLedsOrOffset, nLedsIfOffset);
1126 }
1147
1149 template<template<fl::u8, fl::EOrder> class CHIPSET, fl::u8 DATA_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1150 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1153 return addLedsImpl(&c, data, nLedsOrOffset, nLedsIfOffset);
1154 }
1155
1157 template<template<fl::u8, fl::EOrder> class CHIPSET, fl::u8 DATA_PIN, fl::Bus B = fl::Bus::AUTO>
1158 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1160 static CHIPSET<DATA_PIN, RGB> c;
1161 return addLedsImpl(&c, data, nLedsOrOffset, nLedsIfOffset);
1162 }
1163
1165 template<template<fl::u8> class CHIPSET, fl::u8 DATA_PIN, fl::Bus B = fl::Bus::AUTO>
1166 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1168 static CHIPSET<DATA_PIN> c;
1169 return addLedsImpl(&c, data, nLedsOrOffset, nLedsIfOffset);
1170 }
1171
1172 template<template<fl::u8> class CHIPSET, fl::u8 DATA_PIN, fl::Bus B = fl::Bus::AUTO>
1173 static ::CLEDController &addLeds(fl::Leds& leds, int nLedsOrOffset, int nLedsIfOffset = 0) {
1174 CRGB* rgb = leds;
1175 return addLeds<CHIPSET, DATA_PIN, B>(rgb, nLedsOrOffset, nLedsIfOffset);
1176 }
1177
1178#if defined(__FASTLED_HAS_FIBCC) && (__FASTLED_HAS_FIBCC == 1)
1179 template<fl::u8 NUM_LANES, template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER> class CHIPSET, fl::u8 DATA_PIN, fl::EOrder RGB_ORDER=RGB, fl::Bus B = fl::Bus::AUTO>
1180 static ::CLEDController &addLeds(CRGB *data, int nLeds) {
1182 static fl::__FIBCC<CHIPSET, DATA_PIN, NUM_LANES, RGB_ORDER> c;
1183 return addLeds(&c, data, nLeds);
1184 }
1185#endif
1186
1187 #ifdef FASTSPI_USE_DMX_SIMPLE
1188 template<EClocklessChipsets CHIPSET, fl::u8 DATA_PIN, fl::EOrder RGB_ORDER=RGB, fl::Bus B = fl::Bus::AUTO>
1189 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0)
1190 {
1192 switch(CHIPSET) {
1193 case DMX: { static DMXController<DATA_PIN> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
1194 }
1195 }
1196 #endif
1198#endif
1199
1220
1222 template<template<fl::EOrder RGB_ORDER> class CHIPSET, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1223 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1225 static CHIPSET<RGB_ORDER> c;
1226 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1227 }
1228
1230 template<template<fl::EOrder RGB_ORDER> class CHIPSET, fl::Bus B = fl::Bus::AUTO>
1231 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1233 static CHIPSET<RGB> c;
1234 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1235 }
1236
1237#ifdef USE_OCTOWS2811
1241 template<OWS2811 CHIPSET, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1242 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0)
1243 {
1245 switch(CHIPSET) {
1246 case OCTOWS2811: { static fl::COctoWS2811Controller<RGB_ORDER,WS2811_800kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
1247 case OCTOWS2811_400: { static fl::COctoWS2811Controller<RGB_ORDER,WS2811_400kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
1248#ifdef WS2813_800kHz
1249 case OCTOWS2813: { static fl::COctoWS2811Controller<RGB_ORDER,WS2813_800kHz> controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
1250#endif
1251 }
1252 }
1253
1257 template<OWS2811 CHIPSET, fl::Bus B = fl::Bus::AUTO>
1258 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0)
1259 {
1260 return addLeds<CHIPSET,GRB,B>(data,nLedsOrOffset,nLedsIfOffset);
1261 }
1262
1263#endif
1264
1265#ifdef USE_WS2812SERIAL
1269 template<SWS2812 CHIPSET, int DATA_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1270 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0)
1271 {
1273 static CWS2812SerialController<DATA_PIN,RGB_ORDER> controller;
1274 return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset);
1275 }
1276#endif
1277
1278#ifdef SmartMatrix_h
1281 template<ESM CHIPSET, fl::Bus B = fl::Bus::AUTO>
1282 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0)
1283 {
1285 switch(CHIPSET) {
1286 case SMART_MATRIX: { static CSmartMatrixController controller; return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset); }
1287 }
1288 }
1289#endif
1291
1292
1293#ifdef FASTLED_HAS_BLOCKLESS
1294
1315
1317 template<EBlockChipsets CHIPSET, int NUM_LANES, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1318 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1320 switch(CHIPSET) {
1321 #ifdef PORTA_FIRST_PIN
1322 case WS2811_PORTA: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1323 case WS2811_400_PORTA: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1324 case WS2813_PORTA: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1325 case TM1803_PORTA: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1326 case UCS1903_PORTA: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1327 #endif
1328 #ifdef PORTB_FIRST_PIN
1329 case WS2811_PORTB: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1330 case WS2811_400_PORTB: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1331 case WS2813_PORTB: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1332 case TM1803_PORTB: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1333 case UCS1903_PORTB: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1334 #endif
1335 #ifdef PORTC_FIRST_PIN
1336 case WS2811_PORTC: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1337 case WS2811_400_PORTC: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1338 case WS2813_PORTC: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1339 case TM1803_PORTC: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1340 case UCS1903_PORTC: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1341 #endif
1342 #ifdef PORTD_FIRST_PIN
1343 case WS2811_PORTD: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1344 case WS2811_400_PORTD: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1345 case WS2813_PORTD: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1346 case TM1803_PORTD: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1347 case UCS1903_PORTD: return addLeds(new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1348 #endif
1349 #ifdef HAS_PORTDC
1350 case WS2811_PORTDC: return addLeds(new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1351 case WS2811_400_PORTDC: return addLeds(new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1352 case WS2813_PORTDC: return addLeds(new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1353 case TM1803_PORTDC: return addLeds(new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1354 case UCS1903_PORTDC: return addLeds(new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset); // ok bare allocation
1355 #endif
1356 }
1357 }
1358
1360 template<EBlockChipsets CHIPSET, int NUM_LANES, fl::Bus B = fl::Bus::AUTO>
1361 static ::CLEDController &addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0) {
1362 return addLeds<CHIPSET,NUM_LANES,GRB,B>(data,nLedsOrOffset,nLedsIfOffset);
1363 }
1365#endif
1366
1369 void setBrightness(fl::u8 scale) { mScale = scale; }
1370
1373 fl::u8 getBrightness() { return mScale; }
1374
1378
1385 void setDriverEnabled(const char* name, bool enabled);
1386
1407 template<fl::Bus B>
1411
1423 bool setExclusiveDriver(fl::Bus bus);
1424
1428 bool isDriverEnabled(const char* name) const;
1429
1432 fl::size getDriverCount() const;
1433
1438
1440
1445 void wait();
1446
1450 bool wait(fl::u32 timeout_ms);
1451
1455 inline void setMaxPowerInVoltsAndMilliamps(fl::u8 volts, fl::u32 milliamps) { setMaxPowerInMilliWatts(volts * milliamps); }
1456
1459 inline void setMaxPowerInMilliWatts(fl::u32 milliwatts) { mPPowerFunc = static_cast<power_func>(&calculate_max_brightness_for_power_mW); mNPowerData = milliwatts; }
1460
1464
1473 inline void setPowerModel(const PowerModelRGB& model) {
1474 set_power_model(model);
1475 }
1476
1486 inline void setPowerScalingExponent(float exponent) {
1488 }
1489
1493 inline float getPowerScalingExponent() const {
1495 }
1496
1502
1510 fl::set_input_gamut(profile, g);
1511 }
1512
1517 const float white_xy[2]) FL_NOEXCEPT {
1518 fl::set_input_gamut(profile, g, white_xy);
1519 }
1520
1522
1523private:
1524 // Forward shims for the tiered-wait spin budget (#2818). Full impl
1525 // lives in src/fl/channels/detail/wait_spin_budget.{h,cpp.hpp}.
1526 // Declared here so we don't drag the channel-detail include graph
1527 // into FastLED.h.
1528 static void _setWaitSpinBudgetUs(fl::u32 budget_us) FL_NOEXCEPT;
1529 static fl::u32 _getWaitSpinBudgetUs() FL_NOEXCEPT;
1530public:
1531
1545 inline void setWaitSpinBudgetUs(fl::u32 budget_us) FL_NOEXCEPT {
1546 _setWaitSpinBudgetUs(budget_us);
1547 }
1548
1550 inline fl::u32 getWaitSpinBudgetUs() const FL_NOEXCEPT {
1551 return _getWaitSpinBudgetUs();
1552 }
1553
1558 inline void setPowerModel(const PowerModelRGBW& model) {
1559 set_power_model(model);
1560 }
1561
1566 inline void setPowerModel(const PowerModelRGBWW& model) {
1567 set_power_model(model);
1568 }
1569
1573 return get_power_model();
1574 }
1575
1614 fl::u32 getEstimatedPowerInMilliWatts(bool apply_limiter = true) const;
1615
1617
1624
1636
1641
1643
1646 void show(fl::u8 scale);
1647
1649 void show() { show(mScale); }
1650
1651 // Called automatically at the end of show().
1652 void onEndFrame();
1653
1657 void clear(bool writeData = false);
1658
1680 static void clear(ClearFlags flags);
1681
1683 void clearData();
1684
1688 void showColor(const CRGB & color, fl::u8 scale);
1689
1692 void showColor(const CRGB & color) { showColor(color, mScale); }
1693
1698 void delay(unsigned long ms);
1699
1703 void setTemperature(const CRGB & temp);
1704
1708 void setCorrection(const CRGB & correction);
1709
1713 void setDither(fl::u8 ditherMode = BINARY_DITHER);
1714
1722 void setMaxRefreshRate(fl::u16 refresh, bool constrain=false);
1723
1728 void countFPS(int nFrames=25);
1729
1732 fl::u16 getFPS() { return mNFPS; }
1733
1736 int count();
1737
1741
1744 int size();
1745
1748 CRGB *leds();
1749};
1750
1752#define FastSPI_LED FastLED
1754#define FastSPI_LED2 FastLED
1755#ifndef LEDS
1757#define LEDS FastLED
1758#endif
1759
1761extern CFastLED FastLED;
1762
1766#ifndef HAS_HARDWARE_PIN_SUPPORT
1767#warning "No pin/port mappings found, pin access will be slightly slower. See fastpin.h for info."
1768#define NO_HARDWARE_PIN_SUPPORT
1769#endif
1770
1771
1772#endif
1773
1774
1776
1777#if !defined(FASTLED_INTERNAL) && !defined(FASTLED_LEAN_AND_MEAN)
1778
1779#include "fl/stl/string.h" // Awesome Str class that has stack allocation and heap overflow, copy on write.
1780#include "fl/math/xymap.h" // XYMap class for mapping 2D coordinates on seperintine matrices.
1781
1782#include "fl/math/math.h" // fl::clamp, fl::map_range, fl::min, fl::max, etc.
1783
1784#include "fl/log/log.h"
1785#include "fl/log/log.h" // FL_WARN("time now: " << millis()), FL_WARN_IF(condition, "time now: " << millis());"
1786#include "fl/log/log.h" // FL_PRINT("message" << value), FL_LOG_*() category-specific logging
1787#include "fl/system/serial.h" // Arduino-compatible Serial API: fl::Serial.print(), fl::Serial.read(), etc.
1788#include "fl/stl/assert.h" // FASTLED_ASSERT(condition, "message");
1789#include "fl/stl/sstream.h" // fl::sstream for string stream operations
1790#include "fl/remote/remote.h" // Remote RPC system for JSON-based function calls
1791
1792// provides:
1793// fl::vector<T> - Standard heap vector
1794// fl::vector_inlined<T,N> - Allocate on stack N elements, then overflow to heap vector.
1795// fl::vector_fixed<T,N> - Stack allocated fixed size vector, elements will fail to add when full.
1796#include "fl/stl/vector.h"
1797
1798// Flexible callbacks in the style of std::function.
1799#include "fl/stl/function.h"
1800
1801// Clears the led data and other objects.
1802// CRGB leds[NUM_LEDS];
1803// fl::clear(leds)
1804#include "fl/gfx/clear.h"
1805
1806// Leds has a CRGB block and an XYMap
1807#include "fl/gfx/leds.h"
1808
1809#include "fl/channels/spi.h" // SPI device and multi-lane SPI support (1-16 lanes)
1810
1811#include "fl/ui/ui.h" // Provides UIButton, UISlider, UICheckbox, UINumberField and UITitle, UIDescription, UIHelp, UIGroup.
1812using fl::UITitle;
1813using fl::UIDescription;
1814using fl::UIHelp;
1815using fl::UIButton; // These names are unique enough that we don't need to namespace them
1816using fl::UICheckbox;
1817using fl::UINumberField;
1818using fl::UISlider;
1819using fl::UIDropdown;
1820using fl::UIGroup;
1821using fl::XYMap;
1822using fl::round; // Template version avoids conflicts with ::round
1823// Only expose fl::delay as global delay() on non-hardware platforms (stub/WASM).
1824// On real Arduino platforms, Arduino's native delay(uint32_t) is already in scope;
1825// importing fl::delay there causes an ambiguous-overload error for any third-party
1826// library (e.g. IRremote) that calls the unqualified delay().
1827// Users who need fl::delay's async-task-pumping behaviour can call fl::delay() or
1828// fl::delayMs() explicitly.
1829#if defined(FASTLED_STUB_IMPL)
1830using fl::delay;
1831#endif
1832
1833// Common fl:: type aliases for global namespace convenience
1834template<typename T> using fl_vector = fl::vector<T>;
1835template<typename Key, typename Value, typename Compare = fl::less<Key>> using fl_map = fl::flat_map<Key, Value, Compare>;
1836using fl_string = fl::string;
1837
1838// Note: delayMicroseconds and delayMillis are provided by Arduino core
1839// The fl:: namespace versions are available for explicit use when needed
1840
1841#define FASTLED_TITLE(text) fl::UITitle g_title(text)
1842#define FASTLED_DESCRIPTION(text) fl::UIDescription g_description(text)
1843#define FASTLED_HELP(text) fl::UIHelp g_help(text)
1844
1845
1846#endif // FASTLED_INTERNAL && !FASTLED_LEAN_AND_MEAN
1847
1848
1849
1850// Experimental: loop() hijacking.
1851//
1852// EngineEvents requires that FastLED.show() be invoked.
1853// If the user skips that then certain updates will be skipped.
1854//
1855// Right now this isn't a big deal, but in the future it could be.
1856//
1857// Therefore this experiment is done so that this loop() hijack trick
1858// can be used to insert code at the start of every loop(), such as a
1859// scoped object that forces a begin and end frame event.
1860//
1861// It's possible to hijack the loop() via a macro so that
1862// extra code can be injected at the start of every frame.
1863// When FASTLED_LOOP_RUNS_ASYNC == 1
1864// then use loop() to also run the async.
1865//
1866// EXAMPLE:
1867// #define FASTLED_LOOP_RUNS_ASYNC 1
1868// #include "FastLED.h"
1869// void loop() {
1870// FL_WARN("async will run in the loop");
1871// delay(500);
1872// }
1873
1874#ifndef FASTLED_LOOP_RUNS_ASYNC
1875#define FASTLED_LOOP_RUNS_ASYNC 0
1876#endif
1877
1878#if FASTLED_LOOP_RUNS_ASYNC == 1
1879// The loop is set as a macro that re-defines the user loop function
1880// to sketch_loop()
1881#define loop() \
1882 sketch_loop(); \
1883 void loop() { sketch_loop(); fl::task::run(); } \
1884 void sketch_loop()
1885#endif
1886
1887// Backdoor to get the size of the CLedController object. The one place
1888// that includes this just uses extern to declare the function.
1889// Declaration moved to src/fl/system/fastled.h
#define BRIGHTNESS
int x
Definition simple.h:92
#define CHIPSET
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
#define _FL_MAP_CLOCKED_CHIPSET(CHIPSET_ENUM, CONTROLLER_CLASS)
Definition FastLED.h:939
ClearFlags
Flags for FastLED.clear() to control what state gets cleared/reset.
Definition FastLED.h:578
@ CHANNELS
Remove all channels from controller list.
Definition FastLED.h:580
@ CHANNEL_ENGINES
Clear all channel drivers from ChannelManager.
Definition FastLED.h:585
@ POWER_SETTINGS
Reset power management (setMaxPowerInMilliWatts)
Definition FastLED.h:581
@ FPS_COUNTER
Reset FPS tracking counter to 0.
Definition FastLED.h:584
@ NONE
Clear nothing (no-op)
Definition FastLED.h:579
@ REFRESH_RATE
Reset refresh rate limiting to unlimited.
Definition FastLED.h:583
ClearFlags & operator|=(ClearFlags &a, ClearFlags b)
Enable bitwise OR assignment for ClearFlags.
Definition FastLED.h:599
SWS2812
WS2812Serial Library controller type.
Definition FastLED.h:285
@ WS2812SERIAL
Definition FastLED.h:285
ClearFlags operator|(ClearFlags a, ClearFlags b)
Enable bitwise OR for ClearFlags.
Definition FastLED.h:589
OWS2811
Octo WS2811 LED Library controller types.
Definition FastLED.h:280
@ OCTOWS2811
Definition FastLED.h:280
@ OCTOWS2813
Definition FastLED.h:280
@ OCTOWS2811_400
Definition FastLED.h:280
ClearFlags operator&(ClearFlags a, ClearFlags b)
Enable bitwise AND for ClearFlags.
Definition FastLED.h:594
ESPIChipsets
Backwards compatibility enum - allows old code to use unscoped names (e.g., APA102 instead of fl::Spi...
Definition FastLED.h:255
@ APA102HD
APA102 LED chipset with 5-bit gamma correction.
Definition FastLED.h:267
@ P9813
P9813 LED chipset.
Definition FastLED.h:261
@ SK9822HD
SK9822 LED chipset with 5-bit gamma correction.
Definition FastLED.h:264
@ SK9822
SK9822 LED chipset.
Definition FastLED.h:263
@ WS2803
WS2803 LED chipset.
Definition FastLED.h:259
@ HD107
Same as APA102, but in turbo 40-mhz mode.
Definition FastLED.h:268
@ WS2801
WS2801 LED chipset.
Definition FastLED.h:258
@ DOTSTAR
APA102 LED chipset alias.
Definition FastLED.h:265
@ APA102
APA102 LED chipset.
Definition FastLED.h:262
@ LPD8806
LPD8806 LED chipset.
Definition FastLED.h:257
@ HD107HD
Same as APA102HD, but in turbo 40-mhz mode.
Definition FastLED.h:269
@ LPD6803
LPD6803 LED chipset.
Definition FastLED.h:256
@ DOTSTARHD
APA102HD LED chipset alias.
Definition FastLED.h:266
@ SM16716
SM16716 LED chipset.
Definition FastLED.h:260
@ HD108
16-bit variant of HD107, always gamma corrected. No SD (standard definition) option available - all H...
Definition FastLED.h:270
ESM
Smart Matrix Library controller type.
Definition FastLED.h:275
@ SMART_MATRIX
Definition FastLED.h:275
EBlockChipsets
Blockless output port enum.
Definition FastLED.h:513
fl::u8(* power_func)(fl::u8 scale, fl::u32 data)
Typedef for a power consumption calculation function.
Definition FastLED.h:558
CLEDController * controller
fl::UISlider scale("Scale", 4,.1, 4,.1)
Functions for doing a rotation of bits/bytes used by parallel output.
Compile-time identifier for an LED channel transmission bus.
Per-driver traits keyed on fl::Bus.
ESP32-P4 Parallel IO (PARLIO) LED channel.
Phase 3b templated channel facade – Channel<Bus, Chipset> with compile-time bus/chipset enforcement.
Multi-lane SPI interface for LED output Hardware (SPI_HW): 1-8 parallel data lanes Software (SPI_BITB...
Contains the bulk of the definitions for the various LED chipsets supported.
APA102 high definition controller class.
Definition apa102.h:293
APA102 controller class.
Definition apa102.h:38
static void enableAllDrivers()
Enroll every channel driver available on this platform with ChannelManager.
power_func mPPowerFunc
function for overriding brightness when using FastLED.show();
Definition FastLED.h:616
fl::u32 getEstimatedPowerInMilliWatts(bool apply_limiter=true) const
Get estimated power consumption in milliwatts.
_FL_MAP_CLOCKED_CHIPSET(LPD6803, LPD6803Controller) _FL_MAP_CLOCKED_CHIPSET(LPD8806
void onEndFrame()
static fl::vector< fl::ChannelPtr > & channels()
stored ChannelPtrs to keep them alive
int size()
Get the number of leds in the first controller.
void setMaxPowerInVoltsAndMilliamps(fl::u8 volts, fl::u32 milliamps)
Set the maximum power to be used, given in volts and milliamps.
Definition FastLED.h:1455
CRGB * leds()
Get a pointer to led data for the first controller.
bool isDriverEnabled(const char *name) const
Check if a driver is enabled by name.
void setPowerModel(const PowerModelRGBWW &model)
Definition FastLED.h:1566
void onEndShowLeds()
Manually trigger the end show LEDs event.
void setMaxRefreshRate(fl::u16 refresh, bool constrain=false)
Set the maximum refresh rate.
static fl::RxChannelPtr addRx(const fl::RxChannelConfig &config)
Add an RX channel with runtime configuration.
void setTemperature(const CRGB &temp)
Set a global color temperature.
void setRgbwColorimetricProfile(const fl::DiodeProfile *profile) FL_NOEXCEPT
Install a user-supplied RGBW diode chromaticity profile for the colorimetric modes.
Definition FastLED.h:1633
void show()
Update all our controllers with the current led colors.
Definition FastLED.h:1649
LPD8806Controller WS2803Controller P9813Controller APA102Controller APA102ControllerHD APA102ControllerHD SK9822Controller fl::u8 fl::u8 fl::EOrder fl::u32 SPI_DATA_RATE
Definition FastLED.h:1069
void showColor(const CRGB &color)
Set all leds on all controllers to the given color.
Definition FastLED.h:1692
void onBeginFrame()
Manually trigger the begin frame event.
static void remove(fl::ChannelPtr channel)
Remove a channel from the LED controller list.
LPD8806Controller WS2803Controller P9813Controller APA102Controller APA102ControllerHD APA102ControllerHD SK9822Controller fl::u8 fl::u8 fl::EOrder fl::u32 fl::Bus B
Definition FastLED.h:1069
void setWaitSpinBudgetUs(fl::u32 budget_us) FL_NOEXCEPT
Override the channel-manager tiered-wait spin budget (microseconds).
Definition FastLED.h:1545
void showColor(const CRGB &color, fl::u8 scale)
Set all leds on all controllers to the given color/scale.
void removeListener(fl::EngineEvents::Listener *listener)
Definition FastLED.h:638
LPD8806Controller WS2803Controller P9813Controller APA102Controller APA102ControllerHD APA102ControllerHD SK9822Controller fl::u8 fl::u8 fl::EOrder RGB_ORDER
Definition FastLED.h:1069
void setPowerModel(const PowerModelRGB &model)
Definition FastLED.h:1473
float getPowerScalingExponent() const
Get the configured brightness-to-power response exponent.
Definition FastLED.h:1493
void countFPS(int nFrames=25)
For debugging, this will keep track of time between calls to countFPS().
CLEDController & operator[](int x)
Get a reference to a registered controller.
void setMaxPowerInMilliWatts(fl::u32 milliwatts)
Set the maximum power to be used, given in milliwatts.
Definition FastLED.h:1459
void delay(unsigned long ms)
Delay for the given number of milliseconds.
void setExclusiveDriver() FL_NOEXCEPT
Register a single driver at a priority above the platform default (compile-time TU-linking variant).
Definition FastLED.h:1408
void setPowerScalingExponent(float exponent)
Set a non-linear brightness-to-power response exponent.
Definition FastLED.h:1486
static void _setWaitSpinBudgetUs(fl::u32 budget_us) FL_NOEXCEPT
fl::u32 getWaitSpinBudgetUs() const FL_NOEXCEPT
Get the current tiered-wait spin budget (microseconds).
Definition FastLED.h:1550
fl::u8 mScale
the current global brightness scale setting
Definition FastLED.h:612
void setDither(fl::u8 ditherMode=BINARY_DITHER)
Set the dithering mode.
fl::size getDriverCount() const
Get count of registered channel drivers.
static fl::Watchdog & watchdog()
Access the unified cross-platform watchdog timer.
fl::u32 mNPowerData
max power use parameter
Definition FastLED.h:615
static fl::u32 _getWaitSpinBudgetUs() FL_NOEXCEPT
fl::u16 mNFPS
tracking for current frames per second (FPS) value
Definition FastLED.h:613
const fl::DiodeProfile * getRgbwColorimetricProfile() const FL_NOEXCEPT
Currently active RGBW colorimetric profile (defaults to &fl::kRgbwDefaultProfile).
Definition FastLED.h:1638
void setInputGamut(fl::DiodeProfile *profile, fl::InputGamut g) FL_NOEXCEPT
Reconfigure profile's input gamut to one of the named source chromaticity sets (Native / Rec709 / Rec...
Definition FastLED.h:1509
fl::u32 mNMinMicros
minimum µs between frames, used for capping frame rates
Definition FastLED.h:614
void init()
Initialize platform-specific subsystems.
static void add(fl::ChannelPtr channel)
Add a Channel-based LED controller (from ChannelPtr)
void clearData()
Clear out the local data array.
void addListener(fl::EngineEvents::Listener *listener)
Definition FastLED.h:637
void setInputGamut(fl::DiodeProfile *profile, fl::InputGamut g, const float white_xy[2]) FL_NOEXCEPT
Same as above with an explicit input white-point override.
Definition FastLED.h:1516
PowerModelRGB getPowerModel() const
Get current RGB power model.
Definition FastLED.h:1572
LPD8806Controller WS2803Controller P9813Controller APA102Controller APA102ControllerHD APA102ControllerHD SK9822Controller fl::u8 fl::u8 CLOCK_PIN
Definition FastLED.h:1069
int count()
Get how many controllers have been registered.
LPD8806Controller WS2803Controller P9813Controller APA102Controller APA102ControllerHD APA102ControllerHD SK9822Controller fl::u8 DATA_PIN
Definition FastLED.h:1069
void setPowerModel(const PowerModelRGBW &model)
Definition FastLED.h:1558
void wait()
Wait for all channel bus transmissions to complete.
void clear(bool writeData=false)
Clear the leds, wiping the local array of data.
void setCorrection(const CRGB &correction)
Set a global color correction.
fl::u16 getFPS()
Get the number of frames/second being written out.
Definition FastLED.h:1732
::CLEDController & addLeds(::CLEDController *pLed, CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a CLEDController instance to the world.
fl::span< const fl::DriverInfo > getDriverInfos() const
Get full state of all registered channel drivers.
static fl::ChannelEvents & channelEvents()
Access the channel event system.
High level controller interface for FastLED.
Definition FastLED.h:610
DMX512 based LED controller class, using the DMXSerial library.
Definition dmx.h:67
DMX512 based LED controller class, using the DmxSimple library.
Definition dmx.h:29
LPD6803 controller class (LPD1101).
Definition lpd880x.h:103
LPD8806 controller class.
Definition lpd880x.h:29
P9813 controller class.
Definition p9813.h:26
SK9822 controller class.
Definition apa102.h:340
SK9822 controller class.
Definition apa102.h:318
SM16716 controller class.
Definition sm16716.h:25
WS2801 controller class.
Definition ws2801.h:25
WS2803 controller class.
Definition ws2801.h:87
void setExclusiveDriver() FL_NOEXCEPT
Register a single driver at a priority above the platform default and disable all others (compile-tim...
Definition manager.h:322
static void removeListener(Listener *listener) FL_NOEXCEPT
static void addListener(Listener *listener, int priority=0) FL_NOEXCEPT
Unified cross-platform watchdog interface.
Definition watchdog.h:123
fl::CLEDController CLEDController
Declarations for the predefined color palettes supplied by FastLED.
Compatibility functions based on C++ version.
#define BINARY_DITHER
Enable dithering using binary dithering (only option)
Definition dither_mode.h:12
FastLED dynamic library interface - lightweight header for external callers.
Defines the DMX512-based LED controllers.
constexpr EOrder GRB
Definition eorder.h:19
constexpr EOrder RGB
Definition eorder.h:17
Task executor — runs registered task runners and manages the run loop.
Contains definitions that can be used to configure FastLED at compile time.
Utility functions and classes for managing delay cycles.
Wrapper definitions to allow seamless use of PROGMEM in environments that have it.
Backward compatibility header - use fl/fastpin.h directly.
Serial peripheral interface (SPI) definitions per platform.
Data types and constants used by SPI interfaces.
Functions for red, green, blue, white (RGBW) output.
Internal FastLED header for implementation files.
fl::CRGB CRGB
Definition crgb.h:25
fl::u8 calculate_max_brightness_for_power_mW(const CRGB *ledbuffer, fl::u16 numLeds, fl::u8 target_brightness, fl::u32 max_power_mW)
Determines the highest brightness level you can use and still stay under the specified power budget f...
void set_power_model(const PowerModelRGB &model)
Set custom RGB LED power consumption model.
float get_power_scaling_exponent()
Get the current brightness-to-power response exponent.
void set_power_scaling_exponent(float exponent)
Set a non-linear brightness-to-power response exponent.
PowerModelRGB get_power_model()
Get current RGB power model.
Functions to convert from the HSV colorspace to the RGB colorspace.
Determines which platform system definitions to include.
Fast, efficient 8-bit math functions specifically designed for high-performance LED programming.
Centralized logging categories for FastLED hardware interfaces and subsystems.
Unified manager for channel drivers with priority-based fallback.
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
Definition math.h:71
unsigned char u8
Definition stdint.h:131
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
Definition math.h:75
void set_rgbw_colorimetric_profile(const DiodeProfile *profile) FL_NOEXCEPT
Definition rgbw.cpp.hpp:199
const DiodeProfile * get_rgbw_colorimetric_profile() FL_NOEXCEPT
Definition rgbw.cpp.hpp:203
void delay(u32 ms, bool run_async=true) FL_NOEXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
Definition delay.h:98
InputGamut
Definition rgbw.h:77
Bus
Driver identifier for compile-time bus selection.
Definition bus.h:60
@ AUTO
Sentinel: defer to DefaultBus<Chipset>::value.
Definition bus.h:61
constexpr T radians(T deg) FL_NOEXCEPT
Definition math.h:522
ChannelManager & channelManager()
Get the global ChannelManager singleton instance.
void busKeepAlive() FL_NOEXCEPT
Definition bus_traits.h:117
EOrder
RGB color channel orderings, used when instantiating controllers to determine what order the controll...
Definition eorder.h:13
enable_if<!is_integral< T >::value, T >::type round(T value) FL_NOEXCEPT
Definition math.h:319
SpiChipset
LED chipsets with SPI interface (clocked protocols) Modern type-safe enum class - prefer this for new...
@ SM16716
SM16716 LED chipset.
@ LPD6803
LPD6803 LED chipset.
@ APA102HD
APA102 LED chipset with 5-bit gamma correction.
@ HD107
Same as APA102, but in turbo 40-mhz mode.
@ DOTSTARHD
APA102HD LED chipset alias.
@ SK9822HD
SK9822 LED chipset with 5-bit gamma correction.
@ SK9822
SK9822 LED chipset.
@ DOTSTAR
APA102 LED chipset alias.
@ P9813
P9813 LED chipset.
@ APA102
APA102 LED chipset.
@ HD108
16-bit variant of HD107, always gamma corrected. No SD (standard definition) option available - all H...
@ LPD8806
LPD8806 LED chipset.
@ WS2803
WS2803 LED chipset.
@ WS2801
WS2801 LED chipset.
@ HD107HD
Same as APA102HD, but in turbo 40-mhz mode.
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NOEXCEPT
constexpr T degrees(T rad) FL_NOEXCEPT
Definition math.h:527
void set_input_gamut(DiodeProfile *profile, InputGamut g, const float white_xy[2]) FL_NOEXCEPT
Definition rgbw.cpp.hpp:242
Base definition for an LED controller.
Definition crgb.hpp:179
Functions to generate and fill arrays with noise.
Declares classes for managing logical groups of LEDs.
Includes defintions for RGB and HSV pixels.
Determines which platforms headers to include.
Functions to limit the power used by FastLED.
Common RX interfaces and shared types.
#define FL_STATIC_ASSERT(...)
#define FL_NOEXCEPT
SPI LED chipset enumeration.
Portable compile-time assertion wrapper.
static const bool IS_VALID
Definition FastLED.h:934
RGB LED power consumption model Used for standard 3-channel LEDs (WS2812, WS2812B,...
Definition power_mgt.h:27
RGBW LED power consumption model.
Definition power_mgt.h:56
RGBWW LED power consumption model (RGB + Cool White + Warm White)
Definition power_mgt.h:91
Configuration for a single LED channel.
Definition config.h:163
Singleton event router for Channel lifecycle events.
static SpiEncoder spiEncoderForChipset(SpiChipset chipset, u32 speed_hz_override=0) FL_NOEXCEPT
Look up the default SpiEncoder for a given chipset.
Definition spi.h:151
Aggregator header for the fl/ui/ family of per-element UI types.
Unified cross-platform Watchdog Timer API for FastLED.