Skip to content

heronet/linux-iio-st-vl53l1x

Repository files navigation

ST VL53L1X IIO Proximity Driver

License: GPL v2 Kernel

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

  • Status: Accepted upstream
  • Target: drivers/iio/proximity/vl53l1x-i2c.c
  • Binding: Documentation/devicetree/bindings/iio/proximity/st,vl53l0x.yaml

Features

  • Standard IIO proximity interface
  • Supports both polled and interrupt-driven operation
  • Device Tree support
  • Follows latest IIO subsystem best practices

Build Instructions

# From the repository root
make

# Install the module
sudo modprobe industrialio
sudo insmod vl53l1x-i2c.ko

Device Tree Overlay Setup

Build the device tree overlay:

# From the example directory
cd example
dtc -@ -I dts -O dtb -o vl53l1x.dtbo vl53l1x-overlay.dts

Load 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.dtbo

For other platforms, refer to your board's devicetree documentation for loading compiled overlays.

Reading Distance Measurements

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_raw

Example output:

100

The value represents the distance in millimeters.

About

Out-of-tree Linux IIO proximity driver for ST VL53L1X Time-of-Flight sensor. Backported for older Kernels

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors