![]() |
LUFA Library 110528
|
Lightweight ring buffer, for fast insertion/deletion of bytes. More...
#include "../../Common/Common.h"
Data Structures | |
struct | RingBuffer_t |
Ring Buffer Management Structure. More... | |
Functions | |
static void | RingBuffer_InitBuffer (RingBuffer_t *Buffer, uint8_t *const DataPtr, const uint16_t Size) |
static uint16_t | RingBuffer_GetCount (RingBuffer_t *const Buffer) |
static bool | RingBuffer_IsFull (RingBuffer_t *const Buffer) |
static bool | RingBuffer_IsEmpty (RingBuffer_t *const Buffer) |
static void | RingBuffer_Insert (RingBuffer_t *Buffer, const uint8_t Data) |
static uint8_t | RingBuffer_Remove (RingBuffer_t *Buffer) |
static uint8_t | RingBuffer_Peek (RingBuffer_t *const Buffer) |
Lightweight ring buffer, for fast insertion/deletion. Multiple buffers can be created of different sizes to suit different needs.
Note that for each buffer, insertion and removal operations may occur at the same time (via a multi-threaded ISR based system) however the same kind of operation (two or more insertions or deletions) must not overlap. If there is possibility of two or more of the same kind of operating occurring at the same point in time, atomic (mutex) locking should be used.