13#ifndef INC_RING_BUFFER_H_
14#define INC_RING_BUFFER_H_
int buffer_get_value(buf_handle_t *p_handle, float *p_sensor_data)
Reads and removes the oldest sample from the buffer (FIFO order).
Definition ring_buffer.c:37
void buffer_init(buf_handle_t *p_handle, float *p_buffer, uint16_t size)
Initialises a ring buffer handle.
Definition ring_buffer.c:11
bool buffer_isFull(buf_handle_t *p_handle)
Checks whether the buffer is full.
Definition ring_buffer.c:20
bool buffer_isEmpty(buf_handle_t *p_handle)
Checks whether the buffer is empty.
Definition ring_buffer.c:32
int buffer_write_value(buf_handle_t *p_handle, float p_sensor_data)
Writes a new sample into the buffer.
Definition ring_buffer.c:48
void buffer_clear(buf_handle_t *p_handle)
Resets the buffer to an empty state without clearing storage memory.
Definition ring_buffer.c:25
Ring buffer control structure.
Definition ring_buffer.h:26
uint16_t size
Definition ring_buffer.h:31
uint16_t tail
Definition ring_buffer.h:29
uint16_t head
Definition ring_buffer.h:28
uint16_t count
Definition ring_buffer.h:30
float * buffer
Definition ring_buffer.h:27