STRUCT ABP2_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct abp2_data(9) β€” the kernel API manual, but make it cute

okay so bestie, welcome to struct abp2_data(9) πŸ’– this is a page from the Kernel API Manual, and it's literally about one struct. one. single. struct. and honestly? she's giving main character energy in the pressure-sensor department. let's get into it 🫢


✨ SYNOPSIS ✨

here's the whole vibe, verbatim, no cap β€” do not touch, do not edit, just admire her:

struct abp2_data {
    struct device *dev;
    const struct abp2_ops *ops;
    s32 pmin;
    s32 pmax;
    u32 outmin;
    u32 outmax;
    enum abp2_func_id function;
    int p_scale;
    int p_scale_dec;
    int p_offset;
    int irq;
    struct completion completion;
    struct {
      u32 chan[2];
      aligned_s64 timestamp;
    } scan;
    u8 rx_buf[ABP2_MEASUREMENT_RD_SIZE];
    u8 tx_buf[ABP2_MEASUREMENT_RD_SIZE];
 };

like, look at that nested anonymous struct for scan β€” she's got layers 🧚✨ periodt.


πŸŽ€ Members πŸŽ€

okay now the fun part, member by member, and I'm not skipping a single one because we respect completeness in this group chat πŸ’…

  • dev β€” the current device structure. like, whose device is this? this one. 🫢
  • ops β€” pointers for bus specific read and write functions. the little function-handle besties that actually do the talking on the bus ✨
  • pmin β€” minimal pressure in pascal. the floor, the absolute low, the "couldn't go lower if she tried" 🌸
  • pmax β€” maximal pressure in pascal. the ceiling. the limit. the "no further, bestie" πŸ”₯
  • outmin β€” minimum raw pressure in counts (based on transfer function). yes, the parenthetical matters β€” it's counts, and it's derived from the transfer function πŸ‘‘
  • outmax β€” maximum raw pressure in counts (based on transfer function). same energy, other end of the scale ⭐
  • function β€” the transfer function. that's it. that's the whole description. she's enum abp2_func_id and she's mysterious like that πŸ™ˆ
  • p_scale β€” pressure scale πŸ¦‹
  • p_scale_dec β€” pressure scale, decimal number. yes, a separate one. decimal edition. don't ask, just respect it πŸ’œ
  • p_offset β€” pressure offset. the little nudge, the "actually shift it a bit" of it all πŸŽ€
  • irq β€” end of conversion β€” applies only to the i2c sensor. only the i2c sensor, bestie, i'm being so serious, don't come at the spi one with this 😭
  • completion β€” handshake from irq to read. the little "hey i'm done!!" β†’ "okay reading now!!" moment 🀝
  • scan β€” channel values for buffered mode, and inside her lives:
    • chan[2] β€” the channel array, both of them, exactly two, a duo πŸ’«
    • timestamp β€” an aligned_s64 timestamp because alignment matters and she is aligned ✨
  • rx_buf β€” raw data provided by sensor. incoming!! πŸ“₯ the buffer is u8 rx_buf[ABP2_MEASUREMENT_RD_SIZE], size and all, keep it exact πŸ’–
  • tx_buf β€” transmit buffer used during the SPI communication. outgoing!! πŸ“€ also u8 tx_buf[ABP2_MEASUREMENT_RD_SIZE], again, exact, no cap 🧚
ngl the fact that rx_buf is just "raw data provided by sensor" and tx_buf is specifically "used during the SPI communication" is a whole personality difference and i'm obsessed πŸ”₯

🌈 SEE ALSO 🌈

go look at the kernel file bestie, it's right here, character for character:

Kernel file ./drivers/iio/pressure/abp2030pa.h

iykyk πŸ’…


and that's the page!! slay βœ¨πŸ¦‹πŸŒΈ

cute little sign-off: this gem dropped from ./drivers/iio/pressure, dated October 2026 β€” so yes, she's from the future, and she ate πŸ’–πŸŽ€πŸ’œ

πŸ“¦ where this page comes from