FastLED 3.10.8
Loading...
Searching...
No Matches
fl::ChannelData Class Reference

Detailed Description

Transmission data for a single LED channel.

This lightweight data transfer object holds everything the driver needs to transmit LED data: pin number, timing configuration, and encoded bytes. Separated from Channel to allow concurrent transmission while channels prepare next frame.

Definition at line 55 of file data.h.

#include <data.h>

+ Collaboration diagram for fl::ChannelData:

Public Member Functions

 ~ChannelData ()
 Destructor with debug logging.
 
u8 getBytesPerPixel () const FL_NO_EXCEPT
 Get encoded bytes per pixel/element, or 0 if unknown.
 
const ChipsetVariant & getChipset () const FL_NO_EXCEPT
 Get the chipset configuration variant.
 
const fl::vector_psram< u8 > & getData () const FL_NO_EXCEPT
 Get the encoded transmission data.
 
fl::vector_psram< u8 > & getData () FL_NO_EXCEPT
 Get the encoded transmission data (mutable)
 
u8 getExtraZeroBitsPerByte () const FL_NO_EXCEPT
 Clockless zero bits the wire appends after every encoded byte.
 
size_t getMinimumSize () const FL_NO_EXCEPT
 Calculate the size needed for writeWithPadding() without allocating.
 
int getPin () const FL_NO_EXCEPT
 Get the GPIO pin number.
 
ChannelPixelFormat getPixelFormat () const FL_NO_EXCEPT
 Get explicit pixel byte layout for encoded data.
 
size_t getSize () const FL_NO_EXCEPT
 Get the data size in bytes.
 
const ChipsetTimingConfig & getTiming () const FL_NO_EXCEPT
 Get the timing configuration (clockless chipsets only)
 
bool isClockless () const FL_NO_EXCEPT
 Check if this is a clockless chipset.
 
bool isInUse () const FL_NO_EXCEPT
 Check if channel data is currently in use by the driver.
 
bool isSpi () const FL_NO_EXCEPT
 Check if this is an SPI chipset.
 
void setExtraZeroBitsPerByte (u8 bits) FL_NO_EXCEPT
 Set the per-byte trailing zero-bit count (see getter)
 
void setInUse (bool inUse) FL_NO_EXCEPT
 Mark channel data as in use by the driver.
 
void setPaddingGenerator (PaddingGenerator generator) FL_NO_EXCEPT
 Set the padding generator for this channel.
 
void setPixelFormat (ChannelPixelFormat pixelFormat) FL_NO_EXCEPT
 Set explicit pixel byte layout for encoded data.
 
void writeWithPadding (fl::span< u8 > dst) FL_NO_EXCEPT
 Write encoded data with padding to destination buffer.
 

Static Public Member Functions

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)
 
static ChannelDataPtr create (int pin, const ChipsetTimingConfig &timing, fl::vector_psram< u8 > &&encodedData=fl::vector_psram< u8 >(), ChannelPixelFormat pixelFormat=ChannelPixelFormat::RGB) FL_NO_EXCEPT
 Create channel transmission data (backwards compatibility)
 

Private Member Functions

 ChannelData (const ChannelData &) FL_NO_EXCEPT=delete
 
 ChannelData (const ChipsetVariant &chipset, fl::vector_psram< u8 > &&encodedData, ChannelPixelFormat pixelFormat) FL_NO_EXCEPT
 Private constructor - variant-based (modern API)
 
 ChannelData (int pin, const ChipsetTimingConfig &timing, fl::vector_psram< u8 > &&encodedData, ChannelPixelFormat pixelFormat) FL_NO_EXCEPT
 Private constructor - legacy API (backwards compatibility)
 
ChannelData & operator= (const ChannelData &) FL_NO_EXCEPT=delete
 

Private Attributes

ChipsetVariant mChipset
 Chipset configuration (clockless or SPI)
 
fl::vector_psram< u8 > mEncodedData
 Encoded transmission bytes (PSRAM)
 
u8 mExtraZeroBits = 0
 Trailing zero bits per byte (legacy XTRA0)
 
volatile bool mInUse = false
 Engine is transmitting this data (prevents creator updates)
 
PaddingGenerator mPaddingGenerator
 Optional padding generator for block-size alignment.
 
ChannelPixelFormat mPixelFormat
 Explicit byte layout for encoded data.
 

Friends

template<typename T, typename... Args>
fl::shared_ptr< T > fl::adl_barrier::make_shared (Args &&... args) FL_NO_EXCEPT
 Friend declaration for make_shared to access private constructor.
 

The documentation for this class was generated from the following files: