import "golang.org/x/exp/io/i2c"
Package i2c allows users to read from an write to a slave I2C device.
type Devfs struct{}
Devfs is an I2C driver that works against the devfs. You need to load the "i2c-dev" kernel module to use this driver.
type Device struct {
// contains filtered or unexported fields
}
Device represents an I2C device. Devices must be closed once they are no longer in use.
Open opens an I2C device with the given I2C address on the specified bus.
Close closes the device and releases the underlying sources. All devices must be closed once they are no longer in use.
Read reads at most len(buf) number of bytes from the device for the given command.
Write writes the buffer for the given command to the device.
Path | Synopsis |
---|---|
driver | Package driver contains interfaces to be implemented by various I2C implementations. |
Package i2c imports 5 packages (graph). Updated about 17 hours ago. Refresh now. Tools for package owners.