STRUCT HSC_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct hsc_data β€” okay so bestie, the manpage literally gives us nothing after that dash. Empty. A void. The description is giving mysterious main character energy πŸ™ˆ β€” so we're gonna let the struct speak for itself, and she has so much to say.


✨ SYNOPSIS ✨

struct hsc_data {
    struct device *dev;
    const struct hsc_chip_data *chip;
    hsc_recv_fn recv_cb;
    bool is_valid;
    s32 pmin;
    s32 pmax;
    u32 outmin;
    u32 outmax;
    u32 function;
    s64 p_scale;
    s32 p_scale_dec;
    s64 p_offset;
    s32 p_offset_dec;
    struct {
      __be16 chan[2];
      aligned_s64 timestamp;
    } scan;
    u8 buffer[HSC_REG_MEASUREMENT_RD_SIZE];
};

Look at her. Iconic. No cap, that's the whole vibe right there πŸ’…


🫢 Members 🫢

Time for the roll call, bestie β€” every single member, no skips, no skipsies πŸ”₯

  • dev β€” the current device structure, aka the whole reason we're here πŸŽ€
  • chip β€” structure containing the chip's channel properties. It's giving "know your hardware" ✨
  • recv_cb β€” the function that implements the chip reads. She does the actual work around here πŸ‘‘
  • is_valid β€” true if the last transfer has been validated βœ…. So like, did the last read actually pass the vibe check or not
  • pmin β€” minimum measurable pressure limit 🌸
  • pmax β€” maximum measurable pressure limit 🌈
  • outmin β€” minimum raw pressure in counts (based on transfer function)
  • outmax β€” maximum raw pressure in counts (based on transfer function)
  • function β€” transfer function. The math girlie of the group πŸ“
  • p_scale β€” pressure scale
  • p_scale_dec β€” pressure scale, decimal places
  • p_offset β€” pressure offset
  • p_offset_dec β€” pressure offset, decimal places
  • buffer β€” raw conversion data. The unfiltered, unedited, pre-glow-up version of your measurements 😭
Ngl bestie, pmin/pmax and outmin/outmax are two different pairs β€” one's the real-world pressure limits, one's the raw counts. Do not mix them up, I'm literally begging πŸ™

πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./drivers/iio/pressure/hsc030pa.h β€” go read her, she's the source of truth πŸ¦‹

Okay that's the whole page, bestie β€” you ate that πŸ’…βœ¨ If you need me I'll be in ./drivers/iio/pressure, and this whole thing is dated October 2026, so yes, we're being very future-forward about it πŸ§šπŸ’œ

πŸ“¦ where this page comes from