17#ifndef VL6180X_PARAMS_H
18#define VL6180X_PARAMS_H
32#ifndef VL6180X_PARAM_DEV
34#define VL6180X_PARAM_DEV I2C_DEV(0)
37#ifndef VL6180X_PARAM_ADDR
39#define VL6180X_PARAM_ADDR (VL6180X_I2C_ADDR)
42#ifndef VL6180X_PARAM_INT_PIN
44#define VL6180X_PARAM_INT_PIN (GPIO_PIN(0, 1))
47#ifndef VL6180X_PARAM_SHUTDOWN_PIN
49#define VL6180X_PARAM_SHUTDOWN_PIN (GPIO_PIN(0, 2))
60#ifdef CONFIG_VL6180X_ALS_GAIN_1
61#define CONFIG_VL6180X_ALS_GAIN (VL6180X_ALS_GAIN_1)
62#elif CONFIG_VL6180X_ALS_GAIN_1_25
63#define CONFIG_VL6180X_ALS_GAIN (VL6180X_ALS_GAIN_1_25)
64#elif CONFIG_VL6180X_ALS_GAIN_1_67
65#define CONFIG_VL6180X_ALS_GAIN (VL6180X_ALS_GAIN_1_67)
66#elif CONFIG_VL6180X_ALS_GAIN_2_5
67#define CONFIG_VL6180X_ALS_GAIN (VL6180X_ALS_GAIN_2_5)
68#elif CONFIG_VL6180X_ALS_GAIN_5
69#define CONFIG_VL6180X_ALS_GAIN (VL6180X_ALS_GAIN_5)
70#elif CONFIG_VL6180X_ALS_GAIN_10
71#define CONFIG_VL6180X_ALS_GAIN (VL6180X_ALS_GAIN_10)
72#elif CONFIG_VL6180X_ALS_GAIN_20
73#define CONFIG_VL6180X_ALS_GAIN (VL6180X_ALS_GAIN_20)
74#elif CONFIG_VL6180X_ALS_GAIN_40
75#define CONFIG_VL6180X_ALS_GAIN (VL6180X_ALS_GAIN_40)
78#ifdef CONFIG_VL6180X_RNG_INT_DRDY
79#define CONFIG_VL6180X_RNG_INT (VL6180X_INT_DRDY)
80#elif CONFIG_VL6180X_RNG_INT_LOW
81#define CONFIG_VL6180X_RNG_INT (VL6180X_INT_LOW)
82#elif CONFIG_VL6180X_RNG_INT_HIGH
83#define CONFIG_VL6180X_RNG_INT (VL6180X_INT_HIGH)
84#elif CONFIG_VL6180X_RNG_INT_OUT
85#define CONFIG_VL6180X_RNG_INT (VL6180X_INT_OUT)
88#ifdef CONFIG_VL6180X_ALS_INT_DRDY
89#define CONFIG_VL6180X_ALS_INT (VL6180X_INT_DRDY)
90#elif CONFIG_VL6180X_ALS_INT_LOW
91#define CONFIG_VL6180X_ALS_INT (VL6180X_INT_LOW)
92#elif CONFIG_VL6180X_ALS_INT_HIGH
93#define CONFIG_VL6180X_ALS_INT (VL6180X_INT_HIGH)
94#elif CONFIG_VL6180X_ALS_INT_OUT
95#define CONFIG_VL6180X_ALS_INT (VL6180X_INT_OUT)
100#ifndef CONFIG_VL6180X_MEAS_PERIOD
102#define CONFIG_VL6180X_MEAS_PERIOD (20)
105#ifndef CONFIG_VL6180X_RNG_MAX_TIME
107#define CONFIG_VL6180X_RNG_MAX_TIME (50)
110#ifndef CONFIG_VL6180X_RNG_INT
112#define CONFIG_VL6180X_RNG_INT (VL6180X_INT_DRDY)
115#ifndef CONFIG_VL6180X_RNG_THRESH_LOW
117#define CONFIG_VL6180X_RNG_THRESH_LOW (20)
120#ifndef CONFIG_VL6180X_RNG_THRESH_HIGH
122#define CONFIG_VL6180X_RNG_THRESH_HIGH (90)
125#ifndef CONFIG_VL6180X_ALS_INT_TIME
127#define CONFIG_VL6180X_ALS_INT_TIME (100)
130#ifndef CONFIG_VL6180X_ALS_GAIN
132#define CONFIG_VL6180X_ALS_GAIN (VL6180X_ALS_GAIN_1)
135#ifndef CONFIG_VL6180X_ALS_LUX_RES
137#define CONFIG_VL6180X_ALS_LUX_RES 320
140#ifndef CONFIG_VL6180X_ALS_INT
142#define CONFIG_VL6180X_ALS_INT (VL6180X_INT_DRDY)
145#ifndef CONFIG_VL6180X_ALS_THRESH_LOW
147#define CONFIG_VL6180X_ALS_THRESH_LOW (50)
150#ifndef CONFIG_VL6180X_ALS_THRESH_HIGH
152#define CONFIG_VL6180X_ALS_THRESH_HIGH (2000)
155#if IS_USED(MODULE_VL6180X_RNG) || DOXYGEN
157#define VL6180X_PARAM_RANGE .rng_max_time = CONFIG_VL6180X_RNG_MAX_TIME,
159#define VL6180X_PARAM_RANGE
162#if IS_USED(MODULE_VL6180X_ALS) || DOXYGEN
164#define VL6180X_PARAM_ALS .als_int_time = CONFIG_VL6180X_ALS_INT_TIME, \
165 .als_gain = CONFIG_VL6180X_ALS_GAIN, \
166 .als_lux_res = CONFIG_VL6180X_ALS_LUX_RES,
168#define VL6180X_PARAM_ALS
171#if IS_USED(MODULE_VL6180X_SHUTDOWN) || DOXYGEN
173#define VL6180X_PARAM_SHUTDOWN .shutdown_pin = VL6180X_PARAM_SHUTDOWN_PIN,
175#define VL6180X_PARAM_SHUTDOWN
178#if IS_USED(MODULE_VL6180X_IRQ) || DOXYGEN
180#define VL6180X_PARAM_INT .int_pin = VL6180X_PARAM_INT_PIN,
182#if IS_USED(MODULE_VL6180X_RNG) || DOXYGEN
184#define VL6180X_PARAM_INT_RNG_CFG .int_cfg.rng_int = CONFIG_VL6180X_RNG_INT, \
185 .int_thresh.rng_low = CONFIG_VL6180X_RNG_THRESH_LOW, \
186 .int_thresh.rng_high = CONFIG_VL6180X_RNG_THRESH_HIGH,
188#define VL6180X_PARAM_INT_RNG_CFG
191#if IS_USED(MODULE_VL6180X_ALS) || DOXYGEN
193#define VL6180X_PARAM_INT_ALS_CFG .int_cfg.als_int = CONFIG_VL6180X_ALS_INT, \
194 .int_thresh.als_low = CONFIG_VL6180X_ALS_THRESH_LOW, \
195 .int_thresh.als_high = CONFIG_VL6180X_ALS_THRESH_HIGH,
197#define VL6180X_PARAM_INT_ALS_CFG
201#define VL6180X_PARAM_INT
202#define VL6180X_PARAM_INT_RNG_CFG
203#define VL6180X_PARAM_INT_ALS_CFG
206#if !VL6180X_PARAMS || DOXYGEN
208#define VL6180X_PARAMS { \
209 .i2c_dev = VL6180X_PARAM_DEV, \
210 .i2c_addr = VL6180X_PARAM_ADDR, \
211 .period = CONFIG_VL6180X_MEAS_PERIOD, \
212 VL6180X_PARAM_RANGE \
214 VL6180X_PARAM_SHUTDOWN \
216 VL6180X_PARAM_INT_RNG_CFG \
217 VL6180X_PARAM_INT_ALS_CFG \
221#if !defined(VL6180X_SAUL_INFO) || DOXYGEN
223#define VL6180X_SAUL_INFO { .name = "vl6180x" }
SAUL registry interface definition.
Additional data to collect for each entry.
VL6180X device configuration.
static const vl6180x_params_t vl6180x_params[]
Allocate some memory to store the actual configuration.
#define VL6180X_PARAMS
Default configuration parameter set.
#define VL6180X_SAUL_INFO
Default SAUL information.
static const saul_reg_info_t vl6180x_saul_info[]
Additional meta information to keep in the SAUL registry.