Skip to content

Conversation

@rbuisson-invn
Copy link
Contributor

drivers: sensor: icp101xx: supports icp101xx sensors
dts: supports icp101xx invn pressure sensor
module: HAL TDK module

Adds official TDK Invensense Inc. driver in TDK HAL module for icp101xx sensor.
Replacing icp10125 unofficial driver
Validated with custom setup: nrf52dk_nrf52832 + icp10125 Piromoni board

Signed-off-by: Remi Buisson [email protected]

@zephyrbot
Copy link

zephyrbot commented Jan 16, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_tdk zephyrproject-rtos/hal_tdk@e0ade95 zephyrproject-rtos/hal_tdk@6727477 (main) zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_tdk DNM This PR should not be merged (Do Not Merge) labels Jan 16, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the renaming should happen in the same commit where the old binding is removed, so the history can be bisected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks for your review.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is usually placed in the main source file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks for your review.

@rbuisson-invn rbuisson-invn force-pushed the TDK_Invensense_icp101xx_pressure_sensor branch 4 times, most recently from c6b4f31 to 9ed1ee8 Compare January 17, 2025 14:11
@rbuisson-invn rbuisson-invn force-pushed the TDK_Invensense_icp101xx_pressure_sensor branch from 9ed1ee8 to 3d3b1fd Compare February 3, 2025 09:07
@zephyrbot zephyrbot removed the DNM This PR should not be merged (Do Not Merge) label Feb 3, 2025
Copy link
Contributor

@teburd teburd left a comment

Choose a reason for hiding this comment

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

Please consider dropping float math, unclear what the tdk hal is providing here to be frank.

Copy link
Contributor

Choose a reason for hiding this comment

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

There doesn't seem to be a good reason to split this into a .h file, unless there's multiple .c files needing this it should be in the same compliation unit to keep things simple

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit confused by this call here, you are setting up a struct on the stack, then passing it in by reference, then its unused past this point. This seems wasteful if the result is copied in struct members into device data struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally agree, this is completely useless, removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this call out to the tdk hal really needed? Isn't this simply reading a few registers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This create a specific command sent over I2C.
It seems better to have a dedicated function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this equivalent to i2c_write() with a simple register write? Why is the TDK HAL needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This creates a specific command sent over I2C (depending on selected mode).
It seems better to have a dedicated function.

@rbuisson-invn rbuisson-invn force-pushed the TDK_Invensense_icp101xx_pressure_sensor branch from 3d3b1fd to f4f01b0 Compare February 3, 2025 16:19
teburd
teburd previously approved these changes Feb 3, 2025
Copy link
Contributor

@teburd teburd left a comment

Choose a reason for hiding this comment

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

reasonable answers/fixes given I think to my review comments

@rbuisson-invn
Copy link
Contributor Author

reasonable answers/fixes given I think to my review comments

Thanks for the review and approval !

@rbuisson-invn rbuisson-invn force-pushed the TDK_Invensense_icp101xx_pressure_sensor branch from f4f01b0 to 227b663 Compare February 4, 2025 07:44
teburd
teburd previously approved these changes Feb 4, 2025
Copy link
Contributor

@teburd teburd left a comment

Choose a reason for hiding this comment

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

Refresh +1

@rbuisson-invn rbuisson-invn force-pushed the TDK_Invensense_icp101xx_pressure_sensor branch from 227b663 to 3be0ef6 Compare February 5, 2025 09:57
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool "ICP101XX Barometric Pressure and Temperature Sensor"
bool "ICP101XX Barometric Pressure and Temperature Sensors"

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: ICP101xx High Accuracy, Low Power, Barometric Pressure and Temperature Sensor IC
description: ICP101xx High Accuracy, Low Power, Barometric Pressure and Temperature Sensors IC

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#error "ICP101XX driver enabled without any devices"
#error "ICP101XX driver enabled without any compatible devices in devicetree"

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Enable driver for ICP101XX barometric pressure/temperature sensor.
Enable driver for ICP101XX barometric pressure/temperature sensors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggested changes, all taken into account.
Could you please approve if ok for you?

@rbuisson-invn rbuisson-invn force-pushed the TDK_Invensense_icp101xx_pressure_sensor branch from 3be0ef6 to aec39dd Compare February 5, 2025 16:39
icp101xx are barometric pressure and temperature sensors.
https://invensense.tdk.com/smartpressure

Signed-off-by: Remi Buisson <[email protected]>
Use official TDK Invensense driver for icp101xx sensor in tdk_hal module.

Signed-off-by: Remi Buisson <[email protected]>
Replace icp10125.
tests: sensor: rename icp10125 to icp101xx

Signed-off-by: Remi Buisson <[email protected]>
@rbuisson-invn rbuisson-invn force-pushed the TDK_Invensense_icp101xx_pressure_sensor branch from aec39dd to 744541b Compare February 6, 2025 08:45
@zephyrbot zephyrbot added the Release Notes To be mentioned in the release notes label Feb 6, 2025
@kartben kartben merged commit ad4ed55 into zephyrproject-rtos:main Feb 7, 2025
28 checks passed
@github-actions
Copy link

github-actions bot commented Feb 7, 2025

Hi @rbuisson-invn!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Sensors Sensors manifest manifest-hal_tdk Release Notes To be mentioned in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants