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

C/C++ • Pi5 & CM5: How to programmatically set the alternate function of a GPIO pin

$
0
0
Is there a C API for setting the alternate function of a GPIO pin on the Pi5 or CM5? It doesn't appear to be possible with libgpiod.

I know I can do something like `system("pinctrl set 12 a0")`, but that seems like more of a hack than a proper solution. I looked through the pinctrl source code at https://github.com/raspberrypi/utils/tr ... er/pinctrl, but I honestly couldn't make sense of it.

Statistics: Posted by JinShil — Mon Feb 03, 2025 8:59 pm — Replies 0 — Views 27



Viewing all articles
Browse latest Browse all 5004

Trending Articles