gpiod_get_ar...lue_cansleep(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME ✨

Welcome to the gpiod_get_ar...lue_cansleep(9) page in the Kernel API Manual, bestie 🫢. This one is all about gpiod_get_array_value_cansleep - read values from an array of GPIOs. It's giving "group chat, but for GPIO values" energy, no cap.


✨ SYNOPSIS ✨

int gpiod_get_array_value_cansleep (unsigned int array_size , struct
gpio_desc **desc_array , struct gpio_array *array_info , unsigned long
*value_bitmap );

πŸŽ€ ARGUMENTS πŸŽ€

  • array_size β€” number of elements in the descriptor array / value bitmap. Basically the headcount for this little GPIO squad πŸ’….
  • desc_array β€” array of GPIO descriptors whose values will be read. The main characters, fr fr.
  • array_info β€” information on applicability of fast bitmap processing path. Lowkey important for whether the fast path is applicable πŸ‘€.
  • value_bitmap β€” bitmap to store the read values. This is where the read values get tucked in, cute and organized πŸŽ€.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so what it actually does: it reads the logical values of the GPIOs β€” and yes, that means it takes their ACTIVE_LOW status into account πŸ’…. So you're getting the logical vibe, not just raw pin state. Iconic.

The big caveat: this function is to be called from contexts that can sleep 😴. Like, that's literally the _cansleep of it all. Do not bring this to an atomic-context party where nobody is allowed to snooze, bestie. That would be a whole mess.

Sleepy context only, okay? This is not the function for "can't sleep, clown will eat me" situations 😭.

πŸ”₯ RETURN πŸ”₯

0 on success, or negative errno on failure β€” no cap, that's the whole mood. 0 = slay, negative errno = the vibe check did not pass 😭.


🌈 SEE ALSO 🌈

Kernel file: ./drivers/gpio/gpiolib.c β€” the main character file. And the extended friend group is literally all of these:


Catch u later, bestie β€” this was gpiod_get_ar...lue_cansleep(9) from the Kernel API Manual, straight outta ./drivers/gpio, dated October 2026 πŸ’–βœ¨

πŸ“¦ where this page comes from