zephyr/drivers/sensor/ti_hdc/ti_hdc.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

37 lines
797 B
C

/*
* 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
#define TI_HDC_MANUFID 0x5449
#define TI_HDC1050_DEVID 0x1050
#define TI_HDC1000_DEVID 0x1000
/* For 14bit conversion RH needs 6.5ms and Temp 6.35ms */
#define HDC_CONVERSION_TIME 13
struct ti_hdc_data {
const struct device *i2c;
uint16_t t_sample;
uint16_t rh_sample;
#if DT_INST_NODE_HAS_PROP(0, drdy_gpios)
const struct device *gpio;
struct gpio_callback gpio_cb;
struct k_sem data_sem;
#endif /* DT_INST_NODE_HAS_PROP(0, drdy_gpios) */
};
#endif