#include <MIDI_Interfaces/USBMIDI/LowLevel/BulkTX.hpp>
Sends Bulk packets (IN for device mode, OUT for host mode)
Definition at line 12 of file BulkTX.hpp.
Classes | |
struct | Writing |
State for writing outgoing USB-MIDI data. More... | |
Public Types | |
using | MessageType = MessageTypeT |
Public Member Functions | |
void | write (MessageType msg) |
Send a MIDI USB message. | |
void | write (const MessageType *msgs, uint32_t num_msgs) |
Send multiple MIDI USB messages. | |
template<size_t N> | |
void | write (const MessageType(&msgs)[N]) |
Send multiple MIDI USB messages. May block. | |
uint32_t | write_nonblock (const MessageType *msgs, uint32_t num_msgs) |
Send multiple MIDI USB messages without blocking. | |
void | send_now () |
Try sending the buffered data now. | |
bool | is_done () const |
Check if all transfers have completed. | |
Protected Member Functions | |
void | reset (uint16_t packet_size=MaxPacketSize) |
void | start_timeout ()=delete |
Start a timeout (e.g. | |
void | cancel_timeout ()=delete |
Cancel the timeout started by timeout_callback(). | |
void | tx_start (const void *data, uint32_t size)=delete |
Start a USB transfer (from the main program). | |
void | tx_start_timeout (const void *data, uint32_t size)=delete |
Start a USB transfer (from the timeout callback). | |
void | tx_start_isr (const void *data, uint32_t size)=delete |
Start a USB transfer (from the USB interrupt handler). | |
void | timeout_callback () |
void | tx_callback () |
Private Types | |
using | wbuffer_t = typename Writing::Buffer |
Private Member Functions | |
uint32_t | index_of (wbuffer_t *p) const |
wbuffer_t * | other_buf (wbuffer_t *p) |
uint32_t | write_impl (const MessageType *msgs, uint32_t num_msgs) |
Private Attributes | |
struct BulkTX::Writing | writing |
Static Private Attributes | |
static constexpr uint16_t | MaxPacketSize = MaxPacketSizeV |
static constexpr uint16_t | SizeReserved = MaxPacketSize + 1 |
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 |
using MessageType = MessageTypeT |
Definition at line 14 of file BulkTX.hpp.
|
private |
Definition at line 94 of file BulkTX.hpp.
void write | ( | MessageType | msg | ) |
Send a MIDI USB message.
May block.
msg | The 4-byte MIDI USB message to send. |
void write | ( | const MessageType * | msgs, |
uint32_t | num_msgs ) |
Send multiple MIDI USB messages.
May block.
msgs | An array of 4-byte MIDI USB messages to send. |
num_msgs | The number of messages in the array. |
|
inline |
Send multiple MIDI USB messages. May block.
Definition at line 32 of file BulkTX.hpp.
uint32_t write_nonblock | ( | const MessageType * | msgs, |
uint32_t | num_msgs ) |
Send multiple MIDI USB messages without blocking.
msgs | An array of 4-byte MIDI USB messages to send. |
num_msgs | The number of messages in the array. |
void send_now | ( | ) |
Try sending the buffered data now.
Start transmitting the latest packet if possible, even if it isn't full yet. If the latest packet is empty, this function has no effect.
bool is_done | ( | ) | const |
Check if all transfers have completed.
|
protected |
|
protecteddelete |
Start a timeout (e.g.
using a timer interrupt) that later calls timeout_callback().
|
protecteddelete |
Cancel the timeout started by timeout_callback().
|
protecteddelete |
Start a USB transfer (from the main program).
|
protecteddelete |
Start a USB transfer (from the timeout callback).
|
protecteddelete |
Start a USB transfer (from the USB interrupt handler).
|
inlineprivate |
Definition at line 96 of file BulkTX.hpp.
|
inlineprivate |
Definition at line 97 of file BulkTX.hpp.
|
private |
|
protected |
|
protected |
|
staticconstexprprivate |
Definition at line 57 of file BulkTX.hpp.
|
staticconstexprprivate |
Definition at line 58 of file BulkTX.hpp.
|
staticconstexprprivate |
Definition at line 76 of file BulkTX.hpp.
|
staticconstexprprivate |
Definition at line 77 of file BulkTX.hpp.
|
staticconstexprprivate |
Definition at line 78 of file BulkTX.hpp.
|
staticconstexprprivate |
Definition at line 79 of file BulkTX.hpp.
|
staticconstexprprivate |
Definition at line 80 of file BulkTX.hpp.
|
private |