2019-11-01 13:45:29 +01:00
|
|
|
# VL53L0X time of flight sensor configuration options
|
2017-07-19 16:59:43 +02:00
|
|
|
|
|
|
|
# Copyright (c) 2017 STMicroelectronics
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
menuconfig VL53L0X
|
2018-08-14 16:19:20 +02:00
|
|
|
bool "VL53L0X time of flight sensor"
|
2022-07-19 22:41:45 -05:00
|
|
|
default y
|
|
|
|
depends on DT_HAS_ST_VL53L0X_ENABLED
|
2024-01-10 10:12:51 +01:00
|
|
|
depends on ZEPHYR_HAL_ST_MODULE
|
2022-08-04 10:55:31 -05:00
|
|
|
select I2C
|
2017-07-19 16:59:43 +02:00
|
|
|
select HAS_STLIB
|
|
|
|
help
|
|
|
|
Enable driver for VL53L0X I2C-based time of flight sensor.
|
|
|
|
|
|
|
|
config VL53L0X_PROXIMITY_THRESHOLD
|
2018-08-14 16:19:20 +02:00
|
|
|
int "Proximity threshold in millimeters"
|
2017-07-19 16:59:43 +02:00
|
|
|
default 100
|
kconfig: Replace some single-symbol 'if's with 'depends on'
I think people might be reading differences into 'if' and 'depends on'
that aren't there, like maybe 'if' being needed to "hide" a symbol,
while 'depends on' just adds a dependency.
There are no differences between 'if' and 'depends on'. 'if' is just a
shorthand for 'depends on'. They work the same when it comes to creating
implicit menus too.
The way symbols get "hidden" is through their dependencies not being
satisfied ('if'/'depends on' get copied up as a dependency on the
prompt).
Since 'if' and 'depends on' are the same, an 'if' with just a single
symbol in it can be replaced with a 'depends on'. IMO, it's best to
avoid 'if' there as a style choice too, because it confuses people into
thinking there's deep Kconfig magic going on that requires 'if'.
Going for 'depends on' can also remove some nested 'if's, which
generates nicer symbol information and docs, because nested 'if's really
are so simple/dumb that they just add the dependencies from both 'if's
to all symbols within.
Replace a bunch of single-symbol 'if's with 'depends on' to despam the
Kconfig files a bit and make it clearer how things work. Also do some
other minor related dependency refactoring.
The replacement isn't complete. Will fix up the rest later. Splitting it
a bit to make it more manageable.
(Everything above is true for choices, menus, and comments as well.)
Detected by tweaking the Kconfiglib parsing code. It's impossible to
detect after parsing, because 'if' turns into 'depends on'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 03:45:50 +01:00
|
|
|
depends on VL53L0X
|
2017-07-19 16:59:43 +02:00
|
|
|
help
|
|
|
|
Threshold used for proximity detection when sensor is used with SENSOR_CHAN_PROX.
|
drivers: sensor: vl53l0x: add support to reprogram I2C address
The I2C address of the VL53L0X distance sensor can only be programmed
over the I2C bus. To do this:
1. The sensor is powered off or in standby mode
2. Power up the sensor, it boots with a default I2C address (0x29)
3. The I2C master sends a configuration command to set the new address
4. The sensor now communicates at the new address
In case there are more than one such sensor on the bus, they all have
the same address when starting up. We therefore need to first apply
step 1. on all of them. Then, sensor by sensor apply steps 2. to 4.
Because simple designs may not need to reprogram the address, we
introduce a new configuration option CONFIG_VL53L0X_RECONFIGURE_ADDRESS
If this setting is disabled, then the driver behaves as before.
If CONFIG_VL53L0X_RECONFIGURE_ADDRESS is enabled, then the driver does
the following:
- In vl53l0x_init(), apply step 1. This is done when the driver is
brought up when starting the system
- in vl53l0x_start(), apply steps 2. to 4. This is done when fetching
a sample, if the sensor has not been started yet.
Also, as cosmetic changes:
- add parenthesis around sub conditions in call to __ASSERT_NO_MSG
- gracefully handle unknown sensor channels in vl53l0x_channel_get
Signed-off-by: Titouan Christophe <moiandme@gmail.com>
2021-09-06 23:51:20 +02:00
|
|
|
|
|
|
|
config VL53L0X_RECONFIGURE_ADDRESS
|
|
|
|
bool "Support reconfigurable sensor address"
|
|
|
|
depends on VL53L0X
|
|
|
|
help
|
|
|
|
Enable support for reconfiguring the sensor address at runtime.
|
|
|
|
When this option is enabled, all sensors declared in the device tree
|
|
|
|
must have an xshut-gpio property.
|
|
|
|
|
|
|
|
All sensors are disabled during initialization. When reading the first
|
|
|
|
value from a sensor, it is powered up and its I2C address is reconfigured
|
|
|
|
from the manufacturer default (0x29) to the address specified in the
|
|
|
|
device tree.
|