#include <SFBByteBuffer.h>
Public Types | |
enum | { BBFLAG_ERRORBITS = PK_OVERRUN|PK_PARITY|PK_FRAMING|PK_BREAK, BBFLAG_OVERFLOW = PK_BUFFER, BBFLAG_ZERO = PK_DELETED|PK_BAD_ESCAPE } |
Public Member Functions | |
SFBRxByteBuffer (u8(&buffer)[BYTE_BUFFER_BYTES]) | |
void | resetBG () |
Called in background to reset an rx buffer. | |
int | fetchByteBG () |
Called in background to fetch next byte from old end of rx buf, if any. | |
void | storeErrorStatusIL (u8 status) |
Called at interrupt level to record some error status that arrived from the hardware. | |
void | storeByteIL (u8 data) |
Called at interrupt level to store a byte at new end of rx buf, if possible. |
An SFBRxByteBuffer promises to BG that its bytesAvailable() will never decrease during IL processing. So if BG observes that bytesAvailable() are large enough to do something (e.g., fetch one byte), BG can then go ahead and perform that action without locking or disabling interrupts.
anonymous enum |
BBFLAG_ERRORBITS | Error bits; H/W detected comms problem(s) if non-zero. |
BBFLAG_OVERFLOW | Error bits; S/W detected buffer overrun or reset if non-zero; data may have been lost. |
BBFLAG_ZERO | These bits will be zero in any error code returned from fetchByteBG. |