diff --git a/ssd1331/ssd1331.go b/ssd1331/ssd1331.go index c76d7ee..1534418 100644 --- a/ssd1331/ssd1331.go +++ b/ssd1331/ssd1331.go @@ -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.