aboutsummaryrefslogtreecommitdiff
path: root/docs/ws2812_driver.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ws2812_driver.md')
-rw-r--r--docs/ws2812_driver.md29
1 files changed, 28 insertions, 1 deletions
diff --git a/docs/ws2812_driver.md b/docs/ws2812_driver.md
index 67481c458..80b694858 100644
--- a/docs/ws2812_driver.md
+++ b/docs/ws2812_driver.md
@@ -14,7 +14,7 @@ These LEDs are called "addressable" because instead of using a wire per color, e
14|----------|--------------------|--------------------| 14|----------|--------------------|--------------------|
15| bit bang | :heavy_check_mark: | :heavy_check_mark: | 15| bit bang | :heavy_check_mark: | :heavy_check_mark: |
16| I2C | :heavy_check_mark: | | 16| I2C | :heavy_check_mark: | |
17| SPI | | Soon™ | 17| SPI | | :heavy_check_mark: |
18| PWM | | Soon™ | 18| PWM | | Soon™ |
19 19
20## Driver configuration 20## Driver configuration
@@ -40,3 +40,30 @@ Configure the hardware via your config.h:
40#define WS2812_ADDRESS 0xb0 // default: 0xb0 40#define WS2812_ADDRESS 0xb0 // default: 0xb0
41#define WS2812_TIMEOUT 100 // default: 100 41#define WS2812_TIMEOUT 100 // default: 100
42``` 42```
43
44### SPI
45Targeting STM32 boards where WS2812 support is offloaded to an SPI hardware device. The advantage is that the use of DMA offloads processing of the WS2812 protocol from the MCU. `RGB_DI_PIN` for this driver is the configured SPI MOSI pin. Due to the nature of repurposing SPI to drive the LEDs, the other SPI pins, MISO and SCK, **must** remain unused. To configure it, add this to your rules.mk:
46
47```make
48WS2812_DRIVER = spi
49```
50
51Configure the hardware via your config.h:
52```c
53#define WS2812_SPI SPID1 // default: SPID1
54#define WS2812_SPI_MOSI_PAL_MODE 5 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 5
55```
56
57You must also turn on the SPI feature in your halconf.h and mcuconf.h
58
59#### Testing Notes
60
61While not an exhaustive list, the following table provides the scenarios that have been partially validated:
62
63| | SPI1 | SPI2 | SPI3 |
64|-|-|-|-|
65| f072 | ? | B15 :heavy_check_mark: | N/A |
66| f103 | A7 :heavy_check_mark: | B15 :heavy_check_mark: | N/A |
67| f303 | A7 :heavy_check_mark: B5 :heavy_check_mark: | B15 :heavy_check_mark: | B5 :heavy_check_mark: |
68
69*Other supported ChibiOS boards and/or pins may function, it will be highly chip and configuration dependent.* \ No newline at end of file