FIFO buffer used for both receive and transmit data.
More...
#include <SerialBuffer.h>
|
size_t | getSize () |
|
__forceinline size_t | available () |
| get number of bytes stored in the buffer More...
|
|
__forceinline size_t | getFreeSpace () |
| get number of bytes of space available in this buffer More...
|
|
__forceinline bool | isEmpty () |
|
__forceinline bool | isFull () |
|
__forceinline int | peekChar () |
| see if there's anything in the buffer More...
|
|
__forceinline int | peekLastChar () |
|
__forceinline int | readChar () |
|
__forceinline size_t | writeChar (uint8_t c) |
|
int | find (uint8_t c) |
| find a character in the buffer More...
|
|
size_t | resize (size_t newSize) |
|
void | clear () |
|
__forceinline size_t | getReadData (void *&data) |
| Access data directly within buffer. More...
|
|
__forceinline void | skipRead (size_t length) |
| Skip a number of chars starting at the given read position. More...
|
|
FIFO buffer used for both receive and transmit data.
- Note
- For receive operations, data is written via ISR and read via task For transmit operations, data is written via task and read via ISR Only routines marked with __forceinline or IRAM_ATTR may be called from interrupt context.
__forceinline size_t SerialBuffer::available |
( |
| ) |
|
|
inline |
get number of bytes stored in the buffer
- Return values
-
int SerialBuffer::find |
( |
uint8_t |
c | ) |
|
find a character in the buffer
- Parameters
-
- Return values
-
int | position relative to current read pointer, -1 if character not found |
__forceinline size_t SerialBuffer::getFreeSpace |
( |
| ) |
|
|
inline |
get number of bytes of space available in this buffer
- Return values
-
__forceinline size_t SerialBuffer::getReadData |
( |
void *& |
data | ) |
|
|
inline |
Access data directly within buffer.
- Parameters
-
- Return values
-
size_t | number of chars available |
__forceinline int SerialBuffer::peekChar |
( |
| ) |
|
|
inline |
see if there's anything in the buffer
- Return values
-
int | first available character, or -1 if buffer's empty |
__forceinline void SerialBuffer::skipRead |
( |
size_t |
length | ) |
|
|
inline |
Skip a number of chars starting at the given read position.
- Parameters
-
length | MUST be <= value returned from peek() |
- Note
- Provided for efficient buffer access