Skip to content

Commit 30621bc

Browse files
committed
ext: Add official ST library for vl53l1x
This package contains platform independent drivers written in C language for STMicroelectronics ToF sensors VL53L1X. The aim of this package is to provide a common, clean and stable interface to get ranging data. Library is located in ext/hal/st/lib/sensor/vl53l1x Origin: ST Microelectronics License: BSD-3-Clause URL: http://www.st.com/en/embedded-software/stsw-img007.html Commit: v2.3.3 Purpose: provide a common and stable i/f to get ranging data Maintained-by: ST Microelectronics Signed-off-by: Aaron Tsui <[email protected]>
1 parent 5f0ee9d commit 30621bc

39 files changed

+48945
-3
lines changed

ext/hal/st/lib/CMakeLists.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,33 @@ if(CONFIG_HAS_STLIB)
1010
sensor/vl53l0x/api/core/inc
1111
${PROJECT_SOURCE_DIR}/drivers/sensor/vl53l0x
1212
)
13-
1413
zephyr_sources(sensor/vl53l0x/api/core/src/vl53l0x_api.c)
1514
zephyr_sources(sensor/vl53l0x/api/core/src/vl53l0x_api_ranging.c)
1615
zephyr_sources(sensor/vl53l0x/api/core/src/vl53l0x_api_calibration.c)
1716
zephyr_sources(sensor/vl53l0x/api/core/src/vl53l0x_api_core.c)
1817
zephyr_sources(sensor/vl53l0x/api/core/src/vl53l0x_api_strings.c)
1918
endif()
19+
20+
if(CONFIG_VL53L1X)
21+
zephyr_include_directories(
22+
sensor/vl53l1x/api/core/inc
23+
${PROJECT_SOURCE_DIR}/drivers/sensor/vl53l1x
24+
)
25+
26+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_core.c)
27+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_silicon_core.c)
28+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_core_support.c)
29+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_api.c)
30+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_api_core.c)
31+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_api_calibration.c)
32+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_api_debug.c)
33+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_api_strings.c)
34+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_api_preset_modes.c)
35+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_wait.c)
36+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_error_strings.c)
37+
zephyr_sources(sensor/vl53l1x/api/core/src/vl53l1_register_funcs.c)
38+
endif()
39+
2040
if(CONFIG_AUDIO_MPXXDTYY)
2141
zephyr_include_directories(audio/microphone)
2242
zephyr_sources(audio/microphone/OpenPDMFilter.c)

ext/hal/st/lib/Kconfig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Kconfig - STLIB config
2-
3-
# Copyright (c) 2017 STMicroelectronics
2+
#
3+
# Copyright (c) 2019 STMicroelectronics
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
46

57
config HAS_STLIB
68
bool
9+
imply NEWLIB_LIBC
10+
imply NEWLIB_LIBC_FLOAT_PRINTF

ext/hal/st/lib/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ Available libs:
55
* sensor/vl53l0x:
66
allows to drive the vl53l0x sensor
77
full information can be found here : http://www.st.com/en/embedded-software/stsw-img005.html
8+
* sensor/vl53l1x:
9+
allows to drive the vl53l1x sensor
10+
full information can be found here : http://www.st.com/en/embedded-software/stsw-img007.html
811
* ...
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
VL53L1X
2+
#######
3+
4+
Origin:
5+
ST Microelectronics
6+
http://www.st.com/en/embedded-software/stsw-img007.html
7+
8+
Status:
9+
version 2.3.3
10+
11+
Purpose:
12+
ST Microelectonics official API to use vl53l1x sensor.
13+
14+
Description:
15+
This library written by STMicroelectronics is dedicated to vl53l1x time of flight sensor.
16+
Instead of providing a full description of the registers, ST decided to provide a C library to drive this sensor.
17+
18+
This library is called from the vl53l1x driver and is kept transparent for user.
19+
User is calling a standard Zephyr driver and then, the driver makes some calls to this library.
20+
21+
In order to fit with Zephyr rules and simplify version updates, we have done a minimum of modifications :
22+
- keep only API directory
23+
(remove documentation and samples, see ST website for this)
24+
- rename Api to api
25+
- customize api/platform to fit in Zephyr (mainly for I2C access)
26+
vl53l1x_platform.c and other platform related files have been moved to Zephyr drivers directory.
27+
28+
In order to use this library, you have to :
29+
* define CONFIG_HAS_STLIB and CONFIG_VL53L1X
30+
* include vl53l1x_api.h and vl53l1x_platform.h in the driver.h
31+
32+
Dependencies:
33+
This package depends on Zephyr I2C implementation and is linked statically.
34+
This library will be used by a standard Zephyr driver.
35+
36+
URL:
37+
http://www.st.com/en/embedded-software/stsw-img007.html
38+
39+
commit:
40+
version 2.3.3
41+
42+
Maintained-by:
43+
External
44+
45+
License:
46+
BSD-3-Clause
47+
48+
License Link:
49+
http://www.st.com/en/embedded-software/stsw-img007.html
50+
51+
52+

0 commit comments

Comments
 (0)