Go to the documentation of this file.
32 #ifndef __RING_BUFFER_H_
33 #define __RING_BUFFER_H_
57 #define RB_VHEAD(rb) (*(volatile uint32_t *) &(rb)->head)
63 #define RB_VTAIL(rb) (*(volatile uint32_t *) &(rb)->tail)
95 return RingBuff->
count;
int RingBuffer_PopMult(RINGBUFF_T *RingBuff, void *data, int num)
Pop an array of items from the ring buffer.
STATIC INLINE int RingBuffer_GetFree(RINGBUFF_T *RingBuff)
Return number of free items in the ring buffer.
int RingBuffer_InsertMult(RINGBUFF_T *RingBuff, const void *data, int num)
Insert an array of items into ring buffer.
STATIC INLINE int RingBuffer_IsEmpty(RINGBUFF_T *RingBuff)
Return empty status of ring buffer.
STATIC INLINE int RingBuffer_GetSize(RINGBUFF_T *RingBuff)
Return size the ring buffer.
STATIC INLINE int RingBuffer_IsFull(RINGBUFF_T *RingBuff)
Return number of items in the ring buffer.
int RingBuffer_Init(RINGBUFF_T *RingBuff, void *buffer, int itemSize, int count)
Initialize ring buffer.
STATIC INLINE void RingBuffer_Flush(RINGBUFF_T *RingBuff)
Resets the ring buffer to empty.
int RingBuffer_Insert(RINGBUFF_T *RingBuff, const void *data)
Insert a single item into ring buffer.
STATIC INLINE int RingBuffer_GetCount(RINGBUFF_T *RingBuff)
Return number of items in the ring buffer.
int RingBuffer_Pop(RINGBUFF_T *RingBuff, void *data)
Pop an item from the ring buffer.