4#ifndef __INC_FASTSPI_LED2_H
5#define __INC_FASTSPI_LED2_H
11#include "platforms/is_platform.h"
17#if defined(ARDUINO) && !defined(FL_IS_ESP32)
24#if defined(FL_IS_GCC) || defined(FL_IS_CLANG)
25#define FASTLED_HAS_PRAGMA_MESSAGE
33#define FASTLED_VERSION 3010010
34#ifndef FASTLED_INTERNAL
35# ifdef FASTLED_SHOW_VERSION
36# ifdef FASTLED_HAS_PRAGMA_MESSAGE
37# pragma message "FastLED version 3.010.010"
39# warning FastLED version 3.010.010 (Not really a warning, just telling you here.)
50#if defined(FASTLED_ESP32_I2S) && !defined(FASTLED_INTERNAL)
51#warning "-DFASTLED_ESP32_I2S is removed (FastLED#3526 Phase 2e). Drop the flag; the modern I2S engine is now on Bus::FLEX_IO, 0. Runtime select via FastLED.setExclusiveDriver<fl::Bus::FLEX_IO, 0>()."
66#if (defined(FL_IS_TEENSY_3X) || defined(FL_IS_TEENSY_LC)) && \
67 !defined(FASTLED_INTERNAL) && !defined(FL_TEENSY_EOL_SUPPRESS_WARNING)
68#warning "This Teensy (pre-4.0) is out of production and FastLED no longer hardware-validates it. If you hit a problem, try FastLED 3.10.3, the last release verified against these boards, and please file a report at https://github.com/FastLED/FastLED/issues -- we do still fix these. Define FL_TEENSY_EOL_SUPPRESS_WARNING to silence this."
84#if defined(FL_IS_ESP32)
85#include "platforms/esp/esp_version.h"
86#include "platforms/esp/32/feature_flags/enabled.h"
87#include "platforms/esp/32/esp32_lazy_serial0_main.h"
88#if FASTLED_RMT5 == 0 && FASTLED_ESP32_HAS_RMT && ESP_IDF_VERSION_5_OR_HIGHER
89#error "FASTLED_RMT5=0 (legacy RMT4 backend) is not supported on ESP-IDF 5.x or newer. Remove -DFASTLED_RMT5=0 to use the RMT5 backend, which is the default on this IDF. RMT4 remains available only when building against ESP-IDF 4.x. See https://github.com/FastLED/FastLED/issues/3936"
94#if !defined(FASTLED_FAKE_SPI_FORWARDS_TO_FAKE_CLOCKLESS)
95#if defined(FL_IS_WASM)
96#define FASTLED_FAKE_SPI_FORWARDS_TO_FAKE_CLOCKLESS 1
98#define FASTLED_FAKE_SPI_FORWARDS_TO_FAKE_CLOCKLESS 0
104#if !defined(FASTLED_HAS_CHANNELS)
105#if defined(FL_IS_ESP32) || defined(FL_IS_TEENSY_4X) || \
106 defined(FL_IS_RP) || defined(FL_IS_STM32) || \
107 defined(FL_IS_SAMD) || defined(FL_IS_NRF52)
108#define FASTLED_HAS_CHANNELS 1
110#define FASTLED_HAS_CHANNELS 0
118#if !defined(FASTLED_SPI_USES_CHANNEL_API)
119#if FASTLED_HAS_CHANNELS && (defined(FL_IS_ESP32) || defined(FL_IS_TEENSY_4X) || \
120 defined(FL_IS_RP2040) || defined(FL_IS_RP2350))
121#define FASTLED_SPI_USES_CHANNEL_API 1
123#define FASTLED_SPI_USES_CHANNEL_API 0
127#ifndef __PROG_TYPES_COMPAT__
131#define __PROG_TYPES_COMPAT__
135#include "platforms/wasm/js.h"
136#include "platforms/wasm/led_sysdefs_wasm.h"
137#include "platforms/wasm/compiler/Arduino.h"
138#include "platforms/wasm/js_fetch.h"
143#include <SmartMatrix.h>
149#include <DmxSimple.h>
155#include <DMXSerial.h>
161#include <OctoWS2811.h>
240#include "platforms/default_pins.h"
246#include "platforms/ldf_headers.h"
256#if !defined(FL_IS_TEENSY)
328template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
class PIXIE :
public PixieController<DATA_PIN, RGB_ORDER> {};
331#ifdef FL_CLOCKLESS_CONTROLLER_DEFINED
339template<fl::u8 DATA_PIN>
class NEOPIXEL :
public WS2812Controller800Khz<DATA_PIN, GRB> {};
343template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
344class SM16703 :
public SM16703Controller<DATA_PIN, RGB_ORDER> {};
348template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
349class SM16824E :
public SM16824EController<DATA_PIN, RGB_ORDER> {};
353template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
354class TM1829 :
public TM1829Controller800Khz<DATA_PIN, RGB_ORDER> {};
361template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
362class TX1813N1 :
public TM1829Controller800Khz<DATA_PIN, RGB_ORDER> {};
369template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
370class TM1812 :
public TM1809Controller800Khz<DATA_PIN, RGB_ORDER> {};
374template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
375class TM1809 :
public TM1809Controller800Khz<DATA_PIN, RGB_ORDER> {};
381template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
382class TM1908 :
public TM1908Controller<DATA_PIN, RGB_ORDER> {};
386template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
387class TM1804 :
public TM1809Controller800Khz<DATA_PIN, RGB_ORDER> {};
391template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
392class TM1803 :
public TM1803Controller400Khz<DATA_PIN, RGB_ORDER> {};
396template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
397class UCS1903 :
public UCS1903Controller400Khz<DATA_PIN, RGB_ORDER> {};
401template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
402class UCS1903B :
public UCS1903BController800Khz<DATA_PIN, RGB_ORDER> {};
406template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
407class UCS1904 :
public UCS1904Controller800Khz<DATA_PIN, RGB_ORDER> {};
411template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
412class UCS2903 :
public UCS2903Controller<DATA_PIN, RGB_ORDER> {};
416template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
417class UCS7604 :
public UCS7604Controller8bit<DATA_PIN, RGB_ORDER> {};
421template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
422class UCS7604HD :
public UCS7604Controller16bit<DATA_PIN, RGB_ORDER> {};
427template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
428class UCS7604HD_1600 :
public UCS7604Controller16bit1600<DATA_PIN, RGB_ORDER> {};
432template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
433class WS2812 :
public WS2812Controller800Khz<DATA_PIN, RGB_ORDER> {};
436template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
437class WS2815 :
public WS2815Controller<DATA_PIN, RGB_ORDER> {};
440template <fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
441class WS2816 :
public WS2816Controller<DATA_PIN, RGB_ORDER> {};
445template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
446class WS2852 :
public WS2812Controller800Khz<DATA_PIN, RGB_ORDER> {};
450template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
451class WS2812B :
public WS2812Controller800Khz<DATA_PIN, RGB_ORDER> {};
458template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
459class OSTW2020C1E :
public OSTW2020C1EController<DATA_PIN, RGB_ORDER> {};
463template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
464class WS2812BMiniV3 :
public WS2812BMiniV3Controller<DATA_PIN, RGB_ORDER> {};
468template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
469class WS2812BV5 :
public WS2812BV5Controller<DATA_PIN, RGB_ORDER> {};
477template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
478class GS1903 :
public GS1903Controller<DATA_PIN, RGB_ORDER> {};
482template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
483class SK6812 :
public SK6812Controller<DATA_PIN, RGB_ORDER> {};
489template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
490class LC8816E :
public LC8816EController<DATA_PIN, RGB_ORDER> {};
501template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
502class SK6812WWA :
public SK6812Controller<DATA_PIN, RGB_ORDER> {};
506template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
507class SK6822 :
public SK6822Controller<DATA_PIN, RGB_ORDER> {};
511template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
512class APA106 :
public SK6822Controller<DATA_PIN, RGB_ORDER> {};
516template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
517class PL9823 :
public PL9823Controller<DATA_PIN, RGB_ORDER> {};
521template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
522class WS2811 :
public WS2811Controller800Khz<DATA_PIN, RGB_ORDER> {};
526template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
527class WS2813 :
public WS2813Controller<DATA_PIN, RGB_ORDER> {};
534template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
535class WS2814 :
public WS2814Controller<DATA_PIN, RGB_ORDER> {};
542template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
543class WS2818 :
public WS2818Controller<DATA_PIN, RGB_ORDER> {};
547template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
548class APA104 :
public WS2811Controller800Khz<DATA_PIN, RGB_ORDER> {};
552template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
553class WS2811_400 :
public WS2811Controller400Khz<DATA_PIN, RGB_ORDER> {};
557template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
558class GE8822 :
public GE8822Controller800Khz<DATA_PIN, RGB_ORDER> {};
562template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
563class GW6205 :
public GW6205Controller800Khz<DATA_PIN, RGB_ORDER> {};
567template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
568class GW6205_400 :
public GW6205Controller400Khz<DATA_PIN, RGB_ORDER> {};
572template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
573class LPD1886 :
public LPD1886Controller1250Khz<DATA_PIN, RGB_ORDER> {};
577template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
578class LPD1886_8BIT :
public LPD1886Controller1250Khz_8bit<DATA_PIN, RGB_ORDER> {};
581template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
582class UCS1912 :
public UCS1912Controller<DATA_PIN, RGB_ORDER> {};
584#if defined(DmxSimple_h) || defined(FASTLED_DOXYGEN)
586template<fl::u8 DATA_PIN, fl::EOrder RGB_ORDER>
class DMXSIMPLE :
public DMXSimpleController<DATA_PIN, RGB_ORDER> {};
588#if defined(DmxSerial_h) || defined(FASTLED_DOXYGEN)
599#ifdef PORTA_FIRST_PIN
606#ifdef PORTB_FIRST_PIN
613#ifdef PORTC_FIRST_PIN
620#ifdef PORTD_FIRST_PIN
675 return static_cast<ClearFlags>(
static_cast<fl::u32
>(a) |
static_cast<fl::u32
>(b));
680 return static_cast<ClearFlags>(
static_cast<fl::u32
>(a) &
static_cast<fl::u32
>(b));
714#define FL_DITHER_ENABLE_MIN_REFRESH_HZ 100
852 template<
fl::Bus B, typename Chipset =
fl::ClocklessChipset,
fl::
u8 Which = 0>
855 if (channel !=
nullptr)
add(channel);
861 template<fl::Bus B,
typename Chipset, fl::u8 Which = 0>
864 if (channel !=
nullptr)
add(channel);
868 template<fl::ProfileId Profile>
870 fl::ChannelPtr channel = fl::Channel::create<Profile>(config);
871 if (channel !=
nullptr)
add(channel);
1041 template<
fl::Bus B, typename Chipset =
fl::ClocklessChipset,
fl::
u8 Which = 0>
1089 template<
template<fl::u8, fl::u8, fl::u8>
class CHIPSET,
1120 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN>
1128 #define _FL_MAP_CLOCKED_CHIPSET(CHIPSET_ENUM, CONTROLLER_CLASS) \
1129 template<fl::u8 DATA_PIN, fl::u8 CLOCK_PIN> \
1130 struct ClockedChipsetHelper<CHIPSET_ENUM, DATA_PIN, CLOCK_PIN> { \
1131 static const bool IS_VALID = true; \
1132 typedef CONTROLLER_CLASS<DATA_PIN, CLOCK_PIN> ControllerType; \
1134 template<fl::EOrder RGB_ORDER> \
1135 struct CONTROLLER_CLASS_WITH_ORDER { \
1136 typedef CONTROLLER_CLASS<DATA_PIN, CLOCK_PIN, RGB_ORDER> ControllerType; \
1139 template<fl::EOrder RGB_ORDER, fl::u32 FREQ> \
1140 struct CONTROLLER_CLASS_WITH_ORDER_AND_FREQ { \
1141 typedef CONTROLLER_CLASS<DATA_PIN, CLOCK_PIN, RGB_ORDER, FREQ> ControllerType; \
1172 #if FASTLED_FAKE_SPI_FORWARDS_TO_FAKE_CLOCKLESS
1176 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) {
1183 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) {
1190 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1223 return addLeds(&sCtrl, data, nLedsOrOffset, nLedsIfOffset);
1234 static bool sRegistered =
false;
1239 return addLeds(&sCtrl, data, nLedsOrOffset, nLedsIfOffset);
1245#if defined(FL_IS_ESP32)
1247 fl::platforms::registerNativeSpiDriver();
1259 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, fl::u8 B_WHICH = 0>
1265 return addLedsSpiDispatch<CHIPSET, DATA_PIN, CLOCK_PIN, SPI_DATA_RATE, 0, RGB_ORDER, B, B_WHICH>(data, nLedsOrOffset, nLedsIfOffset, spiCfg, UseSlim());
1269 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, fl::u8 B_WHICH = 0>
1276 return addLedsSpiDispatch<CHIPSET, DATA_PIN, CLOCK_PIN, SPI_DATA_RATE, 1, RGB_ORDER, B, B_WHICH>(data, nLeds, 0, spiCfg, UseSlim());
1280 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::Bus B = fl::Bus::AUTO, fl::u8 B_WHICH = 0>
1290 return addLedsSpiDispatch<CHIPSET, DATA_PIN, CLOCK_PIN, 0, 2, order, B, B_WHICH>(data, nLedsOrOffset, nLedsIfOffset, spiCfg, UseSlim());
1294 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO, fl::u8 B_WHICH = 0>
1300 return addLedsSpiDispatch<CHIPSET, DATA_PIN, CLOCK_PIN, 0, 3, RGB_ORDER, B, B_WHICH>(data, nLedsOrOffset, nLedsIfOffset, spiCfg, UseSlim());
1303 #if FASTLED_FAKE_SPI_FORWARDS_TO_FAKE_CLOCKLESS
1305 #elif FASTLED_SPI_USES_CHANNEL_API
1308 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, fl::u8 B_WHICH = 0>
1314 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, fl::u8 B_WHICH = 0>
1320 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::Bus B = fl::Bus::AUTO, fl::u8 B_WHICH = 0>
1321 static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0) {
1326 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO, fl::u8 B_WHICH = 0>
1334 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)
FL_NO_EXCEPT {
1339 typedef typename CHIP::template CONTROLLER_CLASS_WITH_ORDER_AND_FREQ<RGB_ORDER, SPI_DATA_RATE>::ControllerType ControllerTypeWithFreq;
1340 static ControllerTypeWithFreq c;
1341 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1346 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>
1351 typedef typename CHIP::template CONTROLLER_CLASS_WITH_ORDER_AND_FREQ<RGB_ORDER, SPI_DATA_RATE>::ControllerType ControllerTypeWithFreq;
1352 static ControllerTypeWithFreq c;
1353 c.setSpiBus(spiBus);
1354 return addLeds(&c, data, nLeds, 0);
1358 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)
FL_NO_EXCEPT {
1362 typedef typename CHIP::ControllerType ControllerType;
1363 static ControllerType c;
1364 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1368 template<ESPIChipsets CHIPSET, fl::u8 DATA_PIN, fl::u8 CLOCK_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1373 typedef typename CHIP::template CONTROLLER_CLASS_WITH_ORDER<RGB_ORDER>::ControllerType ControllerTypeWithOrder;
1374 static ControllerTypeWithOrder c;
1375 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1381 template<ESPIChipsets CHIPSET, fl::Bus B = fl::Bus::AUTO> static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0) {
1385 template<ESPIChipsets CHIPSET, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO> static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0) {
1389 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) {
1396#ifdef FL_CLOCKLESS_CONTROLLER_DEFINED
1400 template<
typename ControllerType>
1401 static inline ::CLEDController& addLedsImpl(ControllerType*
controller,
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset)
FL_NO_EXCEPT {
1403 return addLeds(pLed, data, nLedsOrOffset, nLedsIfOffset);
1430 using Controller =
typename fl::detail::ClocklessBusController<CHIPSET<DATA_PIN, RGB_ORDER>,
B>::type;
1431 static Controller c;
1432 return addLedsImpl(&c, data, nLedsOrOffset, nLedsIfOffset);
1439 using Controller =
typename fl::detail::ClocklessBusController<CHIPSET<DATA_PIN, RGB>,
B>::type;
1440 static Controller c;
1441 return addLedsImpl(&c, data, nLedsOrOffset, nLedsIfOffset);
1448 using Controller =
typename fl::detail::ClocklessBusController<CHIPSET<DATA_PIN>,
B>::type;
1449 static Controller c;
1450 return addLedsImpl(&c, data, nLedsOrOffset, nLedsIfOffset);
1459#if defined(__FASTLED_HAS_FIBCC) && (__FASTLED_HAS_FIBCC == 1)
1461 static ::CLEDController &
addLeds(
CRGB *data,
int nLeds) {
1463 static fl::__FIBCC<CHIPSET, DATA_PIN, NUM_LANES, RGB_ORDER> c;
1464 return addLeds(&c, data, nLeds);
1468 #ifdef FASTSPI_USE_DMX_SIMPLE
1469 template<EClocklessChipsets CHIPSET, fl::u8 DATA_PIN, fl::EOrder RGB_ORDER=RGB, fl::Bus B = fl::Bus::AUTO>
1470 static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0)
1507 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1515 return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
1518#ifdef USE_OCTOWS2811
1522 template<OWS2811 CHIPSET, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1523 static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0)
1538 template<OWS2811 CHIPSET, fl::Bus B = fl::Bus::AUTO>
1539 static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0)
1546#ifdef USE_WS2812SERIAL
1550 template<SWS2812 CHIPSET,
int DATA_PIN, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1551 static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0)
1554 static CWS2812SerialController<DATA_PIN,RGB_ORDER>
controller;
1562 template<ESM CHIPSET, fl::Bus B = fl::Bus::AUTO>
1563 static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0)
1574#ifdef FASTLED_HAS_BLOCKLESS
1598 template<EBlockChipsets CHIPSET,
int NUM_LANES, fl::EOrder RGB_ORDER, fl::Bus B = fl::Bus::AUTO>
1599 static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0) {
1602 #ifdef PORTA_FIRST_PIN
1603 case WS2811_PORTA:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1604 case WS2811_400_PORTA:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1605 case WS2813_PORTA:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset);
1606 case TM1803_PORTA:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1607 case UCS1903_PORTA:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTA_FIRST_PIN, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1609 #ifdef PORTB_FIRST_PIN
1610 case WS2811_PORTB:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1611 case WS2811_400_PORTB:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1612 case WS2813_PORTB:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset);
1613 case TM1803_PORTB:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1614 case UCS1903_PORTB:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTB_FIRST_PIN, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1616 #ifdef PORTC_FIRST_PIN
1617 case WS2811_PORTC:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1618 case WS2811_400_PORTC:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1619 case WS2813_PORTC:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset);
1620 case TM1803_PORTC:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1621 case UCS1903_PORTC:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTC_FIRST_PIN, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1623 #ifdef PORTD_FIRST_PIN
1624 case WS2811_PORTD:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1625 case WS2811_400_PORTD:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1626 case WS2813_PORTD:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset);
1627 case TM1803_PORTD:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1628 case UCS1903_PORTD:
return addLeds(
new fl::InlineBlockClocklessController<NUM_LANES, PORTD_FIRST_PIN, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1631 case WS2811_PORTDC:
return addLeds(
new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_WS2811_800KHZ_LEGACY, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1632 case WS2811_400_PORTDC:
return addLeds(
new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_WS2811_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1633 case WS2813_PORTDC:
return addLeds(
new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_WS2813, RGB_ORDER, 0, false>(), data, nLedsOrOffset, nLedsIfOffset);
1634 case TM1803_PORTDC:
return addLeds(
new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_TM1803_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1635 case UCS1903_PORTDC:
return addLeds(
new fl::SixteenWayInlineBlockClocklessController<NUM_LANES, fl::TIMING_UCS1903_400KHZ, RGB_ORDER>(), data, nLedsOrOffset, nLedsIfOffset);
1641 template<EBlockChipsets CHIPSET,
int NUM_LANES, fl::Bus B = fl::Bus::AUTO>
1642 static ::CLEDController &
addLeds(
CRGB *data,
int nLedsOrOffset,
int nLedsIfOffset = 0) {
1692 template<fl::Bus B, fl::u8 Which = 0>
1748#if FL_COLOR_PIPELINE_SHARED
1749 fl::activeFramePowerDispatch() = fl::framePowerDispatch();
1750 mPPowerFunc = fl::activeFramePowerDispatch()->showBrightness;
2083#define FastSPI_LED FastLED
2085#define FastSPI_LED2 FastLED
2097#ifndef HAS_HARDWARE_PIN_SUPPORT
2098#warning "No pin/port mappings found, pin access will be slightly slower. See fastpin.h for info."
2099#define NO_HARDWARE_PIN_SUPPORT
2108#if !defined(FASTLED_INTERNAL) && !defined(FASTLED_LEAN_AND_MEAN)
2124#if defined(FL_INCLUDE_REMOTE)
2166#if defined(FASTLED_STUB_IMPL)
2178#define FASTLED_TITLE(text) fl::UITitle g_title(text)
2179#define FASTLED_DESCRIPTION(text) fl::UIDescription g_description(text)
2180#define FASTLED_HELP(text) fl::UIHelp g_help(text)
2211#ifndef FASTLED_LOOP_RUNS_ASYNC
2212#define FASTLED_LOOP_RUNS_ASYNC 0
2215#if FASTLED_LOOP_RUNS_ASYNC == 1
2220 void loop() { sketch_loop(); fl::task::run(); } \
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
ClearFlags operator&(ClearFlags a, ClearFlags b) FL_NO_EXCEPT
Enable bitwise AND for ClearFlags.
#define _FL_MAP_CLOCKED_CHIPSET(CHIPSET_ENUM, CONTROLLER_CLASS)
ClearFlags
Flags for FastLED.clear() to control what state gets cleared/reset.
@ CHANNELS
Remove all channels from controller list.
@ CHANNEL_ENGINES
Clear all channel drivers from ChannelManager.
@ POWER_SETTINGS
Reset power management (setMaxPowerInMilliWatts)
@ FPS_COUNTER
Reset FPS tracking counter to 0.
@ NONE
Clear nothing (no-op)
@ REFRESH_RATE
Reset refresh rate limiting to unlimited.
ClearFlags & operator|=(ClearFlags &a, ClearFlags b) FL_NO_EXCEPT
Enable bitwise OR assignment for ClearFlags.
ClearFlags operator|(ClearFlags a, ClearFlags b) FL_NO_EXCEPT
Enable bitwise OR for ClearFlags.
SWS2812
WS2812Serial Library controller type.
OWS2811
Octo WS2811 LED Library controller types.
ESPIChipsets
Backwards compatibility enum - allows old code to use unscoped names (e.g., APA102 instead of fl::Spi...
@ APA102HD
APA102 LED chipset with 5-bit gamma correction.
@ P9813
P9813 LED chipset.
@ SK9822HD
SK9822 LED chipset with 5-bit gamma correction.
@ SK9822
SK9822 LED chipset.
@ MY9221
MY9221 12-channel LED driver (dual-edge clocked; 4 RGB LEDs per chip)
@ WS2803
WS2803 LED chipset.
@ HD107
Same as APA102, but in turbo 40-mhz mode.
@ HD107S
Marketed HD107S part name; alias of HD107.
@ WS2801
WS2801 LED chipset.
@ DOTSTAR
APA102 LED chipset alias.
@ APA102
APA102 LED chipset.
@ LPD8806
LPD8806 LED chipset.
@ HD107HD
Same as APA102HD, but in turbo 40-mhz mode.
@ LPD6803
LPD6803 LED chipset.
@ DOTSTARHD
APA102HD LED chipset alias.
@ SM16716
SM16716 LED chipset.
@ HD108
16-bit variant of HD107, always gamma corrected. No SD (standard definition) option available - all H...
ESM
Smart Matrix Library controller type.
EBlockChipsets
Blockless output port enum.
fl::u8(* power_func)(fl::u8 scale, fl::u32 data)
Typedef for a power consumption calculation function.
CLEDController * controller
fl::UISlider scale("Scale", 4,.1, 4,.1)
Three-pin PWM controller for non-addressable RGB LEDs and strips.
Functions for doing a rotation of bits/bytes used by parallel output.
Portable compile-time identifiers for LED channel buses.
Portable bus/device introspection.
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.
void clear(bool writeData=false) FL_NO_EXCEPT
Clear the leds, wiping the local array of data.
power_func mPPowerFunc
function for overriding brightness when using FastLED.show();
_FL_MAP_CLOCKED_CHIPSET(LPD6803, LPD6803Controller) _FL_MAP_CLOCKED_CHIPSET(LPD8806
fl::u8 getBrightness() FL_NO_EXCEPT
Get the current global brightness setting.
fl::u8 getHdFieldFloor() const FL_NO_EXCEPT
void setExclusiveDriver() FL_NO_EXCEPT
Register a single driver at a priority above the platform default (compile-time TU-linking variant).
void setCorrection(const CRGB &correction) FL_NO_EXCEPT
Set a global color correction.
float getPowerScalingExponent() const FL_NO_EXCEPT
Get the configured brightness-to-power response exponent.
void setPowerModel(const PowerModelRGBW &model) FL_NO_EXCEPT
static void _setWaitSpinBudgetUs(fl::u32 budget_us) FL_NO_EXCEPT
static void add(fl::ChannelPtr channel) FL_NO_EXCEPT
Add a Channel-based LED controller (from ChannelPtr)
void show() FL_NO_EXCEPT
Update all our controllers with the current led colors.
void setDriverEnabled(const char *name, bool enabled) FL_NO_EXCEPT
Enable or disable a channel driver by name at runtime.
static void registerExplicitSpiHost(const fl::SpiChipsetConfig &spiCfg, fl::true_type) FL_NO_EXCEPT
static void registerExplicitSpiHost(const fl::SpiChipsetConfig &spiCfg, fl::false_type) FL_NO_EXCEPT
CFastLED & enable() FL_NO_EXCEPT
Enable one bus for the runtime FastLED.add(cfg) path.
static fl::ChannelEvents & channelEvents() FL_NO_EXCEPT
Access the channel event system.
void countFPS(int nFrames=25) FL_NO_EXCEPT
For debugging, this will keep track of time between calls to countFPS().
bool colorManagementStrict() const FL_NO_EXCEPT
void onEndShowLeds() FL_NO_EXCEPT
Manually trigger the end show LEDs event.
fl::u32 getWaitSpinBudgetUs() const FL_NO_EXCEPT
Get the current tiered-wait spin budget (microseconds).
::CLEDController & addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
Add a 3rd party library based CLEDController instance to the world.
void setWaitSpinBudgetUs(fl::u32 budget_us) FL_NO_EXCEPT
Override the channel-manager tiered-wait spin budget (microseconds).
static fl::u32 _getWaitSpinBudgetUs() FL_NO_EXCEPT
static fl::Watchdog & watchdog() FL_NO_EXCEPT
Access the unified cross-platform watchdog timer.
static void remove(fl::ChannelPtr channel) FL_NO_EXCEPT
Remove a channel from the LED controller list.
int size() FL_NO_EXCEPT
Get the number of leds in the first controller.
void setMaxPowerInMilliWatts(fl::u32 milliwatts) FL_NO_EXCEPT
Set the maximum power to be used, given in milliwatts.
::CLEDController & addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
Add an SPI based CLEDController instance to the world (legacy path).
void setBrightness(fl::u8 scale) FL_NO_EXCEPT
Set the global brightness scaling.
void setMaxPowerInVoltsAndMilliamps(fl::u8 volts, fl::u32 milliamps) FL_NO_EXCEPT
Set the maximum power to be used, given in volts and milliamps.
::CLEDController & addLedsSpiDispatch(CRGB *data, int nLedsOrOffset, int nLedsIfOffset, const fl::SpiChipsetConfig &spiCfg, fl::false_type) FL_NO_EXCEPT
void clearData() FL_NO_EXCEPT
Clear out the local data array.
::CLEDController & addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
void setDither(fl::u8 ditherMode=BINARY_DITHER) FL_NO_EXCEPT
Set the dithering mode.
::CLEDController & addLeds(CRGB *data, int nLeds, fl::Esp32SpiBus spiBus) FL_NO_EXCEPT
Add an SPI controller on a selected ESP-IDF host.
const fl::DiodeProfile * getRgbwColorimetricProfile() const FL_NO_EXCEPT
Currently active RGBW colorimetric profile (defaults to &fl::kRgbwDefaultProfile).
fl::u16 getFPS() FL_NO_EXCEPT
Get the number of frames/second being written out.
fl::u8 getLastShowBrightness() const FL_NO_EXCEPT
Brightness the most recent show() / showColor() actually applied, after the power limiter set by setM...
static fl::vector< fl::ChannelPtr > & channels() FL_NO_EXCEPT
stored ChannelPtrs to keep them alive
LPD8806Controller WS2803Controller MY9221Controller APA102Controller APA102ControllerHD APA102Controller HD108Controller SK9822ControllerHD ::CLEDController & addLedsSpiDispatch(CRGB *data, int nLedsOrOffset, int nLedsIfOffset, const fl::SpiChipsetConfig &spiCfg, fl::true_type) FL_NO_EXCEPT
void setMcuPowerMilliWatts(fl::u16 mcu_mW) FL_NO_EXCEPT
void onBeginFrame() FL_NO_EXCEPT
Manually trigger the begin frame event.
void showColor(const CRGB &color, fl::u8 scale) FL_NO_EXCEPT
Set all leds on all controllers to the given color/scale.
void setColorManagementStrict(bool strict) FL_NO_EXCEPT
In strict mode a channel that requests color management without an emitter profile reports a rejected...
void wait() FL_NO_EXCEPT
Wait for all channel bus transmissions to complete.
fl::u8 mScale
the current global brightness scale setting
static fl::ChannelPtr add(const fl::ChannelConfigOf< Chipset > &config) FL_NO_EXCEPT
Add a typed configuration, deducing its chipset family.
void onEndFrame() FL_NO_EXCEPT
bool isPowerLimited() const FL_NO_EXCEPT
True if the power limiter lowered the brightness of the most recent show() / showColor() below what i...
CRGB * leds() FL_NO_EXCEPT
Get a pointer to led data for the first controller.
::CLEDController & addLedsSpiChannel(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
Add an SPI based CLEDController via Channel API (default RGB order and speed).
void showColor(const CRGB &color) FL_NO_EXCEPT
Set all leds on all controllers to the given color.
static ::CLEDController & addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
Add an SPI based CLEDController instance to the world (legacy path).
void setPowerModel(const PowerModelRGB &model) FL_NO_EXCEPT
void delay(unsigned long ms) FL_NO_EXCEPT
Delay for the given number of milliseconds.
static fl::RxChannelPtr addRx(const fl::RxChannelConfig &config) FL_NO_EXCEPT
Add an RX channel with runtime configuration.
void setRgbwColorimetricProfile(const fl::DiodeProfile *profile) FL_NO_EXCEPT
Install a legacy fallback RGBW diode chromaticity profile for scalar colorimetric calls.
void setDefaultSourceProfile(const fl::SourceProfile &profile) FL_NO_EXCEPT
fl::u32 mNPowerData
max power use parameter
fl::u16 mNFPS
tracking for current frames per second (FPS) value
void setMaxRefreshRate(fl::u16 refresh, bool constrain=false) FL_NO_EXCEPT
Set the maximum refresh rate.
void init() FL_NO_EXCEPT
Initialize platform-specific subsystems.
fl::u8 mLastShownScale
brightness the last show()/showColor() applied, after the power limiter
::CLEDController & addLedsSpiChannel(CRGB *data, int nLeds, fl::Esp32SpiBus spiBus) FL_NO_EXCEPT
Add an SPI controller with an explicit ESP-IDF SPI host.
void addListener(fl::EngineEvents::Listener *listener) FL_NO_EXCEPT
::CLEDController & addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a OCTOWS2811 based CLEDController instance to the world.
static fl::ChannelPtr add(const fl::ChannelConfig &config) FL_NO_EXCEPT
void setTemperature(const CRGB &temp) FL_NO_EXCEPT
Set a global color temperature.
int count() FL_NO_EXCEPT
Get how many controllers have been registered.
fl::u8 mLastRequestedScale
brightness the last show()/showColor() was asked for
::CLEDController & addLedsSpiChannel(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
Add an SPI based CLEDController via Channel API (default speed).
::CLEDController & addLedsSpiChannel(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
Add an SPI based CLEDController via Channel API.
const fl::SourceProfile & defaultSourceProfile() const FL_NO_EXCEPT
::CLEDController & addLeds(::CLEDController *pLed, CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
Add a CLEDController instance to the world.
void setPowerModel(const PowerModelRGBWW &model) FL_NO_EXCEPT
::CLEDController & addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
Add an SPI based CLEDController instance to the world (legacy path).
::CLEDController & addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a WS2812Serial library based CLEDController instance to the world.
fl::span< const fl::DriverInfo > getDriverInfos() const FL_NO_EXCEPT
Get full state of all registered channel drivers.
void setPowerScalingExponent(float exponent) FL_NO_EXCEPT
Set a non-linear brightness-to-power response exponent.
fl::u16 getMcuPowerMilliWatts() const FL_NO_EXCEPT
bool isDriverEnabled(const char *name) const FL_NO_EXCEPT
Check if a driver is enabled by name.
fl::u32 getEstimatedPowerInMilliWatts(bool apply_limiter=true) const FL_NO_EXCEPT
Get estimated power consumption in milliwatts.
void setHdFieldFloor(fl::u8 min_field) FL_NO_EXCEPT
Lowest 5-bit current field the colour-managed APA102-HD path may use (B1's flicker floor,...
fl::size getDriverCount() const FL_NO_EXCEPT
Get count of registered channel drivers.
::CLEDController & addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0) FL_NO_EXCEPT
Add a 3rd party library based CLEDController instance to the world.
::CLEDController & addLeds(CRGB *data, int nLedsOrOffset, int nLedsIfOffset=0)
Add a OCTOWS2811 library based CLEDController instance to the world.
PowerModelRGB getPowerModel() const FL_NO_EXCEPT
Get current RGB power model.
void removeListener(fl::EngineEvents::Listener *listener) FL_NO_EXCEPT
static void enableAllDrivers() FL_NO_EXCEPT
Enroll every channel driver available on this platform with ChannelManager.
fl::u16 mMaxRefreshHz
frame-rate cap in Hz, 0 = unlimited (u16 saves 2 B over micros, #4788)
and refresh rates, and provides access functions for driving led data to controllers via the show() /...
DMX512 based LED controller class, using the DMXSerial library.
DMX512 based LED controller class, using the DmxSimple library.
LPD6803 controller class (LPD1101).
LPD8806 controller class.
SM16716 controller class.
void setExclusiveDriver() FL_NO_EXCEPT
Register a single driver at a priority above the platform default and disable all others (compile-tim...
static void removeListener(Listener *listener) FL_NO_EXCEPT
static void addListener(Listener *listener, int priority=0) FL_NO_EXCEPT
Shared legacy addLeds<ESPIChipsets ...>() bridge controller over an IChannelDriver,...
static ChannelPtr create(const ChannelConfigOf< Chipset > &cfg) FL_NO_EXCEPT
Construct a runtime Channel from a typed configuration.
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)
FastLED dynamic library interface - lightweight header for external callers.
Defines the DMX512-based LED controllers.
Opt-in, link-on-use channel driver bindings for FastLED.add(cfg).
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.
Public color namespace facade for RGBW colorimetric profile APIs.
Functions for red, green, blue, white (RGBW) output.
Internal FastLED header for implementation files.
fl::u8 calculate_max_brightness_for_power_mW(const CRGB *ledbuffer, fl::u16 numLeds, fl::u8 target_brightness, fl::u32 max_power_mW) FL_NO_EXCEPT
Determines the highest brightness level you can use and still stay under the specified power budget f...
void set_power_scaling_exponent(float exponent) FL_NO_EXCEPT
Set a non-linear brightness-to-power response exponent.
PowerModelRGB get_power_model() FL_NO_EXCEPT
Get current RGB power model.
void set_power_model(const PowerModelRGB &model) FL_NO_EXCEPT
Set custom RGB LED power consumption model.
fl::u16 get_mcu_power_mW() FL_NO_EXCEPT
The MCU baseline currently charged, in milliwatts.
float get_power_scaling_exponent() FL_NO_EXCEPT
Get the current brightness-to-power response exponent.
void set_mcu_power_mW(fl::u16 mcu_mW) FL_NO_EXCEPT
Override the MCU board's undimmable baseline draw, in milliwatts.
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.
bool & colorProfileStrictMode() FL_NO_EXCEPT
SourceProfile & defaultSourceProfile() FL_NO_EXCEPT
Esp32SpiBus
ESP-IDF SPI host selection for an individual clocked LED controller.
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
void delay(u32 ms, bool run_async=true) FL_NO_EXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
ChannelManager & channelManager() FL_NO_EXCEPT
Get the global ChannelManager singleton instance.
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
integral_constant< bool, false > false_type
enable_if<!is_integral< T >::value, T >::type round(T value) FL_NO_EXCEPT
void busKeepAlive() FL_NO_EXCEPT
Bus
Portable public bus selector.
const DiodeProfile * get_rgbw_colorimetric_profile() FL_NO_EXCEPT
void set_rgbw_colorimetric_profile(const DiodeProfile *profile) FL_NO_EXCEPT
EOrder
RGB color channel orderings, used when instantiating controllers to determine what order the controll...
PowerCodecPolicy powerChannelCodecPolicy(const CLEDController &controller) FL_NO_EXCEPT
Identify the channel's final current/quantization choice without adding a virtual slot or storage to ...
constexpr T degrees(T rad) FL_NO_EXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NO_EXCEPT
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.
@ HD107S
Marketed HD107S part name; protocol-compatible alias of HD107.
@ 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.
@ MY9221
MY9221 12-channel LED driver (dual-edge clocked; 4 RGB LEDs per chip)
@ WS2801
WS2801 LED chipset.
@ HD107HD
Same as APA102HD, but in turbo 40-mhz mode.
integral_constant< bool, true > true_type
constexpr T radians(T deg) FL_NO_EXCEPT
void bindDriver() FL_NO_EXCEPT
Enable one bus for FastLED.add(cfg).
Base definition for an LED controller.
Functions to generate and fill arrays with noise.
Declares classes for managing logical groups of LEDs.
Includes defintions for RGB and HSV pixels.
Functions to limit the power used by FastLED.
Common RX interfaces and shared types.
#define FL_STATIC_ASSERT(...)
Shared "slim bridge" legacy addLeds<ESPIChipsets ...>() controller for the SPI channel API – driver-a...
SPI LED chipset enumeration.
Portable compile-time assertion wrapper.
static const bool IS_VALID
RGB LED power consumption model Used for standard 3-channel LEDs (WS2812, WS2812B,...
RGBW LED power consumption model Used for 4-channel LEDs (SK6812 RGBW and similar).
RGBWW LED power consumption model (RGB + warm white + cool white).
Configuration for a single LED channel.
Strongly-typed channel configuration with compile-time chipset family.
Singleton event router for Channel lifecycle events.
A source declaration, not a container or an output-device selection.
SPI chipset configuration (data + clock pins)
static SpiEncoder spiEncoderForChipset(SpiChipset chipset, u32 speed_hz_override=0) FL_NO_EXCEPT
Look up the default SpiEncoder for a given chipset.
SPI encoder configuration for LED protocols.
Aggregator header for the fl/ui/ family of per-element UI types.
Unified cross-platform Watchdog Timer API for FastLED.