Crate i2c_linux

Source
Expand description

A safe interface to the Linux I2C and SMBus userspace subsystem.

§Example

extern crate i2c_linux;
use i2c_linux::I2c;

let mut i2c = I2c::from_path("/dev/i2c-0")?;
i2c.smbus_set_slave_address(0x50, false)?;
let data = i2c.smbus_read_byte()?;
println!("Read I2C data: {}", data);

§Cargo Features

  • i2c will impl i2c traits for I2c.
  • udev must be enabled to use Enumerator.

Structs§

  • Enumerates all available i2c devices on the system.
  • To determine what functionality is present
  • A safe wrapper around an I2C device.
  • Flags to work around device quirks.
  • Flags to work around device quirks.

Enums§

  • Part of a combined I2C transaction.
  • i2c_smbus_xfer read or write markers