legacy.PinOutput->pin.Output and add High+Low methods on drivers.PinOutput and use them in drivers

This commit is contained in:
Patricio Whittingslow
2025-09-16 17:53:18 -03:00
committed by deadprogram
parent 2e007a6de7
commit 8ac285e821
30 changed files with 280 additions and 245 deletions
+12 -12
View File
@@ -176,11 +176,11 @@ func (d *Device) setCursor(x, y uint16) error {
}
func (d *Device) hwReset() {
d.rst(true)
d.rst.High()
time.Sleep(50 * time.Millisecond)
d.rst(false)
d.rst.Low()
time.Sleep(2 * time.Millisecond)
d.rst(true)
d.rst.High()
time.Sleep(50 * time.Millisecond)
}
@@ -232,26 +232,26 @@ func (d *Device) sendCommandSequence(seq []byte) error {
}
func (d *Device) sendCommandByte(b byte) error {
d.dc(false)
d.cs(false)
d.dc.Low()
d.cs.Low()
_, err := d.bus.Transfer(b)
d.cs(true)
d.cs.High()
return err
}
func (d *Device) sendDataByte(b byte) error {
d.dc(true)
d.cs(false)
d.dc.High()
d.cs.Low()
_, err := d.bus.Transfer(b)
d.cs(true)
d.cs.High()
return err
}
func (d *Device) sendData(b []byte) error {
d.dc(true)
d.cs(false)
d.dc.High()
d.cs.Low()
err := d.bus.Tx(b, nil)
d.cs(true)
d.cs.High()
return err
}