DelegateMQ
Loading...
Searching...
No Matches
UartRingBuffer< Size > Class Template Reference

A lightweight, thread-safe (Single Producer / Single Consumer) Ring Buffer. More...

#include <Stm32UartTransport.h>

Public Member Functions

bool Put (uint8_t data)
 Push a byte into the buffer (Called from ISR).
 
bool Get (uint8_t &data)
 Pop a byte from the buffer (Called from Consumer Task).
 
void Clear ()
 

Detailed Description

template<size_t Size>
class UartRingBuffer< Size >

A lightweight, thread-safe (Single Producer / Single Consumer) Ring Buffer.

Template Parameters
SizeThe size of the buffer in bytes. Must be large enough to hold bursts of data (e.g., 1024 bytes) to prevent overrun.

Member Function Documentation

◆ Clear()

template<size_t Size>
void UartRingBuffer< Size >::Clear ( )
inline

◆ Get()

template<size_t Size>
bool UartRingBuffer< Size >::Get ( uint8_t & data)
inline

Pop a byte from the buffer (Called from Consumer Task).

◆ Put()

template<size_t Size>
bool UartRingBuffer< Size >::Put ( uint8_t data)
inline

Push a byte into the buffer (Called from ISR).


The documentation for this class was generated from the following file: