mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-09 17:33:43 +00:00
4071028e85
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.
11 lines
241 B
Go
11 lines
241 B
Go
//go:build !rp2040 && !rp2350
|
|
|
|
package ws2812
|
|
|
|
import "machine"
|
|
|
|
// newWS2812Device creates a WS2812 device using the bit-bang driver.
|
|
func newWS2812Device(pin machine.Pin) Device {
|
|
return Device{Pin: pin, writeColorFunc: writeColorsRGB}
|
|
}
|