Minor documentation enhancements.
[pub/USBasp.git] / Demos / Device / LowLevel / MIDI / Descriptors.c
index a6d73a3..3c2efdb 100644 (file)
@@ -55,7 +55,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
                
        .VendorID               = 0x03EB,
        .ProductID              = 0x2048,
                
        .VendorID               = 0x03EB,
        .ProductID              = 0x2048,
-       .ReleaseNumber          = 0x0000,
+       .ReleaseNumber          = VERSION_BCD(00.01),
                
        .ManufacturerStrIndex   = 0x01,
        .ProductStrIndex        = 0x02,
                
        .ManufacturerStrIndex   = 0x01,
        .ProductStrIndex        = 0x02,
@@ -104,10 +104,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        
        .Audio_ControlInterface_SPC = 
                {
        
        .Audio_ControlInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_Header,
+                       .Header                   = {.Size = sizeof(USB_Audio_Interface_AC_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = DSUBTYPE_AudioHeader,
                        
                        
-                       .ACSpecification          = VERSION_BCD(01.00),
+                       .AudioSpecification       = VERSION_BCD(01.00),
                        .TotalLength              = sizeof(USB_Audio_Interface_AC_t),
                        
                        .InCollection             = 1,
                        .TotalLength              = sizeof(USB_Audio_Interface_AC_t),
                        
                        .InCollection             = 1,
@@ -132,7 +132,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_StreamInterface_SPC = 
                {
                
        .Audio_StreamInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Interface_MIDI_AS_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_Audio_Interface_MIDI_AS_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_General,
 
                        .AudioSpecification       = VERSION_BCD(01.00),
                        .Subtype                  = DSUBTYPE_General,
 
                        .AudioSpecification       = VERSION_BCD(01.00),
@@ -143,7 +143,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .MIDI_In_Jack_Emb = 
                {
 
        .MIDI_In_Jack_Emb = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_InputJack,
                        
                        .JackType                 = JACKTYPE_EMBEDDED,
                        .Subtype                  = DSUBTYPE_InputJack,
                        
                        .JackType                 = JACKTYPE_EMBEDDED,
@@ -154,7 +154,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .MIDI_In_Jack_Ext = 
                {
 
        .MIDI_In_Jack_Ext = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_MIDI_In_Jack_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_InputJack,
                        
                        .JackType                 = JACKTYPE_EXTERNAL,
                        .Subtype                  = DSUBTYPE_InputJack,
                        
                        .JackType                 = JACKTYPE_EXTERNAL,
@@ -165,7 +165,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .MIDI_Out_Jack_Emb = 
                {
                
        .MIDI_Out_Jack_Emb = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_OutputJack,
                        
                        .JackType                 = JACKTYPE_EMBEDDED,
                        .Subtype                  = DSUBTYPE_OutputJack,
                        
                        .JackType                 = JACKTYPE_EMBEDDED,
@@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .MIDI_Out_Jack_Ext = 
                {
 
        .MIDI_Out_Jack_Ext = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_MIDI_Out_Jack_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_OutputJack,
                        
                        .JackType                 = JACKTYPE_EXTERNAL,
                        .Subtype                  = DSUBTYPE_OutputJack,
                        
                        .JackType                 = JACKTYPE_EXTERNAL,
@@ -211,7 +211,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .MIDI_In_Jack_Endpoint_SPC = 
                {
                
        .MIDI_In_Jack_Endpoint_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint},
+                       .Header                   = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
                        .Subtype                  = DSUBTYPE_General,
 
                        .TotalEmbeddedJacks       = 0x01,
                        .Subtype                  = DSUBTYPE_General,
 
                        .TotalEmbeddedJacks       = 0x01,
@@ -236,7 +236,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .MIDI_Out_Jack_Endpoint_SPC = 
                {
                
        .MIDI_Out_Jack_Endpoint_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint},
+                       .Header                   = {.Size = sizeof(USB_MIDI_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
                        .Subtype                  = DSUBTYPE_General,
 
                        .TotalEmbeddedJacks       = 0x01,
                        .Subtype                  = DSUBTYPE_General,
 
                        .TotalEmbeddedJacks       = 0x01,
@@ -285,37 +285,37 @@ USB_Descriptor_String_t PROGMEM ProductString =
  */
 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                                     const uint8_t wIndex,
  */
 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                                     const uint8_t wIndex,
-                                    void** const DescriptorAddress)
+                                    const void** const DescriptorAddress)
 {
        const uint8_t  DescriptorType   = (wValue >> 8);
        const uint8_t  DescriptorNumber = (wValue & 0xFF);
 
 {
        const uint8_t  DescriptorType   = (wValue >> 8);
        const uint8_t  DescriptorNumber = (wValue & 0xFF);
 
-       void*    Address = NULL;
-       uint16_t Size    = NO_DESCRIPTOR;
+       const void* Address = NULL;
+       uint16_t    Size    = NO_DESCRIPTOR;
 
        switch (DescriptorType)
        {
                case DTYPE_Device: 
 
        switch (DescriptorType)
        {
                case DTYPE_Device: 
-                       Address = (void*)&DeviceDescriptor;
+                       Address = &DeviceDescriptor;
                        Size    = sizeof(USB_Descriptor_Device_t);
                        break;
                case DTYPE_Configuration: 
                        Size    = sizeof(USB_Descriptor_Device_t);
                        break;
                case DTYPE_Configuration: 
-                       Address = (void*)&ConfigurationDescriptor;
+                       Address = &ConfigurationDescriptor;
                        Size    = sizeof(USB_Descriptor_Configuration_t);
                        break;
                case DTYPE_String: 
                        switch (DescriptorNumber)
                        {
                                case 0x00: 
                        Size    = sizeof(USB_Descriptor_Configuration_t);
                        break;
                case DTYPE_String: 
                        switch (DescriptorNumber)
                        {
                                case 0x00: 
-                                       Address = (void*)&LanguageString;
+                                       Address = &LanguageString;
                                        Size    = pgm_read_byte(&LanguageString.Header.Size);
                                        break;
                                case 0x01: 
                                        Size    = pgm_read_byte(&LanguageString.Header.Size);
                                        break;
                                case 0x01: 
-                                       Address = (void*)&ManufacturerString;
+                                       Address = &ManufacturerString;
                                        Size    = pgm_read_byte(&ManufacturerString.Header.Size);
                                        break;
                                case 0x02: 
                                        Size    = pgm_read_byte(&ManufacturerString.Header.Size);
                                        break;
                                case 0x02: 
-                                       Address = (void*)&ProductString;
+                                       Address = &ProductString;
                                        Size    = pgm_read_byte(&ProductString.Header.Size);
                                        break;
                        }
                                        Size    = pgm_read_byte(&ProductString.Header.Size);
                                        break;
                        }