fix uses of legacy i2c WriteRegister calls

This commit is contained in:
Kenneth Bell
2023-08-07 22:10:52 +01:00
committed by Ron Evans
parent eef03917ab
commit 996f1b047f
3 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -10,6 +10,7 @@ import (
"time"
"tinygo.org/x/drivers"
"tinygo.org/x/drivers/internal/legacy"
)
// Device wraps I2C or SPI connection.
@@ -277,9 +278,9 @@ func (d *Device) Tx(data []byte, isCommand bool) {
// tx sends data to the display (I2CBus implementation)
func (b *I2CBus) tx(data []byte, isCommand bool) {
if isCommand {
b.wire.WriteRegister(uint8(b.Address), 0x00, data)
legacy.WriteRegister(b.wire, uint8(b.Address), 0x00, data)
} else {
b.wire.WriteRegister(uint8(b.Address), 0x40, data)
legacy.WriteRegister(b.wire, uint8(b.Address), 0x40, data)
}
}