27 #if !defined(_USBH_MIDI_H_)
31 #define USBH_MIDI_VERSION 600
32 #define MIDI_MAX_ENDPOINTS 3 //endpoint 0, bulk_IN(MIDI), bulk_OUT(MIDI)
33 #define USB_SUBCLASS_MIDISTREAMING 3
34 #define MIDI_EVENT_PACKET_SIZE 64
35 #define MIDI_MAX_SYSEX_SIZE 256
38 const uint8_t
cin2len[] PROGMEM = {0, 0, 2, 3, 3, 1, 2, 3, 3, 3, 3, 3, 2, 2, 3, 1};
39 const uint8_t
sys2cin[] PROGMEM = {0, 2, 3, 2, 0, 0, 5, 0, 0xf, 0, 0xf, 0xf, 0xf, 0, 0xf, 0xf};
48 virtual bool EndpointXtract(uint8_t conf __attribute__((unused)), uint8_t iface __attribute__((unused)), uint8_t alt __attribute__((unused)), uint8_t proto __attribute__((unused)),
const USB_ENDPOINT_DESCRIPTOR *ep __attribute__((unused))) {
58 uint8_t varBuffer[16 ];
60 uint8_t stateParseDescr;
70 bool ParseDescriptor(uint8_t **pp, uint16_t *pcntdn);
74 void Parse(
const uint16_t len,
const uint8_t *pbuf,
const uint16_t &offset);
110 #ifdef DEBUG_USB_HOST
120 uint8_t
RecvData(uint16_t *bytes_rcvd, uint8_t *dataptr);
121 uint8_t
RecvData(uint8_t *outBuf,
bool isRaw=
false);
123 uint8_t
SendData(uint8_t *dataptr, uint8_t nCable=0);
126 uint8_t
SendSysEx(uint8_t *dataptr, uint16_t datasize, uint8_t nCable=0);
129 inline uint8_t
RcvData(uint16_t *bytes_rcvd, uint8_t *dataptr) {
return RecvData(bytes_rcvd, dataptr); };
133 virtual uint8_t
Init(uint8_t parent, uint8_t port,
bool lowspeed);
138 pFuncOnInit = funcOnInit;
141 void (*pFuncOnInit)(void) =
nullptr;
144 #endif //_USBH_MIDI_H_