#linux-gpio #gpio #linux #ioctl #low-level #gpiochip #chardev


A low level library to access GPIO lines on Linux using the GPIO character device

11 unstable releases (5 breaking)

0.6.1 Feb 20, 2024
0.6.0 Nov 22, 2023
0.5.0 Jul 18, 2023
0.3.2 Dec 18, 2022
0.3.1 Nov 21, 2022

#863 in Unix APIs

Download history 167/week @ 2024-01-25 201/week @ 2024-02-01 177/week @ 2024-02-08 425/week @ 2024-02-15 256/week @ 2024-02-22 197/week @ 2024-02-29 337/week @ 2024-03-07 167/week @ 2024-03-14 128/week @ 2024-03-21 75/week @ 2024-03-28 95/week @ 2024-04-04 201/week @ 2024-04-11 131/week @ 2024-04-18 407/week @ 2024-04-25 451/week @ 2024-05-02 366/week @ 2024-05-09

1,390 downloads per month
Used in 5 crates (via gpiocdev)

Apache-2.0 OR MIT

1.5K SLoC


Build Status github crate LICENSE

A thin safe Rust wrapper around the Linux GPIO character device ioctls and file operations.

Rust structs corresponding to the C ABI types are provided, as are functions corresponding to each of the ABI ioctls and character device file reads. Essentially just the Rust version of gpio.h.

Both ABI versions v1 and v2 are supported, though new developments should use v2 unless it is unavailable on the target platform.

The gpiocdev crate provides a higher level abstraction, so you should use that unless you have some particular need to call the ioctls directly.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~23K SLoC