STRUCT SHT15_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, struct sht15_data is literally the device instance specific data for the sht15 driver β€” it's the lil' bag of state that the driver carries around for each device. main character struct energy, no cap ✨

this is from the Kernel API Manual, section 9 (that's the kernel API section, iykyk 🧚)


πŸ¦‹ SYNOPSIS πŸ¦‹

like, here's the whole shape of it, exactly as it is:

struct sht15_data {
    struct gpio_desc                *sck;
    struct gpio_desc                *data;
    struct work_struct              read_work;
    wait_queue_head_t wait_queue;
    uint16_t val_temp;
    uint16_t val_humid;
    u8 val_status;
    bool checksum_ok;
    bool checksumming;
    enum sht15_state                state;
    bool measurements_valid;
    bool status_valid;
    unsigned long                   last_measurement;
    unsigned long                   last_status;
    struct mutex                    read_lock;
    struct device                   *dev;
    struct device                   *hwmon_dev;
    struct regulator                *reg;
    struct notifier_block           nb;
    int supply_uv;
    bool supply_uv_valid;
    struct work_struct              update_supply_work;
    atomic_t interrupt_handled;
 };

πŸ‘‘ Members πŸ‘‘

okay this is the part you actually came for, let's go member by member πŸ’…

  • sck β€” the clock GPIO line πŸŽ€
  • data β€” the data GPIO line 🌸
  • read_work β€” the bh of the interrupt handler. (bh = bottom half, in case you were wondering πŸ™ˆ)
  • wait_queue β€” the wait queue used for getting values from the device πŸ¦‹
  • val_temp β€” the last temperature value read from the device πŸ”₯
  • val_humid β€” the last humidity value read from the device πŸ’§
  • val_status β€” the last status register value read from the device πŸ“‹
  • checksum_ok β€” whether the last value read from the device passed CRC validation βœ… β€” literally the vibe check for your data
  • checksumming β€” a flag used to enable the data validation with CRC 🧚
  • state β€” the state identifying the action the driver is doing ⭐
  • measurements_valid β€” are the current stored measures valid (start condition)? 🫢
  • status_valid β€” is the current stored status valid (start condition)? 🫢
  • last_measurement β€” the time of the last measure ⏰
  • last_status β€” the time of the last status reading ⏰
  • read_lock β€” a mutex to ensure only one read is in progress at a time πŸ”’ (no double-dipping bestie, one read at a time periodt)
  • dev β€” the associate device structure πŸ–‡οΈ
  • hwmon_dev β€” the device associated with the hwmon subsystem 🌑️
  • reg β€” the associated regulator (if specified) ⚑
  • nb β€” the notifier block used to handle notifications of voltage changes πŸ“£
  • supply_uv β€” a local copy of supply voltage, used to allow use of the regulator consumer if available πŸ”Œ
  • supply_uv_valid β€” indicates that an updated value has not yet been obtained from the regulator, and so any calculations based upon it will be invalid 😭 (yes, it's a "not yet updated" flag β€” read it carefully, it's giving sneaky)
  • update_supply_work β€” the work struct that is used to update supply_uv πŸ› οΈ
  • interrupt_handled β€” a flag used to indicate a handler has been scheduled 🚦

✨ SEE ALSO ✨

that's the whole friend group right there, go read all of them, i'll wait πŸ’œ


fr fr that's the entire struct, nothing skipped, nothing invented β€” every field, every flag, every "if specified" and every "start condition" note stayed exactly where it was 🫢

and that's a wrap bestie!! πŸŽ€ this one's from ./drivers/hwmon, dated October 2026, and it's the struct sht15_data(9) page β€” slay, you made it to the end πŸ’…πŸ‘‘

πŸ“¦ where this page comes from