mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-16 04:43:25 +00:00
i2c iface refactor: Resolve 559
This commit is contained in:
+3
-2
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user