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

Download history 1/week @ 2024-12-03 11/week @ 2024-12-10 101/week @ 2025-01-21 13/week @ 2025-01-28 14/week @ 2025-02-04 8/week @ 2025-02-11

136 downloads per month

MPL-2.0 license

7.5MB
11K SLoC

C 10K SLoC // 0.1% comments Rust 849 SLoC // 0.0% comments Python 206 SLoC // 0.4% comments Batch 26 SLoC JavaScript 5 SLoC Shell 1 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