From 6f7466b6dd72e161b61683e26b7720421d8cc9bd Mon Sep 17 00:00:00 2001 From: Xelus22 <17491233+Xelus22@users.noreply.github.com> Date: Fri, 19 Mar 2021 08:29:18 +0000 Subject: ARM WS2812 SPI config (baudrate and circular buffer) (#12216) * initial commit * include circular buffer command * add endif * circular buffer mode * remove untrue comment * revamp and add documentation * do not allow WS2812_SPI_SYNC & CIRCULAR_BUFFER --- docs/ws2812_driver.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'docs/ws2812_driver.md') diff --git a/docs/ws2812_driver.md b/docs/ws2812_driver.md index fa14f02fdb..e69400364c 100644 --- a/docs/ws2812_driver.md +++ b/docs/ws2812_driver.md @@ -77,6 +77,25 @@ Configure the hardware via your config.h: You must also turn on the SPI feature in your halconf.h and mcuconf.h +#### Circular Buffer Mode +Some boards may flicker while in the normal buffer mode. To fix this issue, circular buffer mode may be used to rectify the issue. + +By default, the circular buffer mode is disabled. + +To enable this alternative buffer mode, place this into your `config.h` file: +```c +#define WS2812_SPI_USE_CIRCULAR_BUFFER +``` + +#### Setting baudrate with divisor +To 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. + +Only divisors of 2, 4, 8, 16, 32, 64, 128 and 256 are supported by hardware. + +|Define |Default|Description | +|--------------------|-------|-------------------------------------| +|`WS2812_SPI_DIVISOR`|`16` |SPI source clock peripheral divisor | + #### Testing Notes While not an exhaustive list, the following table provides the scenarios that have been partially validated: -- cgit v1.2.3