LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ring_buffer.h File Reference
#include "lpc_types.h"

Go to the source code of this file.

Data Structures

struct  RINGBUFF_T
 Ring buffer structure. More...
 

Functions

void RingBuffer_Init (RINGBUFF_T *RingBuff, void *buffer, int itemSize, int count)
 Initialize ring buffer.
 
STATIC INLINE int RingBuffer_GetCount (RINGBUFF_T *RingBuff)
 Return number of items in the ring buffer.
 
STATIC INLINE bool RingBuffer_IsFull (RINGBUFF_T *RingBuff)
 Return number of items in the ring buffer.
 
STATIC INLINE bool RingBuffer_IsEmpty (RINGBUFF_T *RingBuff)
 Return empty status of ring buffer.
 
bool RingBuffer_Insert8 (RINGBUFF_T *RingBuff, uint8_t data8)
 Insert 8-bit value in ring buffer.
 
bool RingBuffer_Insert16 (RINGBUFF_T *RingBuff, uint16_t data16)
 Insert 16-bit value in ring buffer.
 
bool RingBuffer_Insert32 (RINGBUFF_T *RingBuff, uint32_t data32)
 Insert 32-bit value in ring buffer.
 
bool RingBuffer_Pop8 (RINGBUFF_T *RingBuff, uint8_t *data8)
 Pop a 8-bit value from the ring buffer.
 
bool RingBuffer_Pop16 (RINGBUFF_T *RingBuff, uint16_t *data16)
 Pop a 16-bit value from the ring buffer.
 
bool RingBuffer_Pop32 (RINGBUFF_T *RingBuff, uint32_t *data32)
 Pop a 32-bit value from the ring buffer.