ENUM GPIOD_FLAGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… enum gpiod_flags(9) β€” the Kernel API Manual, but make it make sense πŸŽ€

okay bestie, so this is a page straight outta the Kernel API Manual (yes, the kernel, we're in the big leagues now ✨) and it's about one very specific little enum. it's enum gpiod_flags, and its whole entire job is to be the options bag you hand over when you call one of the gpiod_* functions β€” it tells the kernel which direction the GPIO lines should go and what value they should drive. that's it, that's the vibe πŸ’…

✨ NAME ✨

enum gpiod_flags β€” optional flags you can pass to one of the gpiod_* functions to configure direction and output value.

🚨 real talk: these values cannot be OR'd. like, at all. no smashing them together, no | chaos. one flag, one vibe, periodt. πŸ’€

🌸 SYNOPSIS 🌸

enum gpiod_flags {
    GPIOD_ASIS ,
    GPIOD_IN ,
    GPIOD_OUT_LOW ,
    GPIOD_OUT_HIGH ,
    GPIOD_OUT_LOW_OPEN_DRAIN ,
    GPIOD_OUT_HIGH_OPEN_DRAIN

};

look at that list, six little icons, all of them different, none of them combinable 🫢


πŸ¦‹ Constants πŸ¦‹

  • GPIOD_ASIS β€” don't touch a thing. don't change anything. leave the lines exactly as you found them, main character energy of the "no thoughts, head empty" variety πŸ™ˆ
  • GPIOD_IN β€” set the lines to input mode. they're listening now πŸ‘‚
  • GPIOD_OUT_LOW β€” set the lines to output and drive them low. pushing a low signal out into the world 🌈
  • GPIOD_OUT_HIGH β€” set the lines to output and drive them high. same deal, but high. iconic ⭐
  • GPIOD_OUT_LOW_OPEN_DRAIN β€” set the lines to open-drain output and drive them low. fancy output mode, low value, slay πŸ’…
  • GPIOD_OUT_HIGH_OPEN_DRAIN β€” set the lines to open-drain output and drive them high. fancy output mode, high value, also slay πŸ‘‘

πŸ’– SEE ALSO πŸ’–

  • Kernel file ./include/linux/gpio/consumer.h β€” the lore, the source of truth 🧚
  • struct gpio_descs(9) β€” the struct bestie
  • devm_fwnode_gpiod_get_optional(9) β€” the other function bestie

k that's the whole page, no notes, it's giving short and sweet πŸ“ and before you go β€” this came from the Kernel API Manual, source ./include/linux/gpio, dated October 2026. mwah, go configure some lines responsibly πŸ”₯πŸ‘‘

πŸ“¦ where this page comes from