Skip to content

[Backport v3.7-branch] lis2dux12: fix temp conversion (and other issues) #76354

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

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

zephyrbot
Copy link
Collaborator

@zephyrbot zephyrbot commented Jul 27, 2024

Backport a1f9793~4..a1f9793 from #76279.

Fixes #75686

Extended the x-nucleo-iks4a1 shield standard sample adding lsm6dsv16x
sensor die temperature display.

Signed-off-by: Armando Visconti <[email protected]>
(cherry picked from commit 878b5a9)
When setting the full scale through SENSOR_ATTR_FULL_SCALE the
driver must convert the g value (i.e. one of 2g/4g/8g/16g) to
the corrispondent sensor fs raw value.

Signed-off-by: Armando Visconti <[email protected]>
(cherry picked from commit 2eaec8b)
The current implementation assumes that sensor odr and range are
always configured in the Device Tree at compile time which might
not be the case.

Instead, application can set odr and range either at compile time
through the DT or using SENSOR_ATTR_SAMPLING_FREQUENCY and
SENSOR_ATTR_FULL_SCALE attributes at runtime, so each driver instance
must keep trace of the latest values set and use them in the sensor
APIs which require them (e.g. lis2dux12_mode_set).

Signed-off-by: Armando Visconti <[email protected]>
(cherry picked from commit cf20aa0)
@zephyrbot zephyrbot requested a review from avisconti as a code owner July 27, 2024 07:37
@zephyrbot zephyrbot added Backport Backport PR and backport failure issues area: Sensors Sensors area: Samples Samples area: Shields Shields (add-on boards) labels Jul 27, 2024
Return to sensor_api i/f the temperature in Celsius instead
of the register raw value in LSB.

Fixes #75686

Signed-off-by: Armando Visconti <[email protected]>
(cherry picked from commit a1f9793)
@avisconti avisconti force-pushed the backport-76279-to-v3.7-branch branch from 8b62daa to 7491218 Compare July 29, 2024 08:51
Copy link
Collaborator

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

Builds fine.

@nashif nashif merged commit ee6c008 into v3.7-branch Aug 6, 2024
23 checks passed
@nashif nashif deleted the backport-76279-to-v3.7-branch branch August 6, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Samples Samples area: Sensors Sensors area: Shields Shields (add-on boards) Backport Backport PR and backport failure issues
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants