zephyr/drivers/sensor/th02/th02.h
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00

35 lines
749 B
C

/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_DRIVERS_SENSOR_TH02_TH02_H_
#define ZEPHYR_DRIVERS_SENSOR_TH02_TH02_H_
#include <device.h>
#include <sys/util.h>
#define TH02_I2C_DEV_ID 0x40
#define TH02_REG_STATUS 0x00
#define TH02_REG_DATA_H 0x01
#define TH02_REG_DATA_L 0x02
#define TH02_REG_CONFIG 0x03
#define TH02_REG_ID 0x11
#define TH02_STATUS_RDY_MASK 0x01
#define TH02_CMD_MEASURE_HUMI 0x01
#define TH02_CMD_MEASURE_TEMP 0x11
#define TH02_WR_REG_MODE 0xC0
#define TH02_RD_REG_MODE 0x80
struct th02_data {
const struct device *i2c;
uint16_t t_sample;
uint16_t rh_sample;
};
#endif /* _SENSOR_TH02_ */