ENUM GPIOD_FLAGS(9)
π 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 bestiedevm_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms