FastLED 3.10.10
Loading...
Searching...
No Matches

◆ Channel() [1/4]

fl::Channel::Channel ( const ChipsetVariant & chipset,
fl::span< CRGB > leds,
EOrder rgbOrder,
const ChannelOptions & options )
private

Private constructor (use create() factory method)

Parameters
chipsetChipset configuration (clockless or SPI)
ledsLED data array
rgbOrderRGB channel ordering
optionsChannel options (correction, temperature, dither, rgbw, affinity)

Definition at line 329 of file channel.cpp.hpp.

331 : CPixelLEDController<RGB>(RegistrationMode::DeferRegister) // Defer registration until FastLED.add()
332 , mChipset(chipset)
334 , mRgbOrder(rgbOrder)
335 , mDriver() // Empty weak_ptr - late binding on first showPixels()
336 , mBus(options.mBus) // Bus selection (#2459)
337 , mBusWhich(options.mBusWhich)
338 , mId(nextId())
339 , mName(makeName(mId)) {
340 // NOTE: Do NOT call fl::pinMode() here. The pin may already be
341 // configured for SPI output by a persistent driver (ChannelEngineSpi).
342 // Calling pinMode(InputPulldown) would disconnect the SPI MOSI from the
343 // GPIO matrix, causing subsequent transmissions to produce no output.
344 // The driver will configure the pin when it first uses it.
345
346 // Set the LED data array
347 setLeds(leds);
348
349 // Channels owns its options; copy only the legacy rendering fields into
350 // the base controller.
351 mSettings = options;
352
353 // Set color correction/temperature/dither/rgbw from ChannelOptions
355
356 // Create ChannelData during construction with chipset variant
358}
@ DeferRegister
Defer registration until addToList() is called.
CLEDController & setLeds(CRGB *data, int nLeds) FL_NO_EXCEPT
Set the default array of LEDs to be used by this controller.
EOrder mRgbOrder
Definition channel.h:417
static i32 nextId() FL_NO_EXCEPT
fl::u8 mBusWhich
Definition channel.h:441
ChipsetVariant mChipset
Definition channel.h:415
PixelEncoder mPixelEncoder
Definition channel.h:416
static fl::string makeName(i32 id, const fl::optional< fl::string > &configName=fl::optional< fl::string >()) FL_NO_EXCEPT
fl::span< CRGB > leds() FL_NO_EXCEPT
Get the LED array as a span (non-const)
ChannelDataPtr mChannelData
Definition channel.h:454
static PixelEncoder selectPixelEncoder(const ChipsetVariant &) FL_NO_EXCEPT
The chipset is fixed when a Channel is constructed, so bind its pixel encoder once instead of switchi...
void syncLegacySettings() FL_NO_EXCEPT
fl::weak_ptr< IChannelDriver > mDriver
Definition channel.h:435
const i32 mId
Definition channel.h:452
fl::string mName
Definition channel.h:453
ChannelOptions mSettings
Definition channel.h:456
static ChannelDataPtr create(const ChipsetVariant &chipset, fl::vector_psram< u8 > &&encodedData=fl::vector_psram< u8 >(), ChannelPixelFormat pixelFormat=ChannelPixelFormat::RGB) FL_NO_EXCEPT
Create channel transmission data (modern variant-based API)
Definition data.cpp.hpp:12

References CPixelLEDController< RGB >::CPixelLEDController(), fl::ChannelData::create(), fl::CLEDController::DeferRegister, fl::FL_NO_EXCEPT, leds(), makeName(), mBus, mBusWhich, mChannelData, mChipset, mDriver, mId, mName, mPixelEncoder, mRgbOrder, mSettings, nextId(), selectPixelEncoder(), fl::CLEDController::setLeds(), and syncLegacySettings().

Referenced by Channel(), Channel(), asChannel(), encodeAPA102(), encodeHD108(), encodeLPD6803(), encodeLPD8806(), encodeMY9221(), encodeP9813(), encodeSK9822(), encodeSM16716(), encodeTM1812RGBWW(), encodeTM1908(), encodeUCS7604(), encodeWS2801(), encodeWS2803(), encodeWS2812(), isEnabled(), operator=(), operator=(), setGamma(), setScreenMap(), setScreenMap(), setScreenMap(), and setScreenMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: