wiringX

Modular GPIO interface

This project is maintained by pilight

Introduction to wiringX

Ever wondered why with every new GPIO capable computer like the Banana Pi, Radxa, Hummingboard people are always asking: "Is there already a wiringPi port?" Gordon from wiringPi did a great job in porting common Arduino style GPIO function to the Raspberry Pi GPIO, but no-one realized it would become the standard C GPIO interface. Sadly, this lack of insight also introduces the biggest issue with wiringPi: it wasn't created modular! This means that every port of wiringPi only supports the single computer it was ported to! When creating multi-platform software, developers had to do a great deal of dirty hacking to actually integrate the different wiringPi ports.

This is exactly where wiringX has jumped in.

What is wiringX?

wiringX combines (and developed in case of the Hummingboard) all wiringPi ports into one single modular GPIO interface created in C. It auto-detects the platform it's running on and will automatically map the GPIO functions to the enable general GPIO interfacing such as reading, writing, handling interrupts and interfacing with I2C and SPI.

This means that programs developed using wiringX will natively work on the following platforms:

wiringX has already been proven to work in pilight, an open source domotica solution.

Get wiringX

Grab the source from the link on the left. Check the README on GitHub for further instructions. Python bindings are now available in the python folder, and must be installed separately. On Arch Linux ARM, you can install it directly from the repository, simply pacman -S wiringx-git

Look in the examples folder to see how to use it.

Spread the word!

Instead of porting wiringPi, computer manufacturers should really start to support wiringX. When manufacturers and developers start to support wiringX, we can make software that will natively work on all platforms. So as users: Spread the word!

GPIO numbering

Raspberry Pi (1; A, B, A+, and B+)

P1
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
--3.3v125v--
8R1: 0 / R2: 2GPIO 8345v--
9R1: 1 / R2: 3GPIO 9560v--
74GPIO 778GPIO 151415
--0v910GPIO 161516
017GPIO 01112GPIO 1181
2R1: 21 / R2: 27GPIO 213140v--
322GPIO 31516GPIO 4234
--3.3v1718GPIO 5245
1210GPIO 1219200v--
139GPIO 132122GPIO 6256
1411GPIO 142324GPIO 10810
--0v2526GPIO 11711
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
P1 (1 and 2; A+ and B+)
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
30?ID_SD2728ID_SC?31
215GPIO 2129300v--
226GPIO 223132GPIO 231326
2319GPIO 2433340v--
24-?3536GPIO 252627
2512GPIO 263738GPIO 271628
--0v3940GPIO 292129
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
P5
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
--5v123.3v--
1828GPIO 1834GPIO 172917
2030GPIO 2056GPIO 193119
--0v780v--
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #

Banana Pi

CON 3
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
--3.3v125v--
82GPIO 8345v--
93GPIO 9560v--
74GPIO 778GPIO 151415
--0v910GPIO 161516
017GPIO 01112GPIO 1181
227GPIO 213140v--
322GPIO 31516GPIO 4234
--3.3v1718GPIO 5245
1210GPIO 1219200v--
139GPIO 132122GPIO 6256
1411GPIO 142324GPIO 10810
--0v2526GPIO 11711
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
J12
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
--5v125v--
14?GPIO 1434GPIO 15?15
28?GPIO 2856GPIO 29?29
--0v9100v--
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
J11
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
30?GPIO 3012GPIO 31?31
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #

Hummingboard

wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
--3.3v125v--
??I2C-SDA345v--
??I2C-SCL560v--
71GPIO 778TxD??
--0v910RxD??
073GPIO 01112GPIO 1?1
271GPIO 213140v--
370GPIO 31516GPIO 41944
--3.3v1718GPIO 51955
??SPI-MOSI19200v--
??SPI-MISO2122GPIO 6676
??SPI-SCLK2324SPI-CS0??
--0v2526SPI-CS1??
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #

Radxa

J8
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
--0v125v--
--HOST_DP234HOST_DM2--
--LINE_Left56LINE_Right--
07GPIO 078GPIO 161
29GPIO 2910GPIO 313
4125GPIO 41112GPIO 51245
632GPIO 61314GPIO 7337
834GPIO 81516GPIO 9359
--0v17182.8v--
1031GPIO 101920GPIO 114511
1228GPIO 122122GPIO 134213
1430GPIO 142324GPIO 154315
--AIN22526GPIO 164416
175GPIO 172728GPIO 182918
--0v2930VCCIO_WL--
1957GPIO 193132GPIO 205620
--AIN03334AIN1--
--POWER_SW3536POWER_EN--
--HSIC_DATD3738HSIC_STOBE--
--0v37385v--
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
J12 / J15
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #
--0v12LCDC0_D0--
--LCDC0_D134LCDC0_D2--
--LCDC0_D356LCDC0_D4--
--LCDC0_D578LCDC0_D6--
--LCDC0_D7910LCDC0_D8--
--LCDC0_D91112LCDC0_D10--
--LCDC0_D111314LCDC0_D12--
--LCDC0_D131516LCDC0_D14--
--LCDC0_D151718LCDC0_D16--
--LCDC0_D171920LCDC0_D18--
--LCDC0_D192122LCDC0_D20--
--LCDC0_D212324LCDC0_D22--
--LCDC0_D232526GPIO 219021
2291GPIO 222728GPIO 238923
--0v2930GPIO 248824
258GPIO 253132GPIO 26226
27126GPIO 273334GPIO 284728
2939GPIO 293536GPIO 303630
3138GPIO 313738GPIO 323732
--5v37380v--
wiringX # BCM GPIO Name Header Name BCM GPIO wiringX #

API

wiringX currently supports the following common wiringPi functions:

Please notice that the waitForInterrupt implementation is a bit different but greatly improved version of the one used in wiringPi. wiringX also includes an garbage collector which was missing in wiringPi.

The following function are additionally available:

As you might have noticed, wiringX currently includes a limited set of functions to support basic GPIO interfacing. The reason for this is that I initially developed wiringX to add multi-platform support for pilight. And pilight just doesn't use any more GPIO functions then listed above. It's up to the community to add support for already existing wiringPi functions and missing functions for other platforms.

Cooperating Manufacturers

Sadly, only Solid Run (Hummingboard) and Radxa have committed themselves in maintaining their wiringX module. The rest is maintained by pilight with help from the community.