refactor: add display.Pin interface and use it everywhere that is easy to do so

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2025-03-16 17:35:09 +01:00
committed by Yurii Soldak
parent d02d21ecea
commit 38c606d813
28 changed files with 164 additions and 236 deletions
+2 -3
View File
@@ -3,7 +3,6 @@ package max6675
import (
"errors"
"machine"
"tinygo.org/x/drivers"
)
@@ -14,13 +13,13 @@ var ErrThermocoupleOpen = errors.New("thermocouple input open")
type Device struct {
bus drivers.SPI
cs machine.Pin
cs drivers.Pin
}
// 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 machine.Pin) *Device {
func NewDevice(bus drivers.SPI, cs drivers.Pin) *Device {
return &Device{
bus: bus,
cs: cs,