RusPiRo GPIO access abstraction for Raspberry Pi
This crate provide a simple to use and safe abstraction of the GPIO peripheral available on the Raspberry Pi 3. The GPIO configuration requires access to MMIO registers with a specific memory base address. As this might differ between different models the right address is choosen based on the given ruspiro_pi3
feature while compiling.
Usage
To use the crate just add the following dependency to your Cargo.toml
file:
[]
= "0.4.3"
Once done the access to the GPIO abstraction is available in your rust files like so:
use GPIO;
Usage Hint
The GPIO crate provides access to the peripheral through a Singleton
to ensure safe access from each core of the Raspberry Pi to it. This Singleton
uses locks and atomic operations to safeguard the access. Those atomic operations does only work on the Raspberry Pi if the MMU is configured and active (with active caches). So to properly use this crate in your project please check the ruspiro-mmu crate as well and how to configure and activate the MMU.
License
Licensed under Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) or MIT (LICENSE-MIT or http://opensource.org/licenses/MIT)) at your choice.