Crates.io | i2cdev |
lib.rs | i2cdev |
version | 0.6.1 |
source | src |
created_at | 2015-09-10 05:50:32.715261 |
updated_at | 2024-06-12 12:39:00.939436 |
description | Provides API for safe access to Linux i2c device interface. |
homepage | https://github.com/rust-embedded/rust-i2cdev |
repository | https://github.com/rust-embedded/rust-i2cdev |
max_upload_size | |
id | 3021 |
size | 101,690 |
The Rust i2cdev
crate seeks to provide full access to the Linux i2cdev
driver interface in Rust without the need to wrap any C code or directly make
low-level system calls. The documentation for the i2cdev interace can
be found at https://www.kernel.org/doc/Documentation/i2c/dev-interface and
in the lm-sensors projects.
Device driver developers should consider building on top of the embedded-hal traits rather than directly coupling to this library. An implementation of those generic traits for Linux can be found in linux-embedded-hal which, at present, uses this crate as the backend for I2C.
The source includes an example of using the library to talk to a Wii Nunchuck (which has an i2c interface). Go View the Example.
The Documentation contains a quick overview of how to get started with an i2c device.
In addition to the Read/Write traits, the following methods are available via the I2CDevice trait.
The following features are implemented and planned for the library:
Most likely, the machine you are running on is not your development machine (although it could be). In those cases, you will need to cross-compile. See https://github.com/cross-rs/cross for pointers.
This crate is guaranteed to compile on stable Rust 1.65.0 and up. It might compile with older versions but that may change in any new patch release.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Contribution to this crate is organized under the terms of the Rust Code of Conduct, the maintainer of this crate, the Embedded Linux Team, promises to intervene to uphold that code of conduct.