mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-16 04:43:25 +00:00
legacy.PinOutput->pin.Output and add High+Low methods on drivers.PinOutput and use them in drivers
This commit is contained in:
committed by
deadprogram
parent
2e007a6de7
commit
8ac285e821
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user