STRUCT ST_SENSOR_DATA(9)
β¨ struct st_sensor_data(9) β¨
okay so bestie, welcome to the Kernel API Manual π this page is all about struct st_sensor_data β the whole vibe check of a status struct for an ST sensor device. it's giving "everything you need to know about what the sensor is doing rn" and honestly? iconic. π
πΈ NAME πΈ
struct st_sensor_data β literally the ST sensor device status. that's it, that's the whole name. no cap. β¨
π¦ SYNOPSIS π¦
here's the whole struct, character for character, because we do not mess with the source of truth:
struct st_sensor_data {
struct iio_trigger *trig;
struct iio_mount_matrix mount_matrix;
struct st_sensor_settings *sensor_settings;
struct st_sensor_fullscale_avl *current_fullscale;
struct regmap *regmap;
bool enabled;
unsigned int odr;
unsigned int num_data_channels;
u8 drdy_int_pin;
bool int_pin_open_drain;
int irq;
bool edge_irq;
bool hw_irq_trigger;
s64 hw_timestamp;
struct mutex odr_lock;
char buffer_data[ST_SENSORS_MAX_BUFFER_SIZE];
};
look at her. so structured. so data. π
π Members π
okay now the part where we meet the cast, one field at a time. main character energy for every single one of them, let's go:
trigβ the trigger in use by the core driver. she's the one calling the shots around here. π₯mount_matrixβ the mounting matrix of the sensor. it's literally the sensor's sense of direction, iykyk.sensor_settingsβ pointer to the specific sensor settings in use. like, which sensor are we even talking about? this is how we know. π§current_fullscaleβ maximum range of measure by the sensor. the absolute ceiling, the limit, the "this is how much we can take." πregmapβ pointer to specific sensor regmap configuration. register map stuff, lowkey essential.enabledβ status of the sensor (false->off,true->on). simple as that bestie. πodrβ output data rate of the sensor, in[Hz]. how fast she's going. βnum_data_channelsβ number of data channels used in buffer. counting her channels like it's a group chat. π«Άdrdy_int_pinβ redirect DRDY on pin 1 (1) or pin 2 (2). pick your fighter. πint_pin_open_drainβ set the interrupt/DRDY to open drain. yes ma'am. β¨irqβ the IRQ number. that's it. that's the field. πedge_irqβ the IRQ triggers on edges and need special handling. edge case literally. πhw_irq_triggerβ if we're using the hardware interrupt on the sensor. conditional queen. πhw_timestampβ latest timestamp from the interrupt handler, when in use. when in use!! note it!! πodr_lockβ local lock for preventing concurrent ODR accesses/changes. no interrupting, we're locking. π (well,mutex, but you get it.) πbuffer_dataβ data used by buffer part. the buffer's lil stash. πΈ
π SEE ALSO π
go look at these next bestie, they're all family:
- Kernel file
./include/linux/iio/common/st_sensors.hstructst_sensor_bdu(9),struct st_sensor_das(9),struct st_sensor_int_drdy(9),struct st_sensor_data_ready_irq(9),struct st_sensor_settings(9)
fr fr, the related structs are right there in ./include/linux/iio/common. obsessed. π
and that's the whole page bestie!! π this lil masterpiece comes to you from ./include/linux/iio/common, dated October 2026, and it's titled struct st_sensor_data(9) in case you forgot already β go forth and slay your sensor status, mwah π
β¨
π¦ 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