Skip to content

Conversation

@avisconti
Copy link
Contributor

Add few other sensors support to steval_stwinbx1 board and a basic sample to test:

  • IIS2MDC: 3-axis magnetometer
  • ISM330DHCX: IMU, 3D accelerometer and 3D gyroscope
  • IIS2DLPC: 3-axis accelerometer
  • IIS2ICLX: 2-axis digital inclinometer

Fixed a couple of things in iis2iclx driver while testing the board.

Do not fail when requested rate passed in SENSOR_ATTR_SAMPLING_FREQUENCY
is not matching any of the odr values supported by sensor. Instead, round
it up to the next one.

Signed-off-by: Armando Visconti <[email protected]>
Fix the sensor range setting at runtime which is currently returning error,
converting the SI (ms2) value passed thru SENSOR_ATTR_FULL_SCALE in mg (and
not in g) as this is the unit used in the driver internals.

Signed-off-by: Armando Visconti <[email protected]>
Add few other sensors support to steval_stwinbx1 board:

 - IIS2MDC: 3-axis magnetometer
 - ISM330DHCX: IMU, 3D accelerometer and 3D gyroscope
 - IIS2DLPC: 3-axis accelerometer
 - IIS2ICLX: 2-axis digital inclinometer

Signed-off-by: Armando Visconti <[email protected]>
@jeppenodgaard
Copy link

Without reading the sample in detail I wonder if SENSOR_SHELL can do the same?

@avisconti
Copy link
Contributor Author

Without reading the sample in detail I wonder if SENSOR_SHELL can do the same?

It's not exactly the same. I mean, sensor_shell is more an interactive tool to explore things up, and this sample is more board specific and automatic.
Not sure what the general intention is; whether we would like to stop the proliferation of samples or the more the better...

@jeppenodgaard
Copy link

It's not exactly the same. I mean, sensor_shell is more an interactive tool to explore things up, and this sample is more board specific and automatic.

I see. There definitely is an advantage of just flashing the board and it will print all sensor values without any interaction.

Not sure what the general intention is; whether we would like to stop the proliferation of samples or the more the better...

I guess it is somewhere in between.

If a generic sensor sample that printed all initialized sensor's values periodically I think a samples/sensor clean up could be done.

jeppenodgaard
jeppenodgaard previously approved these changes Aug 9, 2024
Copy link

@jeppenodgaard jeppenodgaard left a comment

Choose a reason for hiding this comment

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

LGTM. Only nit comments.

Add sample to test STWIN.box board sensors.

Signed-off-by: Armando Visconti <[email protected]>
@carlescufi carlescufi merged commit 9a5f145 into zephyrproject-rtos:main Aug 13, 2024
@avisconti avisconti deleted the add-stwinbx1-sensors branch August 13, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Boards area: Documentation area: Drivers area: Samples Samples area: Sensors Sensors bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants