ssd1331: make SPI TX faster

same change as PR #89
This commit is contained in:
Daniel Esteban
2019-10-11 18:13:12 +02:00
committed by Ayke
parent 7b710e3a48
commit bcb291992c
+3 -16
View File
@@ -34,7 +34,7 @@ type Config struct {
Height int16
}
// New creates a new ST7735 connection. The SPI wire must already be configured.
// New creates a new SSD1331 connection. The SPI wire must already be configured.
func New(bus machine.SPI, resetPin, dcPin, csPin machine.Pin) Device {
dcPin.Configure(machine.PinConfig{Mode: machine.PinOutput})
resetPin.Configure(machine.PinConfig{Mode: machine.PinOutput})
@@ -250,21 +250,8 @@ func (d *Device) Data(data uint8) {
// Tx sends data to the display
func (d *Device) Tx(data []byte, isCommand bool) {
if isCommand {
d.csPin.High()
d.dcPin.Low()
d.csPin.Low()
d.bus.Tx(data, nil)
d.csPin.High()
} else {
d.csPin.High()
d.dcPin.High()
d.csPin.Low()
d.bus.Tx(data, nil)
d.csPin.High()
}
d.dcPin.Set(!isCommand)
d.bus.Tx(data, nil)
}
// Size returns the current size of the display.