Out-of-tree Linux kernel driver for the ST VL53L1X Time-of-Flight (ToF) laser ranging sensor using the IIO proximity subsystem.
This driver has been accepted upstream and is now part of the Linux kernel.
- Status: Accepted upstream
- Target:
drivers/iio/proximity/vl53l1x-i2c.c - Binding:
Documentation/devicetree/bindings/iio/proximity/st,vl53l0x.yaml
- Standard IIO proximity interface
- Supports both polled and interrupt-driven operation
- Device Tree support
- Follows latest IIO subsystem best practices
# From the repository root
make
# Install the module
sudo modprobe industrialio
sudo insmod vl53l1x-i2c.koBuild the device tree overlay:
# From the example directory
cd example
dtc -@ -I dts -O dtb -o vl53l1x.dtbo vl53l1x-overlay.dtsLoad the overlay on a Raspberry Pi (or similar platform supporting dtoverlay):
# Remove any previously loaded overlay
sudo dtoverlay -R
# Load the new overlay
sudo dtoverlay vl53l1x.dtboFor other platforms, refer to your board's devicetree documentation for loading compiled overlays.
Once the module is loaded and the overlay is applied, you can read distance measurements from the IIO device:
cat /sys/bus/iio/devices/iio:device0/in_distance_rawExample output:
100
The value represents the distance in millimeters.