FastLED 3.10.8
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 327 of file channel.cpp.hpp.

329 : CPixelLEDController<RGB>(RegistrationMode::DeferRegister) // Defer registration until FastLED.add()
330 , mChipset(chipset)
332 , mRgbOrder(rgbOrder)
333 , mDriver() // Empty weak_ptr - late binding on first showPixels()
334 , mBus(options.mBus) // Bus selection (#2459)
335 , mBusWhich(options.mBusWhich)
336 , mId(nextId())
337 , mName(makeName(mId)) {
338 // NOTE: Do NOT call fl::pinMode() here. The pin may already be
339 // configured for SPI output by a persistent driver (ChannelEngineSpi).
340 // Calling pinMode(InputPulldown) would disconnect the SPI MOSI from the
341 // GPIO matrix, causing subsequent transmissions to produce no output.
342 // The driver will configure the pin when it first uses it.
343
344 // Set the LED data array
345 setLeds(leds);
346
347 // Channels owns its options; copy only the legacy rendering fields into
348 // the base controller.
349 mSettings = options;
350
351 // Set color correction/temperature/dither/rgbw from ChannelOptions
353
354 // Create ChannelData during construction with chipset variant
356}
@ 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:415
static i32 nextId() FL_NO_EXCEPT
fl::u8 mBusWhich
Definition channel.h:439
ChipsetVariant mChipset
Definition channel.h:413
PixelEncoder mPixelEncoder
Definition channel.h:414
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:457
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:433
const i32 mId
Definition channel.h:455
fl::string mName
Definition channel.h:456
ChannelOptions mSettings
Definition channel.h:459
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: