summaryrefslogtreecommitdiffstats
path: root/docs/ws2812_driver.md
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-03-01 02:05:56 +0000
committerGitHub <noreply@github.com>2020-03-01 13:05:56 +1100
commitf74c769a19662147ead15dcd14777afe5e53c167 (patch)
treeb18226acb011831820f0f6ce9a0c2cbed287bf9a /docs/ws2812_driver.md
parentbb472364909aa8ad0ff8efb76a428df2960e1a7c (diff)
PWM DMA based RGB Underglow for STM32 (#7928)
* Add pwm ws2812 driver * Add docs for pwm ws2812 driver * Update ws2812_pwm for ChibiOS 19 Co-Authored-By: Nick Brassel <nick@tzarc.org> Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'docs/ws2812_driver.md')
-rw-r--r--docs/ws2812_driver.md36
1 files changed, 34 insertions, 2 deletions
diff --git a/docs/ws2812_driver.md b/docs/ws2812_driver.md
index 80b6948586..51b053b9b4 100644
--- a/docs/ws2812_driver.md
+++ b/docs/ws2812_driver.md
@@ -15,7 +15,7 @@ These LEDs are called "addressable" because instead of using a wire per color, e
| bit bang | :heavy_check_mark: | :heavy_check_mark: |
| I2C | :heavy_check_mark: | |
| SPI | | :heavy_check_mark: |
-| PWM | | Soon™ |
+| PWM | | :heavy_check_mark: |
## Driver configuration
@@ -66,4 +66,36 @@ While not an exhaustive list, the following table provides the scenarios that ha
| f103 | A7 :heavy_check_mark: | B15 :heavy_check_mark: | N/A |
| f303 | A7 :heavy_check_mark: B5 :heavy_check_mark: | B15 :heavy_check_mark: | B5 :heavy_check_mark: |
-*Other supported ChibiOS boards and/or pins may function, it will be highly chip and configuration dependent.* \ No newline at end of file
+*Other supported ChibiOS boards and/or pins may function, it will be highly chip and configuration dependent.*
+
+### PWM
+
+Targeting STM32 boards where WS2812 support is offloaded to an PWM timer and DMA stream. The advantage is that the use of DMA offloads processing of the WS2812 protocol from the MCU. To configure it, add this to your rules.mk:
+
+```make
+WS2812_DRIVER = pwm
+```
+
+Configure the hardware via your config.h:
+```c
+#define WS2812_PWM_DRIVER PWMD2 // default: PWMD2
+#define WS2812_PWM_CHANNEL 2 // default: 2
+#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
+#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
+#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
+```
+
+You must also turn on the PWM feature in your halconf.h and mcuconf.h
+
+#### Testing Notes
+
+While not an exhaustive list, the following table provides the scenarios that have been partially validated:
+
+| | Status |
+|-|-|
+| f072 | ? |
+| f103 | :heavy_check_mark: |
+| f303 | :heavy_check_mark: |
+| f401/f411 | :heavy_check_mark: |
+
+*Other supported ChibiOS boards and/or pins may function, it will be highly chip and configuration dependent.*