summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2024-06-13 22:19:45 +1000
committerGitHub <noreply@github.com>2024-06-13 22:19:45 +1000
commit55538b2e1e743ec1a209e61880d52bb5d2156669 (patch)
tree22914c451f5d816470a159f28befd75585bfbceb /docs
parentc4a74be7f02ec64033638e93a49924df20fb2e57 (diff)
APA102: API rework (#23355)
Diffstat (limited to 'docs')
-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.