diff options
Diffstat (limited to 'docs/ws2812_driver.md')
| -rw-r--r-- | docs/ws2812_driver.md | 28 | 
1 files changed, 25 insertions, 3 deletions
| diff --git a/docs/ws2812_driver.md b/docs/ws2812_driver.md index 244d39dbe0..8851c042f0 100644 --- a/docs/ws2812_driver.md +++ b/docs/ws2812_driver.md @@ -33,6 +33,7 @@ Add the following to your `config.h`:  |`WS2812_T0H`       |`350`                  |The length of a "0" bit's high phase in nanoseconds                                             |  |`WS2812_TRST_US`   |`280`                  |The length of the reset phase in microseconds                                                   |  |`WS2812_BYTE_ORDER`|`WS2812_BYTE_ORDER_GRB`|The byte order of the RGB data                                                                  | +|`WS2812_RGBW`      |*Not defined*          |Enables RGBW support (except `i2c` driver)                                                      |  ### Timing Adjustment :id=timing-adjustment @@ -58,6 +59,27 @@ Where the byte order may be one of:  |`RGB`     |WS2812B-2020                |  |`BGR`     |TM1812                      | +### RGBW Support :id=rgbw-support + +Rendering the color white with RGB LEDs is typically inconsistent due to inherent variations between each individual LED die. However, some WS2812 variants (such as SK6812RGBW) also possess a white LED along with the red, green, and blue channels, which allows for a more accurate white to be displayed. + +QMK can automatically convert the RGB data to be sent to the LEDs to mix in the white channel: + +``` +w = min(r, g, b) +r -= w +g -= w +b -= w +``` + +Thus, an RGB triplet of `255,255,255` will simply turn on the white LED fully (`0,0,0,255`). + +To enable RGBW conversion, add the following to your `config.h`: + +```c +#define WS2812_RGBW +``` +  ## Driver Configuration :id=driver-configuration  Driver selection can be configured in `rules.mk` as `WS2812_DRIVER`, or in `info.json` as `ws2812.driver`. Valid values are `bitbang` (default), `i2c`, `spi`, `pwm`, `vendor`, or `custom`. See below for information on individual drivers. @@ -208,9 +230,9 @@ The following `#define`s apply only to the `pwm` driver:  |`WS2812_PWM_DRIVER`              |`PWMD2`             |The PWM driver to use                                                                     |  |`WS2812_PWM_CHANNEL`             |`2`                 |The PWM channel to use                                                                    |  |`WS2812_PWM_PAL_MODE`            |`2`                 |The pin alternative function to use                                                       | -|`WS2812_DMA_STREAM`              |`STM32_DMA1_STREAM2`|The DMA Stream for `TIMx_UP`                                                              | -|`WS2812_DMA_CHANNEL`             |`2`                 |The DMA Channel for `TIMx_UP`                                                             | -|`WS2812_DMAMUX_ID`               |*Not defined*       |The DMAMUX configuration for `TIMx_UP` - only required if your MCU has a DMAMUX peripheral| +|`WS2812_PWM_DMA_STREAM`          |`STM32_DMA1_STREAM2`|The DMA Stream for `TIMx_UP`                                                              | +|`WS2812_PWM_DMA_CHANNEL`         |`2`                 |The DMA Channel for `TIMx_UP`                                                             | +|`WS2812_PWM_DMAMUX_ID`           |*Not defined*       |The DMAMUX configuration for `TIMx_UP` - only required if your MCU has a DMAMUX peripheral|  |`WS2812_PWM_COMPLEMENTARY_OUTPUT`|*Not defined*       |Whether the PWM output is complementary (`TIMx_CHyN`)                                     |  ?> Using a complementary timer output (`TIMx_CHyN`) is possible only for advanced-control timers (1, 8 and 20 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. | 
