Skip to content
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

Add generic fifo stream sample #82342

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

avisconti
Copy link
Collaborator

@avisconti avisconti commented Nov 29, 2024

(based on samples/sensors/accel_polling)
Add sample to read from up to 10 FIFO streaming devices, using the sensor_stream() API and the RTIO framework: https://docs.zephyrproject.org/latest/services/rtio/index.html

The devices has to be aliased as streamN (0 <= N <= 9) in DT, and will be instantiated using SENSOR_DT_STREAM_IODEV() macro. Currently the sample gets/prints data on SENSOR_TRIG_FIFO_WATERMARK trigger basis for the following sensor channels:

    - SENSOR_CHAN_ACCEL_XYZ
    - SENSOR_CHAN_GYRO_XYZ
    - SENSOR_CHAN_DIE_TEMP

Tested with the lsm6dsv16x sensor on a nucleo_h503rb board and a x_nucleo_iks4a1 shield (I2C bus).

EDIT:
The idea is to extend it with the capability of reading other (virtual) sensors, including the GAME_ROTATION Vector quaternions from FIFO.

The get_frame_count() API must return the number of frames in FIFO
for a given channel type, and not the total number of generic FIFO
frames. This API may be also re-used in the decoder routine when
the timestamp baseline is adjusted.

Signed-off-by: Armando Visconti <[email protected]>
Add sample to read from up to 10 FIFO streaming devices, using the
sensor_stream() API and the RTIO framework:
    https://docs.zephyrproject.org/latest/services/rtio/index.html

The devices has to be aliased as streamN (0 <= N <= 9) in DT, and
will be instantiated using SENSOR_DT_STREAM_IODEV() macro.

Currently the sample gets/prints data on SENSOR_TRIG_FIFO_WATERMARK
trigger basis for the following sensor channels:

    - SENSOR_CHAN_ACCEL_XYZ
    - SENSOR_CHAN_GYRO_XYZ
    - SENSOR_CHAN_DIE_TEMP

Signed-off-by: Armando Visconti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant