1 /*
2  * Copyright (c) 2022 T-Mobile USA, Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /**
8  * @file
9  * @brief Extended public API for AMS's TSL2540 ambient light sensor
10  *
11  * This exposes attributes for the TSL2540 which can be used for
12  * setting the on-chip gain and integration time parameters.
13  */
14 
15 #ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_TSL2540_H_
16 #define ZEPHYR_INCLUDE_DRIVERS_SENSOR_TSL2540_H_
17 
18 #include <zephyr/drivers/sensor.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 enum sensor_attribute_tsl2540 {
25 	/* Sensor Integration Time (in ms) */
26 	SENSOR_ATTR_INTEGRATION_TIME = SENSOR_ATTR_PRIV_START + 1,
27 	/* Sensor ALS interrupt persistence filters */
28 	SENSOR_ATTR_INT_APERS,
29 	/* Shutdown the sensor */
30 	SENSOR_ATTR_TSL2540_SHUTDOWN_MODE,
31 	/* Turn on continuous conversion */
32 	SENSOR_ATTR_TSL2540_CONTINUOUS_MODE,
33 	/* Turn on continuous conversion without wait */
34 	SENSOR_ATTR_TSL2540_CONTINUOUS_NO_WAIT_MODE,
35 };
36 
37 enum sensor_gain_tsl2540 {
38 	TSL2540_SENSOR_GAIN_1_2,
39 	TSL2540_SENSOR_GAIN_1,
40 	TSL2540_SENSOR_GAIN_4,
41 	TSL2540_SENSOR_GAIN_16,
42 	TSL2540_SENSOR_GAIN_64,
43 	TSL2540_SENSOR_GAIN_128,
44 };
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 
50 #endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_TSL2540_H_ */
51