Ring buffer.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include "compiler.h"
Data Structures | |
struct | ring_buffer |
Struct for holding the ring buffer. More... | |
Functions | |
static uint8_t | get_next (uint8_t cur_offset, uint8_t size) |
Function to get the next offset in a ring buffer. More... | |
static uint8_t | ring_buffer_get (struct ring_buffer *ring) |
Function for getting one byte from the ring buffer. More... | |
static uint8_t | ring_buffer_get_next_read (const struct ring_buffer *ring) |
Function to get the next read offset in a ring buffer. More... | |
static uint8_t | ring_buffer_get_next_write (const struct ring_buffer *ring) |
Function to get the next write offset in a ring buffer. More... | |
static struct ring_buffer | ring_buffer_init (uint8_t *buffer, uint8_t size) |
Function for initializing a ring buffer. More... | |
static bool | ring_buffer_is_empty (const struct ring_buffer *ring) |
Function for checking if the ring buffer is empty. More... | |
static bool | ring_buffer_is_full (const struct ring_buffer *ring) |
Function for checking if the ring buffer is full. More... | |
static void | ring_buffer_put (struct ring_buffer *ring, uint8_t data) |
Function for putting a data byte in the ring buffer. More... | |