PixelKey
NeoPixel USB Key
Loading...
Searching...
No Matches
ring_buffer.h File Reference
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  ring_buffer_t
 Ring buffer control struct. More...
 

Functions

void ring_buffer_init (ring_buffer_t *p_buffer, void *ptr_array, size_t length)
 Initialize a ring buffer. More...
 
void * ring_buffer_peek (ring_buffer_t *p_buffer)
 Gets a pointer to the next element in the buffer without removing it. More...
 
bool ring_buffer_pop (ring_buffer_t *p_buffer, void **p_element)
 Removes an element from the ring buffer. More...
 
bool ring_buffer_push (ring_buffer_t *p_buffer, void *p_element)
 Pushes a value onto the ring buffer. More...
 
bool ring_buffer_is_empty (ring_buffer_t *p_buffer)
 Gets whether or not the ring buffer is empty. More...
 
size_t ring_buffer_count (ring_buffer_t *p_buffer)
 Get the number of elements currently in the ring buffer. More...