#i2c #i2c-dev #sm-bus

i2c-linux

Linux I2C device interface

4 releases

Uses old Rust 2015

0.1.2 Nov 18, 2018
0.1.1 Mar 29, 2018
0.1.0 Mar 25, 2018
0.0.1 Mar 17, 2018

#1453 in Hardware support

Download history 502/week @ 2024-07-03 382/week @ 2024-07-10 374/week @ 2024-07-17 482/week @ 2024-07-24 417/week @ 2024-07-31 566/week @ 2024-08-07 705/week @ 2024-08-14 620/week @ 2024-08-21 689/week @ 2024-08-28 339/week @ 2024-09-04 510/week @ 2024-09-11 493/week @ 2024-09-18 691/week @ 2024-09-25 609/week @ 2024-10-02 481/week @ 2024-10-09 671/week @ 2024-10-16

2,554 downloads per month
Used in 11 crates (4 directly)

MIT license

28KB
478 lines

i2c-linux

travis-badge release-badge docs-badge license-badge

i2c-linux provides safe bindings over the Linux I2C subsystem, and is an alternative to the i2cdev crate.

Documentation

See the documentation for up to date information.


lib.rs:

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.

Dependencies

~200–320KB