FastLED 3.10.6
Loading...
Searching...
No Matches
fl::SlimBridgeController< DATA_PIN, TIMING, RGB_ORDER, WAIT_TIME, DriverTraits, XTRA0, DIRECT_SHOW > Class Template Reference

Detailed Description

template<int DATA_PIN, typename TIMING, EOrder RGB_ORDER, int WAIT_TIME, typename DriverTraits, int XTRA0 = 0, bool DIRECT_SHOW = (FL_SLIM_BRIDGE_DIRECT_SHOW != 0)>
class fl::SlimBridgeController< DATA_PIN, TIMING, RGB_ORDER, WAIT_TIME, DriverTraits, XTRA0, DIRECT_SHOW >

Shared legacy addLeds<>() bridge controller over an IChannelDriver.

This is the driver-agnostic "slim bridge": a CPixelLEDController that owns one ChannelDataPtr, builds it once at construction, and on every showPixels() call re-encodes into that same buffer (no per-frame allocation) and hands it to the driver named by DriverTraits.

DriverTraits contract (mirrors fl::BusTraits<Bus::X>, see fl/channels/bus_traits.h):

  • static IChannelDriver& instance() FL_NO_EXCEPT; Meyers-singleton accessor for the concrete driver.
  • static void registerWithManager() FL_NO_EXCEPT; Registers instance() with ChannelManager at some priority. MUST be idempotent – called from every SlimBridgeController instantiation's constructor. fl::BusTraits<Bus::X> (see fl/channels/bus_traits.h) already satisfies this contract, so any existing BusTraits<Bus::X> specialization can be passed directly as DriverTraits.
Template Parameters
DATA_PINGPIO data pin for the clockless chipset
TIMINGCompile-time chipset timing trait (see fl/chipsets/chipset_timing_config.h, makeTimingConfig<TIMING>())
RGB_ORDERColor byte ordering (RGB, GBR, etc.)
WAIT_TIMEMinimum inter-frame wait time in microseconds. If greater than the TIMING trait's reset_us, this folds into the built ChannelData's timing so the driver honors the longer of the two (mirrors the historical ClocklessIdf4 reset_us folding).
DriverTraitsTrait type satisfying the contract documented above.
XTRA0Legacy clockless trailing zero bits per byte, stored on the ChannelData for engines that honour it.
DIRECT_SHOWBypass ChannelManager (see SlimBridgeShowPolicy). Defaults to the platform tier via FL_SLIM_BRIDGE_DIRECT_SHOW.

Definition at line 104 of file slim_bridge_controller.h.

#include <slim_bridge_controller.h>

+ Inheritance diagram for fl::SlimBridgeController< DATA_PIN, TIMING, RGB_ORDER, WAIT_TIME, DriverTraits, XTRA0, DIRECT_SHOW >:
+ Collaboration diagram for fl::SlimBridgeController< DATA_PIN, TIMING, RGB_ORDER, WAIT_TIME, DriverTraits, XTRA0, DIRECT_SHOW >:

Public Member Functions

 SlimBridgeController () FL_NO_EXCEPT
 
const ChannelDataPtr & channelData () const FL_NO_EXCEPT
 Expose the underlying ChannelDataPtr for conformance tests.
 
void init () FL_NO_EXCEPT override
 Initialize the LED controller.
 
- Public Member Functions inherited from CPixelLEDController< RGB_ORDER, LANES, MASK >
 CPixelLEDController ()
 
int lanes () override
 Get the number of lanes of the Controller.
 
virtual void showPixels (PixelController< RGB_ORDER, LANES, MASK > &pixels)=0
 Send the LED data to the strip.
 
- Public Member Functions inherited from fl::CLEDController
 CLEDController () FL_NO_EXCEPT
 Create an led controller object, add it to the chain of controllers.
 
VIRTUAL_IF_NOT_AVR ~CLEDController () FL_NO_EXCEPT
 
void addToList () FL_NO_EXCEPT
 Add this controller to the linked list.
 
virtual void * beginShowLeds (int size) FL_NO_EXCEPT
 
void bindStaticEmitterProfile (const EmitterProfile *profile) FL_NO_EXCEPT
 
void clearLedDataInternal (int nLeds=-1) FL_NO_EXCEPT
 Zero out the LED data managed by this controller.
 
VIRTUAL_IF_NOT_AVR void clearLeds (int nLeds=-1) FL_NO_EXCEPT
 Clear out/zero out the given number of LEDs.
 
CLEDController & clearWhiteChannel () FL_NO_EXCEPT
 Reset this channel to plain 3-channel RGB (clears any RGBW/RGBWW configuration).
 
const EmitterProfile * emitterProfile () const FL_NO_EXCEPT
 
virtual void endShowLeds (void *data) FL_NO_EXCEPT
 
CRGB getAdjustment (fl::u8 scale) FL_NO_EXCEPT
 Get the combined brightness/color adjustment for this controller.
 
ColorAdjustment getAdjustmentData (fl::u8 brightness) FL_NO_EXCEPT
 
CRGB getCorrection () FL_NO_EXCEPT
 Get the correction value used by this controller.
 
fl::u8 getDither () const FL_NO_EXCEPT
 Get the dithering option currently set for this controller.
 
bool getEnabled () FL_NO_EXCEPT
 
virtual fl::u16 getMaxRefreshRate () const FL_NO_EXCEPT
 Gets the maximum possible refresh rate of the strip.
 
Rgbw getRgbw () const FL_NO_EXCEPT
 
Rgbww getRgbww () const FL_NO_EXCEPT
 
CRGB getTemperature () FL_NO_EXCEPT
 Get the color temperature, aka white point, for this controller.
 
bool isInList () const FL_NO_EXCEPT
 Check if this controller is in the linked list.
 
const CRGB * leds () const FL_NO_EXCEPT
 Const pointer to the CRGB array for this controller.
 
CRGB * leds () FL_NO_EXCEPT
 Pointer to the CRGB array for this controller.
 
fl::span< CRGB > ledsSpan () FL_NO_EXCEPT
 Span of LEDs managed by this controller.
 
const CLEDController * next () const FL_NO_EXCEPT
 Get the next controller in the linked list after this one (const version).
 
CLEDController * next () FL_NO_EXCEPT
 Get the next controller in the linked list after this one.
 
CRGB & operator[] (int x) FL_NO_EXCEPT
 Reference to the n'th LED managed by the controller.
 
void removeFromDrawList () FL_NO_EXCEPT
 Remove this controller from the draw list.
 
CLEDController & setCorrection (CRGB correction) FL_NO_EXCEPT
 The color corrction to use for this controller, expressed as a CRGB object.
 
CLEDController & setCorrection (LEDColorCorrection correction) FL_NO_EXCEPT
 The color corrction to use for this controller, expressed as a CRGB object.
 
CLEDController & setDither (fl::u8 ditherMode=BINARY_DITHER) FL_NO_EXCEPT
 Set the dithering mode for this controller to use.
 
void setEnabled (bool enabled) FL_NO_EXCEPT
 
CLEDController & setLeds (CRGB *data, int nLeds) FL_NO_EXCEPT
 Set the default array of LEDs to be used by this controller.
 
CLEDController & setLeds (fl::span< CRGB > leds) FL_NO_EXCEPT
 Set the default array of LEDs to be used by this controller (span version)
 
CLEDController & setRgbw (const Rgbw &arg=RgbwDefault::value()) FL_NO_EXCEPT
 
CLEDController & setRgbww (const Rgbww &arg=RgbwwDefault::value()) FL_NO_EXCEPT
 Configure this channel for 5-channel RGBWW (RGB + warm-W + cool-W) output.
 
CLEDController & setScreenMap (const fl::ScreenMap &map) FL_NO_EXCEPT
 
CLEDController & setScreenMap (const fl::XYMap &map, float diameter=-1.f) FL_NO_EXCEPT
 
CLEDController & setScreenMap (fl::u16 width, fl::u16 height, float diameter=-1.f) FL_NO_EXCEPT
 
virtual CLEDController & setSpiBus (Esp32SpiBus bus) FL_NO_EXCEPT
 Select an ESP-IDF SPI host for this clocked controller before init().
 
CLEDController & setTemperature (ColorTemperature temperature) FL_NO_EXCEPT
 Set the color temperature, aka white point, for this controller.
 
CLEDController & setTemperature (CRGB temperature) FL_NO_EXCEPT
 Set the color temperature, aka white point, for this controller.
 
void showColorInternal (const CRGB &data, fl::u8 brightness) FL_NO_EXCEPT
 
void showColorInternal (const CRGB &data, int nLeds, fl::u8 brightness) FL_NO_EXCEPT
 
void showInternal (const CRGB *data, int nLeds, fl::u8 brightness) FL_NO_EXCEPT
 
VIRTUAL_IF_NOT_AVR void showLeds (fl::u8 brightness) FL_NO_EXCEPT
 
void showLedsInternal (fl::u8 brightness) FL_NO_EXCEPT
 Write the data to the LEDs managed by this controller.
 
virtual int size () const FL_NO_EXCEPT
 How many LEDs does this controller manage?
 

Protected Member Functions

virtual void onBeforeEncode (PixelController< RGB_ORDER > &pixels) FL_NO_EXCEPT
 Called once per accepted frame, after the enabled/ready gates pass and BEFORE the frame is encoded and enqueued.
 
void showPixels (PixelController< RGB_ORDER > &pixels) FL_NO_EXCEPT override
 
- Protected Member Functions inherited from CPixelLEDController< RGB_ORDER, LANES, MASK >
 CPixelLEDController (RegistrationMode mode)
 Protected constructor with registration mode.
 
virtual void show (const CRGB *data, int nLeds, fl::u8 brightness) override
 Write the passed in RGB data out to the LEDs managed by this controller.
 
virtual void showColor (const CRGB &data, int nLeds, fl::u8 brightness) override
 Set all the LEDs on the controller to a given color.
 
- Protected Member Functions inherited from fl::CLEDController
 CLEDController (RegistrationMode mode) FL_NO_EXCEPT
 Protected constructor with registration mode.
 
void applyRgbw (const Rgbw &arg) FL_NO_EXCEPT
 
void clearStaticProfileForLegacySettings () FL_NO_EXCEPT
 
virtual const char * fixedWhiteChannelChipset () const FL_NO_EXCEPT
 Return the name of a chipset whose wire format owns its white-channel policy.
 
bool rejectFixedWhiteChannelChange (const char *operation) const FL_NO_EXCEPT
 
void setFixedRgbw (const Rgbw &arg) FL_NO_EXCEPT
 Configure a chipset-owned RGBW policy that public white-channel setters cannot replace.
 
virtual const EmitterProfile * staticEmitterProfile () const FL_NO_EXCEPT
 Template-derived static-profile controllers override this hook.
 
bool staticProfileCleared () const FL_NO_EXCEPT
 

Private Types

using Policy = SlimBridgeShowPolicy<DIRECT_SHOW>
 

Private Attributes

ChannelDataPtr mData
 

Additional Inherited Members

- Static Public Member Functions inherited from fl::CLEDController
static CLEDController * head () FL_NO_EXCEPT
 Get the first LED controller in the linked list of controllers.
 
static void removeFromList (CLEDController *controller) FL_NO_EXCEPT
 Remove a controller from the linked list.
 
template<typename Visitor>
static void visitControllers (Visitor &&visitor) FL_NO_EXCEPT
 Visit all controllers in the linked list with a visitor The visitor must be a callable that accepts (const CLEDController*, fl::span<const CRGB>)
 
- Static Public Attributes inherited from CPixelLEDController< RGB_ORDER, LANES, MASK >
static const int LANES_VALUE = LANES
 The number of lanes for this controller.
 
static const fl::u32 MASK_VALUE = MASK
 The mask for the lanes for this controller.
 
static const EOrder RGB_ORDER_VALUE = RGB_ORDER
 The RGB ordering for this controller.
 
- Protected Types inherited from fl::CLEDController
enum class  RegistrationMode { AutoRegister , DeferRegister }
 Registration mode for constructor. More...
 
enum  StateFlags : u8 { kEnabled = 1 << 0 , kStaticProfileCleared = 1 << 1 }
 
- Protected Attributes inherited from fl::CLEDController
fl::span< CRGB > mLeds
 span of LED data used by this controller
 
CLEDController * mPNext = nullptr
 pointer to the next LED controller in the linked list
 
ChannelOptions mSettings
 Optional channel settings (correction, temperature, dither, rgbw, affinity)
 
u8 mStateFlags = kEnabled
 
- Static Protected Attributes inherited from fl::CLEDController
static CLEDController * mPHead = nullptr
 pointer to the first LED controller in the linked list
 
static CLEDController * mPTail = nullptr
 pointer to the last LED controller in the linked list
 

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