Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
htu31d.h
Go to the documentation of this file.
1/*
2 * Copyright The Zephyr Project Contributors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
16
17#ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_HTU31D_H_
18#define ZEPHYR_INCLUDE_DRIVERS_SENSOR_HTU31D_H_
19
26
27#include <zephyr/device.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
39#define HTU31D_DIAG_HEATER_ON BIT(0)
40#define HTU31D_DIAG_TEMP_LOW_ERR BIT(1)
41#define HTU31D_DIAG_TEMP_HIGH_ERR BIT(2)
42#define HTU31D_DIAG_TEMP_OVER_ERR BIT(3)
43#define HTU31D_DIAG_HUMI_LOW_ERR BIT(4)
44#define HTU31D_DIAG_HUMI_HIGH_ERR BIT(5)
45#define HTU31D_DIAG_HUMI_OVER_ERR BIT(6)
46#define HTU31D_DIAG_NVM_ERR BIT(7)
48
61int htu31d_heater_set(const struct device *dev, bool enable);
62
74int htu31d_read_diagnostics(const struct device *dev, uint8_t *diag);
75
85int htu31d_read_serial(const struct device *dev, uint32_t *serial);
86
87#ifdef __cplusplus
88}
89#endif
90
94
95#endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_HTU31D_H_ */
int htu31d_read_serial(const struct device *dev, uint32_t *serial)
Read the factory-programmed 24-bit serial number.
int htu31d_heater_set(const struct device *dev, bool enable)
Enable or disable the on-chip heater.
int htu31d_read_diagnostics(const struct device *dev, uint8_t *diag)
Read the sensor diagnostics register.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:513