FastLED 3.9.3
Loading...
Searching...
No Matches
FastLED.h File Reference

Detailed Description

central include file for FastLED, defines the CFastLED class/object

Definition in file FastLED.h.

#include <stdint.h>
#include <SmartMatrix.h>
#include <OctoWS2811.h>
#include "force_inline.h"
#include "cpp_compat.h"
#include "fastled_config.h"
#include "led_sysdefs.h"
#include "fastled_delay.h"
#include "bitswap.h"
#include "controller.h"
#include "fastpin.h"
#include "fastspi_types.h"
#include "dmx.h"
#include "platforms.h"
#include "fastled_progmem.h"
#include "lib8tion.h"
#include "pixeltypes.h"
#include "hsv2rgb.h"
#include "colorutils.h"
#include "pixelset.h"
#include "colorpalettes.h"
#include "noise.h"
#include "power_mgt.h"
#include "fastspi.h"
#include "chipsets.h"
#include "engine_events.h"

Go to the source code of this file.

Classes

class  NEOPIXEL< DATA_PIN >
 LED controller for WS2812 LEDs with GRB color order. More...
 
class  SM16703< DATA_PIN, RGB_ORDER >
 SM16703 controller class. More...
 
class  TM1829< DATA_PIN, RGB_ORDER >
 TM1829 controller class. More...
 
class  TM1812< DATA_PIN, RGB_ORDER >
 TM1812 controller class. More...
 
class  TM1809< DATA_PIN, RGB_ORDER >
 TM1809 controller class. More...
 
class  TM1804< DATA_PIN, RGB_ORDER >
 TM1804 controller class. More...
 
class  TM1803< DATA_PIN, RGB_ORDER >
 TM1803 controller class. More...
 
class  UCS1903< DATA_PIN, RGB_ORDER >
 UCS1903 controller class. More...
 
class  UCS1903B< DATA_PIN, RGB_ORDER >
 UCS1903B controller class. More...
 
class  UCS1904< DATA_PIN, RGB_ORDER >
 UCS1904 controller class. More...
 
class  UCS2903< DATA_PIN, RGB_ORDER >
 UCS2903 controller class. More...
 
class  WS2812< DATA_PIN, RGB_ORDER >
 WS2812 controller class. More...
 
class  WS2815< DATA_PIN, RGB_ORDER >
 WS2815 controller class. More...
 
class  WS2852< DATA_PIN, RGB_ORDER >
 WS2852 controller class. More...
 
class  WS2812B< DATA_PIN, RGB_ORDER >
 WS2812B controller class. More...
 
class  GS1903< DATA_PIN, RGB_ORDER >
 GS1903 controller class. More...
 
class  SK6812< DATA_PIN, RGB_ORDER >
 SK6812 controller class. More...
 
class  SK6822< DATA_PIN, RGB_ORDER >
 SK6822 controller class. More...
 
class  APA106< DATA_PIN, RGB_ORDER >
 APA106 controller class. More...
 
class  PL9823< DATA_PIN, RGB_ORDER >
 PL9823 controller class. More...
 
class  WS2811< DATA_PIN, RGB_ORDER >
 WS2811 controller class. More...
 
class  WS2813< DATA_PIN, RGB_ORDER >
 WS2813 controller class. More...
 
class  APA104< DATA_PIN, RGB_ORDER >
 APA104 controller class. More...
 
class  WS2811_400< DATA_PIN, RGB_ORDER >
 WS2811_400 controller class. More...
 
class  GE8822< DATA_PIN, RGB_ORDER >
 GE8822 controller class. More...
 
class  GW6205< DATA_PIN, RGB_ORDER >
 GW6205 controller class. More...
 
class  GW6205_400< DATA_PIN, RGB_ORDER >
 GW6205_400 controller class. More...
 
class  LPD1886< DATA_PIN, RGB_ORDER >
 LPD1886 controller class. More...
 
class  LPD1886_8BIT< DATA_PIN, RGB_ORDER >
 LPD1886_8BIT controller class. More...
 
class  UCS1912< DATA_PIN, RGB_ORDER >
 UCS1912 controller class. More...
 
class  DMXSIMPLE< DATA_PIN, RGB_ORDER >
 DMX512 based LED controller class, using the DmxSimple library. More...
 
class  DMXSERIAL< RGB_ORDER >
 DMX512 based LED controller class, using the DMXSerial library. More...
 
class  CFastLED
 High level controller interface for FastLED. More...
 
struct  CFastLED::ClockedChipsetHelper< CHIPSET, DATA_PIN, CLOCK_PIN >
 

Macros

#define __INC_FASTSPI_LED2_H
 
#define FASTLED_VERSION   3009003
 Current FastLED version number, as an integer.
 
#define __PROG_TYPES_COMPAT__
 avr-libc define to expose progmem typedefs.
 
#define NUM_CONTROLLERS   8
 Unknown NUM_CONTROLLERS definition.
 
#define FastSPI_LED   FastLED
 Alias of the FastLED instance for legacy purposes.
 
#define FastSPI_LED2   FastLED
 Alias of the FastLED instance for legacy purposes.
 
#define NO_HARDWARE_PIN_SUPPORT
 If no pin/port mappings are found, sends a warning message to the user during compilation.
 
Adding SPI-based controllers

Add an SPI based CLEDController instance to the world.

There are two ways to call this method (as well as the other addLeds() variations). The first is with 2 arguments, in which case the arguments are a pointer to led data, and the number of leds used by this controller. The second is with 3 arguments, in which case the first argument is the same, the second argument is an offset into the CRGB data where this controller's CRGB data begins, and the third argument is the number of leds for this controller object.

Parameters
database pointer to an array of CRGB data structures
nLedsOrOffsetnumber of leds (3 argument version) or offset into the data array
nLedsIfOffsetnumber of leds (4 argument version)
Template Parameters
CHIPSETthe chipset type
DATA_PINthe optional data pin for the leds (if omitted, will default to the first hardware SPI MOSI pin)
CLOCK_PINthe optional clock pin for the leds (if omitted, will default to the first hardware SPI clock pin)
RGB_ORDERthe rgb ordering for the leds (e.g. what order red, green, and blue data is written out in)
SPI_DATA_RATEthe data rate to drive the SPI clock at, defined using DATA_RATE_MHZ or DATA_RATE_KHZ macros
Returns
a reference to the added controller
#define _FL_MAP_CLOCKED_CHIPSET(CHIPSET_ENUM, CONTROLLER_CLASS)
 

Typedefs

typedef uint8_t(* power_func) (uint8_t scale, uint32_t data)
 Typedef for a power consumption calculation function.
 

Enumerations

enum  ESPIChipsets {
  LPD6803 , LPD8806 , WS2801 , WS2803 ,
  SM16716 , P9813 , APA102 , SK9822 ,
  SK9822HD , DOTSTAR , DOTSTARHD , APA102HD
}
 LED chipsets with SPI interface. More...
 
enum  ESM { SMART_MATRIX }
 Smart Matrix Library controller type. More...
 
enum  OWS2811 { OCTOWS2811 , OCTOWS2811_400 , OCTOWS2813 }
 Octo WS2811 LED Library controller types. More...
 
enum  SWS2812 { WS2812SERIAL }
 WS2812Serial Library controller type. More...
 
enum  EBlockChipsets
 Blockless output port enum. More...
 

Variables

CFastLED FastLED
 Global LED strip management instance.
 

Macro Definition Documentation

◆ __INC_FASTSPI_LED2_H

#define __INC_FASTSPI_LED2_H

Definition at line 3 of file FastLED.h.

◆ __PROG_TYPES_COMPAT__

#define __PROG_TYPES_COMPAT__

avr-libc define to expose progmem typedefs.

Note
These typedefs are now deprecated!
See also
https://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html

Definition at line 34 of file FastLED.h.

◆ _FL_MAP_CLOCKED_CHIPSET

#define _FL_MAP_CLOCKED_CHIPSET ( CHIPSET_ENUM,
CONTROLLER_CLASS )
Value:
template<uint8_t DATA_PIN, uint8_t CLOCK_PIN> \
struct ClockedChipsetHelper<CHIPSET_ENUM, DATA_PIN, CLOCK_PIN> { \
static const bool IS_VALID = true; \
typedef CONTROLLER_CLASS<DATA_PIN, CLOCK_PIN> ControllerType; \
/* Controller type with RGB_ORDER specified */ \
template<EOrder RGB_ORDER> \
struct CONTROLLER_CLASS_WITH_ORDER { \
typedef CONTROLLER_CLASS<DATA_PIN, CLOCK_PIN, RGB_ORDER> ControllerType; \
}; \
/* Controller type with RGB_ORDER and spi frequency specified */ \
template<EOrder RGB_ORDER, uint32_t FREQ> \
struct CONTROLLER_CLASS_WITH_ORDER_AND_FREQ { \
typedef CONTROLLER_CLASS<DATA_PIN, CLOCK_PIN, RGB_ORDER, FREQ> ControllerType; \
}; \
};

Definition at line 412 of file FastLED.h.

◆ FASTLED_VERSION

#define FASTLED_VERSION   3009003

Current FastLED version number, as an integer.

E.g. 3007001 for version "3.7.1", with:

  • 1 digit for the major version
  • 3 digits for the minor version
  • 3 digits for the patch version

Definition at line 19 of file FastLED.h.

◆ FastSPI_LED

#define FastSPI_LED   FastLED

Alias of the FastLED instance for legacy purposes.

Definition at line 819 of file FastLED.h.

◆ FastSPI_LED2

#define FastSPI_LED2   FastLED

Alias of the FastLED instance for legacy purposes.

Definition at line 821 of file FastLED.h.

◆ NO_HARDWARE_PIN_SUPPORT

#define NO_HARDWARE_PIN_SUPPORT

If no pin/port mappings are found, sends a warning message to the user during compilation.

See also
fastpin.h

Definition at line 835 of file FastLED.h.

◆ NUM_CONTROLLERS

#define NUM_CONTROLLERS   8

Unknown NUM_CONTROLLERS definition.

Unused elsewhere in the library?

Todo
Remove?

Definition at line 336 of file FastLED.h.

Typedef Documentation

◆ power_func

typedef uint8_t(* power_func) (uint8_t scale, uint32_t data)

Typedef for a power consumption calculation function.

Used within CFastLED for rescaling brightness before sending the LED data to the strip with CFastLED::show().

Parameters
scalethe initial brightness scale value
datamax power data, in milliwatts
Returns
the brightness scale, limited to max power

Definition at line 345 of file FastLED.h.

Enumeration Type Documentation

◆ EBlockChipsets

Blockless output port enum.

Definition at line 293 of file FastLED.h.

◆ ESM

enum ESM

Smart Matrix Library controller type.

See also
https://github.com/pixelmatix/SmartMatrix

Definition at line 110 of file FastLED.h.

◆ ESPIChipsets

LED chipsets with SPI interface.

Enumerator
LPD6803 

LPD6803 LED chipset.

LPD8806 

LPD8806 LED chipset.

WS2801 

WS2801 LED chipset.

WS2803 

WS2803 LED chipset.

SM16716 

SM16716 LED chipset.

P9813 

P9813 LED chipset.

APA102 

APA102 LED chipset.

SK9822 

SK9822 LED chipset.

SK9822HD 

SK9822 LED chipset with 5-bit gamma correction.

DOTSTAR 

APA102 LED chipset alias.

DOTSTARHD 

APA102HD LED chipset alias.

APA102HD 

APA102 LED chipset with 5-bit gamma correction.

Definition at line 93 of file FastLED.h.

◆ OWS2811

enum OWS2811

Octo WS2811 LED Library controller types.

See also
https://www.pjrc.com/teensy/td_libs_OctoWS2811.html
https://github.com/PaulStoffregen/OctoWS2811

Definition at line 115 of file FastLED.h.

◆ SWS2812

enum SWS2812

WS2812Serial Library controller type.

See also
https://www.pjrc.com/non-blocking-ws2812-led-library/
https://github.com/PaulStoffregen/WS2812Serial

Definition at line 120 of file FastLED.h.

Variable Documentation

◆ FastLED

CFastLED FastLED
extern

Global LED strip management instance.

Definition at line 33 of file FastLED.cpp.