1.\" $NetBSD: sht3xtemp.4,v 1.5 2025/01/24 03:47:47 uwe Exp $ 2.\" 3.\" Copyright (c) 2021 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 October 31, 2021 18.Dt SHT3XTEMP 4 19.Os 20.Sh NAME 21.Nm sht3xtemp 22.Nd Driver for Sensirion SHT30/SHT31/SHT35 sensor chip via I2C bus 23.Sh SYNOPSIS 24.Cd "sht3xtemp* at iic? addr 0x44" 25.Cd "sht3xtemp* at iic? addr 0x45" 26.Sh DESCRIPTION 27The 28.Nm 29driver provides measurements from the SHT30/SHT31/SHT35 humidity/temperature 30sensors via the 31.Xr envsys 4 32framework. 33The 34.Nm 35.Ar addr 36locator selects the address at the 37.Xr iic 4 38bus. 39The mode of operation, repeatability, heater controls, periodic update rate 40and CRC validity can be changed through 41.Xr sysctl 8 42nodes. 43.Sh SYSCTL VARIABLES 44The following 45.Xr sysctl 8 46variables are provided: 47.Bl -tag -width Li 48.It Li hw.sht3xtemp0.modes 49Lists the modes supported by the driver and chip. 50.It Li hw.sht3xtemp0.mode 51Set the operation mode of the chip. 52The SHT3X chip can run in a single-shot measurement mode or a 53periodic update mode. 54Use one of the strings listed in 55.Li hw.sht3xtemp.modes . 56.It Li hw.sht3xtemp0.rates 57List the periodic update rates supported by the driver and chip. 58.It Li hw.sht3xtemp0.rate 59Set the periodic update rate when the mode of operation is set to 60periodic. 61The unit for this is measurements per second, or ART which is a 62mode that operates at an update rate of 4Hz higher response time. 63Use one of the strings listed in 64.Li hw.sht3xtemp.rates . 65.Pp 66Since it is possible to have subsecond periodic updates from the 67chip if so desired a device file is provided that can be used to 68get the raw temperature and humidity values outside of the 69.Xr envsys 4 70framework. 71The structure of this output is the raw temperature plus an 8-bit CRC 72followed by the raw humidity plus an 8-bit CRC. 73.It Li hw.sht3xtemp0.repeatabilities 74List the valid values for the repeatability used for a measurement. 75.It Li hw.sht3xtemp0.repeatability 76Set the repeatability for the measurement. 77The higher the repeatability the longer the measurement will take 78and the more power used. 79Use one of the strings listed in 80.Li hw.sht3xtemp.repeatabilities . 81.It Li hw.sht3xtemp0.ignorecrc 82If set, the crc calculation for %RH and temperature in the measurement phrase 83will be ignored. 84.It Li hw.sht3xtemp0.heateron 85Turn the heater on and off. 86.It Li hw.sht3xtemp0.debug 87If the driver is compiled with 88.Dv SHT3X_DEBUG , 89this node will appear and can be used to set the debugging level. 90.It Li hw.sht3xtemp0.readattempts 91To read %RH or temperature the chip requires that the command be sent, 92then a delay must be observed before a read can be done to get the values 93back. 94The delays are documented in the datasheet for the chip. 95The driver will attempt to read back the values readattempts number of 96times. 97The default is 10 which should be more than enough for most purposes. 98.It Li hw.sht3xtemp0.clockstretch 99The chip supports a set of commands that lets it use I2C clock 100stretching to perform the temperature or humidity measurement. 101If this is set to 1 then use the clock stretching commands with the 102device. 103Note that the I2C controller must support clock stretching in order 104for this to work reliability. 105When this option is enabled, the readattempts sysctl noted above will 106not be used. 107This option only apply to single shot measurements. 108.El 109.Sh FILES 110.Bl -tag -width Pa -compact 111.It Pa /dev/sht3xtemp Ns Ar u 112SHT3X device unit 113.Ar u 114file. 115.El 116.Sh SEE ALSO 117.Xr envsys 4 , 118.Xr iic 4 , 119.Xr envstat 8 , 120.Xr sysctl 8 121.Sh HISTORY 122The 123.Nm 124driver first appeared in 125.Nx 10.0 . 126.Sh AUTHORS 127.An -nosplit 128The 129.Nm 130driver was written by 131.An Brad Spencer Aq Mt brad@anduin.eldar.org . 132.Sh BUGS 133The datasheet did not provide enough information to get the alarm 134function of the chip working. 135