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

30 lines
710 B
C

/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_DRIVERS_SENSOR_MAX44009_MAX44009_H_
#define ZEPHYR_DRIVERS_SENSOR_MAX44009_MAX44009_H_
#include <sys/util.h>
#define MAX44009_I2C_ADDRESS DT_INST_REG_ADDR(0)
#define MAX44009_SAMPLING_CONTROL_BIT BIT(7)
#define MAX44009_CONTINUOUS_SAMPLING BIT(7)
#define MAX44009_SAMPLE_EXPONENT_SHIFT 12
#define MAX44009_MANTISSA_HIGH_NIBBLE_MASK 0xf00
#define MAX44009_MANTISSA_LOW_NIBBLE_MASK 0xf
#define MAX44009_REG_CONFIG 0x02
#define MAX44009_REG_LUX_HIGH_BYTE 0x03
#define MAX44009_REG_LUX_LOW_BYTE 0x04
struct max44009_data {
const struct device *i2c;
uint16_t sample;
};
#endif /* _SENSOR_MAX44009_ */