gpiod_get_value(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

gpiod_get_value β€” bestie, this is literally the function that hands you a gpio's value πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int gpiod_get_value (const struct gpio_desc *desc );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • desc β€” the gpio whose value you want back, like "hey queen what's your status" πŸ‘‘

⭐ RETURN ⭐

The GPIO's logical value β€” meaning it already took the ACTIVE_LOW status into account, so you don't have to do that mental gymnastics yourself, icon behavior fr 🫢 β€” or a negative errno if things went sideways 😭


🌸 DESCRIPTION 🌸

Okay so here's the tea β˜•: this function can be called from contexts where we cannot sleep πŸ›ŒπŸš« β€” like, it's built for the no-nap zones β€” and it will complain if the GPIO chip functions potentially sleep πŸ’€ Not me calling the sleepy version in an atomic context... the function said no ma'am πŸ™ˆ

It lives in the Kernel file ./drivers/gpio/gpiolib.c, iykyk 🌈


πŸ”₯ SEE ALSO πŸ”₯

The Kernel file ./drivers/gpio/gpiolib.c and honestly the whole friend group πŸ’œ:


okay that's the whole page bestie, go forth and read your GPIOs πŸ’…βœ¨

shoutout to ./drivers/gpio for hosting this masterpiece, October 2026 edition, and this was gpiod_get_value(9) signing off πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from