{"id":13435374,"url":"https://github.com/WiringPi/WiringPi","last_synced_at":"2025-03-18T02:31:55.776Z","repository":{"id":3754616,"uuid":"4830334","full_name":"WiringPi/WiringPi","owner":"WiringPi","description":"The arguably fastest GPIO Library for the Raspberry Pi","archived":false,"fork":false,"pushed_at":"2025-03-02T10:27:11.000Z","size":1066,"stargazers_count":2931,"open_issues_count":28,"forks_count":1250,"subscribers_count":147,"default_branch":"master","last_synced_at":"2025-03-11T19:06:00.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WiringPi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.LESSER","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,"publiccode":null,"codemeta":null}},"created_at":"2012-06-29T08:40:10.000Z","updated_at":"2025-03-11T17:27:47.000Z","dependencies_parsed_at":"2023-07-05T18:49:14.918Z","dependency_job_id":"254cafcf-7bb6-4aed-ab12-d0be3fa10c4b","html_url":"https://github.com/WiringPi/WiringPi","commit_stats":{"total_commits":276,"total_committers":34,"mean_commits":8.117647058823529,"dds":0.6231884057971014,"last_synced_commit":"a0b52b3a40d5ffd604b1dee0a013f96fa629777d"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiringPi%2FWiringPi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiringPi%2FWiringPi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiringPi%2FWiringPi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiringPi%2FWiringPi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WiringPi","download_url":"https://codeload.github.com/WiringPi/WiringPi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244144082,"owners_count":20405336,"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-07-31T03:00:35.219Z","updated_at":"2025-03-18T02:31:55.772Z","avatar_url":"https://github.com/WiringPi.png","language":"C","readme":"# WiringPi Library\nWelcome to the WiringPi Library, the highly performant GPIO access library for Raspberry Pi boards. This library is written in C and is designed to provide fast and efficient control of the GPIO pins by directly accessing the hardware registers using DMA. \n\n**Key Features:** \n- **Support:** WiringPi supports all Raspberry Pi Boards including Pi 5 ( :construction: On the Pi 5, only the GCLK functionality is currently not supported due to missing documentation of the RP1 chip).\n- **High Performance:** By directly accessing the hardware registers, WiringPi ensures minimal latency and maximum performance for your GPIO operations.\n- **Wide Adoption:** WiringPi is widely used in numerous projects, making it a reliable choice for your Raspberry Pi GPIO needs.\n\nWhether you’re working on a simple LED blink project or a complex automation system, WiringPi provides the tools you need to get the job done efficiently.\n\n## How to use\n\nTo compile programs with wiringPi Library, you need to include `wiringPi.h` as well as link against `wiringPi`:\n\n```c\n#include \u003cwiringPi.h\u003e // Include WiringPi library!\n\nint main(void)\n{\n  // uses BCM numbering of the GPIOs and directly accesses the GPIO registers.\n  wiringPiSetupGpio();\n\n  // pin mode ..(INPUT, OUTPUT, PWM_OUTPUT, GPIO_CLOCK)\n  // set pin 17 to input\n  pinMode(17, INPUT);\n\n  // pull up/down mode (PUD_OFF, PUD_UP, PUD_DOWN) =\u003e down\n  pullUpDnControl(17, PUD_DOWN);\n\n  // get state of pin 17\n  int value = digitalRead(17);\n\n  if (HIGH == value)\n  {\n    // your code\n  }\n}\n```\n\nTo compile this code, link against wiringPi:\n\n```sh\ngcc -o myapp myapp.c -l wiringPi\n```\n\nBe sure to check out the [examples](./examples/), build them using Make:\n\n```sh\ncd examples\nmake \u003cexample-name | really-all\u003e\n```\n\nThe tool `gpio` can be used to set single pins as well as get the state of everything at once:\n\n```\npi@wiringdemo:~ $ gpio readall\n +-----+-----+---------+------+---+---Pi 3B--+---+------+---------+-----+-----+\n | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |\n +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |\n |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |\n |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |\n |   4 |   7 | GPIO. 7 |   IN | 0 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |\n |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |\n |  17 |   0 | GPIO. 0 |   IN | 1 | 11 || 12 | 1 | IN   | GPIO. 1 | 1   | 18  |\n |  27 |   2 | GPIO. 2 |   IN | 1 | 13 || 14 |   |      | 0v      |     |     |\n |  22 |   3 | GPIO. 3 |   IN | 1 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |\n |     |     |    3.3v |      |   | 17 || 18 | 1 | IN   | GPIO. 5 | 5   | 24  |\n |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |\n |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 1 | IN   | GPIO. 6 | 6   | 25  |\n |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |\n |     |     |      0v |      |   | 25 || 26 | 0 | IN   | CE1     | 11  | 7   |\n |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |\n |   5 |  21 | GPIO.21 |   IN | 0 | 29 || 30 |   |      | 0v      |     |     |\n |   6 |  22 | GPIO.22 |   IN | 0 | 31 || 32 | 1 | IN   | GPIO.26 | 26  | 12  |\n |  13 |  23 | GPIO.23 |   IN | 1 | 33 || 34 |   |      | 0v      |     |     |\n |  19 |  24 | GPIO.24 |   IN | 1 | 35 || 36 | 1 | IN   | GPIO.27 | 27  | 16  |\n |  26 |  25 | GPIO.25 |   IN | 1 | 37 || 38 | 1 | IN   | GPIO.28 | 28  | 20  |\n |     |     |      0v |      |   | 39 || 40 | 1 | IN   | GPIO.29 | 29  | 21  |\n +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |\n +-----+-----+---------+------+---+---Pi 3B--+---+------+---------+-----+-----+\n```\n\n\n## Documentation\n\n[German](https://github.com/WiringPi/WiringPi/blob/master/documentation/deutsch/functions.md)   \n[English](https://github.com/WiringPi/WiringPi/blob/master/documentation/english/functions.md)   \n\n\n## Installing\n\nYou can either build it yourself or use the prebuilt binaries:\n\n### From Source\n\n1. create debian-package\n\n```sh\n# fetch the source\nsudo apt install git\ngit clone https://github.com/WiringPi/WiringPi.git\ncd WiringPi\n\n# build the package\n./build debian\nmv debian-template/wiringpi-3.0-1.deb .\n\n# install it\nsudo apt install ./wiringpi-3.0-1.deb\n```\n\n\n### Prebuilt Binaries\n\nGrab the latest release from [here](https://github.com/WiringPi/WiringPi/releases).\n\n\nUnzip/use the portable prebuilt verison:\n\n```sh\n# unzip the archive\ntar -xfv wiringpi_3.0.tar.gz\n```\n\nInstall the debian package:\n\n```sh\n# install a dpkg\nsudo apt install ./wiringpi-3.0-1.deb\n```\n\n\n## Ports\n\nwiringPi has been wrapped for multiple languages:\n\n* Node - https://github.com/WiringPi/WiringPi-Node\n* Perl - https://github.com/WiringPi/WiringPi-Perl\n* PHP - https://github.com/WiringPi/WiringPi-PHP\n* Python - https://github.com/WiringPi/WiringPi-Python\n* Ruby - https://github.com/WiringPi/WiringPi-Ruby\n\n## Support\n\nPlease use the [issue system](https://github.com/WiringPi/WiringPi/issues) of GitHub.\n\nIf you're not sure whether to create an issue or not, please engage in [discussions](https://github.com/WiringPi/WiringPi/discussions)!\n\nPlease do not email Gordon or @Gadgetoid.\n\nPlease don't email GC2 for reporting issues, you might [contact us](mailto:wiringpi@gc2.at) for anything that's not meant for the public.\n\n## History\n\nThis repository is the continuation of 'Gordon's wiringPi 2.5' which has been [deprecated](https://web.archive.org/web/20220405225008/http://wiringpi.com/wiringpi-deprecated/), a while ago.\n\n* The last \"old wiringPi\" source of Gordon's release can be found at the\n  [`final_source_2.50`](https://github.com/WiringPi/WiringPi/tree/final_official_2.50) tag.\n* The default `master` branch contains code that has been written since version 2.5\n  to provide support for newer hardware as well as new features.\n\n:information_source:️ Since 2024, [GC2](https://github.com/GrazerComputerClub) has taken over maintenance of the project, supporting new OS versions as well as current hardware generations. We are dedicated to keeping the arguably best-performing GPIO Library for Raspberry Pi running smoothly. We strive to do our best, but please note that this is a community effort, and we cannot provide any guarantees or take responsibility for implementing specific features you may need.\n\n## Debug\n\nWIRINGPI_DEBUG=1 ./my_wiringpi_program\n\nWIRINGPI_DEBUG=1 gpio readall\n","funding_links":[],"categories":["C","Libraries","Uncategorized","Library","utils","二、核心库（Library）"],"sub_categories":["Uncategorized","Arduino","dev","2. Arduino生态常用库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWiringPi%2FWiringPi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWiringPi%2FWiringPi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWiringPi%2FWiringPi/lists"}