RusPiRo I²C Bus interface crate
Simple and safe access to the I²C bus available on the Raspberry Pi. This implementation will need the GPIO pins 2 and 3 for exclusive use for the I²C bus.
Dependency
The I²C implementation requires an allocator to be build into the final binary. It's recommended to
use the ruspiro-allocator
with this crate.
Usage
To use the crate just add the following dependency to your Cargo.toml
file:
[]
= "0.3"
Once done the access to the I²C bus interface is available in your rust files like so:
use I2C;
To configure and use a device connected to the I²C bus you can simply use the provided functions provided when taking the I2C. First off you may check whether the device is connected to the bus before continuing with the config:
use I2C;
License
Licensed under Apache License, Version 2.0, (LICENSE or http://www.apache.org/licenses/LICENSE-2.0)