FastLED 3.9.15
Loading...
Searching...
No Matches
fl::ChannelConfigOf< Chipset > Struct Template Reference

Detailed Description

template<typename Chipset>
struct fl::ChannelConfigOf< Chipset >

Strongly-typed channel configuration with compile-time chipset family.

ChannelConfigOf<Chipset> is the Phase 3b (issue #2428) templated form of ChannelConfig. It carries the same payload as a ChannelConfig but encodes the chipset family (ClocklessChipset or SpiChipsetConfig) as a template parameter so that FastLED.add<Bus, Chipset>(cfg) can:

  • Deduce Chipset from the configuration without a runtime variant probe.
  • static_assert that the named Bus supports Chipset at compile time via BusSupports<B, Chipset>.
  • Reject nonsense combinations (e.g. clockless config routed to an SPI-only bus) at compile time rather than at runtime.

Implicit conversions to/from the non-template ChannelConfig preserve backward compatibility – existing Channel::create(cfg) callers and the non-template FastLED.add(cfg) overloads continue to work unchanged.

Template Parameters
ChipsetOne of fl::ClocklessChipset or fl::SpiChipsetConfig.

Definition at line 303 of file config.h.

#include <config.h>

+ Collaboration diagram for fl::ChannelConfigOf< Chipset >:

Public Member Functions

 ChannelConfigOf (const Chipset &chipset, fl::span< CRGB > leds, EOrder rgbOrder=RGB, const ChannelOptions &options=ChannelOptions()) FL_NOEXCEPT
 Construct from a typed chipset, LEDs span, and optional metadata.
 
 ChannelConfigOf (const fl::string &name, const Chipset &chipset, fl::span< CRGB > leds, EOrder rgbOrder=RGB, const ChannelOptions &options=ChannelOptions()) FL_NOEXCEPT
 Named-channel constructor.
 
 operator ChannelConfig () const FL_NOEXCEPT
 Implicit conversion to the type-erased ChannelConfig so the existing non-template Channel::create() factory accepts a templated config without any per-call-site change.
 
ChannelConfig toErased () const FL_NOEXCEPT
 Convenience: build the erased form by value (handy in templates where the implicit conversion is suppressed by overload rules).
 

Public Attributes

Chipset chipset
 Typed chipset configuration.
 
fl::span< CRGBmLeds
 LED data span.
 
fl::optional< fl::stringmName
 Optional user-specified name. If unset, Channel auto-generates one.
 
fl::ScreenMap mScreenMap
 Screen mapping (for JS canvas visualization).
 
ChannelOptions options
 Optional channel settings (correction, temperature, dither, rgbw, affinity).
 
EOrder rgb_order = RGB
 RGB channel ordering.
 

The documentation for this struct was generated from the following file: