mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-17 13:23:26 +00:00
ws2812: improve documentation
This commit is contained in:
@@ -1,13 +1,17 @@
|
|||||||
|
// Package ws2812 implements a driver for WS2812 and SK6812 RGB LED strips.
|
||||||
package ws2812
|
package ws2812
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"machine"
|
"machine"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// WS2812 wraps a pin object for an easy driver interface.
|
||||||
type WS2812 struct {
|
type WS2812 struct {
|
||||||
Pin machine.GPIO
|
Pin machine.GPIO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// New returns a new WS2812 driver. It does not touch the pin object: you have
|
||||||
|
// to configure it as an output pin before calling New.
|
||||||
func New(pin machine.GPIO) WS2812 {
|
func New(pin machine.GPIO) WS2812 {
|
||||||
return WS2812{pin}
|
return WS2812{pin}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
package ws2812
|
package ws2812
|
||||||
|
|
||||||
|
// This file implements the WS2812 protocol for 16MHz Cortex-M0
|
||||||
|
// microcontrollers.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"device/arm"
|
"device/arm"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user