GPIOSET(1)

πŸ’… GPIOSET(1) β€” the gpioset girlies' guide

okay so this is the manual for gpioset, a libgpiod command-line utility, and honestly it's kind of the main character of the libgpiod world. bestie, let's get into it ✨


🌸 NAME

gpioset β€” libgpiod command-line utility. that's it, that's the name, she's iconic like that πŸ’…


πŸ¦‹ SYNOPSIS

gpioset [OPTIONS] <line=value>...

✨ DESCRIPTION

So what does she do? She sets values of GPIO lines. literally her whole job πŸŽ€

Lines are specified by name, or optionally by offset if the chip option is provided (that's -c/--chip, we'll get there). Values may be '1' or '0', or equivalently 'active'/'inactive' or 'on'/'off' β€” pick your fave, they all slay the same πŸ’–

Now here's the lil caveat you need to know: the line output state is maintained until the process exits, but after that β€” not guaranteed. so like, she holds the vibe while she's on stage, but after she leaves? no promises, no cap 😭


πŸ”₯ OPTIONS

okay this is the part where we go through every single flag because we do NOT skip details in this house πŸ‘‘

  • --banner β€” display a banner on successful startup. cute lil moment of celebration, we love a grand entrance ✨
  • -b, --bias <bias> β€” specify the line bias. possible values: 'pull-down', 'pull-up', 'disabled'. (default is to leave bias unchanged β€” she stays unbothered πŸ’…)
  • --by-name β€” treat lines as names even if they would parse as an offset. like, respect her identity please 🫢
  • -c, --chip <chip> β€” restrict scope to a particular chip. narrowing it down, we love a focused queen
  • -C, --consumer <name> β€” consumer name applied to requested lines (default is 'gpioset'). she's got a name tag πŸŽ€
  • -d, --drive <drive> β€” specify the line drive mode. possible values: 'push-pull', 'open-drain', 'open-source'. (default is 'push-pull') πŸ”₯
  • -h, --help β€” display this help and exit. the classic "wait what does this do again" button πŸ™ˆ
  • -l, --active-low β€” treat the line as active low. flipping the whole vibe, lowkey iconic
  • -p, --hold-period <period> β€” the minimum time period to hold lines at the requested values. hold the pose, bestie 🧚
  • -s, --strict β€” abort if requested line names are not unique. she does NOT tolerate duplicates, periodt πŸ’€
  • -t, --toggle <period>[,period]... β€” toggle the line(s) after the specified period(s). if the last period is 0 then gpioset exits, else the sequence repeats πŸ”
  • --unquoted β€” don't quote line names. raw and unfiltered, we respect it
  • -v, --version β€” output version information and exit 🌈
  • -z, --daemonize β€” set values then detach from the controlling terminal. she's leaving the group chat to go be mysterious πŸ¦‹

πŸŽ€ Chips

A GPIO chip may be identified by number, name, or path. e.g. '0', 'gpiochip0', and /dev/gpiochip0' all refer to the same chip. three looks, one girl, iykyk πŸ’œ

⏱️ Periods

Periods are taken as milliseconds unless units are specified. e.g. 10us. supported units are 'm', 's', 'ms', and 'us' for minutes, seconds, milliseconds and microseconds respectively. so 10us is not a typo, it's a whole unit system 🌸

⭐ NOTE

It should not be assumed that a line will retain its state after gpioset exits. When a process exits, any GPIO lines it has requested are automatically released. Once released, the state of a line may be modified by the kernel or another process. To guarantee the requested value, by default gpioset does not exit.

so yeah β€” she stays on stage by default specifically so nothing messes with your values. respect the commitment 😀


πŸ’– AUTHOR

Bartosz Golaszewski <brgl@kernel.org> β€” the icon, the legend πŸ‘‘


πŸ™ˆ REPORTING BUGS

found a bug? report it to:

Bartosz Golaszewski <brgl@kernel.org>
linux-gpio <linux-gpio@vger.kernel.org>

they want to hear about it, fr fr 🫢


Copyright Β© 2017-2023 Bartosz Golaszewski

License: GPL-2.0-or-later

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (read that in all caps, it means it 🚨)


and that's the whole page bestie β€” gpioset v2.3.2 (libgpiod v2.2.1), dated November 2026, signing off πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from
  • arch rolling: libgpiod 2.3.2-1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later AND CC-BY-SA-4.0
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms