Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pbuf.h File Reference
#include <zephyr/cache.h>
#include <zephyr/devicetree.h>

Go to the source code of this file.

Data Structures

struct  pbuf_cfg
 Control block of packet buffer. More...
 
struct  pbuf_data
 Data block of the packed buffer. More...
 
struct  pbuf
 Scure packed buffer. More...
 

Macros

#define PBUF_PACKET_LEN_SZ   sizeof(uint32_t)
 Size of packet length field.
 
#define PBUF_CFG_INIT(mem_addr, size, dcache_align)
 Macro for configuration initialization.
 
#define PBUF_HEADER_OVERHEAD(dcache_align)    (MAX(dcache_align, _PBUF_IDX_SIZE) + _PBUF_IDX_SIZE)
 Macro calculates memory overhead taken by the header in shared memory.
 
#define PBUF_DEFINE(name, mem_addr, size, dcache_align)
 Statically define and initialize pbuf.
 

Functions

int pbuf_init (struct pbuf *pb)
 Initialize the packet buffer.
 
int pbuf_write (struct pbuf *pb, const char *buf, uint16_t len)
 Write specified amount of data to the packet buffer.
 
int pbuf_read (struct pbuf *pb, char *buf, uint16_t len)
 Read specified amount of data from the packet buffer.