GPIO.CONF(5)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’… GPIO.CONF(5) β€” like, the whole vibe πŸ’…

okay so this is gpio.conf, aka the GPIO config file, and honestly? it's a whole manual page in the File Formats Manual section, bestie. buckle up πŸŽ€


✨ NAME ✨

gpio.conf β€” the GPIO config file, no cap πŸ’œ


🌸 DESCRIPTION 🌸

so the gpio.conf file gets read by the gpio rc.d script during system startup and shutdown β€” like, both ends of the journey πŸ¦‹ β€” and its whole entire purpose is configuring GPIO pins. that's it, that's the job. main character energy only πŸ‘‘

🧚 FILE FORMAT 🧚

here's the tea on how to actually write this file:

  • lines starting with a hash (#) are ignored β€” those are your lil comments, slay πŸ’…
  • empty lines? also ignored. the file format is literally not judging you πŸ™ˆ
  • if a line starts with !, the rest of that line will get evaluated as a shell script fragment πŸ‘€ β€” yes, fr fr, shell script, right there in your config file
  • all other lines get passed straight to gpioctl(8) β€” no filter, no middleman ⭐
lowkey important: that ! thing is doing real shell evaluation. it's giving "powerful but respect it" energy πŸ”₯

πŸŽ€ FILES πŸŽ€

  • /etc/gpio.conf β€” the gpio.conf configuration file resides in /etc. that's home 🏠
  • /etc/rc.d/gpio β€” the rc.d(8) script that parses gpio.conf. it's the one doing the reading, iykyk πŸ’–

🌈 EXAMPLES 🌈

okay so in this example, if the /etc/gpio.conf config file is present, pin 1 of /dev/gpio0 is set as output and named "error_led" β€” iconic naming choice honestly πŸ“

# Program pin 1 of /dev/gpio0 as output and name it "error_led"
gpio0 1 set out error_led

like. that's it. that's the whole config. ate and left no crumbs πŸ’€βœ¨


🫢 SEE ALSO 🫢

go read those, bestie, they're the supporting cast πŸ‘‘


and that's the page!! πŸ¦‹ this little beauty came to you from Debian, dated August 1, 2009 β€” vintage, honestly, but still serving βœ¨πŸ’… mwah, go configure some pins πŸ’œ

πŸ“¦ where this page comes from