Creates and registers a Channel-based LED controller with runtime-configurable timing. Returns a shared_ptr handle for later inspection, reconfiguration, or removal. FastLED retains its own reference until remove(channel) is called.
auto channel =
FastLED.add(config);
CFastLED FastLED
Global LED strip management instance.
CRGB * leds() FL_NO_EXCEPT
Get a pointer to led data for the first controller.
void fill_solid(CRGB *targetArray, int numToFill, const CRGB &color) FL_NO_EXCEPT
Fill a range of LEDs with a solid color.
constexpr ChipsetTimingConfig makeTimingConfig() FL_NO_EXCEPT
Convert compile-time CHIPSET type to runtime timing config.
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Configuration for a single LED channel.
825 {
826
827
828
829
830
834
836 const bool spi = config.
getChipset().is<fl::SpiChipsetConfig>();
837 bool served = false;
841 } else {
842
843
846 if (driver && (spi ? driver->getCapabilities().supportsSpi
847 : driver->getCapabilities().supportsClockless)) {
848 served = true;
849 break;
850 }
851 }
852 }
854
855
856
857
858
859
860 const bool bound = spi
863 if (bound) {
866 if (driver && (spi ? driver->getCapabilities().supportsSpi
867 : driver->getCapabilities().supportsClockless)) {
868 served = true;
869 break;
870 }
871 }
872 }
873 }
874 if (!served) {
875 FL_WARN_EVERY(1000,
"FastLED.add(cfg): no channel driver is enabled for bus '"
876 <<
fl::busName(bus) <<
"'. Call FastLED.enable<fl::Bus::"
877 <<
fl::busName(bus) <<
">() before add() to link only that "
878 "driver, or FastLED.enableAllDrivers() to link every driver.");
879 }
882 return channel;
883}
static void add(fl::ChannelPtr channel) FL_NO_EXCEPT
Add a Channel-based LED controller (from ChannelPtr)
static ChannelPtr create(const ChannelConfig &config) FL_NO_EXCEPT
Create a new channel with optional mBus driver pinning.
static ChannelManager & registry() FL_NO_EXCEPT
Get the singleton WITHOUT registering platform default drivers.
fl::shared_ptr< IChannelDriver > findDriverByName(const fl::string &name) const FL_NO_EXCEPT
Silent counterpart to getDriverByName().
fl::span< const DriverInfo > getDriverInfos() const FL_NO_EXCEPT
Get full state of all registered drivers.
bool bind(Bus bus, u8 which) FL_NO_EXCEPT
Bind (register) every node matching bus/which, or every node when bus is Bus::AUTO.
static DriverBindings & instance() FL_NO_EXCEPT
static string from_literal(const char *literal) FL_NO_EXCEPT
#define FL_WARN_EVERY(MILLIS,...)
bool bindDefaultDriver() FL_NO_EXCEPT
Bind the platform default driver for Chipset, if one exists.
const char * busName(Bus b, fl::u8 which=0) FL_NO_EXCEPT
const char * busDriverName(Bus b, fl::u8 which=0, bool spi=false) FL_NO_EXCEPT
Concrete ChannelManager driver name for a portable bus.
Bus
Portable public bus selector.
const ChipsetVariant & getChipset() const FL_NO_EXCEPT
Get the chipset configuration variant.
ChannelOptions options
Optional channel settings (correction, temperature, dither, rgbw, affinity)