#include <MIDI_Interfaces/USBMIDI/Teensy-host/TeensyHostMIDI.hpp>
template<uint16_t MaxPacketSize = 512>
class TeensyHostMIDI< MaxPacketSize >
Teensy USB Host MIDI driver.
Definition at line 16 of file TeensyHostMIDI.hpp.
|
bool | claim (Device_t *device, int type, const uint8_t *descriptors, uint32_t len) override |
|
void | disconnect () override |
|
void | timer_event (USBDriverTimer *whichtimer) override |
|
void | write_start (uint8_t *buffer, uint32_t size) |
|
void | write_start_isr (uint8_t *buffer, uint32_t size) |
|
uint32_t | write_finish (const Transfer_t *transfer) |
|
void | read_start (uint8_t *buffer, uint32_t size) |
|
void | read_start_isr (uint8_t *buffer, uint32_t size) |
|
uint32_t | read_finish (const Transfer_t *transfer) |
|
bool | claim_if_midi (Device_t *device, int type, const uint8_t *descriptors, uint32_t len) |
|
void | init () |
|
void | start_timeout () |
|
void | cancel_timeout () |
|
void | tx_start (const void *data, uint32_t size) |
|
void | tx_start_timeout (const void *data, uint32_t size) |
|
void | tx_start_isr (const void *data, uint32_t size) |
|
void | rx_start (void *data, uint32_t size) |
|
void | rx_start_isr (void *data, uint32_t size) |
|
bool | read (MessageType &message) |
| Try reading a single message.
|
|
void | reset (uint16_t packet_size=MaxPacketSize) |
|
void | rx_callback (uint32_t num_bytes_read) |
|
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.
|
|
uint32_t | getWriteError () const |
| Get the number messages that failed to send.
|
|
uint32_t | clearWriteError () |
| Get and clear the number messages that failed to send.
|
|
void | reset (uint16_t packet_size=MaxPacketSize) |
|
bool | wait_connect () |
|
void | tx_callback () |
|
|
using | rbuffer_t = std::remove_reference_t<decltype(reading.buffers[0])> |
|
using | wbuffer_t = typename Writing::Buffer |
|
|
template<class T , size_t N> |
static constexpr size_t | len (T(&)[N]) |
|
|
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 |
|
◆ microseconds
template<uint16_t MaxPacketSize = 512>
◆ MessageType [1/2]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ rbuffer_t
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
using rbuffer_t = std::remove_reference_t<decltype(reading.buffers[0])> |
|
privateinherited |
◆ MessageType [2/2]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ wbuffer_t
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ TeensyHostMIDI()
template<uint16_t MaxPacketSize = 512>
◆ read() [1/2]
template<uint16_t MaxPacketSize = 512>
Try reading a 4-byte MIDI USB message.
- Returns
- The message or 0x00000000 if no messages available.
Definition at line 28 of file TeensyHostMIDI.hpp.
◆ setTimeout()
template<uint16_t MaxPacketSize = 512>
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.
◆ setErrorTimeout()
template<uint16_t MaxPacketSize = 512>
◆ connectedForWrite()
template<uint16_t MaxPacketSize = 512>
bool connectedForWrite |
( |
| ) |
const |
|
inline |
◆ claim()
template<uint16_t MaxPacketSize = 512>
bool claim |
( |
Device_t * | device, |
|
|
int | type, |
|
|
const uint8_t * | descriptors, |
|
|
uint32_t | len ) |
|
overrideprotected |
◆ disconnect()
template<uint16_t MaxPacketSize = 512>
◆ timer_event()
template<uint16_t MaxPacketSize = 512>
void timer_event |
( |
USBDriverTimer * | whichtimer | ) |
|
|
overrideprotected |
◆ rx_callback() [1/2]
template<uint16_t MaxPacketSize = 512>
static void rx_callback |
( |
const Transfer_t * | transfer | ) |
|
|
staticprotected |
◆ tx_callback() [1/2]
template<uint16_t MaxPacketSize = 512>
static void tx_callback |
( |
const Transfer_t * | transfer | ) |
|
|
staticprotected |
◆ write_start()
template<uint16_t MaxPacketSize = 512>
void write_start |
( |
uint8_t * | buffer, |
|
|
uint32_t | size ) |
|
protected |
◆ write_start_isr()
template<uint16_t MaxPacketSize = 512>
void write_start_isr |
( |
uint8_t * | buffer, |
|
|
uint32_t | size ) |
|
protected |
◆ write_finish()
template<uint16_t MaxPacketSize = 512>
uint32_t write_finish |
( |
const Transfer_t * | transfer | ) |
|
|
protected |
◆ read_start()
template<uint16_t MaxPacketSize = 512>
void read_start |
( |
uint8_t * | buffer, |
|
|
uint32_t | size ) |
|
protected |
◆ read_start_isr()
template<uint16_t MaxPacketSize = 512>
void read_start_isr |
( |
uint8_t * | buffer, |
|
|
uint32_t | size ) |
|
protected |
◆ read_finish()
template<uint16_t MaxPacketSize = 512>
uint32_t read_finish |
( |
const Transfer_t * | transfer | ) |
|
|
protected |
◆ claim_if_midi()
template<uint16_t MaxPacketSize = 512>
bool claim_if_midi |
( |
Device_t * | device, |
|
|
int | type, |
|
|
const uint8_t * | descriptors, |
|
|
uint32_t | len ) |
|
protected |
◆ init()
template<uint16_t MaxPacketSize = 512>
◆ start_timeout()
template<uint16_t MaxPacketSize = 512>
◆ cancel_timeout()
template<uint16_t MaxPacketSize = 512>
◆ tx_start()
template<uint16_t MaxPacketSize = 512>
void tx_start |
( |
const void * | data, |
|
|
uint32_t | size ) |
|
protected |
◆ tx_start_timeout()
template<uint16_t MaxPacketSize = 512>
void tx_start_timeout |
( |
const void * | data, |
|
|
uint32_t | size ) |
|
protected |
◆ tx_start_isr()
template<uint16_t MaxPacketSize = 512>
void tx_start_isr |
( |
const void * | data, |
|
|
uint32_t | size ) |
|
protected |
◆ rx_start()
template<uint16_t MaxPacketSize = 512>
void rx_start |
( |
void * | data, |
|
|
uint32_t | size ) |
|
protected |
◆ rx_start_isr()
template<uint16_t MaxPacketSize = 512>
void rx_start_isr |
( |
void * | data, |
|
|
uint32_t | size ) |
|
protected |
◆ timeout_callback()
template<uint16_t MaxPacketSize = 512>
void timeout_callback |
( |
| ) |
|
|
private |
◆ in_callback()
template<uint16_t MaxPacketSize = 512>
void in_callback |
( |
const Transfer_t * | transfer | ) |
|
|
private |
◆ out_callback()
template<uint16_t MaxPacketSize = 512>
void out_callback |
( |
const Transfer_t * | transfer | ) |
|
|
private |
◆ len()
template<uint16_t MaxPacketSize = 512>
template<class T , size_t N>
static constexpr size_t len |
( |
T(&) | [N] | ) |
|
|
inlinestaticconstexprprivate |
◆ read() [2/2]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
Try reading a single message.
- Returns
- Whether a message was available.
◆ reset() [1/2]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ rx_callback() [2/2]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
void rx_callback |
( |
uint32_t | num_bytes_read | ) |
|
|
protectedinherited |
◆ write() [1/3]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
Send a MIDI USB message.
May block.
- Parameters
-
msg | The 4-byte MIDI USB message to send. |
◆ write() [2/3]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
void write |
( |
const MessageType * | msgs, |
|
|
uint32_t | num_msgs ) |
|
inherited |
Send multiple MIDI USB messages.
May block.
- Parameters
-
msgs | An array of 4-byte MIDI USB messages to send. |
num_msgs | The number of messages in the array. |
◆ write() [3/3]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
template<size_t N>
Send multiple MIDI USB messages. May block.
Definition at line 32 of file BulkTX.hpp.
◆ write_nonblock()
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
uint32_t write_nonblock |
( |
const MessageType * | msgs, |
|
|
uint32_t | num_msgs ) |
|
inherited |
Send multiple MIDI USB messages without blocking.
- Parameters
-
msgs | An array of 4-byte MIDI USB messages to send. |
num_msgs | The number of messages in the array. |
- Returns
- The number of messages that were actually sent.
◆ send_now()
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
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.
◆ is_done()
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
Check if all transfers have completed.
◆ getWriteError()
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
uint32_t getWriteError |
( |
| ) |
const |
|
inlineinherited |
Get the number messages that failed to send.
Definition at line 54 of file BulkTX.hpp.
◆ clearWriteError()
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
uint32_t clearWriteError |
( |
| ) |
|
|
inlineinherited |
Get and clear the number messages that failed to send.
Definition at line 56 of file BulkTX.hpp.
◆ reset() [2/2]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ wait_connect()
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ index_of()
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ other_buf()
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ write_impl()
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
uint32_t write_impl |
( |
const MessageType * | msgs, |
|
|
uint32_t | num_msgs ) |
|
privateinherited |
◆ tx_callback() [2/2]
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ rxpipe
template<uint16_t MaxPacketSize = 512>
◆ txpipe
template<uint16_t MaxPacketSize = 512>
◆ rx_size
template<uint16_t MaxPacketSize = 512>
◆ tx_size
template<uint16_t MaxPacketSize = 512>
◆ rx_ep
template<uint16_t MaxPacketSize = 512>
◆ tx_ep
template<uint16_t MaxPacketSize = 512>
◆ rx_ep_type
template<uint16_t MaxPacketSize = 512>
◆ tx_ep_type
template<uint16_t MaxPacketSize = 512>
◆ mystring_bufs
template<uint16_t MaxPacketSize = 512>
strbuf_t mystring_bufs[1] |
|
private |
◆ write_timeout
template<uint16_t MaxPacketSize = 512>
USBDriverTimer write_timeout {this} |
|
protected |
◆ write_timeout_duration
template<uint16_t MaxPacketSize = 512>
◆ write_error_timeout_duration
template<uint16_t MaxPacketSize = 512>
◆ MaxPacketSize
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr uint16_t MaxPacketSize = MaxPacketSizeV |
|
staticconstexprprivateinherited |
◆ SizeReserved
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
|
staticconstexprprivateinherited |
◆ NumRxPackets
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
|
staticconstexprprivateinherited |
◆ mo_seq
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_seq = std::memory_order_seq_cst |
|
staticconstexprprivateinherited |
◆ mo_rel
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_rel = std::memory_order_release |
|
staticconstexprprivateinherited |
◆ mo_acq
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_acq = std::memory_order_acquire |
|
staticconstexprprivateinherited |
◆ mo_rlx
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_rlx = std::memory_order_relaxed |
|
staticconstexprprivateinherited |
◆ mo_acq_rel
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
constexpr std::memory_order mo_acq_rel = std::memory_order_acq_rel |
|
staticconstexprprivateinherited |
◆ reading
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ writing
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
◆ disconnected
template<class Derived , class MessageTypeT , uint16_t MaxPacketSizeV>
bool disconnected = false |
|
privateinherited |
The documentation for this class was generated from the following file: