aboutsummaryrefslogtreecommitdiff
path: root/docs/drivers/apa102.md
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2024-08-26 10:01:57 +1000
committerNick Brassel <nick@tzarc.org>2024-08-26 10:01:57 +1000
commit5d76c5280dc0aff398cdce19fa54d0e0725c418d (patch)
tree40026340f0d524a6006f18f01ef988e15d271075 /docs/drivers/apa102.md
parente6a898e3eea3521d3f0497ee26937d5269d78fb7 (diff)
parent81dcf2b547bacc42bd9cf8ccaccd3d7164e69926 (diff)
Merge branch 'develop'
Diffstat (limited to 'docs/drivers/apa102.md')
-rw-r--r--docs/drivers/apa102.md47
1 files changed, 39 insertions, 8 deletions
diff --git a/docs/drivers/apa102.md b/docs/drivers/apa102.md
index 88868a73b5..197b18869e 100644
--- a/docs/drivers/apa102.md
+++ b/docs/drivers/apa102.md
@@ -26,20 +26,51 @@ Add the following to your `config.h`:
## API {#api}
-### `void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds)`
+### `void apa102_init(void)` {#api-apa102-init}
-Send RGB data to the APA102 LED chain.
+Initialize the LED driver. This function should be called first.
-#### Arguments {#api-apa102-setleds-arguments}
+---
+
+### `void apa102_set_color(uint16_t index, uint8_t red, uint8_t green, uint8_t blue)` {#api-apa102-set-color}
+
+Set the color of a single LED. This function does not immediately update the LEDs; call `apa102_flush()` after you are finished.
+
+#### Arguments {#api-apa102-set-color-arguments}
+
+ - `uint16_t index`
+ The LED index in the APA102 chain.
+ - `uint8_t red`
+ The red value to set.
+ - `uint8_t green`
+ The green value to set.
+ - `uint8_t blue`
+ The blue value to set.
+
+---
+
+### `void apa102_set_color_all(uint8_t red, uint8_t green, uint8_t blue)` {#api-apa102-set-color-all}
+
+Set the color of all LEDs.
+
+#### Arguments {#api-apa102-set-color-all-arguments}
+
+ - `uint8_t red`
+ The red value to set.
+ - `uint8_t green`
+ The green value to set.
+ - `uint8_t blue`
+ The blue value to set.
+
+---
+
+### `void apa102_flush(void)` {#api-apa102-flush}
- - `rgb_led_t *start_led`
- A pointer to the LED array.
- - `uint16_t num_leds`
- The length of the LED array.
+Flush the PWM values to the LED chain.
---
-### `void apa102_set_brightness(uint8_t brightness)`
+### `void apa102_set_brightness(uint8_t brightness)` {#api-apa102-set-brightness}
Set the global brightness.