-
Notifications
You must be signed in to change notification settings - Fork 8.3k
drivers: sensor: sdp3x: add driver #74376
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
|
Hello @ygaillard, and thank you very much for your first pull request to the Zephyr project! |
|
Thanks for the PR! Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. |
This comment was marked as outdated.
This comment was marked as outdated.
3064a11 to
b614b2e
Compare
|
@carlescufi , finally fixed my issues. |
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.
Thanks for the contribution!
Please add this sensor to tests/drivers/build_all/sensor
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 i2c_is_ready_dt
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.
This seems to cause an invalid pointer. Could you provide more information on how to use this function? Note that the other implemented sensirion drivers use device_is_ready.
Log:
In function 'sdp3x_init':
/home/ygaillard/ML_sens_board/external/zephyr/drivers/sensor/sdp3x/sdp3x.c:168:38: warning: passing argument 1 of 'i2c_is_ready_dt' from incompatible pointer type [-Wincompatible-pointer-types]
168 | if (!i2c_is_ready_dt(cfg->bus.bus)) {
| ~~~~~~~~^~~~
| |
| const struct device *
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.
Reference:
zephyr/drivers/mfd/mfd_max20335.c
Line 26 in 18fb3f9
| if (!i2c_is_ready_dt(&config->bus)) { |
Can you please point in the coding guidelines how to implement the test? I could not find any for the other sensirion sensors and therefore difficult how to implement them. |
|
I implemented the changes. Did I miss something in the workflow? |
Add device driver for the SDP3x temperature and differential pressure sensors. Datasheet https://sensirion.com/media/documents/4D045D69/6375F34F/DP_DS_SDP3x_digital_D1.pdf Signed-off-by: Yann Gaillard <[email protected]>
|
rebased to re-trigger stuck CI |
ubieda
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.
Thanks for your contribution! Code looks good but needs the indentation fixed and address Maureen's 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.
Reference:
zephyr/drivers/mfd/mfd_max20335.c
Line 26 in 18fb3f9
| if (!i2c_is_ready_dt(&config->bus)) { |
| #define SDP3X_CRC_INIT 0xFF | ||
|
|
||
| struct sdp3x_config { | ||
| struct i2c_dt_spec bus; |
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.
Please fix indentation (various places): spaces -> tabs
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This is a proposition for a driver using the SDP3x family differential pressure sensors. The related documentation can be found via https://sensirion.com/media/documents/4D045D69/6375F34F/DP_DS_SDP3x_digital_D1.pdf. The code was tested using a SDP31 chip on custom hardware in ambient conditions and return plausible data.
Trigger and continous mode can be selected via project file. The board file select the different mesure mode provided by the sensor.