Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4941

Interfacing (DSI, CSI, I2C, etc.) • Re: RPi 5 gpio libraries

$
0
0
6by9: can you, or any of the other Pi engineers, comment on the use of pinctrl in production environments? My understanding is that, as it writes directly to hardware registers and that being prone to races, it should only be used as a debugging tool NOT as a general hardware access solution. Some are suggesting it as the universal solution over libgpiod and other libraries that use the standard kernel interfaces.
Correct - it should not be used in a production environment. The help text for it even says it is only a debug tool:

Code:

WARNING! pinctrl set writes directly to the GPIO control registersignoring whatever else may be using them (such as Linux drivers) -it is designed as a debug tool, only use it if you know what youare doing and at your own risk!
https://github.com/raspberrypi/utils/bl ... .c#L64-L67

The general recommendation from Pi Towers is libgpiod for C and gpiozero for Python.

Statistics: Posted by 6by9 — Sun Aug 18, 2024 6:55 pm



Viewing all articles
Browse latest Browse all 4941

Trending Articles