Device support for Adafruit DotStar LEDs (Opsco SK9822) More...
Device support for Adafruit DotStar LEDs (Opsco SK9822)
#include <dotstar.h>
Classes | |
struct | Config |
Public Types | |
enum class | Result { OK , ERR_INVALID_ARGUMENT , ERR_TRANSPORT } |
Public Member Functions | |
DotStar () | |
~DotStar () | |
Result | Init (Config &config) |
void | SetAllGlobalBrightness (uint16_t b) |
Set global brightness for all pixels. | |
Result | SetPixelGlobalBrightness (uint16_t idx, uint16_t b) |
Set global brightness for a single pixel. | |
uint16_t | GetPixelColor (uint16_t idx) |
void | SetPixelColor (uint16_t idx, const Color &color) |
Sets color of a single pixel. | |
void | SetPixelColor (uint16_t idx, uint32_t color) |
Sets color of a single pixel. | |
Result | SetPixelColor (uint16_t idx, uint8_t r, uint8_t g, uint8_t b) |
Sets color of a single pixel. | |
void | Fill (const Color &color) |
Fills all pixels with color. | |
void | Fill (uint32_t color) |
Fills all pixels with color. | |
void | Fill (uint8_t r, uint8_t g, uint8_t b) |
Fill all pixels with color. | |
void | Clear () |
Clears all current color data. Does not reset global brightnesses. Does not write pixel buffer data to LEDs. | |
Result | Show () |
Writes current pixel buffer data to LEDs. | |
|
strong |
|
inline |
|
inline |
|
inline |
Clears all current color data. Does not reset global brightnesses. Does not write pixel buffer data to LEDs.
Fills all pixels with color.
color | Color with which to fill all pixels |
Fills all pixels with color.
color | 32-bit integer representing 24-bit RGB color. MSB ignored. |
Fill all pixels with color.
r | 8-bit red value to apply to pixels |
g | 8-bit green value to apply to pixels |
b | 8-bit blue value to apply to pixels |
|
inline |
|
inline |
Set global brightness for all pixels.
"Global brightness" for the SK9822 device sets the equivalent constant current for the LEDs, not a pre-multiplied PWM brightness scaling for the pixel's RGB value. See SK9822 datasheet for details.
b | 5-bit global brightness setting (0 - 31) |
Sets color of a single pixel.
idx | Index of the pixel |
color | Color object to apply to the pixel |
|
inline |
Sets color of a single pixel.
color | 32-bit integer representing 24-bit RGB color. MSB ignored. |
|
inline |
Sets color of a single pixel.
idx | Index of the pixel |
r | 8-bit red value to apply to pixel |
g | 8-bit green value to apply to pixel |
b | 8-bit blue value to apply to pixel |
|
inline |
Set global brightness for a single pixel.
"Global brightness" for the SK9822 device sets the equivalent constant current for the LEDs. See datasheet for details.
idx | Index of the pixel for which to set global brightness |
b | 5-bit global brightness setting (0 - 31) |
|
inline |
Writes current pixel buffer data to LEDs.