STRUCT SHT21(9)
β¨ NAME β¨
struct sht21 β the SHT21 device specific data π like, this is the little bundle of everything the driver remembers about your SHT21 sensor, iykyk
(this one lives in the Kernel API Manual, bestie β you're in the right place π)
πΈ SYNOPSIS πΈ
struct sht21 {
struct i2c_client *client;
struct mutex lock;
unsigned long last_update;
int temperature;
int humidity;
bool valid;
char eic[18];
};
Ok so that's the whole struct, character for character, no cap π β the fields are explained down below, keep scrolling bestie π
π Members π
clientβ the I2C client device. that's the whole reason this thing exists fr fr π¦lockβ a mutex whose entire job is protecting the measurement values. do not skip the lock, it's giving bodyguard energy π₯last_updateβ the time of the last update, measured in jiffies β° (yes, jiffies, that's the unit, don't come for me)temperatureβ the cached temperature measurement value. cached!! as in, it's a stored value, not a fresh reading every time π‘οΈhumidityβ the cached humidity measurement value, same deal π§validβ only0before the first measurement is taken. so like,0= we have literally nothing yet, anything else = we've measured at least once βeicβ the cached electronic identification code text, sitting in achar[18]π·οΈ
lowkey important:temperature,humidityandeicare all cached β the struct is holding onto the last known stuff, bestie π«Ά
π§ SEE ALSO π§
- Kernel file
./drivers/hwmon/sht21.c sht21_temp_ticks_to_millicelsius(9)sht21_rh_ticks_to_per_cent_mille(9)sht21_update_measurements(9)sht21_temperature_show(9)sht21_humidity_show(9)eic_show(9)
go read all of those, they're the supporting cast and honestly they ate π
that's the whole page!! mwah π this little struct drop comes courtesy of the ./drivers/hwmon corner of the kernel, dated October 2026 β iconic of it, honestly. periodt. πβ¨
π¦ 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