daisy::DotStar¶
Device support for Adafruit DotStar LEDs (Opsco SK9822) More...
#include <dotstar.h>
Public Classes¶
Name | |
---|---|
struct | Config |
Public Types¶
Name | |
---|---|
enum class | Result |
Public Functions¶
Name | |
---|---|
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. |
Detailed Description¶
Device support for Adafruit DotStar LEDs (Opsco SK9822)
Author: Nick Donaldson
Date: March 2023
Public Types Documentation¶
enum Result¶
Enumerator | Value | Description |
---|---|---|
OK | ||
ERR_INVALID_ARGUMENT | ||
ERR_TRANSPORT |
Public Functions Documentation¶
function DotStar¶
function ~DotStar¶
function Init¶
function SetAllGlobalBrightness¶
Set global brightness for all pixels.
Parameters:
- b 5-bit global brightness setting (0 - 31)
Warning: Recommend not going above 10, especially for SK9822-EC20 which may overheat if you do.
"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.
function SetPixelGlobalBrightness¶
Set global brightness for a single pixel.
Parameters:
- idx Index of the pixel for which to set global brightness
- b 5-bit global brightness setting (0 - 31)
Warning: Recommend not going above 10, especially for SK9822-EC20 which may overheat if you do.
"Global brightness" for the SK9822 device sets the equivalent constant current for the LEDs. See datasheet for details.
function GetPixelColor¶
function SetPixelColor¶
Sets color of a single pixel.
Parameters:
- idx Index of the pixel
- color Color object to apply to the pixel
function SetPixelColor¶
Sets color of a single pixel.
Parameters:
- color 32-bit integer representing 24-bit RGB color. MSB ignored.
function SetPixelColor¶
Sets color of a single pixel.
Parameters:
- 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
function Fill¶
Fills all pixels with color.
Parameters:
- color Color with which to fill all pixels
function Fill¶
Fills all pixels with color.
Parameters:
- color 32-bit integer representing 24-bit RGB color. MSB ignored.
function Fill¶
Fill all pixels with color.
Parameters:
- 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
function Clear¶
Clears all current color data. Does not reset global brightnesses. Does not write pixel buffer data to LEDs.
function Show¶
Writes current pixel buffer data to LEDs.
---¶
Updated on 2024-01-03 at 19:41:00 +0000