]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/protocol/lufa/descriptor.c
Merge remote-tracking branch 'remotes/jackhumbert/master'
[qmk_firmware.git] / tmk_core / protocol / lufa / descriptor.c
index c13a81bda8cd6f68f14207f09ebabff6c991d36b..b345da27b4f3824d302111d06c5903801272e226 100644 (file)
@@ -266,7 +266,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
             .ConfigAttributes       = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_REMOTEWAKEUP),
 
-            .MaxPowerConsumption    = USB_CONFIG_POWER_MA(100)
+            .MaxPowerConsumption    = USB_CONFIG_POWER_MA(500)
         },
 
     /*
@@ -486,6 +486,165 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
             .PollingIntervalMS      = 0x01
         },
 #endif
+
+#ifdef MIDI_ENABLE
+    .Audio_ControlInterface =
+        {
+            .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
+
+            .InterfaceNumber          = AC_INTERFACE,
+            .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,0,0),
+            .TotalLength              = sizeof(USB_Audio_Descriptor_Interface_AC_t),
+
+            .InCollection             = 1,
+            .InterfaceNumber          = AS_INTERFACE,
+        },
+
+    .Audio_StreamInterface =
+        {
+            .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
+
+            .InterfaceNumber          = AS_INTERFACE,
+            .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,0,0),
+
+            .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     = MIDI_STREAM_OUT_EPADDR,
+                    .Attributes          = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+                    .EndpointSize        = MIDI_STREAM_EPSIZE,
+                    .PollingIntervalMS   = 0x05
+                },
+
+            .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     = MIDI_STREAM_IN_EPADDR,
+                    .Attributes          = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+                    .EndpointSize        = MIDI_STREAM_EPSIZE,
+                    .PollingIntervalMS   = 0x05
+                },
+
+            .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}
+        }
+#endif
 };