{"id":20446285,"url":"https://github.com/rust-embedded/gpio-utils","last_synced_at":"2025-10-26T17:54:58.430Z","repository":{"id":62439696,"uuid":"55574143","full_name":"rust-embedded/gpio-utils","owner":"rust-embedded","description":"Userspace Utilities for managing GPIOs in Linux","archived":false,"fork":false,"pushed_at":"2020-04-27T22:19:01.000Z","size":100,"stargazers_count":96,"open_issues_count":5,"forks_count":9,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-03T21:58:23.778Z","etag":null,"topics":["embedded","gpio","linux","rust","sysfs-gpio"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-embedded.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-06T03:49:58.000Z","updated_at":"2025-01-24T15:29:01.000Z","dependencies_parsed_at":"2022-11-01T21:53:04.994Z","dependency_job_id":null,"html_url":"https://github.com/rust-embedded/gpio-utils","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fgpio-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fgpio-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fgpio-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Fgpio-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-embedded","download_url":"https://codeload.github.com/rust-embedded/gpio-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047646,"owners_count":20389206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","gpio","linux","rust","sysfs-gpio"],"created_at":"2024-11-15T10:18:54.010Z","updated_at":"2025-10-26T17:54:58.411Z","avatar_url":"https://github.com/rust-embedded.png","language":"Rust","readme":"# Linux GPIO Utils\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/rust-embedded/gpio-utils/ci.yaml?branch=master\u0026logo=github)](https://github.com/rust-embedded/gpio-utils/actions)\n[![Version](https://img.shields.io/crates/v/gpio-utils.svg)](https://crates.io/crates/gpio-utils)\n[![Minimum Stable Rust Version](https://img.shields.io/badge/Rust-1.75.0-blue?logo=rust)](https://blog.rust-lang.org/2023/12/28/Rust-1.75.0/)\n[![License](https://img.shields.io/crates/l/rustc-serialize.svg)](https://github.com/rust-embedded/gpio-utils/blob/master/README.md#license)\n\nGPIO Utils provides convenient access to GPIOs on a Linux system. The library\nbuilds on top of the sysfs interface to GPIOs exposed by the kernel and provides\nessential functionality required for most embedded systems.\n\n## Install\n\nTo install the latest released version of gpio utils, ensure that you have\ninstalled Rust and then run:\n\n```sh\ncargo install gpio-utils\n```\n\n## Features\n\n- [x] Infrastructure for providing names for the GPIOs in one's system providing\n      names that map to individual pins.  These names (in addition to GPIO numbers)\n      may be used with other commands.\n- [x] Ability to export/unexport GPIOs and expose symlinks using the GPIO \"friendly\"\n      names simpler.\n- [x] Ability to set input/output state on each pin\n- [x] Ability to set active low state on each pin\n- [x] Ability to get/set gpio values by pin number or name (including temporary\n      export if necessary)\n- [x] Ability to block awaiting pin state change (with timeout)\n- [x] Ability to set exported GPIO permissions\n\n## System Integration\n\nGPIO Utils provides two main pieces that one may integrate into their final\nsystem:\n\n1. The `gpio` command.  This provides the core functionality for GPIO Utils and\n   is useful in its own right.\n2. The `gpio` init script/systemd service.  This can be integrated into a target\n   system and will ensure that configured GPIOs get exported on system startup\n   (The GPIO command searches for `/etc/gpio.toml` and `/etc/gpio.d/*.toml`\n   configs)\n\nThe GPIO Utils library is built on top of the\n[Rust sysfs-gpio](https://github.com/rust-embedded/rust-sysfs-gpio) library\nwhich may be used independent of this project.\n\n## GPIO Configuration File\n\nGPIO Utils uses the [TOML](https://github.com/toml-lang/toml).  There is some\nflexibility in the configuration, but the following examples shows the basics of\nhow you can configure your GPIOs.\n\n```toml\n#\n# Example GPIO configuration (e.g. /etc/gpio.toml)\n#\n# The main configuration consists of zero or more pins, each of which may have\n# the following keys:\n#\n# - `num`: Required.  The GPIO number.\n# - `names`: Required.  One or more names for the GPIO\n# - `direction`: Default: `\"in\"`.  Must be either \"in\" or \"out\"\n# - `active_low`: Default: `false`.  If set to true, the polarity of the pin will\n#    be reversed.\n# - `export`: Default: `true`.  If true, this GPIO will be automatically\n#    exported when `gpio export-all` is run (e.g. by an init script).\n# - `user`: User that should own the exported GPIO\n# - `group`: Group that should own the exported GPIO\n# - `mode`: Mode for exported directory\n\n[[pins]]\nnum = 73                 # required\nnames = [\"reset_button\"] # required (may have multiple)\ndirection = \"in\"         # default: in\nactive_low = false       # default: false (really means invert logic)\nexport = true            # default: true\nuser = \"root\"            # default: (OS Default - root)\ngroup = \"gpio\"           # default: (OS Default - root)\nmode = 0o664             # default: (OS Default - 0o644)\n\n[[pins]]\nnum = 37\nnames = [\"status_led\", \"A27\", \"green_led\"]\ndirection = \"out\"\n\n# ...\n```\n\n## Implementation Notes\n\nUnlike several other existing solutions to this problem, this project is\nimplemented in Rust (a modern systems programming language operating at the same\nlevel as C but with a type system providing greater productivity and\nreliability) and seeks to operate with a minimum of overhead.\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate is guaranteed to compile on stable Rust 1.75.0 and up. It *might*\ncompile with older versions but that may change in any new patch release.\n\n## Contributing\n\nContributions are very welcome.\n\n## License\n\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n  http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n## Code of Conduct\n\nContribution to this crate is organized under the terms of the [Rust Code of\nConduct][CoC], the maintainer of this crate, the [Embedded Linux Team][team], promises\nto intervene to uphold that code of conduct.\n\n[CoC]: CODE_OF_CONDUCT.md\n[team]: https://github.com/rust-embedded/wg#the-embedded-linux-team\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded%2Fgpio-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-embedded%2Fgpio-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded%2Fgpio-utils/lists"}