Skip to content
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

sensors: Add Bosch BMA4xx-series driver #66242

Merged
merged 1 commit into from Jan 11, 2024

Conversation

tristan-google
Copy link
Collaborator

@tristan-google tristan-google commented Dec 6, 2023

This is a driver targetting the Bosch BMA 4-series accelerometers. It has been specifically developed for the BMA422 but should be compatible with others in that line, excepting the BMA400. Supports key attributes and async RTIO one-shot operation. I2C operation is supported, with stubs for a SPI implementation provided for future improvement.

yperess
yperess previously approved these changes Dec 18, 2023
drivers/sensor/bma4xx/Kconfig Outdated Show resolved Hide resolved
samples/sensor/bma422/boards/nrf52840dk_nrf52840.overlay Outdated Show resolved Hide resolved
yperess
yperess previously approved these changes Dec 20, 2023
Copy link
Collaborator

@kartben kartben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up the sample stuff!
Spotted a couple more issues. Note that I will dismiss my review after they have been addressed, since there isn't really anything left in the PR that I know enough about to provide an actual +1.

Also, and maybe a bit of an odd question, do you think boards/arm/pinetime_devkit0/pinetime_devkit0.dts needs updating, or are you confident that the driver really is compatible with the entire BMA4XX series (if not, a check on CHIP_ID would maybe make sense for the time being?)?
Until now, no driver existed for the bosch,bma4xx, so the pinetime's accelerometer would have staid disabled.

Thanks!

tests/drivers/build_all/sensor/i2c.dtsi Outdated Show resolved Hide resolved
drivers/sensor/bma4xx/Kconfig Outdated Show resolved Hide resolved
@tristan-google
Copy link
Collaborator Author

Also, and maybe a bit of an odd question, do you think boards/arm/pinetime_devkit0/pinetime_devkit0.dts needs updating, or are you confident that the driver really is compatible with the entire BMA4XX series

(fixing the typos, thanks)

The BMA4xx series (with the exception of BMA400) has a similar enough API to warrant a common driver, but as you could tell this is tailored towards and tested on the 422. I think it should work with the 421 since they're both 12-bit models but I don't have a way to test that on real hardware. I could check the chip ID and print a warning or even return an error if it's something other than the 422's.

This is a driver targetting the Bosch BMA 4-series accelerometers. It
has been specifically developed for the BMA422 but should be compatible
with others in that line, excepting the BMA400. Supports key attributes
and async RTIO one-shot operation. I2C operation is supported, with
stubs for a SPI implementation provided for future improvement.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
@yperess yperess requested a review from kartben January 4, 2024 22:57
@kartben kartben dismissed their stale review January 8, 2024 16:57

as mentioned before, dismissing my own review as I don't have enough expertise on the area for an actual +1. Many thanks for adsressing my earlier comments re: sample code.

@MaureenHelm MaureenHelm merged commit 0f95b6f into zephyrproject-rtos:main Jan 11, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Binding PR modifies or adds a Device Tree binding area: Samples Samples area: Sensors Sensors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants