FIFO buffer used for both receive and transmit data.
More...
#include <SerialBuffer.h>
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.
◆ ~SerialBuffer()
| SerialBuffer::~SerialBuffer |
( |
| ) |
|
|
inline |
◆ available()
| size_t SerialBuffer::available |
( |
| ) |
|
|
inline |
get number of bytes stored in the buffer
- Return values
-
◆ clear()
| void SerialBuffer::clear |
( |
void |
| ) |
|
|
inline |
◆ find()
| 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 |
◆ getFreeSpace()
| size_t SerialBuffer::getFreeSpace |
( |
| ) |
|
|
inline |
get number of bytes of space available in this buffer
- Return values
-
◆ getReadData()
| size_t SerialBuffer::getReadData |
( |
void *& |
data | ) |
|
|
inline |
Access data directly within buffer.
- Parameters
-
- Return values
-
| size_t | number of chars available |
◆ getSize()
| size_t SerialBuffer::getSize |
( |
| ) |
|
|
inline |
◆ isEmpty()
| bool SerialBuffer::isEmpty |
( |
| ) |
|
|
inline |
◆ isFull()
| bool SerialBuffer::isFull |
( |
| ) |
|
|
inline |
◆ peekChar()
| int SerialBuffer::peekChar |
( |
| ) |
|
|
inline |
see if there's anything in the buffer
- Return values
-
| int | first available character, or -1 if buffer's empty |
◆ peekLastChar()
| int SerialBuffer::peekLastChar |
( |
| ) |
|
|
inline |
◆ readChar()
| int SerialBuffer::readChar |
( |
| ) |
|
|
inline |
◆ resize()
| size_t SerialBuffer::resize |
( |
size_t |
newSize | ) |
|
◆ skipRead()
| 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
◆ writeChar()
| size_t SerialBuffer::writeChar |
( |
uint8_t |
c | ) |
|
|
inline |
The documentation for this struct was generated from the following file: