46 void Init(uint8_t* pau8Buffer_, uint16_t u16Size_);
56 bool Read(uint8_t* pu8Data_);
67 uint16_t
Read(uint8_t* pu8Data_, uint16_t u16Len_);
77 bool Write(uint8_t u8Data_);
87 uint16_t
Write(
const uint8_t* pu8Data_, uint16_t u16Len_);
109 bool Claim(uint8_t** pu8Addr_);
120 void Lock(uint8_t* pu8LockAddr_);
Basic data type primatives used throughout the OS.
void Init(uint8_t *pau8Buffer_, uint16_t u16Size_)
Init. Initialize the Streamer object prior to its use, providing a blob of memory for the object to m...
uint8_t * m_pau8Buffer
Pointer to the buffer managed in this object.
void Unlock(void)
Unlock. Reset the lock pointer in the object, allowing a consumer to read any previously unavailable ...
bool Write(uint8_t u8Data_)
Write. Write a byte of data into the stream.
uint16_t m_u16Size
Size of the stream's circular buffer (in bytes)
uint16_t m_u16Avail
Number of bytes free in the stream.
bool Claim(uint8_t **pu8Addr_)
Claim. Claim a byte of data for writing, without actually writing into it. When the writer is ready t...
uint16_t GetAvailable(void)
GetAvailable.
uint16_t m_u16Tail
Current tail index (read from) of the stream.
Single include file given to users of the Mark3 Kernel API.
bool Read(uint8_t *pu8Data_)
Read. Read a byte of data from the stream, if available.
uint16_t m_u16Head
Current head index (write to) of the stream.
uint8_t * m_pu8LockAddr
Address of the lock point in the stream.
bool IsEmpty(void)
IsEmpty.
void Lock(uint8_t *pu8LockAddr_)
Lock. When the lock is set, a client can neither read from, or write to the buffer at the index speci...
bool CanRead(void)
CanRead.
bool CanWrite(void)
CanWrite.
The Streamer class. This class implements a circular byte-buffer with thread and interrupt safe metho...