#include <MIDI_Interfaces/USBMIDI/Teensy-host/TeensyHostMIDI.hpp>
Teensy USB Host MIDI driver.
Definition at line 16 of file TeensyHostMIDI.hpp.
Public Types | |
using | microseconds = std::chrono::microseconds |
Public Member Functions | |
TeensyHostMIDI (USBHost &) | |
uint32_t | read () |
Try reading a 4-byte MIDI USB message. | |
void | setTimeout (microseconds timeout) |
Set the timeout, the number of microseconds to buffer the outgoing MIDI messages. | |
void | setErrorTimeout (microseconds timeout) |
bool | connectedForWrite () const |
Protected Types | |
using | MessageType = MessageTypeT |
using | MessageType = MessageTypeT |
Static Protected Member Functions | |
static void | rx_callback (const Transfer_t *transfer) |
static void | tx_callback (const Transfer_t *transfer) |
Protected Attributes | |
USBDriverTimer | write_timeout {this} |
microseconds | write_timeout_duration {1'000} |
microseconds | write_error_timeout_duration {40'000} |
Private Types | |
using | rbuffer_t = std::remove_reference_t<decltype(reading.buffers[0])> |
using | wbuffer_t = typename Writing::Buffer |
Private Member Functions | |
void | timeout_callback () |
void | in_callback (const Transfer_t *transfer) |
void | out_callback (const Transfer_t *transfer) |
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) |
Static Private Member Functions | |
template<class T , size_t N> | |
static constexpr size_t | len (T(&)[N]) |
Private Attributes | |
Pipe_t * | rxpipe |
Pipe_t * | txpipe |
uint16_t | rx_size |
uint16_t | tx_size |
uint8_t | rx_ep |
uint8_t | tx_ep |
uint8_t | rx_ep_type |
uint8_t | tx_ep_type |
strbuf_t | mystring_bufs [1] |
struct BulkRX::Reading | reading |
struct BulkTX::Writing | writing |
bool | disconnected = false |
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 |
using microseconds = std::chrono::microseconds |
Definition at line 23 of file TeensyHostMIDI.hpp.
|
inherited |
Definition at line 14 of file BulkRX.hpp.
Definition at line 56 of file BulkRX.hpp.
|
inherited |
Definition at line 14 of file BulkTX.hpp.
Definition at line 101 of file BulkTX.hpp.
|
inline |
Definition at line 21 of file TeensyHostMIDI.hpp.
Try reading a 4-byte MIDI USB message.
Definition at line 28 of file TeensyHostMIDI.hpp.
|
inline |
Set the timeout, the number of microseconds to buffer the outgoing MIDI messages.
A shorter timeout usually results in lower latency, but also causes more overhead, because more packets might be required.
Definition at line 44 of file TeensyHostMIDI.hpp.
|
inline |
Definition at line 46 of file TeensyHostMIDI.hpp.
Definition at line 50 of file TeensyHostMIDI.hpp.
|
overrideprotected |
|
overrideprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
private |
|
inlinestaticconstexprprivate |
Definition at line 111 of file TeensyHostMIDI.hpp.
|
inherited |
Try reading a single message.
|
protectedinherited |
|
inherited |
Send a MIDI USB message.
May block.
msg | The 4-byte MIDI USB message to send. |
|
inherited |
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. |
|
inlineinherited |
Send multiple MIDI USB messages. May block.
Definition at line 32 of file BulkTX.hpp.
|
inherited |
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. |
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.
|
inherited |
Check if all transfers have completed.
|
inlineinherited |
Get the number messages that failed to send.
Definition at line 54 of file BulkTX.hpp.
|
inlineinherited |
Get and clear the number messages that failed to send.
Definition at line 56 of file BulkTX.hpp.
|
protectedinherited |
|
protectedinherited |
Definition at line 104 of file BulkTX.hpp.
Definition at line 105 of file BulkTX.hpp.
|
privateinherited |
|
protectedinherited |
Definition at line 79 of file TeensyHostMIDI.hpp.
Definition at line 79 of file TeensyHostMIDI.hpp.
Definition at line 80 of file TeensyHostMIDI.hpp.
Definition at line 80 of file TeensyHostMIDI.hpp.
Definition at line 81 of file TeensyHostMIDI.hpp.
Definition at line 81 of file TeensyHostMIDI.hpp.
Definition at line 82 of file TeensyHostMIDI.hpp.
Definition at line 82 of file TeensyHostMIDI.hpp.
Definition at line 85 of file TeensyHostMIDI.hpp.
|
protected |
Definition at line 95 of file TeensyHostMIDI.hpp.
|
protected |
Definition at line 96 of file TeensyHostMIDI.hpp.
|
protected |
Definition at line 97 of file TeensyHostMIDI.hpp.
|
staticconstexprprivateinherited |
Definition at line 24 of file BulkRX.hpp.
|
staticconstexprprivateinherited |
Definition at line 25 of file BulkRX.hpp.
|
staticconstexprprivateinherited |
Definition at line 26 of file BulkRX.hpp.
|
staticconstexprprivateinherited |
Definition at line 37 of file BulkRX.hpp.
|
staticconstexprprivateinherited |
Definition at line 38 of file BulkRX.hpp.
|
staticconstexprprivateinherited |
Definition at line 39 of file BulkRX.hpp.
|
staticconstexprprivateinherited |
Definition at line 40 of file BulkRX.hpp.
|
staticconstexprprivateinherited |
Definition at line 41 of file BulkRX.hpp.
|
privateinherited |
|
privateinherited |
Definition at line 102 of file BulkTX.hpp.