ws2812: add support for 160MHz cortex-m processors

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>
This commit is contained in:
deadprogram
2026-05-06 18:41:29 +02:00
committed by Ron Evans
parent 62663c1832
commit f459992f3c
3 changed files with 385 additions and 1 deletions
+3
View File
@@ -34,6 +34,9 @@ func (d Device) WriteByte(c byte) error {
case 150_000_000: // 150MHz, e.g. rp2350
d.writeByte150(c)
return nil
case 160_000_000: // 160MHz, e.g. stm32u585
d.writeByte160(c)
return nil
case 168_000_000: // 168MHz, e.g. stm32f405
d.writeByte168(c)
return nil