i2c: update function signatures to have correct types
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
4ebb3b8597
commit
f8f92af056
|
@ -36,7 +36,7 @@ func (t *i2cTestAdaptor) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (t *i2cTestAdaptor) ReadByte() (val uint8, err error) {
|
||||
func (t *i2cTestAdaptor) ReadByte() (val byte, err error) {
|
||||
bytes := []byte{0}
|
||||
bytesRead, err := t.i2cReadImpl(bytes)
|
||||
if err != nil {
|
||||
|
@ -82,7 +82,7 @@ func (t *i2cTestAdaptor) ReadBlockData(_ uint8, b []byte) (n int, err error) {
|
|||
return bytesRead, err
|
||||
}
|
||||
|
||||
func (t *i2cTestAdaptor) WriteByte(val uint8) (err error) {
|
||||
func (t *i2cTestAdaptor) WriteByte(val byte) (err error) {
|
||||
t.written = append(t.written, val)
|
||||
bytes := []byte{val}
|
||||
_, err = t.i2cWriteImpl(bytes)
|
||||
|
|
|
@ -60,7 +60,7 @@ func (c *i2cConnection) Close() error {
|
|||
return c.bus.Close()
|
||||
}
|
||||
|
||||
func (c *i2cConnection) ReadByte() (val uint8, err error) {
|
||||
func (c *i2cConnection) ReadByte() (val byte, err error) {
|
||||
if err := c.bus.SetAddress(c.address); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ func (c *i2cConnection) ReadBlockData(reg uint8, b []byte) (n int, err error) {
|
|||
return c.bus.ReadBlockData(reg, b)
|
||||
}
|
||||
|
||||
func (c *i2cConnection) WriteByte(val uint8) (err error) {
|
||||
func (c *i2cConnection) WriteByte(val byte) (err error) {
|
||||
if err := c.bus.SetAddress(c.address); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue