GPIOCTL(8)
gpioctl(8) β GPIO control utility β¨
Hey bestie, welcome to the System Manager's Manual page for gpioctl, aka the GPIO control utility. π«Ά
π NAME π
gpioctl β GPIO control utility
π SYNOPSIS π
gpioctl [-f ctldev] -l [-v]
gpioctl [-f ctldev] [-pN] -t pin
gpioctl [-f ctldev] [-pN] -c pin flag [flag ...]
gpioctl [-f ctldev] [-pN] -n pin pin-name
gpioctl [-f ctldev] [-pN] pin [0|1]
β¨ DESCRIPTION β¨
So the gpioctl utility could be used to manage GPIO pins from userland and list available pins. Literally the main character of pin-wrangling. π
The pin argument can either be a pin-number or a pin-name. And here's the little plot twist: if it's a number and a pin has this number as its name, and you did not use -N or -p, then gpioctl exits. No cap.
β οΈ Real talk, bestie: that pin-number vs pin-name thing is exactly why-Nand-pexist. Use them when you need to force the interpretation. π
π OPTIONS π
Okay so the options are as follows:
-c pin flag [flag ...]β configurepinby setting the provided flags. The following flags are currently defined:INβ input pinOUTβ output pinODβ open drain pinPPβ push pull pinTSβ tristate pinPUβ pull-up pinPDβ pull-down pinIIβ inverted input pinIOβ inverted output pin
-f ctldevβ GPIO controller device to use. If not specified, defaults to/dev/gpioc0.-lβ list available pins.-n pin pin-nameβ set the name used to describe the pin.-t pinβ toggle value of provided pin.-vβ be verbose: for each listed pin print current configuration.-pβ force pin to be interpreted as a pin number.-Nβ force pin to be interpreted as a pin name.
π EXAMPLES π
- List pins available on GPIO controller defined by device
/dev/gpioc0
gpioctl -f /dev/gpioc0 -l
- Set the value of pin 12 to 1
gpioctl -f /dev/gpioc0 12 1
- Configure pin 12 to be input pin
gpioctl -f /dev/gpioc0 -c 12 IN
- Set the name of pin 12 to test
gpioctl -f /dev/gpioc0 -n 12 test
- Toggle the value the pin named test
gpioctl -f /dev/gpioc0 -t test
- Toggle the value of pin number 12 even if another pin has the name 12
gpioctl -f /dev/gpioc0 -pt 12
π₯ SEE ALSO π₯
πΈ HISTORY πΈ
The gpioctl utility appeared in FreeBSD 9.0. Iconic behavior, honestly. π
π AUTHORS π
The gpioctl utility and this manual page were written by Oleksandr Tymoshenko <gonzo@freebsd.org>. π«Ά
From Debian, dated June 6, 2018 β GPIOCTL(8), periodt. Stay slay, bestie! π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 1980, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms