GPS Device
Loading...
Searching...
No Matches
CBUF_HANDLE_ts Struct Reference

Handle representing a circular buffer instance. More...

#include <cbuf.h>

Public Attributes

uint8_t * ptr
uint8_t size
uint8_t read_position
uint8_t write_position

Detailed Description

Handle representing a circular buffer instance.

This structure holds all state for a single circular buffer. The caller is responsible for allocating the backing array and setting ptr and size before first use.

Note
size must be a power of two. The maximum usable capacity is size - 1 bytes; one slot is reserved to distinguish full from empty.

Definition at line 60 of file cbuf.h.

Member Data Documentation

◆ ptr

uint8_t* CBUF_HANDLE_ts::ptr

Pointer to the backing byte array. Must be size bytes long.

Definition at line 62 of file cbuf.h.

◆ size

uint8_t CBUF_HANDLE_ts::size

Total size of the backing array in bytes. Must be a power of two.

Definition at line 65 of file cbuf.h.

◆ read_position

uint8_t CBUF_HANDLE_ts::read_position

Index of the next byte to be read.

Definition at line 68 of file cbuf.h.

◆ write_position

uint8_t CBUF_HANDLE_ts::write_position

Index of the next byte to be written.

Definition at line 71 of file cbuf.h.


The documentation for this struct was generated from the following file: