|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
TE Connectivity HTU31D temperature and humidity sensor. More...
Files | |
| file | htu31d.h |
| Header file for extended sensor API of HTU31D sensor. | |
Functions | |
| 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. | |
| int | htu31d_read_serial (const struct device *dev, uint32_t *serial) |
| Read the factory-programmed 24-bit serial number. | |
Diagnostics register bit flags | |
Bit positions of the diagnostics byte returned by htu31d_read_diagnostics(). | |
| #define | HTU31D_DIAG_HEATER_ON BIT(0) |
| Heater is currently enabled. | |
| #define | HTU31D_DIAG_TEMP_LOW_ERR BIT(1) |
| Temperature below minimum. | |
| #define | HTU31D_DIAG_TEMP_HIGH_ERR BIT(2) |
| Temperature above maximum. | |
| #define | HTU31D_DIAG_TEMP_OVER_ERR BIT(3) |
| Temperature under/over-run. | |
| #define | HTU31D_DIAG_HUMI_LOW_ERR BIT(4) |
| Humidity below minimum. | |
| #define | HTU31D_DIAG_HUMI_HIGH_ERR BIT(5) |
| Humidity above maximum. | |
| #define | HTU31D_DIAG_HUMI_OVER_ERR BIT(6) |
| Humidity under/over-run. | |
| #define | HTU31D_DIAG_NVM_ERR BIT(7) |
| NVM checksum error. | |
TE Connectivity HTU31D temperature and humidity sensor.
| #define HTU31D_DIAG_HEATER_ON BIT(0) |
#include <zephyr/drivers/sensor/htu31d.h>
Heater is currently enabled.
| #define HTU31D_DIAG_HUMI_HIGH_ERR BIT(5) |
#include <zephyr/drivers/sensor/htu31d.h>
Humidity above maximum.
| #define HTU31D_DIAG_HUMI_LOW_ERR BIT(4) |
#include <zephyr/drivers/sensor/htu31d.h>
Humidity below minimum.
| #define HTU31D_DIAG_HUMI_OVER_ERR BIT(6) |
#include <zephyr/drivers/sensor/htu31d.h>
Humidity under/over-run.
| #define HTU31D_DIAG_NVM_ERR BIT(7) |
#include <zephyr/drivers/sensor/htu31d.h>
NVM checksum error.
| #define HTU31D_DIAG_TEMP_HIGH_ERR BIT(2) |
#include <zephyr/drivers/sensor/htu31d.h>
Temperature above maximum.
| #define HTU31D_DIAG_TEMP_LOW_ERR BIT(1) |
#include <zephyr/drivers/sensor/htu31d.h>
Temperature below minimum.
| #define HTU31D_DIAG_TEMP_OVER_ERR BIT(3) |
#include <zephyr/drivers/sensor/htu31d.h>
Temperature under/over-run.
#include <zephyr/drivers/sensor/htu31d.h>
Enable or disable the on-chip heater.
The heater can be used to burn off condensation or perform sensor self-diagnostics. It increases the measured temperature by several degrees while enabled and should not be left on continuously.
| dev | Pointer to the sensor device. |
| enable | True to enable the heater, false to disable it. |
#include <zephyr/drivers/sensor/htu31d.h>
Read the sensor diagnostics register.
The diagnostics byte reports persistent fault flags; decode the returned value using the HTU31D_DIAG_* bit macros.
| dev | Pointer to the sensor device. |
| diag | Output, populated with the 8-bit diagnostics word. |
#include <zephyr/drivers/sensor/htu31d.h>
Read the factory-programmed 24-bit serial number.
| dev | Pointer to the sensor device. |
| serial | Output, populated with the 24-bit serial number in the low three bytes (upper byte is zero). |