Lines Matching full:buffer

18  * @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
96 * The SPSC packet buffer implements lightweight unidirectional packet buffer
101 * This structure supports single writer and reader. Data stored in the buffer
113 /** @brief Get buffer capacity.
119 * @param pb A buffer.
121 * @return Packet buffer capacity.
129 * @brief Initialize the packet buffer.
131 * This function initializes the packet buffer on top of a dedicated
134 * @param buf Pointer to a memory region on which buffer is
138 * @param blen Length of the buffer. Must be large enough to
143 * @retval struct spsc_pbuf* Pointer to the created buffer. The pointer
145 * @retval NULL Invalid buffer alignment.
150 * @brief Write specified amount of data to the packet buffer.
154 * @param pb A buffer to which to write.
155 * @param buf Pointer to the data to be written to the buffer.
156 * @param len Number of bytes to be written to the buffer. Must be positive
160 * -ENOMEM, if len is bigger than the buffer can fit.
165 * @brief Allocate space in the packet buffer.
168 * the packet buffer. An internal padding is added at the end of the buffer, if
170 * change the state of the buffer so if after allocation packet is not needed
173 * Allocated buffer must be committed (@ref spsc_pbuf_commit) to make the packet
176 * Packet buffer ensures that allocated buffers are 32 bit word aligned.
181 * @param[in] pb A buffer to which to write.
186 * buffer without applying wrap padding is performed.
187 * @param[out] buf Location where buffer address is written on successful allocation.
195 * @brief Commit packet to the buffer.
200 * @param pb A buffer to which to write.
206 * @brief Read specified amount of data from the packet buffer.
213 * @param pb A buffer from which data will be read.
216 * @param len Number of bytes to be read from the buffer.
225 * @brief Claim packet from the buffer.
227 * It claims a single packet from the buffer in the order of the commitment
229 * The returned buffer is 32 bit word aligned and points to the continuous memory.
234 * @param[in] pb A buffer from which packet will be claimed.
238 * @retval 0 No packets in the buffer.
244 * @brief Free the packet to the buffer.
248 * @param pb A packet buffer from which packet was claimed.
254 * @brief Get maximum utilization of the packet buffer.
256 * Function can be used to tune the buffer size. Feature is enabled by
259 * @param pb A packet buffer.