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.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/ws2812_driver.md b/docs/ws2812_driver.md
index cca6827ec..e69400364 100644
--- a/docs/ws2812_driver.md
+++ b/docs/ws2812_driver.md
@@ -77,6 +77,25 @@ Configure the hardware via your config.h:
77 77
78You must also turn on the SPI feature in your halconf.h and mcuconf.h 78You must also turn on the SPI feature in your halconf.h and mcuconf.h
79 79
80#### Circular Buffer Mode
81Some boards may flicker while in the normal buffer mode. To fix this issue, circular buffer mode may be used to rectify the issue.
82
83By default, the circular buffer mode is disabled.
84
85To enable this alternative buffer mode, place this into your `config.h` file:
86```c
87#define WS2812_SPI_USE_CIRCULAR_BUFFER
88```
89
90#### Setting baudrate with divisor
91To adjust the baudrate at which the SPI peripheral is configured, users will need to derive the target baudrate from the clock tree provided by STM32CubeMX.
92
93Only divisors of 2, 4, 8, 16, 32, 64, 128 and 256 are supported by hardware.
94
95|Define |Default|Description |
96|--------------------|-------|-------------------------------------|
97|`WS2812_SPI_DIVISOR`|`16` |SPI source clock peripheral divisor |
98
80#### Testing Notes 99#### Testing Notes
81 100
82While not an exhaustive list, the following table provides the scenarios that have been partially validated: 101While not an exhaustive list, the following table provides the scenarios that have been partially validated:
@@ -102,11 +121,14 @@ Configure the hardware via your config.h:
102#define WS2812_PWM_DRIVER PWMD2 // default: PWMD2 121#define WS2812_PWM_DRIVER PWMD2 // default: PWMD2
103#define WS2812_PWM_CHANNEL 2 // default: 2 122#define WS2812_PWM_CHANNEL 2 // default: 2
104#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 123#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
124//#define WS2812_PWM_COMPLEMENTARY_OUTPUT // Define for a complementary timer output (TIMx_CHyN); omit for a normal timer output (TIMx_CHy).
105#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. 125#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
106#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. 126#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
107#define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. 127#define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU.
108``` 128```
109 129
130Note that using a complementary timer output (TIMx_CHyN) is possible only for advanced-control timers (TIM1, TIM8, TIM20 on STM32), and the `STM32_PWM_USE_ADVANCED` option in mcuconf.h must be set to `TRUE`. Complementary outputs of general-purpose timers are not supported due to ChibiOS limitations.
131
110You must also turn on the PWM feature in your halconf.h and mcuconf.h 132You must also turn on the PWM feature in your halconf.h and mcuconf.h
111 133
112#### Testing Notes 134#### Testing Notes