From 723f678bd3a92dedea5e0cbb20a02b4dc2397e54 Mon Sep 17 00:00:00 2001 From: Michal Piekos Date: Sun, 1 Dec 2024 08:48:57 +0100 Subject: [PATCH] samples: doc: Added README for RTIO sample Added README.rst for sensor_batch_processing sample. Added rtio.rst listing samples from RTIO subsystem. Signed-off-by: Michal Piekos --- samples/subsys/rtio/rtio.rst | 5 ++ .../rtio/sensor_batch_processing/README.rst | 75 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 samples/subsys/rtio/rtio.rst create mode 100644 samples/subsys/rtio/sensor_batch_processing/README.rst diff --git a/samples/subsys/rtio/rtio.rst b/samples/subsys/rtio/rtio.rst new file mode 100644 index 00000000000000..7a186aa02c079d --- /dev/null +++ b/samples/subsys/rtio/rtio.rst @@ -0,0 +1,5 @@ +.. zephyr:code-sample-category:: rtio + :name: Real Time I/O (RTIO) + :show-listing: + + Samples that demonstrate the :ref:`rtio` subsystem. diff --git a/samples/subsys/rtio/sensor_batch_processing/README.rst b/samples/subsys/rtio/sensor_batch_processing/README.rst new file mode 100644 index 00000000000000..23f744bd784ccd --- /dev/null +++ b/samples/subsys/rtio/sensor_batch_processing/README.rst @@ -0,0 +1,75 @@ +.. zephyr:code-sample:: sensor_batch_processing + :name: Sensor batch processing + :relevant-api: rtio + + Implement a sensor device using RTIO for asynchronous data processing. + +Overview +******** + +This sample application demonstrates the use of the :ref:`rtio` framework for +doing asynchronous operation chains. +Application uses :ref:`rtio` with mempool API to fetch data from virtual sensor +and displays it on the console. + +Requirements +************ + +* A board with flash support or native_sim target + +Building and Running +******************** + +This sample can be found under :zephyr_file:`samples/subsys/rtio` in the Zephyr tree. + +The sample can be built for most platforms, the following commands build the +application for the native_sim target. + +.. zephyr-app-commands:: + :zephyr-app: samples/subsys/rtio + :board: native_sim + :goals: build run + :compact: + +When running, the output on the console shows the operations of +submitting for, consuming, and processing the sensor data. + +Sample Output +============= + +.. code-block:: console + + *** Booting Zephyr OS build v4.0.0-1260-gbaa49f6f32d5 *** + I: Submitting 4 read requests + D: sensor@0: buf_len = 16, buf = 0x8056430 + D: sensor@0: buf_len = 16, buf = 0x8056440 + D: sensor@0: buf_len = 16, buf = 0x8056450 + D: sensor@0: buf_len = 16, buf = 0x8056460 + D: Consumed completion event 0 + D: Consumed completion event 1 + D: Consumed completion event 2 + D: Consumed completion event 3 + I: Start processing 4 samples + D: Sample data: + D: 00 01 02 03 04 05 06 07 |........ + D: 08 09 0a 0b 0c 0d 0e 0f |........ + D: Sample data: + D: 10 11 12 13 14 15 16 17 |........ + D: 18 19 1a 1b 1c 1d 1e 1f |........ + D: Sample data: + D: 20 21 22 23 24 25 26 27 | !"#$%&' + D: 28 29 2a 2b 2c 2d 2e 2f |()*+,-./ + D: Sample data: + D: 30 31 32 33 34 35 36 37 |01234567 + D: 38 39 3a 3b 3c 3d 3e 3f |89:;<=>? + D: sensor@0: buf_len = 16, buf = 0x8056470 + D: sensor@0: buf_len = 16, buf = 0x8056480 + D: sensor@0: buf_len = 16, buf = 0x8056490 + I: Finished processing 4 samples + I: Submitting 4 read requests + D: sensor@0: buf_len = 16, buf = 0x8056430 + D: sensor@0: buf_len = 16, buf = 0x8056440 + D: sensor@0: buf_len = 16, buf = 0x8056450 + D: sensor@0: buf_len = 16, buf = 0x8056460 + D: Consumed completion event 0 + ...