APM:Libraries
|
#include <ring_buffer.h>
Public Attributes | |
volatile uint8_t * | buf |
uint16_t | head |
uint16_t | tail |
uint16_t | size |
Ring buffer type.
The buffer is empty when head == tail.
The buffer is full when the head is one byte in front of the tail, modulo buffer length.
One byte is left free to distinguish empty from full.
Definition at line 49 of file ring_buffer.h.
volatile uint8_t* ring_buffer::buf |
Buffer items are stored into
Definition at line 50 of file ring_buffer.h.
Referenced by rb_init(), rb_insert(), and rb_remove().
uint16_t ring_buffer::head |
Index of the next item to remove
Definition at line 51 of file ring_buffer.h.
Referenced by rb_full_count(), rb_init(), rb_is_empty(), rb_is_full(), rb_remove(), and rb_reset().
uint16_t ring_buffer::size |
Buffer capacity minus one
Definition at line 53 of file ring_buffer.h.
Referenced by rb_full_count(), rb_init(), rb_insert(), rb_is_full(), and rb_remove().
uint16_t ring_buffer::tail |
Index where the next item will get inserted
Definition at line 52 of file ring_buffer.h.
Referenced by rb_full_count(), rb_init(), rb_insert(), rb_is_empty(), rb_is_full(), and rb_reset().