-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: sensor: mb7040: add support for MaxBotix MB7040 ultrasonic sensor #91688
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 @ww3ak, and thank you very much for your first pull request to the Zephyr project! |
252bf70
to
36aa2d2
Compare
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
Adds support for the MaxBotix MB7040 ultrasonic sensor via I2C and optional status GPIO, exposing distance measurements through the Zephyr sensor API.
- Implements sample fetch, channel get, and initialization routines with semaphore and GPIO callback
- Provides Kconfig options for driver enablement and measurement timing
- Registers the driver in CMakeLists for build integration
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
File | Description |
---|---|
drivers/sensor/mb7040/mb7040.c | New sensor driver with I2C read/write, status GPIO interrupt, and Zephyr sensor API hooks |
drivers/sensor/mb7040/Kconfig | Configuration entries for enabling the driver, delay timing, and status GPIO support |
drivers/sensor/mb7040/CMakeLists.txt | Build file including the new driver source in the Zephyr library |
Comments suppressed due to low confidence (2)
drivers/sensor/mb7040/Kconfig:19
- Update help text to reflect that
MB7040_DELAY_MS
is applied unconditionally (used even when status GPIO is enabled).
Default delay if status-gpio is not defined
drivers/sensor/mb7040/mb7040.c:1
- [nitpick] Consider adding unit or integration tests for the new driver to verify I2C read/write behavior and status GPIO handling.
/*
I believe I fixed/added necessary things! |
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.
could you run check_compliance.py locally, it will help you solve some of the compliance issues.
https://docs.zephyrproject.org/latest/contribute/style/code.html
2b86f88
to
486a540
Compare
13383bd
to
10dea60
Compare
7ddebba
to
527215e
Compare
This commit adds a new driver for the MaxBotix MB7040 ultrasonic rangefinder. The driver uses I2C communication to read range data from the sensor and exposes it via the Zephyr sensor API. Tested on an esp32-s3 board using I2C bus. Verified readings at multiple distances to confirm accuracy. Signed-off-by: Sabrina Simkhovich <sabrinasimkhovich@gmail.com>
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
@jilaypandya thanks for the approval! What do I have to wait for now for this to be merged? |
You need an approval from the assignee of the PR :). Other requested changes need to be addressed if any, after that the PR is merge ready. |
Adds a new Zephyr sensor driver for the MaxBotix MB7040 ultrasonic rangefinder.
The driver uses I2C communication to read range data from the sensor and exposes it via the Zephyr sensor API.
Functionality was tested on an esp32-s3.