Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Static Private Attributes | List of all members
BulkRX< Derived, MessageTypeT, MaxPacketSizeV > Struct Template Reference

#include <MIDI_Interfaces/USBMIDI/LowLevel/BulkRX.hpp>

Detailed Description

template<class Derived, class MessageTypeT, uint16_t MaxPacketSizeV>
struct BulkRX< Derived, MessageTypeT, MaxPacketSizeV >

Receives Bulk packets (OUT for device mode, IN for host mode)

Definition at line 12 of file BulkRX.hpp.

+ Inheritance diagram for BulkRX< Derived, MessageTypeT, MaxPacketSizeV >:
+ Collaboration diagram for BulkRX< Derived, MessageTypeT, MaxPacketSizeV >:

Classes

struct  Reading
 State for reading incoming USB data. More...
 

Public Types

using MessageType = MessageTypeT
 

Public Member Functions

bool read (MessageType &message)
 Try reading a single message.
 

Protected Member Functions

void reset (uint16_t packet_size=MaxPacketSize)
 
void rx_start (void *data, uint32_t size)=delete
 Start a USB transfer (from the main program).
 
void rx_start_isr (void *data, uint32_t size)=delete
 Start a USB transfer (from the USB interrupt handler).
 
void rx_callback (uint32_t num_bytes_read)
 

Private Types

using rbuffer_t = std::remove_reference_t<decltype(reading.buffers[0])>
 

Private Attributes

struct BulkRX::Reading reading
 

Static Private Attributes

static constexpr uint16_t MaxPacketSize = MaxPacketSizeV
 
static constexpr uint16_t SizeReserved = MaxPacketSize + 1
 
static constexpr uint16_t NumRxPackets = MaxPacketSize == 64 ? 16 : 4
 
static constexpr std::memory_order mo_seq = std::memory_order_seq_cst
 
static constexpr std::memory_order mo_rel = std::memory_order_release
 
static constexpr std::memory_order mo_acq = std::memory_order_acquire
 
static constexpr std::memory_order mo_rlx = std::memory_order_relaxed
 
static constexpr std::memory_order mo_acq_rel = std::memory_order_acq_rel
 

Member Typedef Documentation

◆ MessageType

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
using MessageType = MessageTypeT

Definition at line 14 of file BulkRX.hpp.

◆ rbuffer_t

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
using rbuffer_t = std::remove_reference_t<decltype(reading.buffers[0])>
private

Definition at line 56 of file BulkRX.hpp.

Member Function Documentation

◆ read()

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
bool read ( MessageType & message)

Try reading a single message.

Returns
Whether a message was available.

◆ reset()

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
void reset ( uint16_t packet_size = MaxPacketSize)
protected

◆ rx_start()

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
void rx_start ( void * data,
uint32_t size )
protecteddelete

Start a USB transfer (from the main program).

◆ rx_start_isr()

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
void rx_start_isr ( void * data,
uint32_t size )
protecteddelete

Start a USB transfer (from the USB interrupt handler).

◆ rx_callback()

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
void rx_callback ( uint32_t num_bytes_read)
protected

Member Data Documentation

◆ MaxPacketSize

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr uint16_t MaxPacketSize = MaxPacketSizeV
staticconstexprprivate

Definition at line 24 of file BulkRX.hpp.

◆ SizeReserved

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr uint16_t SizeReserved = MaxPacketSize + 1
staticconstexprprivate

Definition at line 25 of file BulkRX.hpp.

◆ NumRxPackets

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr uint16_t NumRxPackets = MaxPacketSize == 64 ? 16 : 4
staticconstexprprivate

Definition at line 26 of file BulkRX.hpp.

◆ mo_seq

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_seq = std::memory_order_seq_cst
staticconstexprprivate

Definition at line 37 of file BulkRX.hpp.

◆ mo_rel

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_rel = std::memory_order_release
staticconstexprprivate

Definition at line 38 of file BulkRX.hpp.

◆ mo_acq

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_acq = std::memory_order_acquire
staticconstexprprivate

Definition at line 39 of file BulkRX.hpp.

◆ mo_rlx

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_rlx = std::memory_order_relaxed
staticconstexprprivate

Definition at line 40 of file BulkRX.hpp.

◆ mo_acq_rel

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_acq_rel = std::memory_order_acq_rel
staticconstexprprivate

Definition at line 41 of file BulkRX.hpp.

◆ reading

template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
struct BulkRX::Reading reading
private

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