Documentation ¶
Index ¶
- Variables
- type I2C
- func (b *I2C) Address() uint8
- func (b *I2C) Bus() int
- func (b *I2C) Close() error
- func (b *I2C) Err() error
- func (b *I2C) Read(p []byte) (int, error)
- func (b *I2C) ReadReg(reg uint8, p []byte) (int, error)
- func (b *I2C) RegWriter(reg uint8) io.Writer
- func (b *I2C) Write(p []byte) (int, error)
- func (b *I2C) WriteReg(reg uint8, values ...byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
Debug indicates if the debug mode is enabled. In debug mode, all incoming and outgoing bytes are written to stdout.
Functions ¶
This section is empty.
Types ¶
type I2C ¶
type I2C struct {
// contains filtered or unexported fields
}
I2C bus.
func (*I2C) Err ¶
Err returns the first error that happened when using this instance or nil if everything is fine. If Err returns an error != nil, all further invocations of Read and Write will also fail with this error. This instance should not be used anymore.
func (*I2C) ReadReg ¶
ReadReg reads len(p) bytes from the given register (and the following if len(p) > 1).
Click to show internal directories.
Click to hide internal directories.