STRUCT ABP2_DATA(9)
π 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'senum abp2_func_idand 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β analigned_s64timestamp because alignment matters and she is aligned β¨
rx_bufβ raw data provided by sensor. incoming!! π₯ the buffer isu8 rx_buf[ABP2_MEASUREMENT_RD_SIZE], size and all, keep it exact πtx_bufβ transmit buffer used during the SPI communication. outgoing!! π€ alsou8 tx_buf[ABP2_MEASUREMENT_RD_SIZE], again, exact, no cap π§
ngl the fact thatrx_bufis just "raw data provided by sensor" andtx_bufis 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms