-
Notifications
You must be signed in to change notification settings - Fork 8.2k
sample/sensortile_box: update to the new GPIO API #20941
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
sample/sensortile_box: update to the new GPIO API #20941
Conversation
9114d2d to
83c7612
Compare
|
All checks passed. checkpatch (informational only, not a failure)Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
83c7612 to
c3ff85c
Compare
|
I have re-pushed handling also the drivers for the sensors on the board |
c3ff85c to
74937dd
Compare
|
Repushed cleaning out the sensor polarity setting. |
|
Could you update the binding YAML for these sensors to add text like what's in the hts221 yaml so the sensor active level is documented there? |
74937dd to
b865f33
Compare
Sure, I forgot it. |
pabigot
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.
Tested these on nrf52_pca10040 + x-nucleo-iks01a3. As far as basic functionality it seems to work.
The board does not properly handle a reset:
Could not get LSM6DSO device
[00:00:00.007,446] <dbg> LIS2DW12.lis2dw12_set_power_mode: Apply default Power Mode
[00:00:00.025,115] <inf> LSM6DSO: chip id 0x6c
[00:00:00.026,031] <err> i2c_nrfx_twi: Error 195952642 occurred for message 1
[00:00:00.026,031] <dbg> LSM6DSO.lsm6dso_init: failed to initialize chip
[00:00:00.026,031] <dbg> temp_nrf5.temp_nrf5_init:
I think we exchanged some comments about that somewhere; my recollection is that if you follow the pattern suggested in #20017 (comment) and also demonstrated in #19839 that would be fixed: i.e. check the signal level and handle the interrupt when it's detected by level rather than let it be missed.
There are a couple binding yaml errors noted below; they produce build-time errors. It would be nice if the active level of lsm6dso was also provided in that binding file.
You could also update the x-nucleo-iks01a3 shield overlay GPIO entries for the three sensors present on it (all active high).
Minimum for approval is fixing the broken binding yamls.
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.
Needs this inserted:
description: DRDY pin
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.
Also here (insert description keyword)
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.
Sorry, this should have been on lis2dw12-i2c.yaml.
yes, there was a discussion about this that was handled in #20913 .
Ok, I'll fix the bindings for i2c/spi lis2dw12.
I'll add the same description in i2c/spi lsm6dso bindings
Yes, sure.
|
b865f33 to
1dbfe22
Compare
|
@pabigot |
Agreed, only the sensors that have been updated should be changed in the overlay: makes it more clear that something's left undone. FWIW I suspect #20913 doesn't solve the general case and that you really do need to check the level of the interrupt and process it if it's already set. That's a rule for any edge-triggered detection on a level signal that changes asynchronously: it can happen after startup too. Changing it isn't in scope for this PR, though. |
1dbfe22 to
fadc57f
Compare
mnkp
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.
LGTM with a minor comment.
fadc57f to
15d9d80
Compare
mnkp
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.
LGTM with minor comment.
Get rid of all the deprecated functions and definitions replacing them with the new ones. Signed-off-by: Armando Visconti <[email protected]>
Get rid of all the deprecated functions and definitions replacing them with the new ones. Signed-off-by: Armando Visconti <[email protected]>
Get rid of all the deprecated functions and definitions replacing them with the new ones. Signed-off-by: Armando Visconti <[email protected]>
Get rid of all the deprecated functions and definitions replacing them with the new ones. Signed-off-by: Armando Visconti <[email protected]>
Get rid of all the deprecated functions and definitions replacing them with the new ones. Signed-off-by: Armando Visconti <[email protected]>
Use GPIO_ACTIVE_HIGH instead of '0' for drdy/irq flags in overlay files. Signed-off-by: Armando Visconti <[email protected]>
15d9d80 to
b879abc
Compare
update to the new GPIO API