HTU21(4)
β¨ NAME β¨
okay so, bestie, welcome to the htu21(4) page from the Kernel Interfaces Manual! This one is htu21 β driver for HTU21D and compatible temperature and humidity sensors. Itβs giving tiny sensor energy, and honestly? Iconic. π
π οΈ SYNOPSIS π οΈ
To compile this driver into the kernel, place the following lines in your kernel configuration file, bestie:
device htu21
device iicbus
Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):
htu21_load="YES"
π DESCRIPTION π
The htu21 driver provides temperature and relative humidity readings over I2C bus for the supported sensors. Slay, honestly:
HTU21DSHT21Si7021
The htu21 driver reports data via sysctl(8) entries in the device's node in the sysctl(8) tree. Hereβs the whole little lineup, no cap:
temperatureβ the temperature, in hundredths of Kelvin. π‘οΈhumidityβ the relative humidity, in hundredths of a percent. π§crc_errorsβ the number of CRC errors in reading the measurements from the device. πpowerβ the good power indication. This can be useful with battery powered sensors. πheaterβ the built-in heater control. The heater can be used for testing and for recovery from saturation after high humidity. π₯hold_busβ whether the sensor should hold SCL low while performing the measurement. Normally, the sensor releases the bus and NACKs all accessed until the measurement is completed. The hold mode may be useful in mult-master environments.
On an FDT(4) based system the following properties must be set:
compatibleβ must be set to"meas,htu21".regβ the I2C address ofhtu21. Although, it is hard-wired to0x40(7-bit) on all supported sensors.
The DTS part for a htu21 device usually looks like:
/ {
...
htu21d {
compatible = "meas,htu21";
reg = <0x40>;
};
};
π SEE ALSO π
If you want the lore, go peek at fdt(4), iicbus(4), and sysctl(8). iykyk π¦
π HISTORY π
The htu21 driver and this manual page was written by Andriy Gapon <avg@FreeBSD.org>. Respect the author, periodt. π
π BUGS π
There is no way to control the measurement resolution. Big sigh, bestie. π
Some sensor variants do not provide a serial number or use an incompatible format. The htu21 driver does not distinguish those variants and may complain about incorrect serial number checksum. Not me reading a drama between sensor variants. π
π this HTU21(4) page is brought to you by the Debian build, dated January 19, 2021 β love u, bestie, bye! π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π the page's license: BSD-2-Clause
- Copyright (c) 2021 Andriy Gapon <avg@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms