mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-15 12:23:41 +00:00
fix requested changes by @aykevl
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user