Skip to content

Conversation

@pabigot
Copy link
Contributor

@pabigot pabigot commented Oct 17, 2019

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.

@zephyrbot
Copy link

zephyrbot commented Oct 17, 2019

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.:

If there is a new expectation for how samples are to be documented, could you point me to a template I can copy? Thanks.

Copy link
Contributor

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.

@pabigot pabigot force-pushed the pr/20191017a branch 2 times, most recently from c9708e2 to 819a5b2 Compare October 18, 2019 12:54
Copy link
Contributor

@avisconti avisconti left a comment

Choose a reason for hiding this comment

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

ok, thx

Copy link
Contributor

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.

Copy link
Contributor Author

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]>
@galak galak merged commit be7a4bf into zephyrproject-rtos:master Oct 25, 2019
@pabigot pabigot deleted the pr/20191017a branch November 3, 2019 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants