Skip to content

Commit 1f178ca

Browse files
markCwatsonMaureenHelm
authored andcommitted
drivers: sensor: VL53L1X time-of-flight sensor.
The driver utilizes ST Microelectronics library (which exists in modules\hal\st\sensor\vl53l1x. Platform specific headers and source files used by the library are included and adapted for Zephyr. The driver can be configured in proj.conf to use a interrupt/polling methods and the use of the XSHUT pin on the VL53L1X. All uses were tested successfully. Signed-off-by: Mark Watson <[email protected]>
1 parent e169f7c commit 1f178ca

File tree

14 files changed

+1332
-0
lines changed

14 files changed

+1332
-0
lines changed

drivers/sensor/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ add_subdirectory_ifdef(CONFIG_TMP112 tmp112)
109109
add_subdirectory_ifdef(CONFIG_TMP116 tmp116)
110110
add_subdirectory_ifdef(CONFIG_VCNL4040 vcnl4040)
111111
add_subdirectory_ifdef(CONFIG_VL53L0X vl53l0x)
112+
add_subdirectory_ifdef(CONFIG_VL53L1X vl53l1x)
112113
add_subdirectory_ifdef(CONFIG_TEMP_KINETIS nxp_kinetis_temp)
113114
add_subdirectory_ifdef(CONFIG_TACH_XEC mchp_tach_xec)
114115
add_subdirectory_ifdef(CONFIG_WSEN_HIDS wsen_hids)

drivers/sensor/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ source "drivers/sensor/vcnl4040/Kconfig"
259259

260260
source "drivers/sensor/vl53l0x/Kconfig"
261261

262+
source "drivers/sensor/vl53l1x/Kconfig"
263+
262264
source "drivers/sensor/nxp_kinetis_temp/Kconfig"
263265

264266
source "drivers/sensor/wsen_hids/Kconfig"

drivers/sensor/vl53l1x/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
5+
zephyr_library_sources(
6+
vl53l1.c
7+
vl53l1_platform.c
8+
)

drivers/sensor/vl53l1x/Kconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# VL53L0X time of flight sensor configuration options
2+
3+
# Copyright (c) 2023 Prosaris Solutions Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
menuconfig VL53L1X
7+
bool "VL53L1X time of flight sensor"
8+
default y
9+
depends on DT_HAS_ST_VL53L1X_ENABLED
10+
select I2C
11+
select HAS_STLIB
12+
help
13+
Enable driver for VL53L1X I2C-based time of flight sensor.
14+
15+
if VL53L1X
16+
17+
config VL53L1X_INTERRUPT_MODE
18+
bool "Use interrupt mode for VL53L1X time of flight sensor"
19+
default y
20+
depends on GPIO
21+
help
22+
Enable interrupt mode for VL53L1X time of flight sensor. Otherwise,
23+
the driver will use the polling method.
24+
25+
config VL53L1X_XSHUT
26+
bool "Use xshut pin on VL53L1X time of flight sensor"
27+
depends on GPIO
28+
help
29+
Enable to use the xshut pin on the VL53L1X. If not, the pin should be
30+
connected to VDD.
31+
32+
endif # VL53L1X

0 commit comments

Comments
 (0)