-
Notifications
You must be signed in to change notification settings - Fork 8.2k
sensor: mpu6050: switch to devicetree and provide sample #21565
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
sensor: mpu6050: switch to devicetree and provide sample #21565
Conversation
Add a binding for the sensor and replace all Kconfig selection of hardware parameters with devicetree property values. Signed-off-by: Peter Bigot <[email protected]>
8b39d58 to
332b595
Compare
dbkinder
left a comment
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.
one little tweak...
samples/sensor/mpu6050/README.rst
Outdated
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.
Use either samples or measures, but not both words. Since you say "samples" below, I'd change this then to say just samples too.
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.
I went with measures/measurements to avoid confusion with the fact this is a sample application.
332b595 to
d31673f
Compare
|
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
samples/sensor/mpu6050/src/main.c
Outdated
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.
accel units should be m/s/s
Add a sample for the MPU6050 that demonstrates on-demand and triggered display of all sensor data. Signed-off-by: Peter Bigot <[email protected]>
d31673f to
0cf89fa
Compare
MPU6050 no longer using Kconfig to specify I2C addresses. Reference to the removed symbol causes QA diagnostics. Remove the reference; when AK8975 is converted to devicetree it may be possible to restore the link between the sensors. Signed-off-by: Peter Bigot <[email protected]>
|
@MaureenHelm Units fixed. I added a patch to the ak8975 internal header to eliminate the Kconfig warning, but that device needs to be converted to devicetree. |
MaureenHelm
left a comment
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.
Units fixed. I added a patch to the ak8975 internal header to eliminate the Kconfig warning, but that device needs to be converted to devicetree.
Thanks.
| reg = <0x68>; | ||
| status = "okay"; | ||
| label = "MPU6050"; | ||
| int-gpios = <&gpio0 11 0>; |
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.
missing flags
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.
Actually not missing here: this is targeting master, and GPIO_ACTIVE_HIGH isn't available yet.
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.
Right, thanks.
| reg = <0x68>; | ||
| status = "okay"; | ||
| label = "MPU6050"; | ||
| int-gpios = <&gpio0 11 0>; |
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.
Right, thanks.
Converts the driver to use devicetree properties instead of Kconfig.
Adds a sample demonstrating on-demand and triggered sampling.
NB: I find that the driver returns
-EIOon sample fetch within the first hundred observations. It seems likely some timing constraint is being violated.