Crate unbothered_gpio[][src]

Expand description

Unbothered gpio

Everything is unwrapped under the hood for the precious prettiness of your code. It’s more than a simple Rust crate, it’s a philosophy of life.


use unbothered_gpio::{UnbotheredGpioPin, UnbotheredGpioPinReader};

// Open pin 17 for reading
let mut reader = UnbotheredGpioPinReader::new(17);

let state: bool =;
println!("Pin 17 state : {}", state);


use unbothered_gpio::{UnbotheredGpioPin, UnbotheredGpioPinWriter};

// Open pin 17 for writing
let mut writer = UnbotheredGpioPinWriter::new(17);

// Set gpio pin 17 state to true


use unbothered_gpio::UnbotheredGpioPinListener;

UnbotheredGpioPinListener::new(17, |state: bool| {
    println!("New state for pin 17 : {}", state)


An unbothered single gpio pin listener, invoking a callback on gpio state change. Will stop listening upon drop by default, look at UnbotheredGpioPinListener::keep_alive to change this behavior. Dropping this object is time consuming, it is intended to be long lived.

An unbothered single gpio pin reader.

An unbothered single gpio pin writer.


Trait regrouping gpio reader and writer.