|
embedded-software
reusable software modules for embedded systems
|
#include <buffer.h>
Data Fields | |
| uint16_t | size |
| uint16_t | max_size |
| uint8_t * | front |
| uint8_t * | rear |
| uint8_t * | buffer_start |
| uint8_t * | buffer_end |
| void(* | Callback )(void *buf) |
| void(* | OverwriteCallback )(void) |
data structure to hold the required information for each buffer
| uint8_t* buffer_end |
buffer end location in memory (buffer_start + max_size) >
| uint8_t* buffer_start |
buffer start location in memory >
| void(* Callback)(void *buf) |
Enqueue callback, useful if buffer is used for communications, does not need to be used/set, initializes to 0>
| uint8_t* front |
pointer to first byte in buffer >
| uint16_t max_size |
not used >
| void(* OverwriteCallback)(void) |
| uint8_t* rear |
pointer to last byte in the buffer >
| uint16_t size |
size is the number of items in the buffer >