6#include <Settings/NamespaceSettings.hpp>
11template <
class Derived,
class MessageTypeT, u
int16_t MaxPacketSizeV>
32 void rx_start(
void *data, uint32_t size) =
delete;
37 constexpr static std::memory_order
mo_seq = std::memory_order_seq_cst;
38 constexpr static std::memory_order
mo_rel = std::memory_order_release;
39 constexpr static std::memory_order
mo_acq = std::memory_order_acquire;
40 constexpr static std::memory_order
mo_rlx = std::memory_order_relaxed;
41 constexpr static std::memory_order
mo_acq_rel = std::memory_order_acq_rel;
#define BEGIN_CS_NAMESPACE
Wrapper that provides atomic access to variables shared between the main program and interrupt handle...
uint8_t buffer[MaxPacketSize]
State for reading incoming USB data.
struct BulkRX::Reading::Buffer buffers[NumRxPackets]
interrupt_atomic< uint32_t > available
interrupt_atomic< bool > reading
interrupt_atomic< uint32_t > write_idx
Receives Bulk packets (OUT for device mode, IN for host mode)
static constexpr std::memory_order mo_seq
struct BulkRX::Reading reading
static constexpr std::memory_order mo_acq
void rx_start_isr(void *data, uint32_t size)=delete
Start a USB transfer (from the USB interrupt handler).
static constexpr std::memory_order mo_rlx
void rx_callback(uint32_t num_bytes_read)
std::remove_reference_t< decltype(reading.buffers[0])> rbuffer_t
static constexpr std::memory_order mo_acq_rel
bool read(MessageType &message)
Try reading a single message.
static constexpr uint16_t MaxPacketSize
void reset(uint16_t packet_size=MaxPacketSize)
void rx_start(void *data, uint32_t size)=delete
Start a USB transfer (from the main program).
static constexpr uint16_t SizeReserved
static constexpr uint16_t NumRxPackets
static constexpr std::memory_order mo_rel