tester: add very basic mock structs for testing i2c devices, based on work done by @rogpeppe

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2020-08-26 16:44:47 +02:00
committed by Ron Evans
parent b1ae52d1b9
commit ce81b66fe2
6 changed files with 139 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
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(addr uint16, w, r []byte) error
}