FIFO buffer storage using linked pool buffers.
More...
#include <buffers.h>
|
| uint16_t | SpaceAvail () |
| | Get number of bytes available for writing.
|
| |
| uint16_t | SpaceUsed () |
| | Get number of bytes currently stored.
|
| |
| int | ReadData (puint8_t pCopyTo, int max_bytes) |
| | Read data from the buffer.
|
| |
| uint8_t | PeekData (int idx=-1) |
| | Peek at data without removing it.
|
| |
| int | WriteData (puint8_t pCopyFrom, int num_bytes) |
| | Write data to the buffer.
|
| |
| PeekIterator | Peek_Begin () |
| | Get iterator for beginning of buffered data.
|
| |
| PeekIterator | Peek_End () |
| | Get iterator for end of buffered data.
|
| |
| BOOL | Empty () |
| | Check if buffer is empty.
|
| |
| BOOL | Full () |
| | Check if buffer is full.
|
| |
| | fifo_buffer_storage (uint8_t max_buffers=0, uint8_t use_fromisr=1, uint8_t use_fast_buffs=1) |
| | Constructor.
|
| |
|
| ~fifo_buffer_storage () |
| | Destructor - frees all allocated buffers.
|
| |
| void | Reset (uint8_t max_buffers) |
| | Reset buffer storage and free all data.
|
| |
FIFO buffer storage using linked pool buffers.
Manages a FIFO queue of data using a chain of pool_buffer structures. Provides stream-like read/write operations with automatic buffer allocation and deallocation. Used for serial ports and network I/O buffering.
◆ fifo_buffer_storage()
| fifo_buffer_storage::fifo_buffer_storage |
( |
uint8_t | max_buffers = 0, |
|
|
uint8_t | use_fromisr = 1, |
|
|
uint8_t | use_fast_buffs = 1 ) |
Constructor.
- Parameters
-
| max_buffers | Maximum number of buffers to use |
| use_fromisr | Enable ISR-safe operation |
| use_fast_buffs | Prefer fast buffer pool |
◆ Empty()
| BOOL fifo_buffer_storage::Empty |
( |
| ) |
|
Check if buffer is empty.
- Returns
- TRUE if no data is stored
◆ Full()
| BOOL fifo_buffer_storage::Full |
( |
| ) |
|
Check if buffer is full.
- Returns
- TRUE if no more data can be stored
◆ Peek_Begin()
Get iterator for beginning of buffered data.
- Returns
- Iterator positioned at start of data
◆ Peek_End()
Get iterator for end of buffered data.
- Returns
- Iterator positioned after last byte
◆ PeekData()
| uint8_t fifo_buffer_storage::PeekData |
( |
int | idx = -1 | ) |
|
Peek at data without removing it.
- Parameters
-
| idx | Byte index to peek at (-1 for next byte) |
- Returns
- Byte value at specified position
◆ ReadData()
| int fifo_buffer_storage::ReadData |
( |
puint8_t | pCopyTo, |
|
|
int | max_bytes ) |
Read data from the buffer.
- Parameters
-
| pCopyTo | Destination buffer |
| max_bytes | Maximum bytes to read |
- Returns
- Number of bytes actually read
◆ Reset()
| void fifo_buffer_storage::Reset |
( |
uint8_t | max_buffers | ) |
|
Reset buffer storage and free all data.
- Parameters
-
| max_buffers | New maximum buffer count |
◆ SpaceAvail()
| uint16_t fifo_buffer_storage::SpaceAvail |
( |
| ) |
|
Get number of bytes available for writing.
- Returns
- Available space in bytes
◆ SpaceUsed()
| uint16_t fifo_buffer_storage::SpaceUsed |
( |
| ) |
|
Get number of bytes currently stored.
- Returns
- Used space in bytes
◆ WriteData()
| int fifo_buffer_storage::WriteData |
( |
puint8_t | pCopyFrom, |
|
|
int | num_bytes ) |
Write data to the buffer.
- Parameters
-
| pCopyFrom | Source data buffer |
| num_bytes | Number of bytes to write |
- Returns
- Number of bytes actually written
The documentation for this class was generated from the following file: