mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-09 09:23:39 +00:00
feature: some additional changes to drivers.Pin HAL for clarity and readability.
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
+2
-3
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user