File syn_smartled.h¶
FileList > output > syn_smartled.h
Go to the source code of this file
Generic Addressable RGB/RGBW Smart LED Strip Driver (WS2812B, SK6812, APA102, SK9822).
#include "../common/syn_defs.h"#include "../port/syn_port_gpio.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_SmartLED Generic Smart LED Strip Instance Context. |
| struct | SYN_SmartLEDColor 24-bit RGB Color Struct. |
Public Types¶
| Type | Name |
|---|---|
| enum | SYN_SmartLEDOrder Smart LED Color Channel Order. |
Public Functions¶
| Type | Name |
|---|---|
| void | syn_smartled_clear (SYN_SmartLED * led) Clear all pixels in strip (turn off all LEDs). |
| void | syn_smartled_fill_rgb (SYN_SmartLED * led, uint8_t r, uint8_t g, uint8_t b) Fill entire strip with a single RGB color. |
| SYN_Status | syn_smartled_init (SYN_SmartLED * led, SYN_GPIO_Pin data_pin, uint16_t num_leds, SYN_SmartLEDColor * pixel_buf, SYN_SmartLEDOrder order) Initialize a Smart LED Strip context. |
| void | syn_smartled_set_brightness (SYN_SmartLED * led, uint8_t brightness) Set global brightness scale (0 = off, 255 = 100% full brightness). |
| void | syn_smartled_set_pixel_hsv (SYN_SmartLED * led, uint16_t index, uint8_t h, uint8_t s, uint8_t v) Set HSV color of a specific LED pixel (0-255 hue, sat, val). |
| void | syn_smartled_set_pixel_rgb (SYN_SmartLED * led, uint16_t index, uint8_t r, uint8_t g, uint8_t b) Set RGB color of a specific LED pixel. |
Public Types Documentation¶
enum SYN_SmartLEDOrder¶
Smart LED Color Channel Order.
enum SYN_SmartLEDOrder {
SYN_SMARTLED_ORDER_GRB = 0,
SYN_SMARTLED_ORDER_RGB = 1,
SYN_SMARTLED_ORDER_RGBW = 2
};
Public Functions Documentation¶
function syn_smartled_clear¶
Clear all pixels in strip (turn off all LEDs).
Parameters:
ledSmart LED context.
function syn_smartled_fill_rgb¶
Fill entire strip with a single RGB color.
Parameters:
ledSmart LED context.rRed channel.gGreen channel.bBlue channel.
function syn_smartled_init¶
Initialize a Smart LED Strip context.
SYN_Status syn_smartled_init (
SYN_SmartLED * led,
SYN_GPIO_Pin data_pin,
uint16_t num_leds,
SYN_SmartLEDColor * pixel_buf,
SYN_SmartLEDOrder order
)
Parameters:
ledSmart LED context.data_pinGPIO data pin.num_ledsTotal LED count in strip.pixel_bufArray of SYN_SmartLEDColor structs (length = num_leds).orderColor channel order (GRB, RGB, RGBW).
Returns:
SYN_OK on success.
function syn_smartled_set_brightness¶
Set global brightness scale (0 = off, 255 = 100% full brightness).
Parameters:
ledSmart LED context.brightnessBrightness scale (0 to 255).
function syn_smartled_set_pixel_hsv¶
Set HSV color of a specific LED pixel (0-255 hue, sat, val).
void syn_smartled_set_pixel_hsv (
SYN_SmartLED * led,
uint16_t index,
uint8_t h,
uint8_t s,
uint8_t v
)
Parameters:
ledSmart LED context.indexPixel index (0 to num_leds-1).hHue (0 to 255).sSaturation (0 to 255).vValue / Intensity (0 to 255).
function syn_smartled_set_pixel_rgb¶
Set RGB color of a specific LED pixel.
void syn_smartled_set_pixel_rgb (
SYN_SmartLED * led,
uint16_t index,
uint8_t r,
uint8_t g,
uint8_t b
)
Parameters:
ledSmart LED context.indexPixel index (0 to num_leds-1).rRed channel (0 to 255).gGreen channel (0 to 255).bBlue channel (0 to 255).
The documentation for this class was generated from the following file src/syntropic/output/syn_smartled.h