undo epd2in66b Configure method deletion

This commit is contained in:
soypat
2025-11-10 16:10:07 -03:00
parent f9db7a6d0f
commit 0eabf16c36
+21
View File
@@ -8,6 +8,7 @@ import (
"time"
"tinygo.org/x/drivers"
"tinygo.org/x/drivers/internal/legacy"
"tinygo.org/x/drivers/internal/pin"
)
@@ -42,6 +43,26 @@ func New(bus drivers.SPI) Device {
}
}
type Config struct {
ResetPin pin.Output
DataPin pin.Output
ChipSelectPin pin.Output
BusyPin pin.Input
}
// Configure configures the device and its pins.
func (d *Device) Configure(c Config) error {
d.cs = c.ChipSelectPin.Set
d.dc = c.DataPin.Set
d.rst = c.ResetPin.Set
d.isBusy = c.BusyPin.Get
legacy.ConfigurePinOut(c.ChipSelectPin)
legacy.ConfigurePinOut(c.DataPin)
legacy.ConfigurePinOut(c.ResetPin)
legacy.ConfigurePinInput(c.BusyPin)
return nil
}
func (d *Device) Size() (x, y int16) {
return displayWidth, displayHeight
}