Lines Matching +full:humidity +full:- +full:sensor
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
50 * Driver for HTU21D and compatible temperature and humidity sensors.
52 * - Measurement Specialties HTU21D datasheet,
53 * - Sensirion SHT21 datasheet,
54 * - Silicon Labs Si7021 datasheet,
55 * - HTU2X Serial Number Reading application note,
56 * - Sensirion Electronic Identification Code (How to read-out the serial number
132 msgs[0].slave = sc->sc_addr; in htu21_get_measurement()
137 msgs[1].slave = sc->sc_addr; in htu21_get_measurement()
157 msgs[0].slave = sc->sc_addr; in htu21_get_measurement_nohold()
162 msgs[1].slave = sc->sc_addr; in htu21_get_measurement_nohold()
193 if (req->oldptr != NULL) { in htu21_temp_sysctl()
194 if (sc->sc_hold) in htu21_temp_sysctl()
204 temp = -1; in htu21_temp_sysctl()
205 sc->sc_errcount++; in htu21_temp_sysctl()
209 temp = ((temp * 17572) >> 16 ) + 27315 - 4685; in htu21_temp_sysctl()
228 if (req->oldptr != NULL) { in htu21_rh_sysctl()
229 if (sc->sc_hold) in htu21_rh_sysctl()
239 rh = -1; in htu21_rh_sysctl()
240 sc->sc_errcount++; in htu21_rh_sysctl()
244 rh = ((rh * 12500) >> 16 ) - 600; in htu21_rh_sysctl()
263 msgs[0].slave = sc->sc_addr; in htu21_get_cfg()
268 msgs[1].slave = sc->sc_addr; in htu21_get_cfg()
289 msg.slave = sc->sc_addr; in htu21_set_cfg()
307 if (req->oldptr != NULL) { in htu21_heater_sysctl()
314 if (error != 0 || req->newptr == NULL) in htu21_heater_sysctl()
332 if (req->oldptr != NULL) { in htu21_power_sysctl()
359 msgs[0].slave = sc->sc_addr; in htu21_get_serial()
364 msgs[1].slave = sc->sc_addr; in htu21_get_serial()
377 sc->sc_serial[2 + i / 2] = data[i]; in htu21_get_serial()
382 msgs[0].slave = sc->sc_addr; in htu21_get_serial()
387 msgs[1].slave = sc->sc_addr; in htu21_get_serial()
398 sc->sc_serial[6] = data[0]; in htu21_get_serial()
399 sc->sc_serial[7] = data[1]; in htu21_get_serial()
403 sc->sc_serial[0] = data[3]; in htu21_get_serial()
404 sc->sc_serial[1] = data[4]; in htu21_get_serial()
420 dev = sc->sc_dev; in htu21_start()
429 sc->sc_serial, ":", error == 0 ? "" : "in"); in htu21_start()
442 SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "humidity", in htu21_start()
444 htu21_rh_sysctl, "I", "Relative humidity in 0.01%% units"); in htu21_start()
447 htu21_heater_sysctl, "IU", "Enable built-in heater"); in htu21_start()
450 htu21_power_sysctl, "IU", "If sensor's power is good"); in htu21_start()
452 CTLFLAG_RW, &sc->sc_hold, 0, in htu21_start()
455 CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &sc->sc_errcount, 0, in htu21_start()
468 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data) in htu21_probe()
476 device_printf(dev, "non-standard slave address 0x%02x\n", in htu21_probe()
480 device_set_desc(dev, "HTU21 temperature and humidity sensor"); in htu21_probe()
490 sc->sc_dev = dev; in htu21_attach()
491 sc->sc_addr = iicbus_get_addr(dev); in htu21_attach()