FastLED 3.9.15
Loading...
Searching...
No Matches

◆ Channel() [3/5]

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 253 of file channel.cpp.hpp.

255 : CPixelLEDController<RGB>(RegistrationMode::DeferRegister) // Defer registration until FastLED.add()
256 , mChipset(ClocklessChipset(pin, timing)) // Convert to variant
257 , mRgbOrder(rgbOrder)
258 , mDriver() // Empty weak_ptr - late binding on first showPixels()
259 , mBus(options.mBus) // Bus selection (#2459)
260 , mId(nextId())
261 , mName(makeName(mId)) {
262 // NOTE: Do NOT call fl::pinMode() here — see comment in the
263 // Channel(ChipsetVariant, span, EOrder, ChannelOptions) constructor.
264
265 // Set the LED data array
266 setLeds(leds);
267
268 // Sync mSettings from ChannelOptions so the mWhiteCfg variant survives
269 // to showPixels(). See sibling ChipsetVariant constructor for rationale.
270 mSettings = options;
271
272 // Set color correction/temperature/dither/rgbw from ChannelOptions
273 setCorrection(options.mCorrection);
274 setTemperature(options.mTemperature);
275 setDither(options.mDitherMode);
276 applyWhiteCfg(*this, options);
277
278 // Create ChannelData during construction
280}
CLEDController & setCorrection(CRGB correction) FL_NOEXCEPT
The color corrction to use for this controller, expressed as a CRGB object.
@ DeferRegister
Defer registration until addToList() is called.
CLEDController & setLeds(CRGB *data, int nLeds) FL_NOEXCEPT
Set the default array of LEDs to be used by this controller.
CLEDController & setDither(fl::u8 ditherMode=BINARY_DITHER) FL_NOEXCEPT
Set the dithering mode for this controller to use.
CLEDController & setTemperature(CRGB temperature) FL_NOEXCEPT
Set the color temperature, aka white point, for this controller.
EOrder mRgbOrder
Definition channel.h:255
static fl::string makeName(i32 id, const fl::optional< fl::string > &configName=fl::optional< fl::string >())
fl::span< CRGB > leds()
Get the LED array as a span (non-const)
ChipsetVariant mChipset
Definition channel.h:254
ChannelDataPtr mChannelData
Definition channel.h:279
static i32 nextId()
fl::weak_ptr< IChannelDriver > mDriver
Definition channel.h:256
const i32 mId
Definition channel.h:276
fl::string mName
Definition channel.h:277
ChannelOptions mSettings
Definition channel.h:278
static ChannelDataPtr create(const ChipsetVariant &chipset, fl::vector_psram< u8 > &&encodedData=fl::vector_psram< u8 >()) FL_NOEXCEPT
Create channel transmission data (modern variant-based API)
Definition data.cpp.hpp:12
void applyWhiteCfg(CLEDController &ctrl, const ChannelOptions &options) FL_NOEXCEPT
Apply the white-channel selection from ChannelOptions to a CLEDController.

References CPixelLEDController< RGB >::CPixelLEDController(), fl::ChannelData::create(), fl::CLEDController::DeferRegister, leds(), makeName(), mBus, mChannelData, mChipset, fl::ChannelOptions::mCorrection, fl::ChannelOptions::mDitherMode, mDriver, mId, mName, mRgbOrder, mSettings, fl::ChannelOptions::mTemperature, nextId(), fl::RGB, fl::CLEDController::setCorrection(), fl::CLEDController::setDither(), fl::CLEDController::setLeds(), and fl::CLEDController::setTemperature().

+ Here is the call graph for this function: