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

Detailed Description

Real FastLED implementation adapter.

This class adapts the global FastLED singleton to the IFastLED interface. It provides a thin wrapper that delegates all operations to the global FastLED object while optionally managing segment control for specific LED controller indices.

This adapter allows WLED and other integrations to work with FastLED through a standard interface while maintaining full compatibility with the existing FastLED API.

Example usage:

CRGB leds[100];
FastLED.addLeds<WS2812, 5>(leds, 100);
controller->setBrightness(128);
controller->show();
CRGB leds[1]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
CLEDController * controller
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
Definition shared_ptr.h:423
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38
See also
IFastLED for the interface definition
createFastLEDController() for helper functions to create adapters

Definition at line 33 of file adapter.h.

#include <adapter.h>

+ Inheritance diagram for fl::FastLEDAdapter:
+ Collaboration diagram for fl::FastLEDAdapter:

Public Member Functions

 FastLEDAdapter (u8 controllerIndex=0) FL_NO_EXCEPT
 Construct adapter wrapping the global FastLED object.
 
 ~FastLEDAdapter () FL_NO_EXCEPT override=default
 Destructor.
 
void clear (bool writeToStrip=false) FL_NO_EXCEPT override
 Clear all LEDs (set to black)
 
void clearSegment () FL_NO_EXCEPT override
 Clear the segment range (operate on full LED array)
 
void delay (unsigned long ms) FL_NO_EXCEPT override
 Delay for a specified number of milliseconds.
 
u8 getBrightness () const FL_NO_EXCEPT override
 Get the current global brightness.
 
fl::span< CRGB > getLEDs () FL_NO_EXCEPT override
 Get the LED array as a span.
 
u16 getMaxRefreshRate () const FL_NO_EXCEPT override
 Get the maximum refresh rate.
 
size_t getNumLEDs () const FL_NO_EXCEPT override
 Get the number of LEDs.
 
void setBrightness (u8 brightness) FL_NO_EXCEPT override
 Set the global brightness.
 
void setCorrection (CRGB correction) FL_NO_EXCEPT override
 Set color correction.
 
void setMaxRefreshRate (u16 fps) FL_NO_EXCEPT override
 Set the maximum refresh rate.
 
void setSegment (size_t start, size_t end) FL_NO_EXCEPT override
 Set a segment range for subsequent operations.
 
void setTemperature (CRGB temperature) FL_NO_EXCEPT override
 Set color temperature.
 
void show () FL_NO_EXCEPT override
 Send the LED data to the strip Uses the current brightness setting.
 
void show (u8 brightness) FL_NO_EXCEPT override
 Send the LED data to the strip with a specific brightness.
 
- Public Member Functions inherited from fl::IFastLED
virtual ~IFastLED () FL_NO_EXCEPT=default
 

Private Attributes

u8 mControllerIndex
 
bool mHasSegment
 
size_t mSegmentEnd
 
size_t mSegmentStart
 

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