-
Notifications
You must be signed in to change notification settings - Fork 8.2k
sensors: lis2dh: fixes for Nordic use, add sample #19901
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
Conversation
|
All checks passed. 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/lis2dh/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.
I see the build part, but what about the flashing and running? Don't forget to mention you'll need to connect the board to your host computer and run a serial terminal program.
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.
Huh. Copied that and most of the rest of the sample from lsm6dsl which apparently doesn't have that material.
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.
@dbkinder Many if not most (sensor) samples have no more documentation than this; e.g.:
- https://docs.zephyrproject.org/latest/samples/sensor/adt7420/README.html
- https://docs.zephyrproject.org/latest/samples/sensor/bme680/README.html
- https://docs.zephyrproject.org/latest/samples/sensor/ens210/README.html
If there is a new expectation for how samples are to be documented, could you point me to a template I can copy? Thanks.
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.
Since you asked, there is a sample template in doc/templates/sample.tmpl. There's a comment in the samples/index.rst that points this template out but it's not obvious.
Sadly, not all samples follow this template, particularly the sensor samples that punt the issue with statements such as "Flash the binary to a board of choice with a sensor connected." but don't provide instructions on how to connect the sensor (or how to flash).
As we get new developers trying out Zephyr, we're getting more comments about incomplete documentation that I'm hoping we can resolve as new documentation shows up and we can eventually address in the documentation that's already included. If you'd like to help fix this situation, I'd appreciate your adding those instructions to your PR (and even others if you can). I'll approve this PR with those instructions missing for now if you're too busy.
c9708e2 to
819a5b2
Compare
avisconti
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.
ok, thx
drivers/sensor/lis2dh/lis2dh.h
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.
Can we add a reference to issue #20154. in the comment block.
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.
Done
The default I2C driver on Nordic platforms does not support the I2C burst operations, so replace those calls with ones that work on the platform. Signed-off-by: Peter Bigot <[email protected]>
The Thingy:52 has a LIS2DH12 low-power accelerometer on the external I2C bus. Add the necessary description to devicetree. Signed-off-by: Peter Bigot <[email protected]>
Basic polled and triggered sampling of accelerometer data from LIS2DH-compatible sensors. Signed-off-by: Peter Bigot <[email protected]>
Rework the use of the I2C API so that functions that are not supported on Nordic are bypassed (#17801).
Add devicetree support for the LIS2DH12 on the Nordic Thingy:52 (nrf52_pca20020).
Add a sample that tests both polled and triggered readings.
Tested on nrf52_pca20020 and nucleo_l476rg+x_nucleo_iks01a2.