zephyr/drivers/sensor/max44009/max44009.h
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00

34 lines
772 B
C

/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _SENSOR_MAX44009
#define _SENSOR_MAX44009
#include <misc/util.h>
#define SYS_LOG_DOMAIN "MAX44009"
#define SYS_LOG_LEVEL CONFIG_SYS_LOG_SENSOR_LEVEL
#include <logging/sys_log.h>
#define MAX44009_I2C_ADDRESS CONFIG_MAX44009_I2C_ADDR
#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 {
struct device *i2c;
uint16_t sample;
};
#endif /* _SENSOR_MAX44009_ */