APM:Libraries
Public Attributes | List of all members
Pulse_buffer Struct Reference

#include <ring_buffer_pulse.h>

Collaboration diagram for Pulse_buffer:
[legend]

Public Attributes

Pulsebuf
 
uint16_t head
 
volatile uint16_t tail
 
uint16_t size
 

Detailed Description

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 element is left free to distinguish empty from full.

Definition at line 34 of file ring_buffer_pulse.h.

Member Data Documentation

◆ buf

Pulse* Pulse_buffer::buf

Buffer items are stored into

Definition at line 35 of file ring_buffer_pulse.h.

Referenced by pb_init(), pb_insert(), and pb_remove().

◆ head

uint16_t Pulse_buffer::head

Index of the next item to remove

Definition at line 36 of file ring_buffer_pulse.h.

Referenced by pb_full_count(), pb_init(), pb_is_empty(), pb_is_full(), pb_remove(), and pb_reset().

◆ size

uint16_t Pulse_buffer::size

Buffer capacity minus one

Definition at line 38 of file ring_buffer_pulse.h.

Referenced by pb_full_count(), pb_init(), pb_insert(), pb_is_full(), and pb_remove().

◆ tail

volatile uint16_t Pulse_buffer::tail

Index where the next item will get inserted

Definition at line 37 of file ring_buffer_pulse.h.

Referenced by pb_full_count(), pb_init(), pb_insert(), pb_is_empty(), pb_is_full(), and pb_reset().


The documentation for this struct was generated from the following file: