i2c iface refactor: Resolve 559

This commit is contained in:
soypat
2023-05-28 18:03:19 -03:00
committed by Ron Evans
parent e20c6d05f8
commit e6f82fad2e
37 changed files with 313 additions and 247 deletions
+3 -2
View File
@@ -8,6 +8,7 @@ import (
"machine"
"tinygo.org/x/drivers"
"tinygo.org/x/drivers/internal/legacy"
"tinygo.org/x/drivers/touch"
)
@@ -98,10 +99,10 @@ func (d *Device) Touched() bool {
}
func (d *Device) write1Byte(reg, data uint8) {
d.bus.WriteRegister(d.Address, reg, []byte{data})
legacy.WriteRegister(d.bus, d.Address, reg, []byte{data})
}
func (d *Device) read8bit(reg uint8) uint8 {
d.bus.ReadRegister(d.Address, reg, d.buf[:1])
legacy.ReadRegister(d.bus, d.Address, reg, d.buf[:1])
return d.buf[0]
}