16#ifndef _LIB_RING_BUFFER_H_
17#define _LIB_RING_BUFFER_H_
44bool RB_init(
rb_st *ps_rb, uint16_t sizeOfElement_u16, uint16_t noOfElements_u16);
bool RB_init(rb_st *ps_rb, uint16_t sizeOfElement_u16, uint16_t noOfElements_u16)
Intialize the ring buffer.
void RB_clear(rb_st *ps_rb)
Clear the ring buffer.
uint16_t RB_available(rb_st *ps_rb)
Number of bytes available in a ring buffer.
bool RB_read(rb_st *ps_rb, void *pBuffer)
Read data from ring buffer.
void RB_free(rb_st *ps_rb)
Free the memory associated with ring buffer.
uint16_t RB_hasSpace(rb_st *ps_rb)
Check if ring buffer is not full.
bool RB_write(rb_st *ps_rb, void *pBuffer)
Write data to ring buffer.
Ring buffer structure.
Definition: lib_ringBuffer.h:25
uint16_t elemetSize_u16
Definition: lib_ringBuffer.h:29
uint8_t * pBuffer_u8
Definition: lib_ringBuffer.h:32
uint16_t writeCount_u16
Definition: lib_ringBuffer.h:30
uint16_t maxRbElements_u16
Definition: lib_ringBuffer.h:28
uint16_t readCount_u16
Definition: lib_ringBuffer.h:31
uint16_t tail_u16
Definition: lib_ringBuffer.h:27
uint16_t head_u16
Definition: lib_ringBuffer.h:26