From e528087ee539fda2f13795d4a6c03403faef44d5 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 20 Aug 2015 00:42:08 -0400 Subject: midi --- protocol/lufa/descriptor.c | 158 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) (limited to 'protocol/lufa/descriptor.c') diff --git a/protocol/lufa/descriptor.c b/protocol/lufa/descriptor.c index c13a81bda8..6eedd57000 100644 --- a/protocol/lufa/descriptor.c +++ b/protocol/lufa/descriptor.c @@ -486,6 +486,164 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .PollingIntervalMS = 0x01 }, #endif + + .Audio_ControlInterface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = (NKRO_INTERFACE + 1), + .AlternateSetting = 0, + + .TotalEndpoints = 0, + + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_ControlSubclass, + .Protocol = AUDIO_CSCP_ControlProtocol, + + .InterfaceStrIndex = NO_DESCRIPTOR + }, + + .Audio_ControlInterface_SPC = + { + .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_Header, + + .ACSpecification = VERSION_BCD(1,1,1), + .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t), + + .InCollection = 1, + .InterfaceNumber = (NKRO_INTERFACE + 2), + }, + + .Audio_StreamInterface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + + .InterfaceNumber = (NKRO_INTERFACE + 2), + .AlternateSetting = 0, + + .TotalEndpoints = 2, + + .Class = AUDIO_CSCP_AudioClass, + .SubClass = AUDIO_CSCP_MIDIStreamingSubclass, + .Protocol = AUDIO_CSCP_StreamingProtocol, + + .InterfaceStrIndex = NO_DESCRIPTOR + }, + + .Audio_StreamInterface_SPC = + { + .Header = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_General, + + .AudioSpecification = VERSION_BCD(1,1,1), + + .TotalLength = (sizeof(USB_Descriptor_Configuration_t) - + offsetof(USB_Descriptor_Configuration_t, Audio_StreamInterface_SPC)) + }, + + .MIDI_In_Jack_Emb = + { + .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, + + .JackType = MIDI_JACKTYPE_Embedded, + .JackID = 0x01, + + .JackStrIndex = NO_DESCRIPTOR + }, + + .MIDI_In_Jack_Ext = + { + .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal, + + .JackType = MIDI_JACKTYPE_External, + .JackID = 0x02, + + .JackStrIndex = NO_DESCRIPTOR + }, + + .MIDI_Out_Jack_Emb = + { + .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, + + .JackType = MIDI_JACKTYPE_Embedded, + .JackID = 0x03, + + .NumberOfPins = 1, + .SourceJackID = {0x02}, + .SourcePinID = {0x01}, + + .JackStrIndex = NO_DESCRIPTOR + }, + + .MIDI_Out_Jack_Ext = + { + .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface}, + .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal, + + .JackType = MIDI_JACKTYPE_External, + .JackID = 0x04, + + .NumberOfPins = 1, + .SourceJackID = {0x01}, + .SourcePinID = {0x01}, + + .JackStrIndex = NO_DESCRIPTOR + }, + + .MIDI_In_Jack_Endpoint = + { + .Endpoint = + { + .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM), + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = MIDI_STREAM_EPSIZE, + .PollingIntervalMS = 0x01 + }, + + .Refresh = 0, + .SyncEndpointNumber = 0 + }, + + .MIDI_In_Jack_Endpoint_SPC = + { + .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint}, + .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, + + .TotalEmbeddedJacks = 0x01, + .AssociatedJackID = {0x01} + }, + + .MIDI_Out_Jack_Endpoint = + { + .Endpoint = + { + .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, + + .EndpointAddress = (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM), + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = MIDI_STREAM_EPSIZE, + .PollingIntervalMS = 0x01 + }, + + .Refresh = 0, + .SyncEndpointNumber = 0 + }, + + .MIDI_Out_Jack_Endpoint_SPC = + { + .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint}, + .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General, + + .TotalEmbeddedJacks = 0x01, + .AssociatedJackID = {0x03} + } + }; -- cgit v1.2.3 From 04885a3b447c82437d919d467328800eb00af629 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 21 Aug 2015 10:46:53 -0400 Subject: preonic --- protocol/lufa/descriptor.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'protocol/lufa/descriptor.c') diff --git a/protocol/lufa/descriptor.c b/protocol/lufa/descriptor.c index 6eedd57000..0536b79110 100644 --- a/protocol/lufa/descriptor.c +++ b/protocol/lufa/descriptor.c @@ -487,6 +487,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = }, #endif +#ifdef MIDI_ENABLE .Audio_ControlInterface = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, @@ -508,7 +509,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface}, .Subtype = AUDIO_DSUBTYPE_CSInterface_Header, - .ACSpecification = VERSION_BCD(1,1,1), + .ACSpecification = VERSION_BCD(1,0,0), .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t), .InCollection = 1, @@ -536,7 +537,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .Header = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_CSInterface}, .Subtype = AUDIO_DSUBTYPE_CSInterface_General, - .AudioSpecification = VERSION_BCD(1,1,1), + .AudioSpecification = VERSION_BCD(1,0,0), .TotalLength = (sizeof(USB_Descriptor_Configuration_t) - offsetof(USB_Descriptor_Configuration_t, Audio_StreamInterface_SPC)) @@ -603,7 +604,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM), .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, @@ -628,7 +629,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointAddress = (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM), .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, @@ -643,7 +644,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalEmbeddedJacks = 0x01, .AssociatedJackID = {0x03} } - +#endif }; -- cgit v1.2.3 From b191f8c60fbbaf1fb55d67edb86a6c33489b2ce3 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 21 Aug 2015 23:13:33 -0400 Subject: midi --- protocol/lufa/descriptor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'protocol/lufa/descriptor.c') diff --git a/protocol/lufa/descriptor.c b/protocol/lufa/descriptor.c index 0536b79110..8a14c5e09f 100644 --- a/protocol/lufa/descriptor.c +++ b/protocol/lufa/descriptor.c @@ -492,7 +492,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = (NKRO_INTERFACE + 1), + .InterfaceNumber = MIDI_INTERFACE, .AlternateSetting = 0, .TotalEndpoints = 0, @@ -513,14 +513,14 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t), .InCollection = 1, - .InterfaceNumber = (NKRO_INTERFACE + 2), + .InterfaceNumber = MIDI2_INTERFACE, }, .Audio_StreamInterface = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = (NKRO_INTERFACE + 2), + .InterfaceNumber = MIDI2_INTERFACE, .AlternateSetting = 0, .TotalEndpoints = 2, -- cgit v1.2.3