Lines Matching refs:ring
6 A :dfn:`ring buffer` is a circular buffer, whose contents are stored in
19 can be enqueued and dequeued from the ring buffer in
25 legal to mix these two modes on a single ring buffer instance. A ring
38 Any number of ring buffers can be defined (limited only by available RAM). Each
39 ring buffer is referenced by its memory address.
41 A ring buffer has the following key properties:
44 bytes or 32-bit words that have been added to the ring buffer but not yet
48 the maximum amount of data (including possible metadata values) the ring
51 A ring buffer must be initialized before it can be used. This sets its
58 buffer passed change (either bytes or words) depending on how the ring
61 :c:macro:`RING_BUF_DECLARE` will declare and statically initialize a ring
69 "Bytes" data may be copied into the ring buffer using
74 will copy bytes out of the ring buffer in the order that they were
80 user and returns a pointer to memory internal to the ring buffer that
88 Similarly, :c:func:`ring_buf_get_claim` returns a pointer to internal ring
103 The user can manage the capacity of a ring buffer without modifying it
109 ring buffer, discarding the tracking of any bytes or items already
117 A **byte mode** ring buffer instance is declared using
123 Data can be copied into the ring buffer (see
124 :c:func:`ring_buf_put`) or ring buffer memory can be used
134 Data can be retrieved from a ring buffer through copying
138 1. retrieving source location with valid data written to a ring buffer
147 A **data item mode** ring buffer instance is declared using
151 A ring buffer **data item** is an array of 32-bit words from 0 to 1020 bytes
154 values (which occupy one additional 32-bit word). If the ring buffer has
157 A data item is **dequeued** (:c:func:`ring_buf_item_get`) from a ring
160 retriever. If the ring buffer is empty, or if the data array supplied by the
167 The ring buffer APIs do not provide any concurrency control.
169 readers/writers) applications may need to protect the ring buffer with
179 Data streamed through a ring buffer is always written to the next byte
181 the end, thus the "ring" structure. Internally, the ``struct
201 A ring buffer is defined using a variable of type :c:struct:`ring_buf`.
205 The following code defines and initializes an empty **data item mode** ring
206 buffer (which is part of a larger data structure). The ring buffer's data buffer
225 Alternatively, a ring buffer can be defined and initialized at compile time
226 using one of two macros at file scope. Each macro defines both the ring
229 The following code defines a **data item mode** ring buffer:
236 The following code defines a ring buffer intended to be used for raw bytes:
246 Bytes are copied to a **byte mode** ring buffer by calling
260 Data can be added to a **byte mode** ring buffer by directly accessing the
261 ring buffer's memory. For example:
270 /* Allocate buffer within a ring buffer memory. */
273 /* Work directly on a ring buffer memory. */
283 A data item is added to a ring buffer by calling
314 Data bytes are copied out from a **byte mode** ring buffer by calling
330 Data can be retrieved from a **byte mode** ring buffer by direct
331 operations on the ring buffer's memory. For example:
340 /* Get buffer within a ring buffer memory. */
343 /* Work directly on a ring buffer memory. */
351 /* proc_size exceeds amount of valid data in a ring buffer. */
355 A data item is removed from a ring buffer by calling
383 * :kconfig:option:`CONFIG_RING_BUFFER`: Enable ring buffer.
388 The following ring buffer APIs are provided by :zephyr_file:`include/zephyr/sys/ring_buffer.h`: