https://github.com/leso-kn/wiringpi-gpiod
A generic wiringPi-implementation for single-board computers.
https://github.com/leso-kn/wiringpi-gpiod
gpio gpiod sbc wiringpi
Last synced: about 1 year ago
JSON representation
A generic wiringPi-implementation for single-board computers.
- Host: GitHub
- URL: https://github.com/leso-kn/wiringpi-gpiod
- Owner: leso-kn
- License: mit
- Created: 2023-10-14T11:19:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-14T11:20:07.000Z (over 2 years ago)
- Last Synced: 2025-02-03T13:12:38.170Z (over 1 year ago)
- Topics: gpio, gpiod, sbc, wiringpi
- Language: C
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# `wiringpi-gpiod`
_A generic wiringPi-implementation for single-board computers._
## About
This is a lightweight re-implementation of the [wiringPi](https://github.com/WiringPi/WiringPi)-library based on gpiod – the [linux kernel GPIO API](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=79a9becda8940deb2274b5aa4577c86d52ee7ecb).
This allows for `wiringpi-gpiod` to be used on any single-board computer, as long as the kernel recognizes the GPIO chip – the original wiringPi-library supported only a [limited range](http://web.archive.org/web/20231011062333/http://wiringpi.com/#post-15) of SBCs.
## Compiling
```bash
> cmake -B build .
> cmake --build build
# produces build/libwiringpi-gpiod.[a|so]
# [optional]
> sudo cmake --install build
```
### And linking against it
Linking a wiringPi-based project against `wiringpi-gpiod` is as simple as replacing `-lwiringpi` with `-lwiringpi-gpiod` in the compiler arguments.
In case you do not wish to install the library system-wide, add an additional `-L/path/to/libwiringpi-gpiod.so`.
## Dependencies
* [gpiod-dev](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/)
## Comparison to the original wiringPi-library
* Runs on any single-board computer, as long as GPIO pins are recognized [by the kernel](https://www.kernel.org/doc/html/latest/driver-api/gpio/board.html)
* ! Pin numbers in `wiringpi-gpiod` follow the standard GPIOxx-numbering of your board (\*not\* the [custom wiringPi-mapping](https://pinout.xyz/pinout/wiringpi))
---
Created by Lesosoftware in 2023