feature: some additional changes to drivers.Pin HAL for clarity and readability.

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2025-09-20 08:29:32 +02:00
parent 97ed81556b
commit d224b5d648
33 changed files with 139 additions and 171 deletions
+2 -3
View File
@@ -5,18 +5,17 @@ import (
"time"
"tinygo.org/x/drivers"
"tinygo.org/x/drivers/internal/pin"
)
// Device wraps a GPIO connection to a buzzer.
type Device struct {
pin drivers.PinOutput
pin drivers.PinOutputFunc
High bool
BPM float64
}
// New returns a new buzzer driver given which pin to use
func New(pin pin.Output) Device {
func New(pin drivers.PinOutput) Device {
return Device{
pin: pin.Set,
High: false,