64 return pin == other.pin &&
71 return !(*
this == other);
93template <
typename TIMING>
129 return dataPin == other.dataPin &&
136 return !(*
this == other);
205 template<
typename TIMING>
302template<
typename Chipset>
322 if (
mName.has_value()) {
Runtime chipset timing configuration for clockless LED drivers.
SPI encoder configuration for clocked LED chipsets.
Encoding pipeline selector for clockless LED chipsets.
Declares dithering options and types.
Functions for red, green, blue, white (RGBW) output.
ClocklessEncoder
Identifies which encoder to use for clockless chipsets in the Channel API.
@ CLOCKLESS_ENCODER_WS2812
Default, no preamble (WS2812 and compatible)
constexpr T * begin(T(&array)[N]) FL_NOEXCEPT
MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > > map
constexpr ClocklessChipset makeClockless(int pin) FL_NOEXCEPT
Build a ClocklessChipset from a compile-time TIMING trait.
constexpr T * end(T(&array)[N]) FL_NOEXCEPT
constexpr ChipsetTimingConfig makeTimingConfig() FL_NOEXCEPT
Convert compile-time CHIPSET type to runtime timing config.
fl::variant< ClocklessChipset, SpiChipsetConfig > ChipsetVariant
EOrder
RGB color channel orderings, used when instantiating controllers to determine what order the controll...
@ RGB
Red, Green, Blue (0012)
constexpr ClocklessEncoder encoder_for() FL_NOEXCEPT
Extract the encoder selector from a compile-time TIMING type.
@ APA102
APA102 LED chipset.
Base definition for an LED controller.
#define FASTLED_SHARED_PTR_STRUCT(type)
const fl::ScreenMap & getScreenMap() const FL_NOEXCEPT
Get screen map for JS canvas visualization.
fl::optional< fl::string > mName
Optional user-specified name (if not set, Channel generates one automatically)
bool isSpi() const FL_NOEXCEPT
Check if this is an SPI chipset.
const ChipsetVariant & getChipset() const FL_NOEXCEPT
Get the chipset configuration variant.
const ClocklessChipset * getClocklessChipset() const FL_NOEXCEPT
Get clockless chipset (returns nullptr if not clockless)
bool hasScreenMap() const FL_NOEXCEPT
Check if screen map is configured.
const SpiChipsetConfig * getSpiChipset() const FL_NOEXCEPT
Get SPI chipset (returns nullptr if not SPI)
int getDataPin() const FL_NOEXCEPT
Get data pin (works for both clockless and SPI)
void setScreenMap(const fl::ScreenMap &map) FL_NOEXCEPT
Set screen map for JS canvas visualization.
fl::ScreenMap mScreenMap
Screen mapping.
ChannelConfig(int pin, fl::span< CRGB > leds, EOrder rgbOrder=RGB, const ChannelOptions &options=ChannelOptions()) FL_NOEXCEPT
Template constructor with TIMING type (backwards compatibility)
ChannelOptions options
Optional channel settings (correction, temperature, dither, rgbw, affinity)
fl::span< CRGB > mLeds
LED data array.
bool isClockless() const FL_NOEXCEPT
Check if this is a clockless chipset.
ChannelConfig(const fl::string &name, const ChipsetVariant &chipset, fl::span< CRGB > leds, EOrder rgbOrder=RGB, const ChannelOptions &options=ChannelOptions()) FL_NOEXCEPT
Named constructor with chipset variant.
ChipsetVariant chipset
Chipset configuration (clockless or SPI)
int getClockPin() const FL_NOEXCEPT
Get clock pin (returns -1 for clockless chipsets)
EOrder rgb_order
RGB channel ordering.
Configuration for a single LED channel.
ChannelConfig toErased() const FL_NOEXCEPT
Convenience: build the erased form by value (handy in templates where the implicit conversion is supp...
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.
fl::ScreenMap mScreenMap
Screen mapping (for JS canvas visualization).
fl::span< CRGB > mLeds
LED data span.
ChannelOptions options
Optional channel settings (correction, temperature, dither, rgbw, affinity).
fl::optional< fl::string > mName
Optional user-specified name. If unset, Channel auto-generates one.
EOrder rgb_order
RGB channel ordering.
Chipset chipset
Typed chipset configuration.
ChannelConfigOf(const fl::string &name, const Chipset &chipset, fl::span< CRGB > leds, EOrder rgbOrder=RGB, const ChannelOptions &options=ChannelOptions()) FL_NOEXCEPT
Named-channel constructor.
Optional channel configuration parameters All fields have sensible defaults and can be overridden as ...
Runtime bit-period timing for a clockless chipset.
bool operator!=(const ClocklessChipset &other) const FL_NOEXCEPT
Inequality operator.
ChipsetTimingConfig timing
T1/T2/T3 timing parameters.
constexpr ClocklessChipset(int pin, const ChipsetTimingConfig &timing, ClocklessEncoder encoder) FL_NOEXCEPT
Constructor with explicit encoder.
ClocklessChipset(const ClocklessChipset &) FL_NOEXCEPT=default
Copy constructor.
constexpr ClocklessChipset(int pin, const ChipsetTimingConfig &timing) FL_NOEXCEPT
Constructor (encoder defaults to WS2812)
ClocklessEncoder encoder
Byte-level encoding pipeline (default: WS2812)
ClocklessChipset(ClocklessChipset &&) FL_NOEXCEPT=default
Move constructor.
constexpr ClocklessChipset() FL_NOEXCEPT
Default constructor.
Clockless chipset configuration (single data pin)
MultiChannelConfig & operator=(const MultiChannelConfig &) FL_NOEXCEPT=default
MultiChannelConfig & operator=(MultiChannelConfig &&) FL_NOEXCEPT=default
fl::vector< ChannelConfigPtr > mChannels
Vector of shared pointers to channel configurations.
MultiChannelConfig() FL_NOEXCEPT=default
MultiChannelConfig(fl::initializer_list< ChannelConfigPtr > channels) FL_NOEXCEPT
MultiChannelConfig & add(ChannelConfigPtr channel) FL_NOEXCEPT
Add a channel configuration to the multi-channel config.
SpiEncoder timing
SPI encoder configuration.
bool operator!=(const SpiChipsetConfig &other) const FL_NOEXCEPT
Inequality operator.
SpiChipsetConfig(const SpiChipsetConfig &) FL_NOEXCEPT=default
Copy constructor.
SpiChipsetConfig() FL_NOEXCEPT
Default constructor (requires explicit protocol specification)
SpiChipsetConfig(SpiChipsetConfig &&) FL_NOEXCEPT=default
Move constructor.
int clockPin
GPIO clock pin (SCK)
int dataPin
GPIO data pin (MOSI)
SpiChipsetConfig(int dataPin, int clockPin, const SpiEncoder &timing) FL_NOEXCEPT
Constructor.
SPI chipset configuration (data + clock pins)
SPI encoder configuration for LED protocols.