Skip to content

Conversation

@ygaillard
Copy link

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.

@github-actions
Copy link

Hello @ygaillard, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating 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. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@carlescufi
Copy link
Member

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.

@ygaillard ygaillard changed the title sensor: add driver for SDP3x sensors drivers: sensor: sdp3x: add driver Jun 17, 2024
@ygaillard

This comment was marked as outdated.

@ygaillard ygaillard force-pushed the main branch 2 times, most recently from 3064a11 to b614b2e Compare June 17, 2024 18:45
@ygaillard
Copy link
Author

@carlescufi , finally fixed my issues.

Copy link
Member

@MaureenHelm MaureenHelm left a 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

Copy link
Member

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

Copy link
Author

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 *

Copy link
Member

Choose a reason for hiding this comment

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

Reference:

if (!i2c_is_ready_dt(&config->bus)) {

@ygaillard
Copy link
Author

Thanks for the contribution!

Please add this sensor to tests/drivers/build_all/sensor

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.

@ygaillard
Copy link
Author

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]>
@kartben
Copy link
Contributor

kartben commented Aug 2, 2024

rebased to re-trigger stuck CI

@decsny decsny removed their request for review August 19, 2024 19:26
Copy link
Member

@ubieda ubieda left a 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.

Copy link
Member

Choose a reason for hiding this comment

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

Reference:

if (!i2c_is_ready_dt(&config->bus)) {

#define SDP3X_CRC_INIT 0xFF

struct sdp3x_config {
struct i2c_dt_spec bus;
Copy link
Member

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

@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Jan 15, 2025
@github-actions github-actions bot closed this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Devicetree Binding PR modifies or adds a Device Tree binding area: Sensors Sensors Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants