-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: sensor: add Garmin LIDAR-Lite v4 LED distance sensor driver #93063
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: main
Are you sure you want to change the base?
Conversation
Hello @alexayl, and thank you very much for your first pull request to the Zephyr project! |
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.
Pull Request Overview
This PR adds support for the Garmin LIDAR-Lite v4 LED distance sensor to Zephyr by implementing a new driver, devicetree binding, test DTS entry, and a sample application.
- Implements the LIDAR-Lite v4 driver (header and C source) with I2C-based distance measurements.
- Adds devicetree binding YAML, integrates into Kconfig/CMake, and includes a build-all test DTS entry.
- Provides a sample application with board overlay and project config for ESP32-S3.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/drivers/build_all/sensor/i2c.dtsi | Added test node for the LIDAR-Lite v4 sensor |
samples/sensor/lidar_lite_v4/src/main.c | New sample app fetching and printing distances |
samples/sensor/lidar_lite_v4/prj.conf | Enabled I2C, SENSOR, and LIDAR_LITE_V4 configs |
samples/sensor/lidar_lite_v4/boards/esp32s3_devkitc.overlay | Board overlay: pinctrl, I2C bus, and sensor node |
samples/sensor/lidar_lite_v4/CMakeLists.txt | Sample app CMake entry |
dts/bindings/sensor/grmn,lidar-lite-v4.yaml | Devicetree binding for Garmin LIDAR-Lite v4 |
drivers/sensor/grmn/lidar_lite_v4/lidar_lite_v4.h | Driver header definitions and structures |
drivers/sensor/grmn/lidar_lite_v4/lidar_lite_v4.c | Driver implementation (init, fetch, channel_get) |
drivers/sensor/grmn/lidar_lite_v4/Kconfig | Driver Kconfig entry |
drivers/sensor/grmn/lidar_lite_v4/CMakeLists.txt | Driver CMakeLists integration |
drivers/sensor/grmn/Kconfig | Includes new driver Kconfig |
drivers/sensor/grmn/CMakeLists.txt | Includes new driver directory in build |
drivers/sensor/Kconfig | Added grmn group to sensor Kconfig |
drivers/sensor/CMakeLists.txt | Added grmn folder to sensor CMakeLists |
Comments suppressed due to low confidence (6)
samples/sensor/lidar_lite_v4/boards/esp32s3_devkitc.overlay:3
- Remove the stray "/" on line 3; it will cause a Devicetree parse error.
/
samples/sensor/lidar_lite_v4/boards/esp32s3_devkitc.overlay:19
- Fix hyphenation to
bias-pull-up;
for valid Devicetree syntax.
bias - pull - up;
samples/sensor/lidar_lite_v4/boards/esp32s3_devkitc.overlay:20
- Fix hyphenation to
drive-open-drain;
for valid Devicetree syntax.
drive - open - drain;
samples/sensor/lidar_lite_v4/boards/esp32s3_devkitc.overlay:21
- Fix hyphenation to
output-high;
for valid Devicetree syntax.
output - high;
drivers/sensor/grmn/lidar_lite_v4/lidar_lite_v4.c:52
- Add
#include <zephyr/kernel.h>
at the top of this file to ensurek_msleep
is declared.
k_msleep(1);
samples/sensor/lidar_lite_v4/src/main.c:9
- Add
#include <zephyr/sys/printk.h>
to properly useprintk
in the sample application.
#include <zephyr/kernel.h>
ret = i2c_reg_write_byte_dt(&config->i2c, LIDAR_LITE_V4_REG_MEASURE, | ||
LIDAR_LITE_V4_CMD_MEASURE); |
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.
It seems your editor is configured for 4 spaces per tab but 8 are expected.
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.
In this line I know the indentation is wrong. However, would the rest of the code need to be refactored to remove 4-space tabs? To address this comment I was just going to run clang-format
Garmin Lidar Lite V4 driver that enables distance measurements via i2c as described in sensor manual. This includes sample_fetch(), channel_get(), and init(). Signed-off-by: Alex Aylward <[email protected]>
Add intermediate Cmake and Kconfig files, sensor dts binding, change "garmin" to "grmn" due to prior convention. Signed-off-by: Alex Aylward <[email protected]>
Added dts node for driver build test to build all sensors. Signed-off-by: Alex Aylward <[email protected]>
|
This patch adds a driver for the Garmin LIDAR-Lite v4 LED distance sensor.
The sensor communicates over I2C and supports a basic distance measurement mode. The driver implements the Zephyr sensor API and is configurable via devicetree and Kconfig.
Devicetree bindings and a test application are also included for validation.
Signed-off-by: Alexander Aylward [email protected]