1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-29 13:49:14 +08:00

40 lines
627 B
Go
Raw Normal View History

2014-04-27 18:54:41 -07:00
package i2c
2014-11-29 12:10:23 -08:00
import (
"errors"
"github.com/hybridgroup/gobot"
)
var (
ErrEncryptedBytes = errors.New("Encrypted bytes")
ErrNotEnoughBytes = errors.New("Not enough bytes read")
2015-07-08 10:54:37 -07:00
ErrNotReady = errors.New("Device is not ready")
2014-11-29 12:10:23 -08:00
)
const (
Error = "error"
Joystick = "joystick"
C = "c"
Z = "z"
)
type I2cStarter interface {
I2cStart(address int) (err error)
}
type I2cReader interface {
I2cRead(address int, len int) (data []byte, err error)
}
type I2cWriter interface {
I2cWrite(address int, buf []byte) (err error)
}
2014-11-29 12:10:23 -08:00
type I2c interface {
gobot.Adaptor
I2cStarter
I2cReader
I2cWriter
}