gpiocdev 0.8.0

Access GPIO lines on Linux using the GPIO character device
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// SPDX-FileCopyrightText: 2023 Kent Gibson <warthog618@gmail.com>
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

// Basic example of reading the info for a chip.

fn main() -> gpiocdev::Result<()> {
    let chip_path = "/dev/gpiochip0";

    let chip = gpiocdev::chip::Chip::from_path(chip_path)?;
    let info = chip.info()?;
    println!("{} [{}] ({} lines)", info.name, info.label, info.num_lines);
    Ok(())
}