Expand description
Safe WiringX Rust bindings.
Example Blinker on pin 0 for Milk-V Duo S:
use wiringx::{Output, Platform, WiringX};
use std::{thread, time::Duration};
// 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));
}Structs§
- I2C
- An Inter-integrated circuit communication instance.
- Input
- Sets the pin mode to input, allowing reading the physical value.
- Interrupt
Time Out - Returned if a interrupt function times out.
- Output
- Sets the pin mode to output, allowing writing to the pin value.
- Pin
- Representation of a GPIO, General Purpose Input Output, pin.
- Platform
Parse Error - Returns when the given platform string is invalid.
- PwmPin
- Instance of a pulse-width modulated pin.
- Serial
Config - Configuration of the serial connection.
- Spi
- A Serial Peripheral Interface communication instance.
- Uart
- Universal asynchronous receiver/transmitter serial communication instance.
- WiringX
- Instance of WiringX
Enums§
- Flow
Control - UART flow control
- I2CError
- Errors when reading or writing from the I2C device.
- InvalidUART
Config - When a setting in the config is not supported, this error gets returned.
- IsrMode
- Mode for the interrupt service routine.
- Parity
- UART error correction parity.
- Platform
- All supported platforms of WiringX
- Polarity
- PWM polarity of a pin.
- Value
- Digital voltage value of the pin.
- WiringX
Error - Errors that can occur from wiringX.