Home
last modified time | relevance | path

Searched full:buffer (Results 1 – 25 of 2278) sorted by relevance

12345678910>>...92

/Zephyr-latest/lib/os/
Dmpsc_pbuf.c10 #define MPSC_PBUF_DBG(buffer, ...) do { \ argument
13 if (buffer) { \
14 mpsc_state_print(buffer); \
19 static inline void mpsc_state_print(struct mpsc_pbuf_buffer *buffer) in mpsc_state_print() argument
23 buffer->wr_idx, buffer->tmp_wr_idx, in mpsc_state_print()
24 buffer->rd_idx, buffer->tmp_rd_idx); in mpsc_state_print()
28 void mpsc_pbuf_init(struct mpsc_pbuf_buffer *buffer, in mpsc_pbuf_init() argument
31 memset(buffer, 0, offsetof(struct mpsc_pbuf_buffer, buf)); in mpsc_pbuf_init()
32 buffer->get_wlen = cfg->get_wlen; in mpsc_pbuf_init()
33 buffer->notify_drop = cfg->notify_drop; in mpsc_pbuf_init()
[all …]
/Zephyr-latest/tests/subsys/dsp/print_format/src/
Dmain.c21 char buffer[256]; in ZTEST() local
24 snprintf(buffer, 256, "%" PRIq(6), PRIq_arg(q, 6, 0)); in ZTEST()
25 assert_strings("0.119999", buffer); in ZTEST()
27 snprintf(buffer, 256, "%" PRIq(6), PRIq_arg(q, 6, 1)); in ZTEST()
28 assert_strings("0.239999", buffer); in ZTEST()
30 snprintf(buffer, 256, "%" PRIq(6), PRIq_arg(q, 6, -2)); in ZTEST()
31 assert_strings("0.029999", buffer); in ZTEST()
33 snprintf(buffer, 256, "%" PRIq(4), PRIq_arg(q, 4, 0)); in ZTEST()
34 assert_strings("0.1199", buffer); in ZTEST()
36 snprintf(buffer, 256, "%" PRIq(4), PRIq_arg(q, 4, 1)); in ZTEST()
[all …]
/Zephyr-latest/subsys/modem/
Dmodem_stats.c26 static void stats_buffer_list_append(struct modem_stats_buffer *buffer) in stats_buffer_list_append() argument
29 sys_slist_append(&stats_buffer_list, &buffer->node); in stats_buffer_list_append()
44 static struct modem_stats_buffer *stats_buffer_list_next(struct modem_stats_buffer *buffer) in stats_buffer_list_next() argument
49 next = stats_buffer_from_node(sys_slist_peek_next(&buffer->node)); in stats_buffer_list_next()
74 static void stats_buffer_get_and_clear_max_used(struct modem_stats_buffer *buffer, in stats_buffer_get_and_clear_max_used() argument
78 *max_used = buffer->max_used; in stats_buffer_get_and_clear_max_used()
79 buffer->max_used = 0; in stats_buffer_get_and_clear_max_used()
83 static bool stats_buffer_length_is_valid(const struct modem_stats_buffer *buffer, uint32_t length) in stats_buffer_length_is_valid() argument
85 return length <= buffer->size; in stats_buffer_length_is_valid()
88 static void stats_buffer_log_invalid_length(const struct modem_stats_buffer *buffer, in stats_buffer_log_invalid_length() argument
[all …]
/Zephyr-latest/subsys/tracing/include/
Dtracing_buffer.h18 * @brief Initialize tracing buffer.
23 * @brief Tracing buffer is empty or not.
25 * @return true if the ring buffer is empty, or false if not.
30 * @brief Get free space in the tracing buffer.
32 * @return Tracing buffer free space (in bytes).
37 * @brief Get tracing buffer capacity (max size).
39 * @return Tracing buffer capacity (in bytes).
44 * @brief Try to allocate buffer in the tracing buffer.
47 * within the tracing buffer.
48 * @param size Requested buffer size (in bytes).
[all …]
/Zephyr-latest/include/zephyr/sys/
Dmpsc_pbuf.h20 * @brief Multi producer, single consumer packet buffer API
21 * @defgroup mpsc_buf MPSC (Multi producer, single consumer) packet buffer API
27 * Multi producer, single consumer packet buffer allows to allocate variable
33 * If buffer is full and packet cannot be allocated then null is returned unless
40 * returns pointer to the packet within the buffer. Packet is freed when no
44 /**@defgroup MPSC_PBUF_FLAGS MPSC packet buffer flags
48 /** @brief Flag indicating that buffer size is power of 2.
50 * When buffer size is power of 2 then optimizations are applied.
54 /** @brief Flag indicating buffer full policy.
56 * If flag is set then when allocating from a full buffer oldest packets are
[all …]
Dring_buffer.h30 * @defgroup ring_buffer_apis Ring Buffer APIs
33 * @brief Simple ring buffer implementation.
39 * @brief A structure to represent a ring buffer
43 uint8_t *buffer; member
66 * @brief Define and initialize a ring buffer for byte data.
68 * This macro establishes a ring buffer of an arbitrary size.
71 * The ring buffer can be accessed outside the module where it is defined
76 * @param name Name of the ring buffer.
77 * @param size8 Size of ring buffer (in bytes).
84 .buffer = _ring_buffer_data_##name, \
[all …]
Dspsc_pbuf.h18 * @brief Single producer, single consumer packet buffer API
19 * @defgroup spsc_buf SPSC (Single producer, single consumer) packet buffer API
24 /**@defgroup SPSC_PBUF_FLAGS SPSC packet buffer flags
30 * It shall be used only when packet buffer is shared between two cores as on a single
59 /** @brief First part of packet buffer control block.
76 /** @brief Remaining part of a packet buffer when cache is used.
84 uint8_t data[]; /* Buffer data. */
87 /** @brief Remaining part of a packet buffer when cache is not used. */
90 uint8_t data[]; /* Buffer data. */
94 * @brief Single producer, single consumer packet buffer
[all …]
/Zephyr-latest/tests/lib/sprintf/src/
Dmain.c105 char buffer[400]; in ZTEST() local
123 sprintf(buffer, "%e", var.d); in ZTEST()
124 zassert_true((strcmp(buffer, "inf") == 0), in ZTEST()
125 "sprintf(inf) - incorrect output '%s'\n", buffer); in ZTEST()
127 sprintf(buffer, "%E", var.d); in ZTEST()
128 zassert_true((strcmp(buffer, "INF") == 0), in ZTEST()
129 "sprintf(INF) - incorrect output '%s'\n", buffer); in ZTEST()
131 sprintf(buffer, "%f", var.d); in ZTEST()
132 zassert_true((strcmp(buffer, "inf") == 0), in ZTEST()
133 "sprintf(inf) - incorrect output '%s'\n", buffer); in ZTEST()
[all …]
/Zephyr-latest/include/zephyr/
Dnet_buf.h2 * @brief Buffer management.
24 * @brief Network buffer library
25 * @defgroup net_buf Network Buffer Library
32 /* Alignment needed for various parts of the buffer definition */
46 * @param _size Maximum data storage for the buffer.
65 * @param _size Maximum data storage for the buffer.
77 * @brief Simple network buffer representation.
86 * when the buffer only needs to be allocated on the stack or when the
87 * access to and lifetime of the buffer is well controlled and constrained.
90 /** Pointer to the start of data in the buffer. */
[all …]
/Zephyr-latest/tests/lib/mpsc_pbuf/src/
Dmain.c59 static void drop(const struct mpsc_pbuf_buffer *buffer, const union mpsc_pbuf_generic *item) in drop() argument
90 static void init(struct mpsc_pbuf_buffer *buffer, uint32_t wlen, bool overwrite) in init() argument
96 mpsc_pbuf_init(buffer, &mpsc_buf_cfg); in init()
116 struct mpsc_pbuf_buffer buffer; in item_put_no_overwrite() local
118 init(&buffer, 4 - !pow2, false); in item_put_no_overwrite()
120 int repeat = buffer.size*2; in item_put_no_overwrite()
127 mpsc_pbuf_put_word(&buffer, test_1word.item); in item_put_no_overwrite()
129 t = (union test_item *)mpsc_pbuf_claim(&buffer); in item_put_no_overwrite()
132 mpsc_pbuf_free(&buffer, &t->item); in item_put_no_overwrite()
136 zassert_is_null(mpsc_pbuf_claim(&buffer)); in item_put_no_overwrite()
[all …]
/Zephyr-latest/samples/boards/espressif/flash_encryption/src/
Dmain.c26 uint8_t buffer[32]; in main() local
37 buffer[k] = k; in main()
39 LOG_HEXDUMP_INF(buffer, sizeof(buffer), "WRITE BUFFER CONTENT"); in main()
45 flash_write(flash_device, address, &buffer, sizeof(buffer)); in main()
48 memset(buffer, 0, sizeof(buffer)); in main()
49 esp_flash_read(NULL, &buffer, address, sizeof(buffer)); in main()
50 LOG_HEXDUMP_INF(buffer, sizeof(buffer), "FLASH RAW DATA (Encrypted)"); in main()
53 memset(buffer, 0, sizeof(buffer)); in main()
54 flash_read(flash_device, address, &buffer, sizeof(buffer)); in main()
55 LOG_HEXDUMP_INF(buffer, sizeof(buffer), "FLASH DECRYPTED DATA"); in main()
/Zephyr-latest/doc/kernel/data_structures/
Dring_buffers.rst6 A :dfn:`ring buffer` is a circular buffer, whose contents are stored in
12 buffer of memory.
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
26 buffer initialized with a byte count must be used only with the
39 ring buffer is referenced by its memory address.
41 A ring buffer has the following key properties:
43 * A **data buffer** of bytes or 32-bit words. The data buffer contains the raw
44 bytes or 32-bit words that have been added to the ring buffer but not yet
47 * A **data buffer size**, measured in bytes or 32-bit words. This governs
[all …]
Dspsc_pbuf.rst3 Single Producer Single Consumer Packet Buffer
6 A :dfn:`Single Producer Single Consumer Packet Buffer (SPSC_PBUF)` is a circular
7 buffer, whose contents are stored in first-in-first-out order. Variable size
8 packets are stored in the buffer. Packet buffer works under assumption that there
14 Packets are added to the buffer using :c:func:`spsc_pbuf_write` which copies a
15 data into the buffer. If the buffer is full error is returned.
17 Packets are copied out of the buffer using :c:func:`spsc_pbuf_read`.
/Zephyr-latest/include/zephyr/modem/
Dstats.h17 /** Modem statistics buffer structure */
30 * @brief Initialize modem statistics buffer
32 * @param buffer Modem statistics buffer instance
33 * @param name Name of buffer instance
34 * @param size Size of buffer
36 void modem_stats_buffer_init(struct modem_stats_buffer *buffer,
40 * @brief Advertise modem statistics buffer size
42 * @param buffer Modem statistics buffer instance
43 * @param length Length of buffer
45 * @note Invoke when buffer size changes
[all …]
/Zephyr-latest/subsys/logging/backends/
DKconfig.rtt13 is transferred to up-buffer at once depending on available space and
16 in up-buffer for a message and message is transferred to host.
25 bool "Drop messages that do not fit in up-buffer."
27 If there is not enough space in up-buffer for a message, drop it.
29 Increase up-buffer size helps to reduce dropping of messages.
34 Waits until there is enough space in the up-buffer for a message.
37 bool "Overwrite messages if up-buffer full"
39 If there is not enough space in up-buffer for a message overwrite
49 int "Size of internal buffer for storing messages."
54 This option defines maximum message size transferable to up-buffer.
[all …]
/Zephyr-latest/drivers/misc/ft8xx/
Dft8xx_common.c23 uint8_t buffer[2]; in ft8xx_wr16() local
25 *(uint16_t *)buffer = sys_cpu_to_le16(data); in ft8xx_wr16()
26 err = ft8xx_drv_write(address, buffer, sizeof(buffer)); in ft8xx_wr16()
33 uint8_t buffer[4]; in ft8xx_wr32() local
35 *(uint32_t *)buffer = sys_cpu_to_le32(data); in ft8xx_wr32()
36 err = ft8xx_drv_write(address, buffer, sizeof(buffer)); in ft8xx_wr32()
54 uint8_t buffer[2] = {0}; in ft8xx_rd16() local
56 err = ft8xx_drv_read(address, buffer, sizeof(buffer)); in ft8xx_rd16()
59 return sys_le16_to_cpu(*(const uint16_t *)buffer); in ft8xx_rd16()
65 uint8_t buffer[4] = {0}; in ft8xx_rd32() local
[all …]
/Zephyr-latest/include/zephyr/bluetooth/
Dbuf.h2 * @brief Bluetooth data buffer API
57 /** Helper to include reserved HCI data in buffer calculations */
60 /** Helper to calculate needed buffer size for HCI ACL packets */
63 /** Helper to calculate needed buffer size for HCI Event packets. */
66 /** Helper to calculate needed buffer size for HCI Command packets. */
69 /** Helper to calculate needed buffer size for HCI ISO packets. */
95 * We keep around the first buffer (that comes from the driver) to do
96 * re-assembly into, and if all links are re-assembling, there will be no buffer
114 "Maximum number of ACL RX buffer is 65535, reduce CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA");
120 /** Buffer count needed for HCI ACL, HCI ISO or Event RX buffers */
[all …]
/Zephyr-latest/include/zephyr/drivers/serial/
Duart_async_rx.h21 /* @brief RX buffer structure which holds the buffer and its state. */
24 * received to that buffer.
28 /* Set to one if buffer is released by the driver. */
32 uint8_t buffer[]; member
46 /* Single buffer size. */
49 /* Index of the next buffer to be provided to the driver. */
52 /* Current buffer from which data is being consumed. */
55 /* Current read index in the buffer from which data is being consumed.
56 * Read index which is incremented whenever data is consumed from the buffer.
63 /* Pointer to the buffer. */
[all …]
/Zephyr-latest/subsys/bluetooth/controller/util/
Ddbuf.h8 * @brief Generic double buffer data structure header.
16 /* Last enqueued element. It will be used after buffer is swapped. */
18 /* Size in a bytes of a single element stored in double buffer. */
20 /* Pointer for actual buffer memory. Its size should be 2 times @p elem_size. */
25 * @brief Allocate element in double buffer.
28 * For consecutive calls it always returns the same pointer until buffer is swapped
31 * @param hdr Pointer to double buffer header.
44 * @param hdr Pointer to double buffer header.
54 * @brief Enqueue new element for buffer swap.
56 * @param hdr Pointer to double buffer header.
[all …]
/Zephyr-latest/lib/net_buf/
DKconfig1 # Network buffer configuration options
7 bool "Network buffer support"
15 bool "Network buffer logging"
27 int "Interval of Network buffer allocation warnings"
31 Interval in seconds of Network buffer allocation warnings which are
32 generated when a buffer cannot immediately be allocated with K_FOREVER
37 bool "Network buffer memory debugging"
45 bool "Network buffer pool usage tracking"
47 Enable network buffer pool tracking. This means that:
53 int "Network buffer alignment restriction"
[all …]
/Zephyr-latest/tests/modules/nanopb/src/
Dmain.c21 uint8_t buffer[SimpleMessage_size]; in ZTEST() local
24 for (size_t i = 0; i < sizeof(msg.buffer); ++i) { in ZTEST()
25 msg.buffer[i] = i; in ZTEST()
28 pb_ostream_t ostream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in ZTEST()
36 pb_istream_t istream = pb_istream_from_buffer(buffer, ostream.bytes_written); in ZTEST()
41 for (size_t i = 0; i < sizeof(msg.buffer); ++i) { in ZTEST()
42 zassert_equal(msg.buffer[i], i); in ZTEST()
48 uint8_t buffer[ComplexMessage_size]; in ZTEST() local
55 pb_ostream_t ostream = pb_ostream_from_buffer(buffer, sizeof(buffer)); in ZTEST()
63 pb_istream_t istream = pb_istream_from_buffer(buffer, ostream.bytes_written); in ZTEST()
[all …]
/Zephyr-latest/soc/nordic/common/
Ddmm.h64 * @brief Preallocate buffer in memory region associated with the specified device node
78 * @brief Prepare a DMA output buffer for the specified device
80 * Allocate an output buffer in memory region that given device can perform DMA transfers from.
82 * Writeback data cache lines associated with output buffer, if needed.
84 * @note Depending on provided user buffer parameters and SoC architecture,
88 * to support transmitting and receiving data to the same buffer.
92 * or @ref dmm_buffer_in_release is called on the same buffer
95 * @param region Memory region associated with device to prepare the buffer for.
96 * @param user_buffer CPU address (virtual if applicable) of the buffer containing data
98 * @param user_length Length of the buffer containing data to be processed by the given device.
[all …]
/Zephyr-latest/include/zephyr/net/prometheus/
Dformatter.h24 * Formats the exposition data collected by the specified collector into the provided buffer.
28 * @param buffer Pointer to the buffer where the formatted exposition data will be stored.
29 * @param buffer_size Size of the buffer.
33 int prometheus_format_exposition(struct prometheus_collector *collector, char *buffer,
39 * Formats the exposition data of one specific metric into the provided buffer.
43 * @param buffer Pointer to the buffer where the formatted exposition data will be stored.
44 * @param buffer_size Size of the buffer.
45 * @param written How many bytes have been written to the buffer.
49 int prometheus_format_one_metric(struct prometheus_metric *metric, char *buffer,
/Zephyr-latest/arch/arm/core/cortex_m/
Dfpu.c17 void z_arm_save_fp_context(struct fpu_ctx_full *buffer) in z_arm_save_fp_context() argument
20 __ASSERT_NO_MSG(buffer != NULL); in z_arm_save_fp_context()
29 :: "r" (buffer->caller_saved), "r" (buffer->callee_saved) : in z_arm_save_fp_context()
32 buffer->fpscr = __get_FPSCR(); in z_arm_save_fp_context()
33 buffer->ctx_saved = true; in z_arm_save_fp_context()
46 void z_arm_restore_fp_context(const struct fpu_ctx_full *buffer) in z_arm_restore_fp_context() argument
49 if (buffer->ctx_saved) { in z_arm_restore_fp_context()
56 __set_FPSCR(buffer->fpscr); in z_arm_restore_fp_context()
61 :: "r" (buffer->caller_saved), "r" (buffer->callee_saved) : in z_arm_restore_fp_context()
/Zephyr-latest/modules/canopennode/
DCO_driver.c92 CO_CANrx_t *buffer; in canopen_rx_callback() local
100 buffer = &CANmodule->rx_array[i]; in canopen_rx_callback()
102 if (buffer->filter_id == -ENOSPC || buffer->pFunct == NULL) { in canopen_rx_callback()
106 if (((frame->id ^ buffer->ident) & buffer->mask) == 0U) { in canopen_rx_callback()
108 if (buffer->rtr && ((frame->flags & CAN_FRAME_RTR) == 0U)) { in canopen_rx_callback()
115 buffer->pFunct(buffer->object, &rxMsg); in canopen_rx_callback()
148 CO_CANtx_t *buffer; in canopen_tx_retry() local
157 buffer = &CANmodule->tx_array[i]; in canopen_tx_retry()
158 if (buffer->bufferFull) { in canopen_tx_retry()
159 frame.id = buffer->ident; in canopen_tx_retry()
[all …]

12345678910>>...92