gpiod_direction_output(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gpiod_direction_output(9) β€” Kernel API Manual, bestie edition ✨

Okay so this is from the Kernel API Manual, and it's literally about setting a GPIO's direction to output. Main character energy for pins. πŸŽ€


🌸 NAME 🌸

gpiod_direction_output β€” set the GPIO direction to output. πŸ’…


πŸ’… SYNOPSIS πŸ’…

Here's the call, bestie:

int gpiod_direction_output (struct gpio_desc *desc , int value );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • desc β€” the GPIO you're setting to output. πŸ¦‹
  • value β€” the initial output value of the GPIO. πŸ“

✨ DESCRIPTION ✨

Okay so this function sets the direction of the passed GPIO to output, so that stuff like gpiod_set_value can be called safely on it. No cap, that's the whole serve. ✨

The initial value of the output must be specified as the logical value of the GPIO β€” i.e. you have to take its ACTIVE_LOW status into account, bestie. Do not skip that part πŸ’…


🫢 RETURN 🫢

  • 0 on success, or a negative errno on failure. Slay when it's zero 🫢

🌈 SEE ALSO 🌈

Kernel file: ./drivers/gpio/gpiolib.c β€” the source bestie. πŸ‘‘

Then the whole friend group:


xoxo, from the source/version ./drivers/gpio, dated October 2026 πŸ’–πŸ«Ά

πŸ“¦ where this page comes from