Skip to content

Commit 3b56358

Browse files
michalpiekoskartben
authored andcommitted
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 <[email protected]>
1 parent 2bda7b8 commit 3b56358

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

samples/subsys/rtio/rtio.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. zephyr:code-sample-category:: rtio
2+
:name: Real Time I/O (RTIO)
3+
:show-listing:
4+
5+
Samples that demonstrate the :ref:`rtio` subsystem.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
.. zephyr:code-sample:: sensor_batch_processing
2+
:name: Sensor batch processing
3+
:relevant-api: rtio
4+
5+
Implement a sensor device using RTIO for asynchronous data processing.
6+
7+
Overview
8+
********
9+
10+
This sample application demonstrates the use of the :ref:`rtio` framework for
11+
doing asynchronous operation chains.
12+
Application uses :ref:`rtio` with mempool API to fetch data from virtual sensor
13+
and displays it on the console.
14+
15+
Requirements
16+
************
17+
18+
* A board with flash support or native_sim target
19+
20+
Building and Running
21+
********************
22+
23+
This sample can be found under :zephyr_file:`samples/subsys/rtio` in the Zephyr tree.
24+
25+
The sample can be built for most platforms, the following commands build the
26+
application for the native_sim target.
27+
28+
.. zephyr-app-commands::
29+
:zephyr-app: samples/subsys/rtio
30+
:board: native_sim
31+
:goals: build run
32+
:compact:
33+
34+
When running, the output on the console shows the operations of
35+
submitting for, consuming, and processing the sensor data.
36+
37+
Sample Output
38+
=============
39+
40+
.. code-block:: console
41+
42+
*** Booting Zephyr OS build v4.0.0-1260-gbaa49f6f32d5 ***
43+
I: Submitting 4 read requests
44+
D: sensor@0: buf_len = 16, buf = 0x8056430
45+
D: sensor@0: buf_len = 16, buf = 0x8056440
46+
D: sensor@0: buf_len = 16, buf = 0x8056450
47+
D: sensor@0: buf_len = 16, buf = 0x8056460
48+
D: Consumed completion event 0
49+
D: Consumed completion event 1
50+
D: Consumed completion event 2
51+
D: Consumed completion event 3
52+
I: Start processing 4 samples
53+
D: Sample data:
54+
D: 00 01 02 03 04 05 06 07 |........
55+
D: 08 09 0a 0b 0c 0d 0e 0f |........
56+
D: Sample data:
57+
D: 10 11 12 13 14 15 16 17 |........
58+
D: 18 19 1a 1b 1c 1d 1e 1f |........
59+
D: Sample data:
60+
D: 20 21 22 23 24 25 26 27 | !"#$%&'
61+
D: 28 29 2a 2b 2c 2d 2e 2f |()*+,-./
62+
D: Sample data:
63+
D: 30 31 32 33 34 35 36 37 |01234567
64+
D: 38 39 3a 3b 3c 3d 3e 3f |89:;<=>?
65+
D: sensor@0: buf_len = 16, buf = 0x8056470
66+
D: sensor@0: buf_len = 16, buf = 0x8056480
67+
D: sensor@0: buf_len = 16, buf = 0x8056490
68+
I: Finished processing 4 samples
69+
I: Submitting 4 read requests
70+
D: sensor@0: buf_len = 16, buf = 0x8056430
71+
D: sensor@0: buf_len = 16, buf = 0x8056440
72+
D: sensor@0: buf_len = 16, buf = 0x8056450
73+
D: sensor@0: buf_len = 16, buf = 0x8056460
74+
D: Consumed completion event 0
75+
...

0 commit comments

Comments
 (0)