HTU21(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

✨ 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:

  • HTU21D
  • SHT21
  • Si7021

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 of htu21. Although, it is hard-wired to 0x40 (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