This adds support to the WS2812 for the ESP32-C3 processor
which is a RISC-V processor from Espressif.
Signed-off-by: deadprogram <ron@hybridgroup.com>
This adds hardware timing support for driving WS2812 LEDs on Cortex-M microcontrollers running at 160MHz (such as the STM32U585).
- Updated `go:generate` directive to include 160MHz.
- Generated the corresponding `ws2812_writeByte160` assembly routine.
- Added a switch case in `WriteByte` to handle generic 160MHz processors.
Signed-off-by: deadprogram <ron@hybridgroup.com>
Integrate PIO support directly into the existing Device.
NewWS2812() now uses PIO for hardware-timed control
on RP2040/RP2350 and falls back to bit-banging on other platforms.
No changes to the exported API surface.
Previously, a new implementation had to be written for each processor
speed. This is tedious and error-prone, therefore I've rewritten all of
the assembly code using a tool that will calculate exactly how many NOP
instructions are required.
I've also switched from build tags to a switch statement over all
processor speeds.
All in all, this means that:
- Chips with a supported CPU performance will automatically be
supported (no build tags necessary).
- Adding a new chip is as easy as adding the MHz count to the
generator script and to the switch statement.
Right now this is only for the Cortex-M, but it's certainly feasible to
extend this to other architectures such as the AVR.
* Merge AVR support for Digispark and non-Digispark
* Fix the error "inline assembly requires more registers than available"
* Use a single file for all AVR targets, in a similar style as the
Xtensa support.