qmk_firmware/docs/ws2812_driver.md
Joel Challis 1ea0cac998
ARM - ws2812 bitbang ()
* Initial ARM bitbang ws2812 driver

* Unify chibios platform to run rgblight_task

* Remove 'avr only' comments from ws2812 docs

* Remove 'avr only' comments from ws2812 docs

* Unify chibios platform to run rgblight_task - review comments

* Remove debug flags from keymap

* Add comments from review

* Add defines for STM32L0XX

* Attempt to get arm ws2812 working on multiple gcc versions
2019-11-07 13:10:29 +00:00

1.6 KiB

WS2812 Driver

This driver powers the RGB Lighting and RGB Matrix features.

Currently QMK supports the following addressable LEDs (however, the white LED in RGBW variants is not supported):

WS2811, WS2812, WS2812B, WS2812C, etc.
SK6812, SK6812MINI, SK6805

These LEDs are called "addressable" because instead of using a wire per color, each LED contains a small microchip that understands a special protocol sent over a single wire. The chip passes on the remaining data to the next LED, allowing them to be chained together. In this way, you can easily control the color of the individual LEDs.

Supported Driver Types

AVR ARM
bit bang ✔️ ✔️
I2C ✔️
SPI Soon™
PWM Soon™

Driver configuration

Bitbang

Default driver, the absence of configuration assumes this driver. To configure it, add this to your rules.mk:

WS2812_DRIVER = bitbang

!> This driver is not hardware accelerated and may not be performant on heavily loaded systems.

I2C

Targeting boards where WS2812 support is offloaded to a 2nd MCU. Currently the driver is limited to AVR given the known consumers are ps2avrGB/BMC. To configure it, add this to your rules.mk:

WS2812_DRIVER = i2c

Configure the hardware via your config.h:

#define WS2812_ADDRESS 0xb0 // default: 0xb0
#define WS2812_TIMEOUT 100 // default: 100