5 releases
0.2.0 | Jan 25, 2025 |
---|---|
0.1.3 | Sep 3, 2024 |
0.1.2 | Jul 19, 2024 |
0.1.1 | Jul 8, 2024 |
0.1.0 | Jul 8, 2024 |
#492 in Embedded development
136 downloads per month
7.5MB
11K
SLoC
wiringX
Safe Rust port of the wiringX GPIO library.
Examples found in the examples folder next to this readme.
Examples are made for the Milk-V Duo S, but can easily be changed for other platforms by changing the selected platform in the enum and changing the pin number for the LED.
lib.rs
:
Safe WiringX Rust bindings.
Example Blinker on pin 0
for Milk-V Duo S
:
use wiringx::{Output, Platform, WiringX};
use std::{thread, time::Duration};
fn main() {
// Replace `Platform` with your platform
let wiringx = WiringX::new(Platform::MilkVDuoS).unwrap();
// We use pin `0`, for the built in LED
let mut pin = wiringx.gpio_pin::<Output>(0).unwrap();
loop {
pin.toggle();
thread::sleep(Duration::from_secs(1));
}
}
Dependencies
~0.6–8MB
~71K SLoC