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

drivers: sensor: mpu6050: adds samplerate divider setting #84452

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

TilmannUnte
Copy link
Contributor

@TilmannUnte TilmannUnte commented Jan 23, 2025

Moves the MPU6050 accel/gyro scale settings from KConfig to Devicetree.
Adds a new setting for the MPU6050 sample rate divider register and
transmits it to the sensor upon initialization.
This helps to reduce the interrupt firing rate when combined with the
data ready trigger.
A default division factor is provided which ensures compatibility with
existing applications.
The MPU6050 sample application is extended and used for hardware tests.

Copy link
Member

@MaureenHelm MaureenHelm left a comment

Choose a reason for hiding this comment

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

@teburd @afontaine-invn please take a look

@TilmannUnte
Copy link
Contributor Author

TilmannUnte commented Mar 20, 2025

Sorry for the long wait, work got in the way.

I did my best to move the sensor specific settings from Kconfig to Devicetree. However, there is one thing I'm still somewhat unhappy with and I'm hoping for suggestions:
The new smplrt-div setting has a range from 0 to 255, but the Devicetree int type allows values far outside that range. Is there a way to specify a valid range in devicetree, besides using enum?

Moves the MPU6050 accel/gyro scale settings from KConfig to Devicetree.
Adds a new setting for the MPU6050 sample rate divider register and
transmits it to the sensor upon initialization.
This helps to reduce the interrupt firing rate when combined with the
data ready trigger.
A default division factor is provided which ensures compatibility with
existing applications.
The MPU6050 sample application is extended and used for hardware tests.

Signed-off-by: Tilmann Unte <unte@es-augsburg.de>
@TilmannUnte TilmannUnte requested a review from MaureenHelm March 24, 2025 09:41
@kartben kartben merged commit 224b5b7 into zephyrproject-rtos:main Mar 25, 2025
22 checks passed
@TilmannUnte TilmannUnte deleted the mpu6050_smplrt_div branch March 26, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants