Skip to content

Commit b2af17e

Browse files
authored
Merge pull request WiringPi#366 from WiringPi/develop
Release 3.16
2 parents ee3e2a9 + 3cf394b commit b2af17e

39 files changed

+2595
-773
lines changed

README.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# WiringPi Library
2+
23
Welcome 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.
34

4-
**Key Features:**
5+
**Key Features:**
6+
57
- **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).
68
- **High Performance:** By directly accessing the hardware registers, WiringPi ensures minimal latency and maximum performance for your GPIO operations.
79
- **Wide Adoption:** WiringPi is widely used in numerous projects, making it a reliable choice for your Raspberry Pi GPIO needs.
@@ -50,9 +52,23 @@ cd examples
5052
make <example-name | really-all>
5153
```
5254

53-
The tool `gpio` can be used to set single pins as well as get the state of everything at once:
55+
To use WiringPi in a project with CMake, the following snippet is all that is required provided that WiringPi is installed.
56+
57+
```CMake
58+
add_executable(example
59+
# project sources...
60+
)
5461
62+
target_link_libraries(
63+
example
64+
65+
PRIVATE wiringPi
66+
)
5567
```
68+
69+
The tool `gpio` can be used to set single pins as well as get the state of everything at once:
70+
71+
```none
5672
pi@wiringdemo:~ $ gpio readall
5773
+-----+-----+---------+------+---+---Pi 3B--+---+------+---------+-----+-----+
5874
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
@@ -82,12 +98,10 @@ pi@wiringdemo:~ $ gpio readall
8298
+-----+-----+---------+------+---+---Pi 3B--+---+------+---------+-----+-----+
8399
```
84100

85-
86101
## Documentation
87102

88-
[German](https://github.com/WiringPi/WiringPi/blob/master/documentation/deutsch/functions.md)
89-
[English](https://github.com/WiringPi/WiringPi/blob/master/documentation/english/functions.md)
90-
103+
[German](./documentation/deutsch/functions.md)
104+
[English](./documentation/english/functions.md)
91105

92106
## Installing
93107

@@ -105,42 +119,42 @@ cd WiringPi
105119

106120
# build the package
107121
./build debian
108-
mv debian-template/wiringpi-3.0-1.deb .
122+
mv debian-template/wiringpi-3.x.deb .
109123

110124
# install it
111-
sudo apt install ./wiringpi-3.0-1.deb
125+
sudo apt install ./wiringpi-3.x.deb
112126
```
113127

114-
115128
### Prebuilt Binaries
116129

117130
Grab the latest release from [here](https://github.com/WiringPi/WiringPi/releases).
118131

119-
120132
Unzip/use the portable prebuilt verison:
121133

122134
```sh
123135
# unzip the archive
124-
tar -xfv wiringpi_3.0.tar.gz
136+
tar -xfv wiringpi_3.x.tar.gz
125137
```
126138

127139
Install the debian package:
128140

129141
```sh
130142
# install a dpkg
131-
sudo apt install ./wiringpi-3.0-1.deb
143+
sudo apt install ./wiringpi-3.x.deb
132144
```
133145

134-
135146
## Ports
136147

137-
wiringPi has been wrapped for multiple languages:
148+
wiringPi has been wrapped for multiple languages:
149+
150+
NOTE: these wrappers are _not_ updated and maintained in sync with WiringPi version 3+,
151+
therefore we cannot guarantee functionality or provide support for a specific implementation.
138152

139-
* Node - https://github.com/WiringPi/WiringPi-Node
140-
* Perl - https://github.com/WiringPi/WiringPi-Perl
141-
* PHP - https://github.com/WiringPi/WiringPi-PHP
142-
* Python - https://github.com/WiringPi/WiringPi-Python
143-
* Ruby - https://github.com/WiringPi/WiringPi-Ruby
153+
- Node - [https://github.com/WiringPi/WiringPi-Node](https://github.com/WiringPi/WiringPi-Node)
154+
- Perl - [https://github.com/WiringPi/WiringPi-Perl](https://github.com/WiringPi/WiringPi-Perl)
155+
- PHP - [https://github.com/WiringPi/WiringPi-PHP](https://github.com/WiringPi/WiringPi-PHP)
156+
- Python - [https://github.com/WiringPi/WiringPi-Python](https://github.com/WiringPi/WiringPi-Python)
157+
- Ruby - [https://github.com/WiringPi/WiringPi-Ruby](https://github.com/WiringPi/WiringPi-Ruby)
144158

145159
## Support
146160

@@ -156,9 +170,9 @@ Please don't email GC2 for reporting issues, you might [contact us](mailto:wirin
156170

157171
This 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.
158172

159-
* The last "old wiringPi" source of Gordon's release can be found at the
173+
- The last "old wiringPi" source of Gordon's release can be found at the
160174
[`final_source_2.50`](https://github.com/WiringPi/WiringPi/tree/final_official_2.50) tag.
161-
* The default `master` branch contains code that has been written since version 2.5
175+
- The default `master` branch contains code that has been written since version 2.5
162176
to provide support for newer hardware as well as new features.
163177

164178
: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.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.14
1+
3.16

devLib/lcd128x64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ void lcd128x64rectangle (int x1, int y1, int x2, int y2, int colour, int filled)
370370

371371
if (filled)
372372
{
373-
/**/ if (x1 == x2)
373+
if (x1 == x2)
374374
lcd128x64line (x1, y1, x2, y2, colour) ;
375375
else if (x1 < x2)
376376
for (x = x1 ; x <= x2 ; ++x)

devLib/piGlow.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,9 @@ void piGlow1 (const int leg, const int ring, const int intensity)
4747
if ((leg < 0) || (leg > 2)) return ;
4848
if ((ring < 0) || (ring > 5)) return ;
4949

50-
/**/ if (leg == 0)
51-
legLeds = leg0 ;
52-
else if (leg == 1)
53-
legLeds = leg1 ;
54-
else
55-
legLeds = leg2 ;
50+
if (leg == 0) { legLeds = leg0 ; }
51+
else if (leg == 1) { legLeds = leg1 ; }
52+
else { legLeds = leg2 ; }
5653

5754
analogWrite (PIGLOW_BASE + legLeds [ring], intensity) ;
5855
}
@@ -71,12 +68,9 @@ void piGlowLeg (const int leg, const int intensity)
7168
if ((leg < 0) || (leg > 2))
7269
return ;
7370

74-
/**/ if (leg == 0)
75-
legLeds = leg0 ;
76-
else if (leg == 1)
77-
legLeds = leg1 ;
78-
else
79-
legLeds = leg2 ;
71+
if (leg == 0) { legLeds = leg0 ; }
72+
else if (leg == 1) { legLeds = leg1 ; }
73+
else { legLeds = leg2 ; }
8074

8175
for (i = 0 ; i < 6 ; ++i)
8276
analogWrite (PIGLOW_BASE + legLeds [i], intensity) ;

devLib/scrollPhat.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,19 +210,21 @@ void scrollPhatRectangle (int x1, int y1, int x2, int y2, int colour, int filled
210210
{
211211
register int x ;
212212

213-
if (filled)
214-
{
215-
/**/ if (x1 == x2)
213+
if (filled) {
214+
if (x1 == x2) {
216215
scrollPhatLine (x1, y1, x2, y2, colour) ;
217-
else if (x1 < x2)
218-
for (x = x1 ; x <= x2 ; ++x)
219-
scrollPhatLine (x, y1, x, y2, colour) ;
220-
else
221-
for (x = x2 ; x <= x1 ; ++x)
222-
scrollPhatLine (x, y1, x, y2, colour) ;
223-
}
224-
else
225-
{
216+
}
217+
else if (x1 < x2) {
218+
for (x = x1 ; x <= x2 ; ++x) {
219+
scrollPhatLine (x, y1, x, y2, colour) ;
220+
}
221+
}
222+
else {
223+
for (x = x2 ; x <= x1 ; ++x) {
224+
scrollPhatLine (x, y1, x, y2, colour) ;
225+
}
226+
}
227+
} else {
226228
scrollPhatLine (x1, y1, x2, y1, colour) ;
227229
scrollPhatLineTo (x2, y2, colour) ;
228230
scrollPhatLineTo (x1, y2, colour) ;

0 commit comments

Comments
 (0)