{"id":17316588,"url":"https://github.com/mwallner/rust-wiringpi","last_synced_at":"2025-12-12T14:46:29.715Z","repository":{"id":22104697,"uuid":"25434999","full_name":"mwallner/rust-wiringpi","owner":"mwallner","description":"WiringPi API wrapper for Rust","archived":false,"fork":false,"pushed_at":"2024-04-19T19:39:07.000Z","size":72,"stargazers_count":32,"open_issues_count":4,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-17T16:19:01.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwallner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2014-10-19T17:56:25.000Z","updated_at":"2024-04-19T19:39:11.000Z","dependencies_parsed_at":"2024-04-19T20:55:41.230Z","dependency_job_id":null,"html_url":"https://github.com/mwallner/rust-wiringpi","commit_stats":{"total_commits":80,"total_committers":11,"mean_commits":"7.2727272727272725","dds":0.4375,"last_synced_commit":"1b6babc784498254c24a6e4fdcccfe7744c66225"},"previous_names":["mwallner/rust-wiringpi","ogeon/rust-wiringpi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwallner%2Frust-wiringpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwallner%2Frust-wiringpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwallner%2Frust-wiringpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwallner%2Frust-wiringpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwallner","download_url":"https://codeload.github.com/mwallner/rust-wiringpi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858056,"owners_count":20359271,"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":[],"created_at":"2024-10-15T13:13:27.579Z","updated_at":"2025-12-12T14:46:24.669Z","avatar_url":"https://github.com/mwallner.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WiringPi Bindings for Rust\n\nAn API wrapper for [WiringPi](http://wiringpi.com/) to make it accessible\nusing Rust. It implements the most important functions and provides a bit of\ntype system convenience.\n\nAdd the following lines to your `Cargo.io` to use `rust-wiringpi`:\n\n```toml\n[dependencies]\nwiringpi = \"0.2\"\n```\n\n## Online Documentation\n\n[Released](https://docs.rs/wiringpi/0.2.4/wiringpi/)\n\n[Master branch](http://ogeon.github.io/docs/rust-wiringpi/master/wiringpi/index.html)\n\n## Example: Flashing Light\n\n```Rust\nextern crate wiringpi;\n\nuse wiringpi::pin::Value::{High, Low};\nuse std::{thread, time};\n\nfn main() {\n    //Setup WiringPi with its own pin numbering order\n    let pi = wiringpi::setup();\n\n    //Use WiringPi pin 0 as output\n    let pin = pi.output_pin(0);\n\n    let interval = time::Duration::from_millis(1000);\n\n    loop {\n        //Set pin 0 to high and wait one second\n        pin.digital_write(High);\n        thread::sleep(interval);\n\n        //Set pin 0 to low and wait one second\n        pin.digital_write(Low);\n        thread::sleep(interval);\n    }\n}\n```\n\n## Cross Compiling Using Cargo\n\nFollow this [guide](https://hackernoon.com/compiling-rust-for-the-raspberry-pi-49fdcd7df658).\n\n```\ncargo build --target=arm-unknown-linux-gnueabihf   # Older models\ncargo build --target=armv7-unknown-linux-gnueabihf # Newer models\n```\n\n## Orange Pi support\n\n`rust-wiringpi` can also wrap the WiringOP library for the Orange Pi SBC boards.\nThis can be enabled with the `orangepi` feature:\n\n```toml\n[dependencies.wiringpi]\nversion = \"0.2\"\nfeatures = [\"orangepi\"]\n```\n\n## Development Mode\n\nIn development mode, `rust-wiringpi` is compiled as a rust-native library excluding the original WiringPi.\nAnd binding functions are replaced by dummy functions that output simple logs to stdout.\nWith this mode, you can build and debug your project on platforms that does not support WiringPi.\n\nDevelopment mode will be turned on automatically on non-arm targets, but can be turned on manually \non arm targets as well\n\n```shell\n# build\n$ cargo build --features wiringpi/development\n\n# run\n$ cargo run --features wiringpi/development\n\n[wiringpi] `wiringPiSetup` called\n[wiringpi] `pinMode` called with: 0, 1\n[wiringpi] `digitalWrite` called with: 0, 1\n[wiringpi] `digitalWrite` called with: 0, 0\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwallner%2Frust-wiringpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwallner%2Frust-wiringpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwallner%2Frust-wiringpi/lists"}