33 #ifndef ti_drivers_utils_RingBuf__include 34 #define ti_drivers_utils_RingBuf__include 65 void RingBuf_construct(RingBuf_Handle
object,
unsigned char *bufPtr,
size_t bufSize);
89 int RingBuf_get(RingBuf_Handle
object,
unsigned char *data);
141 int RingBuf_getn(RingBuf_Handle
object,
unsigned char *data,
size_t n);
187 int RingBuf_peek(RingBuf_Handle
object,
unsigned char *data);
201 int RingBuf_put(RingBuf_Handle
object,
unsigned char data);
232 int RingBuf_putn(RingBuf_Handle
object,
unsigned char *data,
size_t n);
void RingBuf_construct(RingBuf_Handle object, unsigned char *bufPtr, size_t bufSize)
Initialize circular buffer.
int RingBuf_getn(RingBuf_Handle object, unsigned char *data, size_t n)
Get one or more unsigned chars from the end of the circular buffer and remove them.
int RingBuf_getPointer(RingBuf_Handle object, unsigned char **data)
Get a pointer reference to the next chunk of linear memory available for accessing data in the buffer...
void RingBuf_flush(RingBuf_Handle object)
Flush all the data from the buffer.
static size_t RingBuf_space(RingBuf_Handle object)
Return the number of unsigned characters that the buffer has space for. This function should normally...
Definition: RingBuf.h:262
unsigned char * buffer
Definition: RingBuf.h:46
int RingBuf_put(RingBuf_Handle object, unsigned char data)
Put an unsigned char into the end of the circular buffer.
struct RingBuf_Object * RingBuf_Handle
size_t tail
Definition: RingBuf.h:50
int RingBuf_peek(RingBuf_Handle object, unsigned char *data)
Get an unsigned char from the end of the circular buffer without removing it.
int RingBuf_getMaxCount(RingBuf_Handle object)
A high-water mark indicating the largest number of unsigned chars stored on the circular buffer since...
int RingBuf_get(RingBuf_Handle object, unsigned char *data)
Get an unsigned char from the end of the circular buffer and remove it.
size_t count
Definition: RingBuf.h:48
int RingBuf_getConsume(RingBuf_Handle object, size_t size)
Advance the get index and decrement the buffer count. This function should normally be called from a ...
int RingBuf_getCount(RingBuf_Handle object)
Get the number of unsigned chars currently stored on the circular buffer.
bool RingBuf_isFull(RingBuf_Handle object)
Function to determine if the circular buffer is full or not.
size_t head
Definition: RingBuf.h:49
size_t maxCount
Definition: RingBuf.h:51
int RingBuf_putAdvance(RingBuf_Handle object, size_t size)
Advance the committed put index and increment the buffer count. This function should normally be call...
int RingBuf_putn(RingBuf_Handle object, unsigned char *data, size_t n)
Put one or more unsigned chars into the end of the circular buffer.
int RingBuf_putPointer(RingBuf_Handle object, unsigned char **data)
Get a pointer reference to the next chunk of linear memory available for adding data to the buffer...
size_t length
Definition: RingBuf.h:47