A Library for Using Raspberry Pi Peripherals in Userland.

librpip came into being when I needed a to interact with peripherals on the GPIO header from a non-privileged account on a rPi. With the rPi / Raspbian combination I was expecting a reasonably mature OS with drivers for all the hardware the broadcom chip offered. At first it didn’t look like it was possible but after a bit if digging the pieces were all there, they just needed being pulled together. So hence librpip.

This library will not be for everyone, it is totally dependant on the functionality of the underlying kernel modules, and the modules do not incorporate 100% of the broadcom chip functionality. However they do incorporate all standard functionality (inherited from the linux kernel) so a standard device will work just fine.

If you need the raw functionality of the broadcom chip then you are probably best with another library that accesses the hardware registers directly. Try Pigpio, WiringPi or the BCM2835 library. You’ll have to run these as root (pigpio can side step this issue by running a daemon as root).

The Library is a C library that should work with C++.

The library will detect and use whatever hardware it can find, so you have full control on what features it has. You will need to configure / activate various kernel modules. See the section on Peripheral Config for details.

The library was developed using Raspbian Jessie 4.1 and Wheezy 3.18 on a modern Raspberry Pi 2 B. I’d like to have tried on more boards but I can’t get my hands on them. If you have a spare board lying about and live in Australia I’ll happily accept it to test against for a few weeks. hint hint.

For some, the library may just serve as a convenient reference for developing with the kernel modules on the rPi, and thats fine too.

The code is hosted in GitHub so if you have and requests/bugs to report then please do so here.