-
Notifications
You must be signed in to change notification settings - Fork 2.1k
drivers/vl53l1x: add VL53L1X ToF ranging sensor driver #21648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
drivers/vl53l1x: add VL53L1X ToF ranging sensor driver #21648
Conversation
Is this Ready for Review? :) |
I think so. |
@crasbe BTW, the rework was motivated by the request to pull the 11 thousands line file For the current implementation, the ST Ultra-Light Driver API is used as a package that provides important functions with significantly lower memory requirements. Instead of implementing the basic functions in the driver itself, the ST Ultra-Light Driver API is now always used as a package, even for the driver variant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not intend that you have to fully rework the PR, sorry 😅
This is just an initial transfer of the review comments from the last PR.
That's fine, because the driver is now much less complex. |
Contribution description
This PR adds a device driver for ST VL53L1X Time-of-Flight laser-ranging sensor which allows accurate and fast ranging up to 4 m at a frequency of up to 50 Hz. It is a complete rework of PR #10363 and uses the ST VL53L1X ULD API (STSW-IMG009) as a package instead of the ST VL53L1X API (STSW-IMG007) that was used in PR #10363.
There are two variants of the driver which differ in functionality and size:
vl53l1x_basic
vl53l1x
The
vl53l1x_basic
driver variant is the smallest driver variant which provides only some basic functions such as the distance measurement and the data-ready interrupt.The
vl53l1x
driver variant (default) is a compromise of size and functionality. It provides the application with most functionality of the sensor. The driver can be used when memory requirements are important and most of the functionality should be used.Both driver variants use the ST VL53L1X ULD API (STSW-IMG009) as vendor code, provide SAUL capabilities and data-ready interrupt functionality. The
vl53l1x
driver variant allows to use threshold interrupts.[1] These functions are available by using the ST VL53L1X ULD API directly.
[2] Reference platform: STM32F411RE
Testing procedure
The driver variants can be tested by using the test application with different modules where the standard variant
vl53l1x
is used by default:To use the
vl53l1x_basic
driver variant, define it in it the make command:If the configuration parameter
VL53L1X_PARAM_PIN_INT
is defined, e.g.,interrupts are used to get data instead of polling for new data. In the case of the
vl53l1x
driver variant, threshold interrupts are configured.In all cases, the sensor is configured with following default parameters:
Test Output
Issues/PRs references
This PR is a complete rework of PR #10363.