FastLED 3.10.6
Loading...
Searching...
No Matches

◆ Channel() [2/4]

fl::Channel::Channel ( int pin,
const ChipsetTimingConfig & timing,
fl::span< CRGB > leds,
EOrder rgbOrder,
const ChannelOptions & options )
private

Backwards-compatible constructor (deprecated)

Deprecated
Use variant-based constructor instead

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

379 : CPixelLEDController<RGB>(RegistrationMode::DeferRegister) // Defer registration until FastLED.add()
380 , mChipset(ClocklessChipset(pin, timing)) // Convert to variant
382 , mRgbOrder(rgbOrder)
383 , mDriver() // Empty weak_ptr - late binding on first showPixels()
384 , mBus(options.mBus) // Bus selection (#2459)
385 , mBusWhich(options.mBusWhich)
386 , mId(nextId())
387 , mName(makeName(mId)) {
388 // NOTE: Do NOT call fl::pinMode() here — see comment in the
389 // Channel(ChipsetVariant, span, EOrder, ChannelOptions) constructor.
390
391 // Set the LED data array
392 setLeds(leds);
393
394 // Initialize the inherited per-channel controller settings so mWhiteCfg
395 // survives to showPixels(). See the sibling constructor for rationale.
397
398 // Set color correction/temperature/dither/rgbw from ChannelOptions
399 if (!options.hasColorProfile()) { setCorrection(options.mCorrection); setTemperature(options.mTemperature); }
400 setDither(options.mDitherMode);
401 applyWhiteCfg(*this, options);
402
403 // Create ChannelData during construction
405}
@ DeferRegister
Defer registration until addToList() is called.
CLEDController & setTemperature(CRGB temperature) FL_NO_EXCEPT
Set the color temperature, aka white point, for this controller.
CLEDController & setLeds(CRGB *data, int nLeds) FL_NO_EXCEPT
Set the default array of LEDs to be used by this controller.
ChannelOptions mSettings
Optional channel settings (correction, temperature, dither, rgbw, affinity)
CLEDController & setDither(fl::u8 ditherMode=BINARY_DITHER) FL_NO_EXCEPT
Set the dithering mode for this controller to use.
CLEDController & setCorrection(CRGB correction) FL_NO_EXCEPT
The color corrction to use for this controller, expressed as a CRGB object.
EOrder mRgbOrder
Definition channel.h:393
static fl::string makeName(i32 id, const fl::optional< fl::string > &configName=fl::optional< fl::string >())
fl::u8 mBusWhich
Definition channel.h:417
fl::span< CRGB > leds()
Get the LED array as a span (non-const)
ChipsetVariant mChipset
Definition channel.h:391
PixelEncoder mPixelEncoder
Definition channel.h:392
ChannelDataPtr mChannelData
Definition channel.h:435
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...
static i32 nextId()
fl::weak_ptr< IChannelDriver > mDriver
Definition channel.h:411
const i32 mId
Definition channel.h:433
fl::string mName
Definition channel.h:434
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
void applyWhiteCfg(CLEDController &ctrl, const ChannelOptions &options) FL_NO_EXCEPT
Apply the white-channel selection from ChannelOptions to a CLEDController.

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, fl::CLEDController::mSettings, nextId(), selectPixelEncoder(), fl::CLEDController::setCorrection(), fl::CLEDController::setDither(), fl::CLEDController::setLeds(), and fl::CLEDController::setTemperature().

+ Here is the call graph for this function: