2019-02-12 17:50:47 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_DRIVERS_SENSOR_TI_HDC_TI_HDC_H_
|
|
|
|
#define ZEPHYR_DRIVERS_SENSOR_TI_HDC_TI_HDC_H_
|
|
|
|
|
|
|
|
#include <kernel.h>
|
|
|
|
|
|
|
|
#define TI_HDC_REG_TEMP 0x0
|
|
|
|
#define TI_HDC_REG_HUMIDITY 0x1
|
|
|
|
#define TI_HDC_REG_MANUFID 0xFE
|
|
|
|
#define TI_HDC_REG_DEVICEID 0xFF
|
|
|
|
|
2019-06-05 14:52:42 +08:00
|
|
|
#define TI_HDC_MANUFID 0x5449
|
2019-06-05 15:01:02 +08:00
|
|
|
#define TI_HDC1050_DEVID 0x1050
|
|
|
|
#define TI_HDC1000_DEVID 0x1000
|
2019-02-12 17:50:47 +08:00
|
|
|
|
2019-06-05 14:52:42 +08:00
|
|
|
/* For 14bit conversion RH needs 6.5ms and Temp 6.35ms */
|
|
|
|
#define HDC_CONVERSION_TIME 13
|
|
|
|
|
2019-02-12 17:50:47 +08:00
|
|
|
struct ti_hdc_data {
|
|
|
|
struct device *i2c;
|
|
|
|
u16_t t_sample;
|
|
|
|
u16_t rh_sample;
|
2019-06-05 14:52:42 +08:00
|
|
|
|
2020-03-30 23:08:08 +08:00
|
|
|
#if DT_INST_NODE_HAS_PROP(0, drdy_gpios)
|
2019-06-05 14:52:42 +08:00
|
|
|
struct device *gpio;
|
|
|
|
struct gpio_callback gpio_cb;
|
2019-02-12 17:50:47 +08:00
|
|
|
struct k_sem data_sem;
|
2020-03-30 23:08:08 +08:00
|
|
|
#endif /* DT_INST_NODE_HAS_PROP(0, drdy_gpios) */
|
2019-02-12 17:50:47 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|