#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.
|
| 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 () |
|
| template<class T, size_t N> |
| static constexpr size_t | len (T(&)[N]) |
◆ microseconds
template<uint16_t MaxPacketSize = 512>
◆ MessageType [1/2]
◆ rbuffer_t
◆ MessageType [2/2]
◆ wbuffer_t
◆ 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>
| void rx_callback |
( |
const Transfer_t * | transfer | ) |
|
|
staticprotected |
◆ tx_callback() [1/2]
template<uint16_t MaxPacketSize = 512>
| 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>
| constexpr size_t len |
( |
T(&) | [N] | ) |
|
|
inlinestaticconstexprprivate |
◆ read() [2/2]
Try reading a single message.
- Returns
- Whether a message was available.
◆ reset() [1/2]
◆ rx_callback() [2/2]
◆ write()
Send a MIDI USB message.
May block.
- Parameters
-
| msg | The 4-byte MIDI USB message to send. |
◆ write_nonblock()
| 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()
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()
Check if all transfers have completed.
◆ getWriteError()
| uint32_t getWriteError |
( |
| ) |
const |
|
inlineinherited |
Get the number messages that failed to send.
Definition at line 54 of file BulkTX.hpp.
◆ clearWriteError()
| 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]
◆ wait_connect()
◆ index_of()
◆ other_buf()
◆ write_impl()
| uint32_t write_impl |
( |
const MessageType * | msgs, |
|
|
uint32_t | num_msgs ) |
|
privateinherited |
◆ tx_callback() [2/2]
◆ 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
|
|
staticconstexprprivateinherited |
◆ SizeReserved
|
|
staticconstexprprivateinherited |
◆ NumRxPackets
|
|
staticconstexprprivateinherited |
◆ mo_seq
|
|
staticconstexprprivateinherited |
◆ mo_rel
|
|
staticconstexprprivateinherited |
◆ mo_acq
|
|
staticconstexprprivateinherited |
◆ mo_rlx
|
|
staticconstexprprivateinherited |
◆ mo_acq_rel
| std::memory_order mo_acq_rel |
|
staticconstexprprivateinherited |
◆ reading
◆ writing
◆ disconnected
The documentation for this class was generated from the following file: