fix requested changes by @aykevl

This commit is contained in:
soypat
2023-05-31 22:08:39 -03:00
committed by Ron Evans
parent 64029612e0
commit 31538f1b2f
6 changed files with 24 additions and 16 deletions
+10 -2
View File
@@ -3,7 +3,15 @@ package drivers
// I2C represents an I2C bus. It is notably implemented by the
// machine.I2C type.
type I2C interface {
// ReadRegister(addr uint8, r uint8, buf []byte) error
// WriteRegister(addr uint8, r uint8, buf []byte) error
// Tx performs a [I²C] transaction with address addr.
// Most I2C peripherals have some sort of register mapping scheme to allow
// users to interact with them:
//
// bus.Tx(addr, []byte{reg}, buf) // Reads register reg into buf.
// bus.Tx(addr, append([]byte{reg}, buf...), nil) // Writes buf into register reg.
//
// The semantics of most I2C transactions require that the w write buffer be non-empty.
//
// [I²C]: https://en.wikipedia.org/wiki/I%C2%B2C
Tx(addr uint16, w, r []byte) error
}