iio_read_avail_channel_raw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… iio_read_avail_channel_raw πŸ’…

okay so bestie, this is a page from the Kernel API Manual (the iio_read_avail_channel_raw(9) one, yes the name is a mouthful, we love her anyway 🫢), and it's genuinely so useful β€” it's all about reading the available raw values from a given channel. let's get into it ✨


🌸 NAME 🌸

iio_read_avail_channel_raw β€” read available raw values from a given channel πŸ’–


✨ SYNOPSIS ✨

int iio_read_avail_channel_raw (struct iio_channel *chan , const int
**vals , int *length );

πŸŽ€ ARGUMENTS πŸŽ€

  • chan β€” the channel you're querying, bestie. that's the one you're asking about πŸ’…
  • vals β€” the available values get read back into here, so this is where the good stuff lands πŸ¦‹
  • length β€” how many entries are chillin' in vals πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

so this function returns an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST. those are your two moods, no in-between 😌

for ranges, three vals are always returned β€” min, step and max. that's the whole trio, periodt πŸ”₯

for lists, all the possible values are enumerated β€” like every single one, she's thorough like that πŸ’€

⚠️ note note note: if you need standard units, those raw available values from iio channels need the offset (default 0) and scale (default 1) applied, and the formula is literally (raw + offset) * scale. don't forget the parentheses, i'm begging πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, gathered for the occasion 🌈 β€” kernel file ./include/linux/iio/consumer.h and:


and that's the page, babe πŸ’œ this lil gem came straight out of ./include/linux/iio, dated October 2026 β€” so go forth, read those available values, and slay βœ¨πŸ‘‘

πŸ“¦ where this page comes from