1 /* 2 * Copyright (c) 2016 Intel Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_DRIVERS_SENSOR_TH02_TH02_H_ 8 #define ZEPHYR_DRIVERS_SENSOR_TH02_TH02_H_ 9 10 #include <zephyr/device.h> 11 #include <zephyr/sys/util.h> 12 13 #define TH02_REG_STATUS 0x00 14 #define TH02_REG_DATA_H 0x01 15 #define TH02_REG_DATA_L 0x02 16 #define TH02_REG_CONFIG 0x03 17 #define TH02_REG_ID 0x11 18 19 #define TH02_STATUS_RDY_MASK 0x01 20 21 #define TH02_CMD_MEASURE_HUMI 0x01 22 #define TH02_CMD_MEASURE_TEMP 0x11 23 24 #define TH02_WR_REG_MODE 0xC0 25 #define TH02_RD_REG_MODE 0x80 26 27 struct th02_config { 28 struct i2c_dt_spec i2c; 29 }; 30 31 struct th02_data { 32 uint16_t t_sample; 33 uint16_t rh_sample; 34 }; 35 36 #endif /* _SENSOR_TH02_ */ 37