Data Structures | |
struct | USB_ClassInfo_MIDI_Host_t |
Enumerations | |
enum | MIDIHost_EnumerationFailure_ErrorCodes_t { MIDI_ENUMERROR_NoError = 0, MIDI_ENUMERROR_InvalidConfigDescriptor = 1, MIDI_ENUMERROR_NoStreamingInterfaceFound = 2, MIDI_ENUMERROR_EndpointsNotFound = 3 } |
Functions | |
void | MIDI_Host_USBTask (USB_ClassInfo_MIDI_Host_t *const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) |
uint8_t | MIDI_Host_ConfigurePipes (USB_ClassInfo_MIDI_Host_t *const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize, void *DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3) |
uint8_t | MIDI_Host_SendEventPacket (USB_ClassInfo_MIDI_Host_t *const MIDIInterfaceInfo, MIDI_EventPacket_t *const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) |
bool | MIDI_Host_ReceiveEventPacket (USB_ClassInfo_MIDI_Host_t *const MIDIInterfaceInfo, MIDI_EventPacket_t *const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) |
The following files must be built with any user project that uses this module:
Host Mode USB Class driver framework interface, for the MIDI USB Class driver.
Enum for the possible error codes returned by the MIDI_Host_ConfigurePipes() function.
uint8_t MIDI_Host_ConfigurePipes | ( | USB_ClassInfo_MIDI_Host_t *const | MIDIInterfaceInfo, | |
uint16_t | ConfigDescriptorSize, | |||
void * | DeviceConfigDescriptor | |||
) |
Host interface configuration routine, to configure a given MIDI host interface instance using the Configuration Descriptor read from an attached USB device. This function automatically updates the given MIDI Host instance's state values and configures the pipes required to communicate with the interface if it is found within the device. This should be called once after the stack has enumerated the attached device, while the host state machine is in the Addressed state.
[in,out] | MIDIInterfaceInfo | Pointer to a structure containing an MIDI Class host configuration and state |
[in] | ConfigDescriptorSize | Length of the attached device's Configuration Descriptor |
[in] | DeviceConfigDescriptor | Pointer to a buffer containing the attached device's Configuration Descriptor |
bool MIDI_Host_ReceiveEventPacket | ( | USB_ClassInfo_MIDI_Host_t *const | MIDIInterfaceInfo, | |
MIDI_EventPacket_t *const | Event | |||
) |
Receives a MIDI event packet from the device.
[in,out] | MIDIInterfaceInfo | Pointer to a structure containing a MIDI Class configuration and state |
[out] | Event | Pointer to a USB_MIDI_EventPacket_t structure where the received MIDI event is to be placed |
uint8_t MIDI_Host_SendEventPacket | ( | USB_ClassInfo_MIDI_Host_t *const | MIDIInterfaceInfo, | |
MIDI_EventPacket_t *const | Event | |||
) |
Sends a MIDI event packet to the device. If no device is connected, the event packet is discarded.
[in,out] | MIDIInterfaceInfo | Pointer to a structure containing a MIDI Class configuration and state |
[in] | Event | Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send |
void MIDI_Host_USBTask | ( | USB_ClassInfo_MIDI_Host_t *const | MIDIInterfaceInfo | ) |
General management task for a given MIDI host class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask().
[in,out] | MIDIInterfaceInfo | Pointer to a structure containing an MIDI Class host configuration and state |