Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WS2812B driver (SPI-based) #190

Merged
merged 3 commits into from
Apr 6, 2019
Merged

Conversation

salkinium
Copy link
Member

This adds a driver for any number of chained WS2812 leds using a 3-bit SPI encoding (0 -> 100, 1 -> 110) running at 3 MHz.

There are several caveats:

  1. Since we don't have DMA, this uses the STM32 HAL directly to keep the transmit register full.
  2. Atomic lock is not enforced, this should be done externally, if required. (Writing one LED takes 24µs, so this atomic section could become quite long).
  3. The memory footprint is 3x as large, due to the bit stuffing for SPI.
  4. There is no enforced reset period of at least 50µs after the write is finished, it is up to the user to not trigger another write too early.

Unfortunately due to the SPI HAL being used directly, this driver is STM32 specific.

@salkinium salkinium merged commit a6b4186 into modm-io:develop Apr 6, 2019
@salkinium salkinium deleted the feature/ws2812 branch April 6, 2019 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant