zephyr/drivers/sensor/tmp116/tmp116.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
856 B
C

/*
* Copyright (c) 2019 Centaur Analytics, Inc
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_DRIVERS_SENSOR_TMP116_TMP116_H_
#define ZEPHYR_DRIVERS_SENSOR_TMP116_TMP116_H_
#define TMP116_REG_TEMP 0x0
#define TMP116_REG_CFGR 0x1
#define TMP116_REG_HIGH_LIM 0x2
#define TMP116_REG_LOW_LIM 0x3
#define TMP116_REG_EEPROM_UL 0x4
#define TMP116_REG_EEPROM1 0x5
#define TMP116_REG_EEPROM2 0x6
#define TMP116_REG_EEPROM3 0x7
#define TMP116_REG_EEPROM4 0x8
#define TMP116_REG_DEVICE_ID 0xF
#define TMP116_RESOLUTION 78125 /* in tens of uCelsius*/
#define TMP116_RESOLUTION_DIV 10000000
#define TMP116_DEVICE_ID 0x1116
#define TMP117_DEVICE_ID 0x0117
struct tmp116_data {
const struct device *i2c;
uint16_t sample;
};
struct tmp116_dev_config {
uint16_t i2c_addr;
};
#endif /* ZEPHYR_DRIVERS_SENSOR_TMP116_TMP116_H_ */