STRUCT ST_SENSOR_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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.h struct st_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