FastLED 3.9.7
Loading...
Searching...
No Matches
CLEDController Class Referenceabstract

Detailed Description

Base definition for an LED controller.

Pretty much the methods that every LED controller object will make available. If you want to pass LED controllers around to methods, make them references to this type, keeps your code saner. However, most people won't be seeing/using these objects directly at all.

Note
That the methods for eventual checking of background writing of data (I'm looking at you, Teensy 3.0 DMA controller!) are not yet implemented.

Definition at line 35 of file cled_controller.h.

#include <cled_controller.h>

+ Inheritance diagram for CLEDController:

Public Member Functions

CLEDControllersetRgbw (const Rgbw &arg=RgbwDefault::value())
 
void setEnabled (bool enabled)
 
 CLEDController ()
 Create an led controller object, add it to the chain of controllers.
 
Rgbw getRgbw () const
 
virtual void init ()=0
 Initialize the LED controller.
 
VIRTUAL_IF_NOT_AVR void clearLeds (int nLeds=-1)
 Clear out/zero out the given number of LEDs.
 
VIRTUAL_IF_NOT_AVR void showLeds (uint8_t brightness)
 
ColorAdjustment getAdjustmentData (uint8_t brightness)
 
void showInternal (const struct CRGB *data, int nLeds, uint8_t brightness)
 
void showColorInternal (const struct CRGB &data, int nLeds, uint8_t brightness)
 
void showLedsInternal (uint8_t brightness)
 Write the data to the LEDs managed by this controller.
 
void showColorInternal (const struct CRGB &data, uint8_t brightness)
 
CLEDControllernext ()
 Get the next controller in the linked list after this one.
 
CLEDControllersetLeds (CRGB *data, int nLeds)
 Set the default array of LEDs to be used by this controller.
 
void clearLedDataInternal (int nLeds=-1)
 Zero out the LED data managed by this controller.
 
virtual int size ()
 How many LEDs does this controller manage?
 
virtual int lanes ()
 How many Lanes does this controller manage?
 
CRGBleds ()
 Pointer to the CRGB array for this controller.
 
CRGBoperator[] (int x)
 Reference to the n'th LED managed by the controller.
 
CLEDControllersetDither (uint8_t ditherMode=BINARY_DITHER)
 Set the dithering mode for this controller to use.
 
CLEDControllersetScreenMap (const fl::XYMap &map)
 
CLEDControllersetScreenMap (const fl::ScreenMap &map)
 
CLEDControllersetScreenMap (uint16_t width, uint16_t height)
 
uint8_t getDither ()
 Get the dithering option currently set for this controller.
 
virtual void * beginShowLeds ()
 
virtual void endShowLeds (void *data)
 
CLEDControllersetCorrection (CRGB correction)
 The color corrction to use for this controller, expressed as a CRGB object.
 
CLEDControllersetCorrection (LEDColorCorrection correction)
 The color corrction to use for this controller, expressed as a CRGB object.
 
CRGB getCorrection ()
 Get the correction value used by this controller.
 
CLEDControllersetTemperature (CRGB temperature)
 Set the color temperature, aka white point, for this controller.
 
CLEDControllersetTemperature (ColorTemperature temperature)
 Set the color temperature, aka white point, for this controller.
 
CRGB getTemperature ()
 Get the color temperature, aka whipe point, for this controller.
 
CRGB getAdjustment (uint8_t scale)
 Get the combined brightness/color adjustment for this controller.
 
virtual uint16_t getMaxRefreshRate () const
 Gets the maximum possible refresh rate of the strip.
 

Static Public Member Functions

static CLEDControllerhead ()
 Get the first LED controller in the linked list of controllers.
 

Public Attributes

Rgbw mRgbMode = RgbwInvalid::value()
 

Protected Member Functions

virtual void showColor (const CRGB &data, int nLeds, uint8_t brightness)=0
 Set all the LEDs to a given color.
 
virtual void show (const struct CRGB *data, int nLeds, uint8_t brightness)=0
 Write the passed in RGB data out to the LEDs managed by this controller.
 

Protected Attributes

CRGBm_Data
 pointer to the LED data used by this controller
 
CLEDControllerm_pNext
 pointer to the next LED controller in the linked list
 
CRGB m_ColorCorrection
 CRGB object representing the color correction to apply to the strip on show()
 
CRGB m_ColorTemperature
 CRGB object representing the color temperature to apply to the strip on show()
 
EDitherMode m_DitherMode
 the current dither mode of the controller
 
bool m_enabled = true
 
int m_nLeds
 the number of LEDs in the LED data array
 

Static Protected Attributes

static CLEDControllerm_pHead = NULL
 pointer to the first LED controller in the linked list
 
static CLEDControllerm_pTail = NULL
 pointer to the last LED controller in the linked list
 

Friends

class CFastLED
 

Constructor & Destructor Documentation

◆ CLEDController()

CLEDController::CLEDController ( )

Create an led controller object, add it to the chain of controllers.

Definition at line 14 of file cled_controller.cpp.

Member Function Documentation

◆ beginShowLeds()

virtual void * CLEDController::beginShowLeds ( )
inlinevirtual

Definition at line 222 of file cled_controller.h.

◆ clearLedDataInternal()

void CLEDController::clearLedDataInternal ( int nLeds = -1)

Zero out the LED data managed by this controller.

Definition at line 23 of file cled_controller.cpp.

◆ clearLeds()

VIRTUAL_IF_NOT_AVR void CLEDController::clearLeds ( int nLeds = -1)
inline

Clear out/zero out the given number of LEDs.

Parameters
nLedsthe number of LEDs to clear

Definition at line 100 of file cled_controller.h.

◆ endShowLeds()

virtual void CLEDController::endShowLeds ( void * data)
inlinevirtual

Definition at line 239 of file cled_controller.h.

◆ getAdjustment()

CRGB CLEDController::getAdjustment ( uint8_t scale)
inline

Get the combined brightness/color adjustment for this controller.

Parameters
scalethe brightness scale to get the correction for
Returns
a CRGB object representing the total adjustment, including color correction and color temperature

Definition at line 274 of file cled_controller.h.

◆ getAdjustmentData()

ColorAdjustment CLEDController::getAdjustmentData ( uint8_t brightness)

Definition at line 32 of file cled_controller.cpp.

◆ getCorrection()

CRGB CLEDController::getCorrection ( )
inline

Get the correction value used by this controller.

Returns
the current color correction (CLEDController::m_ColorCorrection)

Definition at line 257 of file cled_controller.h.

◆ getDither()

uint8_t CLEDController::getDither ( )
inline

Get the dithering option currently set for this controller.

Returns
the currently set dithering option (CLEDController::m_DitherMode)

Definition at line 220 of file cled_controller.h.

◆ getMaxRefreshRate()

virtual uint16_t CLEDController::getMaxRefreshRate ( ) const
inlinevirtual

Gets the maximum possible refresh rate of the strip.

Returns
the maximum refresh rate, in frames per second (FPS)

Definition at line 280 of file cled_controller.h.

◆ getRgbw()

Rgbw CLEDController::getRgbw ( ) const
inline

Definition at line 91 of file cled_controller.h.

◆ getTemperature()

CRGB CLEDController::getTemperature ( )
inline

Get the color temperature, aka whipe point, for this controller.

Returns
the current color temperature (CLEDController::m_ColorTemperature)

Definition at line 269 of file cled_controller.h.

◆ head()

static CLEDController * CLEDController::head ( )
inlinestatic

Get the first LED controller in the linked list of controllers.

Returns
CLEDController::m_pHead

Definition at line 162 of file cled_controller.h.

◆ init()

◆ lanes()

virtual int CLEDController::lanes ( )
inlinevirtual

How many Lanes does this controller manage?

Returns
1 for a non-Parallel controller

Reimplemented in CPixelLEDController< RGB_ORDER, LANES, MASK >, CPixelLEDController< GRB, CONTROLLER::LANES_VALUE, CONTROLLER::MASK_VALUE >, and CPixelLEDController< RGB >.

Definition at line 186 of file cled_controller.h.

◆ leds()

CRGB * CLEDController::leds ( )
inline

Pointer to the CRGB array for this controller.

Returns
CLEDController::m_Data

Definition at line 190 of file cled_controller.h.

◆ next()

CLEDController * CLEDController::next ( )
inline

Get the next controller in the linked list after this one.

Will return NULL at the end of the linked list.

Returns
CLEDController::m_pNext

Definition at line 166 of file cled_controller.h.

◆ operator[]()

CRGB & CLEDController::operator[] ( int x)
inline

Reference to the n'th LED managed by the controller.

Parameters
xthe LED number to retrieve
Returns
reference to CLEDController::m_Data[x]

Definition at line 195 of file cled_controller.h.

◆ setCorrection() [1/2]

CLEDController & CLEDController::setCorrection ( CRGB correction)
inline

The color corrction to use for this controller, expressed as a CRGB object.

Parameters
correctionthe color correction to set
Returns
a reference to the controller

Definition at line 250 of file cled_controller.h.

◆ setCorrection() [2/2]

CLEDController & CLEDController::setCorrection ( LEDColorCorrection correction)
inline

The color corrction to use for this controller, expressed as a CRGB object.

Parameters
correctionthe color correction to set
Returns
a reference to the controller

Definition at line 253 of file cled_controller.h.

◆ setDither()

CLEDController & CLEDController::setDither ( uint8_t ditherMode = BINARY_DITHER)
inline

Set the dithering mode for this controller to use.

Parameters
ditherModethe dithering mode to set
Returns
a reference to the controller

Definition at line 200 of file cled_controller.h.

◆ setEnabled()

void CLEDController::setEnabled ( bool enabled)
inline

Definition at line 71 of file cled_controller.h.

◆ setLeds()

CLEDController & CLEDController::setLeds ( CRGB * data,
int nLeds )
inline

Set the default array of LEDs to be used by this controller.

Parameters
datapointer to the LED data
nLedsthe number of LEDs in the LED data

Definition at line 171 of file cled_controller.h.

◆ setRgbw()

CLEDController & CLEDController::setRgbw ( const Rgbw & arg = RgbwDefault::value())
inline

Definition at line 64 of file cled_controller.h.

◆ setScreenMap() [1/3]

CLEDController & CLEDController::setScreenMap ( const fl::ScreenMap & map)
inline

Definition at line 209 of file cled_controller.h.

◆ setScreenMap() [2/3]

CLEDController & CLEDController::setScreenMap ( const fl::XYMap & map)
inline

Definition at line 202 of file cled_controller.h.

◆ setScreenMap() [3/3]

CLEDController & CLEDController::setScreenMap ( uint16_t width,
uint16_t height )
inline

Definition at line 214 of file cled_controller.h.

◆ setTemperature() [1/2]

CLEDController & CLEDController::setTemperature ( ColorTemperature temperature)
inline

Set the color temperature, aka white point, for this controller.

Parameters
temperaturethe color temperature to set
Returns
a reference to the controller

Definition at line 265 of file cled_controller.h.

◆ setTemperature() [2/2]

CLEDController & CLEDController::setTemperature ( CRGB temperature)
inline

Set the color temperature, aka white point, for this controller.

Parameters
temperaturethe color temperature to set
Returns
a reference to the controller

Definition at line 262 of file cled_controller.h.

◆ show()

virtual void CLEDController::show ( const struct CRGB * data,
int nLeds,
uint8_t brightness )
protectedpure virtual

Write the passed in RGB data out to the LEDs managed by this controller.

Parameters
datathe rgb data to write out to the strip
nLedsthe number of LEDs being written out
scalethe rgb scaling to apply to each led before writing it out

Implemented in CPixelLEDController< RGB_ORDER, LANES, MASK >, CPixelLEDController< GRB, CONTROLLER::LANES_VALUE, CONTROLLER::MASK_VALUE >, and CPixelLEDController< RGB >.

◆ showColor()

virtual void CLEDController::showColor ( const CRGB & data,
int nLeds,
uint8_t brightness )
protectedpure virtual

Set all the LEDs to a given color.

Parameters
datathe CRGB color to set the LEDs to
nLedsthe number of LEDs to set to this color
scalethe rgb scaling value for outputting color

Implemented in CPixelLEDController< RGB_ORDER, LANES, MASK >, CPixelLEDController< GRB, CONTROLLER::LANES_VALUE, CONTROLLER::MASK_VALUE >, and CPixelLEDController< RGB >.

◆ showColorInternal() [1/2]

void CLEDController::showColorInternal ( const struct CRGB & data,
int nLeds,
uint8_t brightness )
inline

Will scale for color correction and temperature. Can accept LED data not attached to this controller.

Parameters
datathe CRGB color to set the LEDs to
nLedsthe number of LEDs in the data array
brightnessthe brightness of the LEDs
See also
showColor(const struct CRGB&, int, CRGB)

Definition at line 134 of file cled_controller.h.

◆ showColorInternal() [2/2]

void CLEDController::showColorInternal ( const struct CRGB & data,
uint8_t brightness )
inline

Parameters
datathe CRGB color to set the LEDs to
brightnessthe brightness of the LEDs
See also
showColor(const struct CRGB&, int, CRGB)

Definition at line 154 of file cled_controller.h.

◆ showInternal()

void CLEDController::showInternal ( const struct CRGB * data,
int nLeds,
uint8_t brightness )
inline

Will scale for color correction and temperature. Can accept LED data not attached to this controller.

Parameters
datathe LED data to write to the strip
nLedsthe number of LEDs in the data array
brightnessthe brightness of the LEDs
See also
show(const struct CRGB*, int, CRGB)

Definition at line 121 of file cled_controller.h.

◆ showLeds()

VIRTUAL_IF_NOT_AVR void CLEDController::showLeds ( uint8_t brightness)
inline

Definition at line 106 of file cled_controller.h.

◆ showLedsInternal()

void CLEDController::showLedsInternal ( uint8_t brightness)
inline

Write the data to the LEDs managed by this controller.

Parameters
brightnessthe brightness of the LEDs
See also
show(const struct CRGB*, int, uint8_t)

Definition at line 143 of file cled_controller.h.

◆ size()

virtual int CLEDController::size ( )
inlinevirtual

How many LEDs does this controller manage?

Returns
CLEDController::m_nLeds

Definition at line 182 of file cled_controller.h.

Friends And Related Symbol Documentation

◆ CFastLED

friend class CFastLED
friend

Definition at line 37 of file cled_controller.h.

Member Data Documentation

◆ m_ColorCorrection

CRGB CLEDController::m_ColorCorrection
protected

CRGB object representing the color correction to apply to the strip on show()

See also
setCorrection

Definition at line 40 of file cled_controller.h.

◆ m_ColorTemperature

CRGB CLEDController::m_ColorTemperature
protected

CRGB object representing the color temperature to apply to the strip on show()

See also
setTemperature

Definition at line 41 of file cled_controller.h.

◆ m_Data

CRGB* CLEDController::m_Data
protected

pointer to the LED data used by this controller

Definition at line 38 of file cled_controller.h.

◆ m_DitherMode

EDitherMode CLEDController::m_DitherMode
protected

the current dither mode of the controller

Definition at line 42 of file cled_controller.h.

◆ m_enabled

bool CLEDController::m_enabled = true
protected

Definition at line 43 of file cled_controller.h.

◆ m_nLeds

int CLEDController::m_nLeds
protected

the number of LEDs in the LED data array

Definition at line 44 of file cled_controller.h.

◆ m_pHead

CLEDController * CLEDController::m_pHead = NULL
staticprotected

pointer to the first LED controller in the linked list

Definition at line 45 of file cled_controller.h.

◆ m_pNext

CLEDController* CLEDController::m_pNext
protected

pointer to the next LED controller in the linked list

Definition at line 39 of file cled_controller.h.

◆ m_pTail

CLEDController * CLEDController::m_pTail = NULL
staticprotected

pointer to the last LED controller in the linked list

Definition at line 46 of file cled_controller.h.

◆ mRgbMode

Rgbw CLEDController::mRgbMode = RgbwInvalid::value()

Definition at line 63 of file cled_controller.h.


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