periphery 0.1.0

A Rust library for peripheral I/O (GPIO, PWM, SPI, I2C, MMIO) in Linux.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Helper macro to execute a system call that returns an `io::Result`.
macro_rules! syscall {
    ($fn: ident ( $($arg: expr),* $(,)* ) ) => {{
        let res = unsafe { libc::$fn($($arg, )*) };
        if res == -1 {
            Err(std::io::Error::last_os_error())
        } else {
            Ok(res)
        }
    }};
}

pub mod gpio;
pub mod i2c;
pub mod spi;
pub mod pwm;