FastLED 3.6.0
|
base definitions used by led controllers for writing out led data
Definition in file controller.h.
#include "FastLED.h"
#include "led_sysdefs.h"
#include "pixeltypes.h"
#include "color.h"
#include <stddef.h>
Go to the source code of this file.
Classes | |
class | CLEDController |
Base definition for an LED controller. More... | |
struct | PixelController< RGB_ORDER, LANES, MASK > |
Pixel controller class. More... | |
class | CPixelLEDController< RGB_ORDER, LANES, MASK > |
Template extension of the CLEDController class. More... | |
Macros | |
#define | RO(X) RGB_BYTE(RGB_ORDER, X) |
Gets the assigned color channel for a byte's position in the output, using the color order (EOrder) template parameter from the LED controller. | |
#define | RGB_BYTE(RO, X) (((RO)>>(3*(2-(X)))) & 0x3) |
Gets the assigned color channel for a byte's position in the output, using a passed RGB color order. | |
#define | RGB_BYTE0(RO) ((RO>>6) & 0x3) |
Gets the color channel for byte 0. | |
#define | RGB_BYTE1(RO) ((RO>>3) & 0x3) |
Gets the color channel for byte 1. | |
#define | RGB_BYTE2(RO) ((RO) & 0x3) |
Gets the color channel for byte 2. | |
#define | DISABLE_DITHER 0x00 |
Disable dithering. | |
#define | BINARY_DITHER 0x01 |
Enable dithering using binary dithering (only option) | |
#define | MAX_LIKELY_UPDATE_RATE_HZ 400 |
Predicted max update rate, in Hertz. | |
#define | MIN_ACCEPTABLE_DITHER_RATE_HZ 50 |
Minimum acceptable dithering rate, in Hertz. | |
#define | UPDATES_PER_FULL_DITHER_CYCLE (MAX_LIKELY_UPDATE_RATE_HZ / MIN_ACCEPTABLE_DITHER_RATE_HZ) |
The number of updates in a single dither cycle. | |
#define | RECOMMENDED_VIRTUAL_BITS |
Set "virtual bits" of dithering to the highest level that is not likely to cause excessive flickering at low brightness levels + low update rates. | |
#define | VIRTUAL_BITS RECOMMENDED_VIRTUAL_BITS |
Alias for RECOMMENDED_VIRTUAL_BITS. | |
Typedefs | |
typedef uint8_t | EDitherMode |
The dither setting, either DISABLE_DITHER or BINARY_DITHER. | |
#define BINARY_DITHER 0x01 |
Enable dithering using binary dithering (only option)
Definition at line 46 of file controller.h.
#define DISABLE_DITHER 0x00 |
Disable dithering.
Definition at line 44 of file controller.h.
#define MAX_LIKELY_UPDATE_RATE_HZ 400 |
Predicted max update rate, in Hertz.
Definition at line 335 of file controller.h.
#define MIN_ACCEPTABLE_DITHER_RATE_HZ 50 |
Minimum acceptable dithering rate, in Hertz.
Definition at line 338 of file controller.h.
#define RECOMMENDED_VIRTUAL_BITS |
Set "virtual bits" of dithering to the highest level that is not likely to cause excessive flickering at low brightness levels + low update rates.
These pre-set values are a little ambitious, since a 400Hz update rate for WS2811-family LEDs is only possible with 85 pixels or fewer. Once we have a "number of milliseconds since last update" value available here, we can quickly calculate the correct number of "virtual bits" on the fly with a couple of "if" statements – no division required. At this point, the division is done at compile time, so there's no runtime cost, but the values are still hard-coded.
Definition at line 356 of file controller.h.
Gets the assigned color channel for a byte's position in the output, using a passed RGB color order.
RO | the RGB color order |
X | the byte's position in the output (0-2) |
Definition at line 29 of file controller.h.
Gets the color channel for byte 0.
Definition at line 33 of file controller.h.
Gets the color channel for byte 1.
Definition at line 36 of file controller.h.
Gets the color channel for byte 2.
Definition at line 39 of file controller.h.
#define RO | ( | X | ) | RGB_BYTE(RGB_ORDER, X) |
Gets the assigned color channel for a byte's position in the output, using the color order (EOrder) template parameter from the LED controller.
X | the byte's position in the output (0-2) |
Definition at line 21 of file controller.h.
#define UPDATES_PER_FULL_DITHER_CYCLE (MAX_LIKELY_UPDATE_RATE_HZ / MIN_ACCEPTABLE_DITHER_RATE_HZ) |
The number of updates in a single dither cycle.
Definition at line 341 of file controller.h.
#define VIRTUAL_BITS RECOMMENDED_VIRTUAL_BITS |
Alias for RECOMMENDED_VIRTUAL_BITS.
Definition at line 366 of file controller.h.
typedef uint8_t EDitherMode |
The dither setting, either DISABLE_DITHER or BINARY_DITHER.
Definition at line 48 of file controller.h.