Porting C based GPIO Programming from Raspian/Raspberry PI OS

The issue is that Raspberry Pi decided to modify the kernel to print out fields in various kernel virtual filesystems that are non-standard compared to upstream Linux. Then people start targeting these non-standard fields thinking these are standardized APIs when they’re just proprietary Raspberry Pi modifications.

These are standard fields used across the computer industry since the 1994, almost 30 years. Any Linux computer you boot will read these DMI fields from the BIOS and populate it. Again, this is industry standard and Raspberry Pi decided against using these standard interfaces to introduce their own so that they can lock in people targeting their software.

GPIOs chip and numbering are a function of the SoC used. These work with the Linux pinctrl system and the numbering is based on the physical hardware. We provide a quick lookup tool lgpio with documentation that can be found here: Libre Computer Wiring Tool
Again, libgpiod/pinctrl is a standard interface used across the Linux ecosystem by every vendor except Raspberry Pi.

We are not trying to be mean to our users. We are just stating fact of how things came to be this way. We try to move everyone to the correct API interfaces. If you have specific implementation questions, you can ask and we always answer. Asking us to port one of the poorly written Raspberry Pi GPIO libraries or hacky VFS interfaces is a no go.

1 Like