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,7 +5,6 @@ import (
"errors"
"tinygo.org/x/drivers"
"tinygo.org/x/drivers/internal/pin"
)
// ErrThermocoupleOpen is returned when the thermocouple input is open.
@@ -14,13 +13,13 @@ var ErrThermocoupleOpen = errors.New("thermocouple input open")
type Device struct {
bus drivers.SPI
cs drivers.PinOutput
cs drivers.PinOutputFunc
}
// Create a new Device to read from a MAX6675 thermocouple.
// Pins must be configured before use. Frequency for SPI
// should be 4.3MHz maximum.
func NewDevice(bus drivers.SPI, cs pin.Output) *Device {
func NewDevice(bus drivers.SPI, cs drivers.PinOutput) *Device {
return &Device{
bus: bus,
cs: cs.Set,