#include <MIDI_Interfaces/USBMIDI/mbed/PluggableUSBMIDI.hpp>
Definition at line 18 of file PluggableUSBMIDI.hpp.
Public Types | |
| using | setup_packet_t = USBDevice::setup_packet_t |
| using | DeviceState = USBDevice::DeviceState |
| using | microseconds = std::chrono::microseconds |
Public Member Functions | |
| PluggableUSBMIDI () | |
| ~PluggableUSBMIDI () | |
| bool | connected () const |
| Check if this class is connected and ready. | |
| bool | connectedForWrite () const |
| 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) |
Protected Types | |
| using | MessageType |
| using | MessageType |
Protected Member Functions | |
| void | init (EndpointResolver &resolver) override |
| void | callback_state_change (DeviceState new_state) override |
| uint32_t | callback_request (const setup_packet_t *setup, USBDevice::RequestResult *result, uint8_t **data) override |
| bool | callback_request_xfer_done (const setup_packet_t *setup, bool aborted) override |
| bool | callback_set_configuration (uint8_t configuration) override |
| void | callback_set_interface (uint16_t interface, uint8_t alternate) override |
| const uint8_t * | string_iinterface_desc () override |
| const uint8_t * | configuration_desc (uint8_t index) override |
| uint8_t | getProductVersion () override |
| void | timeout_callback () |
| void | in_callback () |
| void | out_callback () |
| 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 () |
Protected Attributes | |
| interrupt_atomic< bool > | usb_connected {false} |
| microseconds | timeout_duration {1'000} |
| microseconds | error_timeout_duration {40'000} |
| mbed::Timeout | timeout |
| usb_ep_t | bulk_in_ep |
| usb_ep_t | bulk_out_ep |
| uint8_t | config_descriptor [0x65] |
Private Types | |
| using | rbuffer_t |
| using | wbuffer_t |
Private Member Functions | |
| 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) |
| 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 | |
| static constexpr uint32_t | get_packet_size () |
Private Attributes | |
| struct BulkRX::Reading | reading |
| struct BulkTX::Writing | writing |
| bool | disconnected |
Static Private Attributes | |
| static constexpr uint16_t | MaxPacketSize |
| static constexpr uint16_t | SizeReserved |
| static constexpr uint16_t | NumRxPackets |
| static constexpr std::memory_order | mo_seq |
| static constexpr std::memory_order | mo_rel |
| static constexpr std::memory_order | mo_acq |
| static constexpr std::memory_order | mo_rlx |
| static constexpr std::memory_order | mo_acq_rel |
| using setup_packet_t = USBDevice::setup_packet_t |
Definition at line 26 of file PluggableUSBMIDI.hpp.
| using DeviceState = USBDevice::DeviceState |
Definition at line 27 of file PluggableUSBMIDI.hpp.
| using microseconds = std::chrono::microseconds |
Definition at line 28 of file PluggableUSBMIDI.hpp.
|
inherited |
Definition at line 14 of file BulkRX.hpp.
|
privateinherited |
Definition at line 56 of file BulkRX.hpp.
|
inherited |
Definition at line 14 of file BulkTX.hpp.
|
privateinherited |
Definition at line 101 of file BulkTX.hpp.
| PluggableUSBMIDI | ( | ) |
| ~PluggableUSBMIDI | ( | ) |
|
inlinestaticconstexprprivate |
Definition at line 34 of file PluggableUSBMIDI.hpp.
|
inlineprivate |
Definition at line 36 of file PluggableUSBMIDI.hpp.
|
inlineprivate |
Definition at line 40 of file PluggableUSBMIDI.hpp.
|
inlineprivate |
Definition at line 41 of file PluggableUSBMIDI.hpp.
|
inlineprivate |
Definition at line 45 of file PluggableUSBMIDI.hpp.
|
inlineprivate |
Definition at line 48 of file PluggableUSBMIDI.hpp.
|
inlineprivate |
Definition at line 49 of file PluggableUSBMIDI.hpp.
|
inlineprivate |
Definition at line 52 of file PluggableUSBMIDI.hpp.
| bool connected | ( | ) | const |
Check if this class is connected and ready.
|
inline |
Definition at line 57 of file PluggableUSBMIDI.hpp.
|
inline |
Try reading a 4-byte MIDI USB message.
Definition at line 62 of file PluggableUSBMIDI.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 78 of file PluggableUSBMIDI.hpp.
|
inline |
Definition at line 80 of file PluggableUSBMIDI.hpp.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
inlineoverrideprotected |
Definition at line 97 of file PluggableUSBMIDI.hpp.
|
inlineprotected |
Definition at line 110 of file PluggableUSBMIDI.hpp.
|
inlineprotected |
Definition at line 113 of file PluggableUSBMIDI.hpp.
|
inlineprotected |
Definition at line 118 of file PluggableUSBMIDI.hpp.
|
inherited |
Try reading a single message.
|
protectedinherited |
|
protectedinherited |
|
inherited |
Send a MIDI USB message.
May block.
| msg | The 4-byte MIDI USB message to send. |
|
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. |
|
inherited |
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 |
|
inlineprivateinherited |
Definition at line 104 of file BulkTX.hpp.
Definition at line 105 of file BulkTX.hpp.
|
privateinherited |
|
protectedinherited |
|
protected |
Definition at line 100 of file PluggableUSBMIDI.hpp.
|
protected |
Definition at line 101 of file PluggableUSBMIDI.hpp.
|
protected |
Definition at line 102 of file PluggableUSBMIDI.hpp.
|
protected |
Definition at line 103 of file PluggableUSBMIDI.hpp.
|
protected |
Definition at line 105 of file PluggableUSBMIDI.hpp.
|
protected |
Definition at line 106 of file PluggableUSBMIDI.hpp.
|
protected |
Definition at line 107 of file PluggableUSBMIDI.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 |
|
privateinherited |
Definition at line 102 of file BulkTX.hpp.