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
+2 -1
View File
@@ -5,6 +5,7 @@ import (
"errors"
"tinygo.org/x/drivers"
"tinygo.org/x/drivers/internal/legacy"
)
// registerAttributes is a bitfield of attributes for a register
@@ -94,7 +95,7 @@ func (r *i2cRegister) readShiftAndMask(bus drivers.I2C, deviceAddress uint8, shi
buf = buffer[:]
}
// Read the host register over I2C
err := bus.ReadRegister(deviceAddress, r.host.address, buf)
err := legacy.ReadRegister(bus, deviceAddress, r.host.address, buf)
if nil != err {
return 0, err
}