aboutsummaryrefslogtreecommitdiff
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)
downloadqmk_firmware-f74c769a19662147ead15dcd14777afe5e53c167.tar.gz
qmk_firmware-f74c769a19662147ead15dcd14777afe5e53c167.zip
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 80b694858..51b053b9b 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
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 | | :heavy_check_mark: | 17| SPI | | :heavy_check_mark: |
18| PWM | | Soon™ | 18| PWM | | :heavy_check_mark: |
19 19
20## Driver configuration 20## Driver configuration
21 21
@@ -66,4 +66,36 @@ While not an exhaustive list, the following table provides the scenarios that ha
66| f103 | A7 :heavy_check_mark: | 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: | 67| f303 | A7 :heavy_check_mark: B5 :heavy_check_mark: | B15 :heavy_check_mark: | B5 :heavy_check_mark: |
68 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 69*Other supported ChibiOS boards and/or pins may function, it will be highly chip and configuration dependent.*
70
71### PWM
72
73Targeting 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:
74
75```make
76WS2812_DRIVER = pwm
77```
78
79Configure the hardware via your config.h:
80```c
81#define WS2812_PWM_DRIVER PWMD2 // default: PWMD2
82#define WS2812_PWM_CHANNEL 2 // default: 2
83#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
84#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
85#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
86```
87
88You must also turn on the PWM feature in your halconf.h and mcuconf.h
89
90#### Testing Notes
91
92While not an exhaustive list, the following table provides the scenarios that have been partially validated:
93
94| | Status |
95|-|-|
96| f072 | ? |
97| f103 | :heavy_check_mark: |
98| f303 | :heavy_check_mark: |
99| f401/f411 | :heavy_check_mark: |
100
101*Other supported ChibiOS boards and/or pins may function, it will be highly chip and configuration dependent.*