1.\" $NetBSD: si70xxtemp.4,v 1.9 2025/01/24 16:12:50 uwe Exp $ 2.\" 3.\" Copyright (c) 2017 Brad Spencer <brad@anduin.eldar.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd December 28, 2017 18.Dt SI70XXTEMP 4 19.Os 20.Sh NAME 21.Nm si70xxtemp 22.Nd Driver for Silicon Labs SI7013/SI7020/SI7021, HTU21D and SHT21 sensor chip via I2C bus 23.Sh SYNOPSIS 24.Cd "si70xxtemp* at iic? addr 0x40" 25.Sh DESCRIPTION 26The 27.Nm 28driver provides measurements from the SI7013/SI7020/SI7021 humidity/temperature 29sensors via the 30.Xr envsys 4 31framework. 32The 33.Nm 34.Ar addr 35locator selects the address at the 36.Xr iic 4 37bus. 38The resolution, heater control and crc validity can be changed through 39.Xr sysctl 8 40nodes. 41.Sh SYSCTL VARIABLES 42The following 43.Xr sysctl 8 44variables are provided: 45.Bl -tag -width Li 46.It Li hw.si70xxtemp0.resolutions 47Lists the resolutions supported by the driver and chip. 48.It Li hw.si70xxtemp0.resolution 49Set the resolution, or number of bits, used for %RH and temperature. 50Use one of the strings listed in 51.Li hw.si70xxtemp.resolutions . 52.It Li hw.si70xxtemp0.ignorecrc 53If set, the crc calculation for %RH and temperature will be ignored. 54.It Li hw.si70xxtemp0.vddok 55If 1, the chip is getting enough power. 56.It Li hw.si70xxtemp0.heateron 57Turn the heater on and off. 58.It Li hw.si70xxtemp0.heaterstrength 59From 1 to 6, the amount of energy put into the heater. 60The higher the number, the more power used. 61.Pp 62Some HTU21D chips do not support a heater register. 63These chips are detected and the heater features of the driver will 64be disabled. 65.It Li hw.si70xxtemp0.debug 66If the driver is compiled with 67.Dv SI70XX_DEBUG , 68this node will appear and can be used to set the debugging level. 69.It Li hw.si70xxtemp0.readattempts 70To read %RH or temperature the driver uses a No Hold Master command. 71This command needs to be sent to the device, a wait must then occur 72and then another read command is sent to read back the values. 73Depending on the resolution, and other factors, the wait time varies. 74The driver will attempt to read back the values readattempts number of 75times. 76The default is 40 which should be enough for most purposes. 77There is an initial wait of 10,500 microseconds followed by 78a additional 1,000 microseconds per read attempt. 79.It Li hw.si70xxtemp0.clockstretch 80The chip supports a set of commands that lets it use I2C clock 81stretching to perform the temperature or humidity measurement. If 82this is set to 1 then use the clock stretching commands with the 83device. Note that the I2C controller must support clock stretching 84in order for this to work reliability. When this option is enabled, 85the readattempts sysctl noted above will not be used. 86.El 87.Sh SEE ALSO 88.Xr envsys 4 , 89.Xr iic 4 , 90.Xr envstat 8 , 91.Xr sysctl 8 92.Sh HISTORY 93The 94.Nm 95driver first appeared in 96.Nx 8.0 . 97.Sh AUTHORS 98.An -nosplit 99The 100.Nm 101driver was written by 102.An Brad Spencer Aq Mt brad@anduin.eldar.org . 103