Move out many of the common class driver constants into grouped enums, to make them...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 28 Sep 2010 12:14:06 +0000 (12:14 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 28 Sep 2010 12:14:06 +0000 (12:14 +0000)
Add new CDC descriptor structs to the CDC class driver, so that the CDC demos can use human readable field names.

Rename prefix for Still Image Host class driver functions from "SImage_" to "SI_" to remain consistent with the rest of the driver.

80 files changed:
Demos/Device/ClassDriver/AudioInput/Descriptors.c
Demos/Device/ClassDriver/AudioOutput/Descriptors.c
Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c
Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h
Demos/Device/ClassDriver/GenericHID/Descriptors.c
Demos/Device/ClassDriver/GenericHID/GenericHID.c
Demos/Device/ClassDriver/Joystick/Descriptors.c
Demos/Device/ClassDriver/Joystick/Joystick.c
Demos/Device/ClassDriver/Keyboard/Descriptors.c
Demos/Device/ClassDriver/Keyboard/Keyboard.c
Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c
Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
Demos/Device/ClassDriver/MIDI/Descriptors.c
Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
Demos/Device/ClassDriver/Mouse/Descriptors.c
Demos/Device/ClassDriver/Mouse/Mouse.c
Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c
Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h
Demos/Device/ClassDriver/VirtualSerial/Descriptors.c
Demos/Device/ClassDriver/VirtualSerial/Descriptors.h
Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c
Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h
Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c
Demos/Device/LowLevel/AudioInput/Descriptors.c
Demos/Device/LowLevel/AudioInput/Descriptors.h
Demos/Device/LowLevel/AudioOutput/Descriptors.c
Demos/Device/LowLevel/AudioOutput/Descriptors.h
Demos/Device/LowLevel/MIDI/Descriptors.c
Demos/Device/LowLevel/MIDI/Descriptors.h
Demos/Device/LowLevel/MassStorage/MassStorage.h
Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c
Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c
Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c
Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c
Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c
Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
Demos/Host/ClassDriver/MouseHost/MouseHost.c
Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c
Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
LUFA/Drivers/USB/Class/Common/Audio.h
LUFA/Drivers/USB/Class/Common/CDC.h
LUFA/Drivers/USB/Class/Common/HID.h
LUFA/Drivers/USB/Class/Common/MIDI.h
LUFA/Drivers/USB/Class/Common/MassStorage.h
LUFA/Drivers/USB/Class/Common/RNDIS.h
LUFA/Drivers/USB/Class/Common/StillImage.h
LUFA/Drivers/USB/Class/Device/CDC.c
LUFA/Drivers/USB/Class/Device/HID.c
LUFA/Drivers/USB/Class/Device/HID.h
LUFA/Drivers/USB/Class/Device/MassStorage.c
LUFA/Drivers/USB/Class/Device/RNDIS.c
LUFA/Drivers/USB/Class/Host/CDC.c
LUFA/Drivers/USB/Class/Host/HID.c
LUFA/Drivers/USB/Class/Host/HID.h
LUFA/Drivers/USB/Class/Host/HIDParser.c
LUFA/Drivers/USB/Class/Host/MassStorage.c
LUFA/Drivers/USB/Class/Host/RNDIS.c
LUFA/Drivers/USB/Class/Host/StillImage.c
LUFA/Drivers/USB/Class/Host/StillImage.h
LUFA/Drivers/USB/HighLevel/StdDescriptors.h
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/FutureChanges.txt
LUFA/ManPages/MigrationInformation.txt
Projects/Benito/Descriptors.c
Projects/Benito/Descriptors.h
Projects/LEDNotifier/Descriptors.c
Projects/LEDNotifier/Descriptors.h
Projects/Magstripe/Descriptors.c
Projects/Magstripe/Magstripe.c
Projects/TempDataLogger/Descriptors.c
Projects/TempDataLogger/TempDataLogger.c
Projects/USBtoSerial/Descriptors.c
Projects/USBtoSerial/Descriptors.h
Projects/XPLAINBridge/USARTDescriptors.c
Projects/XPLAINBridge/USARTDescriptors.h

index ba8c001..991b33e 100644 (file)
@@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_ControlInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_Header,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_Header,
 
                        .ACSpecification          = VERSION_BCD(01.00),
                        .TotalLength              = (sizeof(USB_Audio_Descriptor_Interface_AC_t) +
@@ -113,13 +113,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                                     sizeof(USB_Audio_Descriptor_OutputTerminal_t)),
                        
                        .InCollection             = 1,
-                       .InterfaceNumbers         = {1},
+                       .InterfaceNumber          = 1,
                },
 
        .Audio_InputTerminal = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_InputTerminal,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
 
                        .TerminalID               = 0x01,
                        .TerminalType             = TERMINAL_IN_MIC,
@@ -134,8 +134,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_OutputTerminal = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_OutputTerminal,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
 
                        .TerminalID               = 0x02,
                        .TerminalType             = TERMINAL_STREAMING,
@@ -180,8 +180,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_StreamInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_General,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_General,
 
                        .TerminalLink             = 0x02,
 
@@ -191,8 +191,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_AudioFormat = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_Format,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_FormatType,
 
                        .FormatType               = 0x01,
                        .Channels                 = 0x01,
@@ -222,8 +222,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_StreamEndpoint_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
-                       .Subtype                  = DSUBTYPE_General,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSEndpoint_General,
                        
                        .Attributes               = 0x00,
                        
index 9f38501..57668f2 100644 (file)
@@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        
        .Audio_ControlInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_Header,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_Header,
                        
                        .ACSpecification          = VERSION_BCD(01.00),
                        .TotalLength              = (sizeof(USB_Audio_Descriptor_Interface_AC_t) +
@@ -113,13 +113,13 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                                     sizeof(USB_Audio_Descriptor_OutputTerminal_t)),
                        
                        .InCollection             = 1,
-                       .InterfaceNumbers         = {1},
+                       .InterfaceNumber          = 1,
                },
 
        .Audio_InputTerminal = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_InputTerminal,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_InputTerminal_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
                
                        .TerminalID               = 0x01,
                        .TerminalType             = TERMINAL_STREAMING,
@@ -134,8 +134,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_OutputTerminal = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_OutputTerminal,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_OutputTerminal_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
                
                        .TerminalID               = 0x02,
                        .TerminalType             = TERMINAL_OUT_SPEAKER,
@@ -180,8 +180,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_StreamInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_General,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AS_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_General,
                        
                        .TerminalLink             = 0x01,
                        
@@ -191,8 +191,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_AudioFormat = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_Format,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Format_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_FormatType,
 
                        .FormatType               = 0x01,
                        .Channels                 = 0x02,
@@ -222,8 +222,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_StreamEndpoint_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
-                       .Subtype                  = DSUBTYPE_General,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSEndpoint_General,
                        
                        .Attributes               = EP_ACCEPTS_SMALL_PACKETS,
                        
index 617cebd..20ba493 100644 (file)
@@ -128,28 +128,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
-       .CDC1_Functional_IntHeader = 
+       .CDC1_Functional_Header = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
                        
-                       .Data                   = {0x01, 0x10}
+                       .CDCSpecification       = VERSION_BCD(01.10),
                },
 
-       .CDC1_Functional_AbstractControlManagement = 
+       .CDC1_Functional_ACM = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
-                       .SubType                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
                        
-                       .Data                   = {0x06}
+                       .Capabilities           = 0x06,
                },
                
        .CDC1_Functional_Union = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
                        
-                       .Data                   = {0x00, 0x01}
+                       .MasterInterfaceNumber  = 0,
+                       .SlaveInterfaceNumber   = 1,
                },
 
        .CDC1_ManagementEndpoint = 
@@ -228,28 +229,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
-       .CDC2_Functional_IntHeader = 
+       .CDC2_Functional_Header = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
                        
-                       .Data                   = {0x01, 0x10}
+                       .CDCSpecification       = VERSION_BCD(01.10),
                },
 
-       .CDC2_Functional_AbstractControlManagement = 
+       .CDC2_Functional_ACM = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
-                       .SubType                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
                        
-                       .Data                   = {0x06}
+                       .Capabilities           = 0x06,
                },
                
        .CDC2_Functional_Union = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
                        
-                       .Data                   = {0x02, 0x03}
+                       .MasterInterfaceNumber  = 2,
+                       .SlaveInterfaceNumber   = 3,
                },
 
        .CDC2_ManagementEndpoint = 
index fd6735e..5c1bf53 100644 (file)
                        USB_Descriptor_Configuration_Header_t    Config;
                        USB_Descriptor_Interface_Association_t   CDC1_IAD;
                        USB_Descriptor_Interface_t               CDC1_CCI_Interface;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC1_Functional_IntHeader;
-                       CDC_FUNCTIONAL_DESCRIPTOR(1)             CDC1_Functional_AbstractControlManagement;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC1_Functional_Union;
+                       USB_CDC_Descriptor_FunctionalHeader_t    CDC1_Functional_Header;
+                       USB_CDC_Descriptor_FunctionalACM_t       CDC1_Functional_ACM;
+                       USB_CDC_Descriptor_FunctionalUnion_t     CDC1_Functional_Union;
                        USB_Descriptor_Endpoint_t                CDC1_ManagementEndpoint;
                        USB_Descriptor_Interface_t               CDC1_DCI_Interface;
                        USB_Descriptor_Endpoint_t                CDC1_DataOutEndpoint;
                        USB_Descriptor_Endpoint_t                CDC1_DataInEndpoint;
                        USB_Descriptor_Interface_Association_t   CDC2_IAD;
                        USB_Descriptor_Interface_t               CDC2_CCI_Interface;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC2_Functional_IntHeader;
-                       CDC_FUNCTIONAL_DESCRIPTOR(1)             CDC2_Functional_AbstractControlManagement;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC2_Functional_Union;
+                       USB_CDC_Descriptor_FunctionalHeader_t    CDC2_Functional_Header;
+                       USB_CDC_Descriptor_FunctionalACM_t       CDC2_Functional_ACM;
+                       USB_CDC_Descriptor_FunctionalUnion_t     CDC2_Functional_Union;
                        USB_Descriptor_Endpoint_t                CDC2_ManagementEndpoint;
                        USB_Descriptor_Interface_t               CDC2_DCI_Interface;
                        USB_Descriptor_Endpoint_t                CDC2_DataOutEndpoint;
index 26d672c..1964d53 100644 (file)
@@ -123,19 +123,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x00,
-                       .Protocol               = HID_NON_BOOT_PROTOCOL,
+                       .Protocol               = HID_BOOTP_NonBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID_GenericHID = 
                {
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
                                                                         
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(GenericReport)
                },
 
@@ -227,11 +227,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID: 
+               case HID_DTYPE_HID: 
                        Address = &ConfigurationDescriptor.HID_GenericHID;
                        Size    = sizeof(USB_HID_Descriptor_HID_t);
                        break;
-               case DTYPE_Report: 
+               case HID_DTYPE_Report: 
                        Address = &GenericReport;
                        Size    = sizeof(GenericReport);
                        break;
index 4fe58a8..d64c164 100644 (file)
@@ -138,7 +138,7 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \param[in]     HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID    Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
- *  \param[in]     ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in]     ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out]    ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out]    ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -163,7 +163,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in] ReportID    Report ID of the received report from the host
- *  \param[in] ReportType  The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
index 217016f..8696e20 100644 (file)
@@ -133,19 +133,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x00,
-                       .Protocol               = HID_NON_BOOT_PROTOCOL,
+                       .Protocol               = HID_BOOTP_NonBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID_JoystickHID = 
                {
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
                        
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(JoystickReport)
                },
 
@@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID: 
+               case HID_DTYPE_HID: 
                        Address = &ConfigurationDescriptor.HID_JoystickHID;
                        Size    = sizeof(USB_HID_Descriptor_HID_t);
                        break;
-               case DTYPE_Report: 
+               case HID_DTYPE_Report: 
                        Address = &JoystickReport;
                        Size    = sizeof(JoystickReport);
                        break;
index 622106f..c759e13 100644 (file)
@@ -132,7 +132,7 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \param[in]     HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID    Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
- *  \param[in]     ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in]     ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out]    ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out]    ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -173,7 +173,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in] ReportID    Report ID of the received report from the host
- *  \param[in] ReportType  The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
index 63114b1..ed2cb6c 100644 (file)
@@ -139,19 +139,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x01,
-                       .Protocol               = HID_BOOT_KEYBOARD_PROTOCOL,
+                       .Protocol               = HID_BOOTP_KeyboardBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID_KeyboardHID = 
                {  
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
                        
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(KeyboardReport)
                },
                
@@ -243,11 +243,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID: 
+               case HID_DTYPE_HID: 
                        Address = &ConfigurationDescriptor.HID_KeyboardHID;
                        Size    = sizeof(USB_HID_Descriptor_HID_t);
                        break;
-               case DTYPE_Report: 
+               case HID_DTYPE_Report: 
                        Address = &KeyboardReport;
                        Size    = sizeof(KeyboardReport);
                        break;
index 8d85030..755c25a 100644 (file)
@@ -132,7 +132,7 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \param[in]     HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID    Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
- *  \param[in]     ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in]     ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out]    ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out]    ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -175,7 +175,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in] ReportID    Report ID of the received report from the host
- *  \param[in] ReportType  The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
index 4f7c55b..bba7ca2 100644 (file)
@@ -172,19 +172,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x01,
-                       .Protocol               = HID_BOOT_KEYBOARD_PROTOCOL,
+                       .Protocol               = HID_BOOTP_KeyboardBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID1_KeyboardHID = 
                {  
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
                        
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(KeyboardReport)
                },
                
@@ -209,19 +209,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x01,
-                       .Protocol               = HID_BOOT_MOUSE_PROTOCOL,
+                       .Protocol               = HID_BOOTP_MouseBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID2_MouseHID = 
                {  
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
                        
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(MouseReport)
                },
                
@@ -313,7 +313,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID: 
+               case HID_DTYPE_HID: 
                        if (!(wIndex))
                        {
                                Address = &ConfigurationDescriptor.HID1_KeyboardHID;
@@ -325,7 +325,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                                Size    = sizeof(USB_HID_Descriptor_HID_t);                     
                        }
                        break;
-               case DTYPE_Report: 
+               case HID_DTYPE_Report: 
                        if (!(wIndex))
                        {
                                Address = &KeyboardReport;
index 6ba7ce3..96c430a 100644 (file)
@@ -158,7 +158,7 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \param[in]     HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID  Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
- *  \param[in]     ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in]     ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out]    ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out]    ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -230,7 +230,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in] ReportID    Report ID of the received report from the host
- *  \param[in] ReportType  The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
index 3459541..b842bd2 100644 (file)
@@ -104,14 +104,14 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        
        .Audio_ControlInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_Header,
+                       .Header                   = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_Header,
                        
                        .ACSpecification          = VERSION_BCD(01.00),
                        .TotalLength              = sizeof(USB_Audio_Descriptor_Interface_AC_t),
                        
                        .InCollection             = 1,
-                       .InterfaceNumbers         = {1},
+                       .InterfaceNumber          = 1,
                },
 
        .Audio_StreamInterface = 
@@ -132,8 +132,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_StreamInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_General,
+                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_General,
 
                        .AudioSpecification       = VERSION_BCD(01.00),
                        
@@ -143,10 +143,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .MIDI_In_Jack_Emb = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_InputJack,
+                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
                        
-                       .JackType                 = MIDI_JACKTYPE_EMBEDDED,
+                       .JackType                 = MIDI_JACKTYPE_Embedded,
                        .JackID                   = 0x01,
                        
                        .JackStrIndex             = NO_DESCRIPTOR
@@ -154,10 +154,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .MIDI_In_Jack_Ext = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_InputJack,
+                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
                        
-                       .JackType                 = MIDI_JACKTYPE_EXTERNAL,
+                       .JackType                 = MIDI_JACKTYPE_External,
                        .JackID                   = 0x02,
                        
                        .JackStrIndex             = NO_DESCRIPTOR
@@ -165,10 +165,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .MIDI_Out_Jack_Emb = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_OutputJack,
+                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
                        
-                       .JackType                 = MIDI_JACKTYPE_EMBEDDED,
+                       .JackType                 = MIDI_JACKTYPE_Embedded,
                        .JackID                   = 0x03,
 
                        .NumberOfPins             = 1,
@@ -180,10 +180,10 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .MIDI_Out_Jack_Ext = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_AudioInterface},
-                       .Subtype                  = DSUBTYPE_OutputJack,
+                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
                        
-                       .JackType                 = MIDI_JACKTYPE_EXTERNAL,
+                       .JackType                 = MIDI_JACKTYPE_External,
                        .JackID                   = 0x04,
 
                        .NumberOfPins             = 1,
@@ -211,8 +211,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .MIDI_In_Jack_Endpoint_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint},
-                       .Subtype                  = DSUBTYPE_General,
+                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSEndpoint_General,
 
                        .TotalEmbeddedJacks       = 0x01,
                        .AssociatedJackID         = {0x01}
@@ -236,8 +236,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .MIDI_Out_Jack_Endpoint_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_AudioEndpoint},
-                       .Subtype                  = DSUBTYPE_General,
+                       .Header                   = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
+                       .Subtype                  = AUDIO_DSUBTYPE_CSEndpoint_General,
 
                        .TotalEmbeddedJacks       = 0x01,
                        .AssociatedJackID         = {0x03}
index c14e4c7..12422ad 100644 (file)
@@ -188,19 +188,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x01,
-                       .Protocol               = 0x01,
+                       .Protocol               = HID_BOOTP_KeyboardBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID_KeyboardHID = 
                {  
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
                        
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(KeyboardReport)
                },
                
@@ -292,11 +292,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID:
+               case HID_DTYPE_HID:
                        Address = &ConfigurationDescriptor.HID_KeyboardHID;
                        Size    = sizeof(USB_HID_Descriptor_HID_t);
                        break;
-               case DTYPE_Report:
+               case HID_DTYPE_Report:
                        Address = &KeyboardReport;
                        Size    = sizeof(KeyboardReport);
                        break;
index ba62130..e5dbfb6 100644 (file)
@@ -178,7 +178,7 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \param[in]     HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID    Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
- *  \param[in]     ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in]     ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out]    ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out]    ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -221,7 +221,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in] ReportID    Report ID of the received report from the host
- *  \param[in] ReportType  The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
index 8302555..6a699b0 100644 (file)
@@ -133,19 +133,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x01,
-                       .Protocol               = HID_BOOT_MOUSE_PROTOCOL,
+                       .Protocol               = HID_BOOTP_MouseBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID_MouseHID = 
                {
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
 
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(MouseReport)
                },
 
@@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID: 
+               case HID_DTYPE_HID: 
                        Address = &ConfigurationDescriptor.HID_MouseHID;
                        Size    = sizeof(USB_HID_Descriptor_HID_t);
                        break;
-               case DTYPE_Report: 
+               case HID_DTYPE_Report: 
                        Address = &MouseReport;
                        Size    = sizeof(MouseReport);
                        break;
index 6efdb99..aabd961 100644 (file)
@@ -132,7 +132,7 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \param[in]     HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID    Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
- *  \param[in]     ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in]     ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out]    ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out]    ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -173,7 +173,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in] ReportID    Report ID of the received report from the host
- *  \param[in] ReportType  The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
index 1748809..d259390 100644 (file)
@@ -104,26 +104,27 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .CDC_Functional_Header = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
                        
-                       .Data                   = {0x01, 0x10}
+                       .CDCSpecification       = VERSION_BCD(01.10),
                },
-               
-       .CDC_Functional_AbstractControlManagement = 
+
+       .CDC_Functional_ACM = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
-                       .SubType                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
                        
-                       .Data                   = {0x00}
+                       .Capabilities           = 0x00,
                },
-       
+               
        .CDC_Functional_Union = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
                        
-                       .Data                   = {0x00, 0x01}
+                       .MasterInterfaceNumber  = 0,
+                       .SlaveInterfaceNumber   = 1,
                },
 
        .CDC_NotificationEndpoint = 
index ed4d274..26bd571 100644 (file)
@@ -67,9 +67,9 @@
                {
                        USB_Descriptor_Configuration_Header_t    Config;
                        USB_Descriptor_Interface_t               CDC_CCI_Interface;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_Header;
-                       CDC_FUNCTIONAL_DESCRIPTOR(1)             CDC_Functional_AbstractControlManagement;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_Union;
+                       USB_CDC_Descriptor_FunctionalHeader_t    CDC_Functional_Header;
+                       USB_CDC_Descriptor_FunctionalACM_t       CDC_Functional_ACM;
+                       USB_CDC_Descriptor_FunctionalUnion_t     CDC_Functional_Union;
                        USB_Descriptor_Endpoint_t                CDC_NotificationEndpoint;
                        USB_Descriptor_Interface_t               CDC_DCI_Interface;
                        USB_Descriptor_Endpoint_t                RNDIS_DataOutEndpoint;
index 3deaf6d..2e47069 100644 (file)
@@ -114,28 +114,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
-       .CDC_Functional_IntHeader = 
+       .CDC_Functional_Header = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
                        
-                       .Data                   = {0x01, 0x10}
+                       .CDCSpecification       = VERSION_BCD(01.10),
                },
 
-       .CDC_Functional_AbstractControlManagement = 
+       .CDC_Functional_ACM = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
-                       .SubType                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
                        
-                       .Data                   = {0x06}
+                       .Capabilities           = 0x06,
                },
                
        .CDC_Functional_Union = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
                        
-                       .Data                   = {0x00, 0x01}
+                       .MasterInterfaceNumber  = 0,
+                       .SlaveInterfaceNumber   = 1,
                },
 
        .CDC_NotificationEndpoint = 
index 1c1f469..159d8d2 100644 (file)
@@ -67,9 +67,9 @@
                {
                        USB_Descriptor_Configuration_Header_t    Config;
                        USB_Descriptor_Interface_t               CDC_CCI_Interface;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_IntHeader;
-                       CDC_FUNCTIONAL_DESCRIPTOR(1)             CDC_Functional_AbstractControlManagement;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_Union;
+                       USB_CDC_Descriptor_FunctionalHeader_t    CDC_Functional_Header;
+                       USB_CDC_Descriptor_FunctionalACM_t       CDC_Functional_ACM;
+                       USB_CDC_Descriptor_FunctionalUnion_t     CDC_Functional_Union;
                        USB_Descriptor_Endpoint_t                CDC_NotificationEndpoint;
                        USB_Descriptor_Interface_t               CDC_DCI_Interface;
                        USB_Descriptor_Endpoint_t                CDC_DataOutEndpoint;
index 7d383a4..72e89ef 100644 (file)
@@ -164,28 +164,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
-       .CDC_Functional_IntHeader = 
+       .CDC_Functional_Header = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
                        
-                       .Data                   = {0x01, 0x10}
+                       .CDCSpecification       = VERSION_BCD(01.10),
                },
 
-       .CDC_Functional_AbstractControlManagement = 
+       .CDC_Functional_ACM = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
-                       .SubType                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
                        
-                       .Data                   = {0x06}
+                       .Capabilities           = 0x06,
                },
                
        .CDC_Functional_Union = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
                        
-                       .Data                   = {0x00, 0x01}
+                       .MasterInterfaceNumber  = 0,
+                       .SlaveInterfaceNumber   = 1,
                },
 
        .CDC_NotificationEndpoint = 
@@ -245,19 +246,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x01,
-                       .Protocol               = HID_BOOT_MOUSE_PROTOCOL,
+                       .Protocol               = HID_BOOTP_MouseBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID_MouseHID = 
                {
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
 
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(MouseReport)
                },
 
@@ -349,11 +350,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID: 
+               case HID_DTYPE_HID: 
                        Address = &ConfigurationDescriptor.HID_MouseHID;
                        Size    = sizeof(USB_HID_Descriptor_HID_t);
                        break;
-               case DTYPE_Report: 
+               case HID_DTYPE_Report: 
                        Address = &MouseReport;
                        Size    = sizeof(MouseReport);
                        break;
index dfe6c11..6b6178a 100644 (file)
@@ -75,9 +75,9 @@
                        USB_Descriptor_Configuration_Header_t    Config;
                        USB_Descriptor_Interface_Association_t   CDC_IAD;
                        USB_Descriptor_Interface_t               CDC_CCI_Interface;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_IntHeader;
-                       CDC_FUNCTIONAL_DESCRIPTOR(1)             CDC_Functional_AbstractControlManagement;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_Union;
+                       USB_CDC_Descriptor_FunctionalHeader_t    CDC_Functional_Header;
+                       USB_CDC_Descriptor_FunctionalACM_t       CDC_Functional_ACM;
+                       USB_CDC_Descriptor_FunctionalUnion_t     CDC_Functional_Union;
                        USB_Descriptor_Endpoint_t                CDC_NotificationEndpoint;
                        USB_Descriptor_Interface_t               CDC_DCI_Interface;
                        USB_Descriptor_Endpoint_t                CDC_DataOutEndpoint;
index 86cdb4e..8372d4e 100644 (file)
@@ -191,7 +191,7 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \param[in]     HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID    Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
- *  \param[in]     ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in]     ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out]    ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out]    ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -232,7 +232,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in] ReportID    Report ID of the received report from the host
- *  \param[in] ReportType  The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
index 46b43ac..3074396 100644 (file)
@@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        
        .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),
                        .TotalLength              = (sizeof(USB_Audio_Interface_AC_t) +
@@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_InputTerminal = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_InputTerminal,
                
                        .TerminalID               = 0x01,
@@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_OutputTerminal = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_OutputTerminal,
                
                        .TerminalID               = 0x02,
@@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_StreamInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_General,
                        
                        .TerminalLink             = 0x02,
@@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_AudioFormat = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_Format,
 
                        .FormatType               = 0x01,
@@ -223,7 +223,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_StreamEndpoint_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
+                       .Header                   = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
                        .Subtype                  = DSUBTYPE_General,
                        
                        .Attributes               = 0x00,
index 1b700a6..d154f01 100644 (file)
                #include <avr/pgmspace.h>
 
        /* Macros: */
-               /** Descriptor header constant to indicate a Audio class interface descriptor. */
-               #define DTYPE_AudioInterface         0x24
-
-               /** Descriptor header constant to indicate a Audio class endpoint descriptor. */
-               #define DTYPE_AudioEndpoint          0x25
-
                /** Audio class descriptor subtype value for a Audio class specific header descriptor. */
-               #define DSUBTYPE_Header              0x01
+               #define DSUBTYPE_AudioHeader         0x01
 
                /** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */
                #define DSUBTYPE_InputTerminal       0x02
index 20ce79e..2d749fc 100644 (file)
@@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        
        .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),
                        .TotalLength              = (sizeof(USB_Audio_Interface_AC_t) +
@@ -118,7 +118,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_InputTerminal = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_Audio_InputTerminal_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_InputTerminal,
                
                        .TerminalID               = 0x01,
@@ -134,7 +134,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .Audio_OutputTerminal = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_Audio_OutputTerminal_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_OutputTerminal,
                
                        .TerminalID               = 0x02,
@@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_StreamInterface_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_Audio_Interface_AS_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_General,
                        
                        .TerminalLink             = 0x01,
@@ -191,7 +191,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_AudioFormat = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_AudioInterface},
+                       .Header                   = {.Size = sizeof(USB_Audio_Format_t), .Type = DTYPE_CSInterface},
                        .Subtype                  = DSUBTYPE_Format,
 
                        .FormatType               = 0x01,
@@ -223,7 +223,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .Audio_StreamEndpoint_SPC = 
                {
-                       .Header                   = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_AudioEndpoint},
+                       .Header                   = {.Size = sizeof(USB_Audio_StreamEndpoint_Spc_t), .Type = DTYPE_CSEndpoint},
                        .Subtype                  = DSUBTYPE_General,
                        
                        .Attributes               = EP_ACCEPTS_SMALL_PACKETS,
index 112b900..cd6b2b8 100644 (file)
                #include <avr/pgmspace.h>
 
        /* Macros: */
-               /** Descriptor header constant to indicate a Audio class interface descriptor. */
-               #define DTYPE_AudioInterface         0x24
-
-               /** Descriptor header constant to indicate a Audio class endpoint descriptor. */
-               #define DTYPE_AudioEndpoint          0x25
-
                /** Audio class descriptor subtype value for a Audio class specific header descriptor. */
-               #define DSUBTYPE_Header              0x01
+               #define DSUBTYPE_AudioHeader         0x01
 
                /** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */
                #define DSUBTYPE_InputTerminal       0x02
index 33fba26..af52cba 100644 (file)
@@ -104,8 +104,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
        
        .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),
                        .TotalLength              = sizeof(USB_Audio_Interface_AC_t),
@@ -132,7 +132,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .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),
@@ -143,7 +143,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .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,
@@ -154,7 +154,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .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,
@@ -165,7 +165,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .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,
@@ -180,7 +180,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .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,
@@ -211,7 +211,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .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,
@@ -236,7 +236,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                
        .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,
index ba65a89..5aebd8f 100644 (file)
                #include <avr/pgmspace.h>
 
        /* Macros: */
-               /** Descriptor header constant to indicate a Audio class interface descriptor. */
-               #define DTYPE_AudioInterface        0x24
-
-               /** Descriptor header constant to indicate a Audio class endpoint descriptor. */
-               #define DTYPE_AudioEndpoint         0x25
-
                /** Audio class descriptor subtype value for a Audio class specific header descriptor. */
-               #define DSUBTYPE_Header             0x01
+               #define DSUBTYPE_AudioHeader        0x01
 
                /** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */
                #define DSUBTYPE_InputJack          0x02
index 97b9de0..5a5c5f8 100644 (file)
@@ -89,7 +89,7 @@
                /** LED mask for the library LED driver, to indicate that the USB interface is busy. */
                #define LEDMASK_USB_BUSY           LEDS_LED2
                
-       /* Type defines: */
+       /* Type Defines: */
                /** Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
                typedef struct
                {
index 8302555..6a699b0 100644 (file)
@@ -133,19 +133,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x01,
-                       .Protocol               = HID_BOOT_MOUSE_PROTOCOL,
+                       .Protocol               = HID_BOOTP_MouseBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID_MouseHID = 
                {
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
 
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(MouseReport)
                },
 
@@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID: 
+               case HID_DTYPE_HID: 
                        Address = &ConfigurationDescriptor.HID_MouseHID;
                        Size    = sizeof(USB_HID_Descriptor_HID_t);
                        break;
-               case DTYPE_Report: 
+               case HID_DTYPE_Report: 
                        Address = &MouseReport;
                        Size    = sizeof(MouseReport);
                        break;
index e2a2128..be01a2d 100644 (file)
@@ -98,7 +98,7 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID  Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
- *  \param[in] ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out] ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out] ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -139,7 +139,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in] ReportID    Report ID of the received report from the host
- *  \param[in] ReportType  The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
index dfd67ae..4e794dc 100644 (file)
@@ -47,7 +47,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Host_Interface =
                                .DataINPipeNumber       = 1,
                                .DataOUTPipeNumber      = 2,
                                
-                               .HIDInterfaceProtocol   = HID_BOOT_MOUSE_PROTOCOL,
+                               .HIDInterfaceProtocol   = HID_BOOTP_MouseBootProtocol,
                        },
        };
 
index 8420d05..fb48c2b 100644 (file)
@@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Joystick_HID_Interface =
                                .DataOUTPipeNumber      = 2,
                                .DataOUTPipeDoubleBank  = false,
                                
-                               .HIDInterfaceProtocol   = HID_NON_BOOT_PROTOCOL,
+                               .HIDInterfaceProtocol   = HID_BOOTP_NonBootProtocol,
                                
                                .HIDParserData          = &HIDReportInfo
                        },
@@ -138,7 +138,7 @@ int main(void)
 
                                                /* Determine what report item is being tested, process updated value as needed */
                                                if ((ReportItem->Attributes.Usage.Page        == USAGE_PAGE_BUTTON) &&
-                                                       (ReportItem->ItemType                     == REPORT_ITEM_TYPE_In))
+                                                       (ReportItem->ItemType                     == HID_REPORT_ITEM_In))
                                                {
                                                        if (ReportItem->Value)
                                                          LEDMask = LEDS_ALL_LEDS;
@@ -146,7 +146,7 @@ int main(void)
                                                else if ((ReportItem->Attributes.Usage.Page   == USAGE_PAGE_GENERIC_DCTRL) &&
                                                                 ((ReportItem->Attributes.Usage.Usage == USAGE_X)                  ||
                                                                  (ReportItem->Attributes.Usage.Usage == USAGE_Y))                 &&
-                                                                (ReportItem->ItemType                == REPORT_ITEM_TYPE_In))
+                                                                (ReportItem->ItemType                == HID_REPORT_ITEM_In))
                                                {
                                                        int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t);
                                                        
index 8bdf2b6..ddce64c 100644 (file)
@@ -50,7 +50,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface =
                                .DataOUTPipeNumber      = 2,
                                .DataOUTPipeDoubleBank  = false,
                                
-                               .HIDInterfaceProtocol   = HID_BOOT_KEYBOARD_PROTOCOL,
+                               .HIDInterfaceProtocol   = HID_BOOTP_KeyboardBootProtocol,
                        },
        };
 
index 9135e53..3fd23f0 100644 (file)
@@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface =
                                .DataOUTPipeNumber      = 2,
                                .DataOUTPipeDoubleBank  = false,
                                
-                               .HIDInterfaceProtocol   = HID_NON_BOOT_PROTOCOL,
+                               .HIDInterfaceProtocol   = HID_BOOTP_NonBootProtocol,
                                
                                .HIDParserData          = &HIDReportInfo
                        },
@@ -138,7 +138,7 @@ int main(void)
                                                if ((ReportItem->Attributes.Usage.Page      == USAGE_PAGE_KEYBOARD) &&
                                                        (ReportItem->Attributes.BitSize         == 8)                   &&
                                                        (ReportItem->Attributes.Logical.Maximum > 1)                    &&
-                                                       (ReportItem->ItemType                   == REPORT_ITEM_TYPE_In))
+                                                       (ReportItem->ItemType                   == HID_REPORT_ITEM_In))
                                                {
                                                        /* Key code is an unsigned char in length, cast to the appropriate type */
                                                        uint8_t KeyCode = (uint8_t)ReportItem->Value;
index a03381c..d76f048 100644 (file)
@@ -50,7 +50,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface =
                                .DataOUTPipeNumber      = 2,
                                .DataOUTPipeDoubleBank  = false,
                                
-                               .HIDInterfaceProtocol   = HID_BOOT_MOUSE_PROTOCOL,
+                               .HIDInterfaceProtocol   = HID_BOOTP_MouseBootProtocol,
                        },
        };
 
index 7482b01..d02424c 100644 (file)
@@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface =
                                .DataOUTPipeNumber      = 2,
                                .DataOUTPipeDoubleBank  = false,
                                
-                               .HIDInterfaceProtocol   = HID_NON_BOOT_PROTOCOL,
+                               .HIDInterfaceProtocol   = HID_BOOTP_NonBootProtocol,
                                
                                .HIDParserData          = &HIDReportInfo
                        },
@@ -138,14 +138,14 @@ int main(void)
                                                
                                                /* Determine what report item is being tested, process updated value as needed */
                                                if ((ReportItem->Attributes.Usage.Page        == USAGE_PAGE_BUTTON) &&
-                                                       (ReportItem->ItemType                     == REPORT_ITEM_TYPE_In))
+                                                       (ReportItem->ItemType                     == HID_REPORT_ITEM_In))
                                                {
                                                        if (ReportItem->Value)
                                                          LEDMask = LEDS_ALL_LEDS;
                                                }
                                                else if ((ReportItem->Attributes.Usage.Page   == USAGE_PAGE_GENERIC_DCTRL) &&
                                                                 (ReportItem->Attributes.Usage.Usage  == USAGE_SCROLL_WHEEL)       &&
-                                                                (ReportItem->ItemType                == REPORT_ITEM_TYPE_In))
+                                                                (ReportItem->ItemType                == HID_REPORT_ITEM_In))
                                                {
                                                        int16_t WheelDelta = HID_ALIGN_DATA(ReportItem, int16_t);
                                                        
@@ -155,7 +155,7 @@ int main(void)
                                                else if ((ReportItem->Attributes.Usage.Page   == USAGE_PAGE_GENERIC_DCTRL) &&
                                                                 ((ReportItem->Attributes.Usage.Usage == USAGE_X)                  ||
                                                                  (ReportItem->Attributes.Usage.Usage == USAGE_Y))                 &&
-                                                                (ReportItem->ItemType                == REPORT_ITEM_TYPE_In))
+                                                                (ReportItem->ItemType                == HID_REPORT_ITEM_In))
                                                {
                                                        int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t);
                                                        
index 152639f..f5d1b23 100644 (file)
@@ -86,8 +86,8 @@ int main(void)
                                        break;
                                }
 
-                               if (SImage_Host_ConfigurePipes(&DigitalCamera_SI_Interface,
-                                                              ConfigDescriptorSize, ConfigDescriptorData) != SI_ENUMERROR_NoError)
+                               if (SI_Host_ConfigurePipes(&DigitalCamera_SI_Interface,
+                                                          ConfigDescriptorSize, ConfigDescriptorData) != SI_ENUMERROR_NoError)
                                {
                                        puts_P(PSTR("Attached Device Not a Valid Still Image Class Device.\r\n"));
                                        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
@@ -110,7 +110,7 @@ int main(void)
                        case HOST_STATE_Configured:
                                puts_P(PSTR("Opening Session...\r\n"));
                                
-                               if (SImage_Host_OpenSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
+                               if (SI_Host_OpenSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
                                {
                                        puts_P(PSTR("Could not open PIMA session.\r\n"));
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;
@@ -119,8 +119,8 @@ int main(void)
 
                                puts_P(PSTR("Turning off Device...\r\n"));
 
-                               SImage_Host_SendCommand(&DigitalCamera_SI_Interface, 0x1013, 0, NULL);
-                               if (SImage_Host_ReceiveResponse(&DigitalCamera_SI_Interface))
+                               SI_Host_SendCommand(&DigitalCamera_SI_Interface, 0x1013, 0, NULL);
+                               if (SI_Host_ReceiveResponse(&DigitalCamera_SI_Interface))
                                {
                                        puts_P(PSTR("Could not turn off device.\r\n"));
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;
@@ -131,7 +131,7 @@ int main(void)
 
                                puts_P(PSTR("Closing Session...\r\n"));
 
-                               if (SImage_Host_CloseSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
+                               if (SI_Host_CloseSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
                                {
                                        puts_P(PSTR("Could not close PIMA session.\r\n"));
                                        USB_HostState = HOST_STATE_WaitForDeviceRemoval;
@@ -143,7 +143,7 @@ int main(void)
                                break;
                }
        
-               SImage_Host_USBTask(&DigitalCamera_SI_Interface);
+               SI_Host_USBTask(&DigitalCamera_SI_Interface);
                USB_USBTask();
        }
 }
index e92c242..cf469ff 100644 (file)
@@ -193,9 +193,9 @@ void Joystick_HID_Task(void)
                        {
                                HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
                                
-                               uint8_t ReportSizeInBits      = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In];
-                               uint8_t ReportSizeOutBits     = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out];
-                               uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature];
+                               uint8_t ReportSizeInBits      = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
+                               uint8_t ReportSizeOutBits     = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
+                               uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
 
                                /* Print out the byte sizes of each report within the device */
                                printf_P(PSTR("  + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
@@ -258,7 +258,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
                bool FoundData;
 
                if ((ReportItem->Attributes.Usage.Page        == USAGE_PAGE_BUTTON) &&
-                       (ReportItem->ItemType                     == REPORT_ITEM_TYPE_In))
+                       (ReportItem->ItemType                     == HID_REPORT_ITEM_In))
                {
                        /* Get the joystick button value */
                        FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem);
@@ -274,7 +274,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
                else if ((ReportItem->Attributes.Usage.Page   == USAGE_PAGE_GENERIC_DCTRL) &&
                                 ((ReportItem->Attributes.Usage.Usage == USAGE_X)                  ||
                                  (ReportItem->Attributes.Usage.Usage == USAGE_Y))                 &&
-                                (ReportItem->ItemType                == REPORT_ITEM_TYPE_In))
+                                (ReportItem->ItemType                == HID_REPORT_ITEM_In))
                {
                        /* Get the joystick relative position value */
                        FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem);
index dfb1a4a..94aca2f 100644 (file)
@@ -194,9 +194,9 @@ void Keyboard_HID_Task(void)
                        {
                                HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
                                
-                               uint8_t ReportSizeInBits      = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In];
-                               uint8_t ReportSizeOutBits     = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out];
-                               uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature];
+                               uint8_t ReportSizeInBits      = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
+                               uint8_t ReportSizeOutBits     = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
+                               uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
 
                                /* Print out the byte sizes of each report within the device */
                                printf_P(PSTR("  + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
@@ -258,7 +258,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport)
                if ((ReportItem->Attributes.Usage.Page      == USAGE_PAGE_KEYBOARD) &&
                        (ReportItem->Attributes.BitSize         == 8)                   &&
                        (ReportItem->Attributes.Logical.Maximum > 1)                    &&
-                       (ReportItem->ItemType                   == REPORT_ITEM_TYPE_In))
+                       (ReportItem->ItemType                   == HID_REPORT_ITEM_In))
                {
                        /* Retrieve the keyboard scan-code from the report data retrieved from the device */
                        bool FoundData = USB_GetHIDReportItemInfo(KeyboardReport, ReportItem);
index d9e90a8..bb038f1 100644 (file)
@@ -75,7 +75,7 @@
                /** Additional error code for Mass Storage functions when a device returns a logical command failure. */
                #define MASS_STORE_SCSI_COMMAND_FAILED      0xC0
 
-       /* Type defines: */
+       /* Type Defines: */
                /** Type define for a Mass Storage class Command Block Wrapper, used to wrap SCSI
                 *  commands for transport over the USB bulk endpoints to the device.
                 */
index 38e4b25..5536d87 100644 (file)
@@ -194,9 +194,9 @@ void Mouse_HID_Task(void)
                        {
                                HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
                                
-                               uint8_t ReportSizeInBits      = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In];
-                               uint8_t ReportSizeOutBits     = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out];
-                               uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature];
+                               uint8_t ReportSizeInBits      = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
+                               uint8_t ReportSizeOutBits     = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
+                               uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
 
                                /* Print out the byte sizes of each report within the device */
                                printf_P(PSTR("  + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
@@ -259,7 +259,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
                bool FoundData;
 
                if ((ReportItem->Attributes.Usage.Page        == USAGE_PAGE_BUTTON) &&
-                       (ReportItem->ItemType                     == REPORT_ITEM_TYPE_In))
+                       (ReportItem->ItemType                     == HID_REPORT_ITEM_In))
                {
                        /* Get the mouse button value */
                        FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem);
@@ -274,7 +274,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
                }
                else if ((ReportItem->Attributes.Usage.Page   == USAGE_PAGE_GENERIC_DCTRL) &&
                                 (ReportItem->Attributes.Usage.Usage  == USAGE_SCROLL_WHEEL)       &&
-                                (ReportItem->ItemType                == REPORT_ITEM_TYPE_In))
+                                (ReportItem->ItemType                == HID_REPORT_ITEM_In))
                {
                        /* Get the mouse wheel value if it is contained within the current 
                         * report, if not, skip to the next item in the parser list
@@ -290,7 +290,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
                else if ((ReportItem->Attributes.Usage.Page   == USAGE_PAGE_GENERIC_DCTRL) &&
                                 ((ReportItem->Attributes.Usage.Usage == USAGE_X)                  ||
                                  (ReportItem->Attributes.Usage.Usage == USAGE_Y))                 &&
-                                (ReportItem->ItemType                == REPORT_ITEM_TYPE_In))
+                                (ReportItem->ItemType                == HID_REPORT_ITEM_In))
                {
                        /* Get the mouse relative position value */
                        FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem);
index 8ee5fa2..f4b7849 100644 (file)
                        #define AUDIO_TOTAL_SAMPLE_RATES    1
                #endif
                
-               /** Descriptor header constant to indicate a Audio class interface descriptor. */
-               #define DTYPE_AudioInterface         0x24
-
-               /** Descriptor header constant to indicate a Audio class endpoint descriptor. */
-               #define DTYPE_AudioEndpoint          0x25
-
-               /** Audio class descriptor subtype value for a Audio class-specific header descriptor. */
-               #define DSUBTYPE_Header              0x01
-
-               /** Audio class descriptor subtype value for an Output Terminal Audio class-specific descriptor. */
-               #define DSUBTYPE_InputTerminal       0x02
-
-               /** Audio class descriptor subtype value for an Input Terminal Audio class-specific descriptor. */
-               #define DSUBTYPE_OutputTerminal      0x03
-
-               /** Audio class descriptor subtype value for a Feature Unit Audio class-specific descriptor. */
-               #define DSUBTYPE_FeatureUnit         0x06
-
-               /** Audio class descriptor subtype value for a general Audio class-specific descriptor. */
-               #define DSUBTYPE_General             0x01
-
-               /** Audio class descriptor subtype value for an Audio class-specific descriptor indicating the format of an audio stream. */
-               #define DSUBTYPE_Format              0x02
-               
                /** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
                #define CHANNEL_LEFT_FRONT           (1 << 0)
 
                #define FEATURE_GRAPHIC_EQUALIZER    (1 << 5)
 
                /** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
-
-               /** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
                #define FEATURE_AUTOMATIC_GAIN       (1 << 6)
 
                /** Supported feature mask for an Audio class feature unit descriptor. See the Audio class specification for more details. */
                 *
                 *  \param[in] freq  Required audio sampling frequency in HZ
                 */
-               #define AUDIO_SAMPLE_FREQ(freq)  {LowWord: ((uint32_t)freq & 0x00FFFF), HighByte: (((uint32_t)freq >> 16) & 0x0000FF)}
+               #define AUDIO_SAMPLE_FREQ(freq)      {LowWord: ((uint32_t)freq & 0x00FFFF), HighByte: (((uint32_t)freq >> 16) & 0x0000FF)}
                
                /** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint
                 *  accepts only filled endpoint packets of audio samples.
                 *  will accept partially filled endpoint packets of audio samples.
                 */
                #define EP_ACCEPTS_SMALL_PACKETS     (0 << 7)
-               
-       /* Type Defines: */
-               /** \brief Audio class-specific Interface Descriptor (LUFA naming conventions).
-                *
-                *  Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
-                *  supply extra information about the audio device's layout to the host. See the USB Audio specification for more
-                *  details.
-                *
-                *  \see \ref USB_Audio_StdDescriptor_Interface_AC_t for the version of this type with standard element names.
-                */
-               typedef struct
+       
+       /* Enums: */
+               /** Audio class specific interface description subtypes, for the Audio Control interface. */
+               enum Audio_CSInterface_AC_SubTypes_t
                {
-                       USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
-                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
-
-                       uint16_t                ACSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
-                       uint16_t                TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
-                       
-                       uint8_t                 InCollection; /**< Total number of audio class interfaces within this device. */
-                       uint8_t                 InterfaceNumbers[1]; /**< Interface numbers of each audio interface. */
-               } USB_Audio_Descriptor_Interface_AC_t;
-
-               /** \brief Audio class-specific Interface Descriptor (USB-IF naming conventions).
-                *
-                *  Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
-                *  supply extra information about the audio device's layout to the host. See the USB Audio specification for more
-                *  details.
-                *
-                *  \see \ref USB_Audio_Descriptor_Interface_AC_t for the version of this type with non-standard LUFA specific
-                *       element names.
-                */
-               typedef struct
-               {
-                       uint8_t  bLength; /**< Size of the descriptor, in bytes. */
-                       uint8_t  bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
-                                                  *   given by the specific class.
-                                                  */
-
-                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
-
-                       uint16_t bcdADC; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
-                       uint16_t wTotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
-                       
-                       uint8_t  bInCollection; /**< Total number of audio class interfaces within this device. */
-                       uint8_t  bInterfaceNumbers[1]; /**< Interface numbers of each audio interface. */
-               } USB_Audio_StdDescriptor_Interface_AC_t;
-               
-               /** \brief Audio class-specific Feature Unit Descriptor (LUFA naming conventions).
-                *
-                *  Type define for an Audio class-specific Feature Unit descriptor. This indicates to the host what features
-                *  are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
-                *  specification for more details.
-                *
-                *  \see \ref USB_Audio_StdDescriptor_FeatureUnit_t for the version of this type with standard element names.
-                */
-               typedef struct
+                       AUDIO_DSUBTYPE_CSInterface_Header         = 0x01, /**< Audio class specific control interface header. */
+                       AUDIO_DSUBTYPE_CSInterface_InputTerminal  = 0x02, /**< Audio class specific control interface Input Terminal. */
+                       AUDIO_DSUBTYPE_CSInterface_OutputTerminal = 0x03, /**< Audio class specific control interface Output Terminal. */
+                       AUDIO_DSUBTYPE_CSInterface_Mixer          = 0x04, /**< Audio class specific control interface Mixer Unit. */
+                       AUDIO_DSUBTYPE_CSInterface_Selector       = 0x05, /**< Audio class specific control interface Selector Unit. */
+                       AUDIO_DSUBTYPE_CSInterface_Feature        = 0x06, /**< Audio class specific control interface Feature Unit. */
+                       AUDIO_DSUBTYPE_CSInterface_Processing     = 0x07, /**< Audio class specific control interface Processing Unit. */
+                       AUDIO_DSUBTYPE_CSInterface_Extension      = 0x08, /**< Audio class specific control interface Extension Unit. */
+               };
+
+               /** Audio class specific interface description subtypes, for the Audio Streaming interface. */
+               enum Audio_CSInterface_AS_SubTypes_t
                {
-                       USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
-                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
-                       
-                       uint8_t                 UnitID; /**< ID value of this feature unit - must be a unique value within the device. */
-                       uint8_t                 SourceID; /**< Source ID value of the audio source input into this feature unit. */
-                       
-                       uint8_t                 ControlSize; /**< Size of each element in the ChanelControlls array. */
-                       uint8_t                 ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
-                       
-                       uint8_t                 FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
-               } USB_Audio_Descriptor_FeatureUnit_t;
+                       AUDIO_DSUBTYPE_CSInterface_General        = 0x01, /**< Audio class specific streaming interface general descriptor. */
+                       AUDIO_DSUBTYPE_CSInterface_FormatType     = 0x02, /**< Audio class specific streaming interface format type descriptor. */
+                       AUDIO_DSUBTYPE_CSInterface_FormatSpecific = 0x03, /**< Audio class specific streaming interface format information descriptor. */
+               };
 
-               /** \brief Audio class-specific Feature Unit Descriptor (USB-IF naming conventions).
-                *
-                *  Type define for an Audio class-specific Feature Unit descriptor. This indicates to the host what features
-                *  are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
-                *  specification for more details.
-                *
-                *  \see \ref USB_Audio_Descriptor_FeatureUnit_t for the version of this type with non-standard LUFA specific
-                *       element names.
-                */
-               typedef struct
+               /** Audio class specific endpoint description subtypes, for the Audio Streaming interface. */
+               enum Audio_CSEndpoint_SubTypes_t
                {
-                       uint8_t bLength; /**< Size of the descriptor, in bytes. */
-                       uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
-                                                 *   given by the specific class.
-                                                 */
-
-                       uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
-                       
-                       uint8_t bUnitID; /**< ID value of this feature unit - must be a unique value within the device. */
-                       uint8_t bSourceID; /**< Source ID value of the audio source input into this feature unit. */
-                       
-                       uint8_t bControlSize; /**< Size of each element in the ChanelControlls array. */
-                       uint8_t bmaControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
-                       
-                       uint8_t iFeature; /**< Index of a string descriptor describing this descriptor within the device. */
-               } USB_Audio_StdDescriptor_FeatureUnit_t;
-
+                       AUDIO_DSUBTYPE_CSEndpoint_General         = 0x01, /**< Audio class specific endpoint general descriptor. */
+               };
+       
+       /* Type Defines: */
                /** \brief Audio class-specific Input Terminal Descriptor (LUFA naming conventions).
                 *
                 *  Type define for an Audio class-specific input terminal descriptor. This indicates to the host that the device
                typedef struct
                {
                        USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
-                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
-               
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                         *   must be \ref AUDIO_DSUBTYPE_CSInterface_InputTerminal.
+                                                         */
+                       
                        uint8_t                 TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
                        uint16_t                TerminalType; /**< Type of terminal, a TERMINAL_* mask. */
                        uint8_t                 AssociatedOutputTerminal; /**< ID of associated output terminal, for physically grouped terminals
                                                   *   given by the specific class.
                                                   */
 
-                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
+                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                     *   must be \ref AUDIO_DSUBTYPE_CSInterface_InputTerminal.
+                                                     */
                        uint8_t  bTerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
                        uint16_t wTerminalType; /**< Type of terminal, a TERMINAL_* mask. */
                        uint8_t  bAssocTerminal; /**< ID of associated output terminal, for physically grouped terminals
                typedef struct
                {
                        USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
-                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                         *   must be \ref AUDIO_DSUBTYPE_CSInterface_OutputTerminal.
+                                                         */
                
                        uint8_t                 TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
                        uint16_t                TerminalType; /**< Type of terminal, a TERMINAL_* mask. */
                typedef struct
                {
                        uint8_t  bLength; /**< Size of the descriptor, in bytes. */
-                       uint8_t  bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
-                                                  *   given by the specific class.
+                       uint8_t  bDescriptorType; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                  *   must be \ref AUDIO_DSUBTYPE_CSInterface_OutputTerminal.
                                                   */
 
-                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */               
+                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                     *   a value from the \ref Audio_CSInterface_AC_SubTypes_t enum.
+                                                     */
                        uint8_t  bTerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
                        uint16_t wTerminalType; /**< Type of terminal, a TERMINAL_* mask. */
                        uint8_t  bAssocTerminal; /**< ID of associated input terminal, for physically grouped terminals
                        
                        uint8_t  iTerminal; /**< Index of a string descriptor describing this descriptor within the device. */
                } USB_Audio_StdDescriptor_OutputTerminal_t;
+
+               /** \brief Audio class-specific Interface Descriptor (LUFA naming conventions).
+                *
+                *  Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
+                *  supply extra information about the audio device's layout to the host. See the USB Audio specification for more
+                *  details.
+                *
+                *  \see \ref USB_Audio_StdDescriptor_Interface_AC_t for the version of this type with standard element names.
+                */
+               typedef struct
+               {
+                       USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                         *   a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
+                                                         */
+
+                       uint16_t                ACSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
+                       uint16_t                TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
+                       
+                       uint8_t                 InCollection; /**< Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1). */
+                       uint8_t                 InterfaceNumber; /**< Interface number of the associated Audio Streaming interface. */
+               } USB_Audio_Descriptor_Interface_AC_t;
+
+               /** \brief Audio class-specific Interface Descriptor (USB-IF naming conventions).
+                *
+                *  Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
+                *  supply extra information about the audio device's layout to the host. See the USB Audio specification for more
+                *  details.
+                *
+                *  \see \ref USB_Audio_Descriptor_Interface_AC_t for the version of this type with non-standard LUFA specific
+                *       element names.
+                */
+               typedef struct
+               {
+                       uint8_t  bLength; /**< Size of the descriptor, in bytes. */
+                       uint8_t  bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
+                                                  *   given by the specific class.
+                                                  */
+
+                       uint8_t  bDescriptorSubtype;/**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                    *   a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
+                                                    */
+
+                       uint16_t bcdADC; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
+                       uint16_t wTotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
+                       
+                       uint8_t  bInCollection; /**< Total number of Audio Streaming interfaces linked to this Audio Control interface (must be 1). */
+                       uint8_t  bInterfaceNumbers; /**< Interface number of the associated Audio Streaming interface. */
+               } USB_Audio_StdDescriptor_Interface_AC_t;
+               
+               /** \brief Audio class-specific Feature Unit Descriptor (LUFA naming conventions).
+                *
+                *  Type define for an Audio class-specific Feature Unit descriptor. This indicates to the host what features
+                *  are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
+                *  specification for more details.
+                *
+                *  \see \ref USB_Audio_StdDescriptor_FeatureUnit_t for the version of this type with standard element names.
+                */
+               typedef struct
+               {
+                       USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                         *   must be \ref AUDIO_DSUBTYPE_CSInterface_Feature.
+                                                         */
+                       
+                       uint8_t                 UnitID; /**< ID value of this feature unit - must be a unique value within the device. */
+                       uint8_t                 SourceID; /**< Source ID value of the audio source input into this feature unit. */
+                       
+                       uint8_t                 ControlSize; /**< Size of each element in the ChanelControlls array. */
+                       uint8_t                 ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
+                       
+                       uint8_t                 FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
+               } USB_Audio_Descriptor_FeatureUnit_t;
+
+               /** \brief Audio class-specific Feature Unit Descriptor (USB-IF naming conventions).
+                *
+                *  Type define for an Audio class-specific Feature Unit descriptor. This indicates to the host what features
+                *  are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
+                *  specification for more details.
+                *
+                *  \see \ref USB_Audio_Descriptor_FeatureUnit_t for the version of this type with non-standard LUFA specific
+                *       element names.
+                */
+               typedef struct
+               {
+                       uint8_t bLength; /**< Size of the descriptor, in bytes. */
+                       uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
+                                                 *   given by the specific class.
+                                                 */
+
+                       uint8_t bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                    *   must be \ref AUDIO_DSUBTYPE_CSInterface_Feature.
+                                                    */
+                       
+                       uint8_t bUnitID; /**< ID value of this feature unit - must be a unique value within the device. */
+                       uint8_t bSourceID; /**< Source ID value of the audio source input into this feature unit. */
+                       
+                       uint8_t bControlSize; /**< Size of each element in the ChanelControlls array. */
+                       uint8_t bmaControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
+                       
+                       uint8_t iFeature; /**< Index of a string descriptor describing this descriptor within the device. */
+               } USB_Audio_StdDescriptor_FeatureUnit_t;
                
                /** \brief Audio class-specific Streaming Audio Interface Descriptor (LUFA naming conventions).
                 *
                typedef struct
                {
                        USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
-                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                         *   a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
+                                                         */
                        
                        uint8_t                 TerminalLink; /**< ID value of the output terminal this descriptor is describing. */
                        
                                                   *   given by the specific class.
                                                   */
 
-                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */               
+                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                     *   a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
+                                                     */
                        
                        uint8_t  bTerminalLink; /**< ID value of the output terminal this descriptor is describing. */
                        
                 */
                typedef struct
                {
-                       uint16_t    LowWord; /**< Low 16 bits of the 24-bit value. */
-                       uint8_t     HighByte; /**< Upper 8 bits of the 24-bit value. */
+                       uint16_t LowWord; /**< Low 16 bits of the 24-bit value. */
+                       uint8_t  HighByte; /**< Upper 8 bits of the 24-bit value. */
                } USB_Audio_SampleFreq_t;
 
                /** \brief Audio class-specific Format Descriptor (LUFA naming conventions).
                typedef struct
                {
                        USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
-                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
-
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                         *   must be \ref AUDIO_DSUBTYPE_CSInterface_FormatType.
+                                                         */
+                       
                        uint8_t                 FormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
                        uint8_t                 Channels; /**< Total number of discrete channels in the stream. */
                        
                 */
                typedef struct
                {
-                       uint8_t  bLength; /**< Size of the descriptor, in bytes. */
-                       uint8_t  bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
-                                                  *   given by the specific class.
-                                                  */
+                       uint8_t bLength; /**< Size of the descriptor, in bytes. */
+                       uint8_t bDescriptorType; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                 *   must be \ref AUDIO_DSUBTYPE_CSInterface_FormatType.
+                                                 */
 
-                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */               
+                       uint8_t bDescriptorSubtype;/**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                   *   a value from the \ref Audio_CSInterface_AS_SubTypes_t enum.
+                                                   */
 
-                       uint8_t  bFormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
-                       uint8_t  bNrChannels; /**< Total number of discrete channels in the stream. */
+                       uint8_t bFormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
+                       uint8_t bNrChannels; /**< Total number of discrete channels in the stream. */
                        
-                       uint8_t  bSubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */
-                       uint8_t  bBitResolution; /**< Bits of resolution of each channel's samples in the stream. */
+                       uint8_t bSubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */
+                       uint8_t bBitResolution; /**< Bits of resolution of each channel's samples in the stream. */
 
-                       uint8_t  bSampleFrequencyType; /**< Total number of sample frequencies supported by the device. */                      
-                       uint8_t  SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES * 3]; /**< Sample frequencies supported by the device (must be 24-bit). */
+                       uint8_t bSampleFrequencyType; /**< Total number of sample frequencies supported by the device. */                       
+                       uint8_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES * 3]; /**< Sample frequencies supported by the device (must be 24-bit). */
                } USB_Audio_StdDescriptor_Format_t;
                
                /** \brief Audio class-specific Streaming Endpoint Descriptor (LUFA naming conventions).
                 */
                typedef struct
                {
-                       USB_Descriptor_Header_t   Header; /**< Regular descriptor header containing the descriptor's type and length. */
-                       uint8_t                   Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
+                       USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                         *   a value from the \ref Audio_CSEndpoint_SubTypes_t enum.
+                                                         */
                        
-                       uint8_t                   Attributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */
+                       uint8_t                 Attributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */
 
-                       uint8_t                   LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification. */
-                       uint16_t                  LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry. */
+                       uint8_t                 LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification. */
+                       uint16_t                LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry. */
                } USB_Audio_Descriptor_StreamEndpoint_Spc_t;
 
                /** \brief Audio class-specific Extended Endpoint Descriptor (USB-IF naming conventions).
                                                   *   given by the specific class.
                                                   */
 
-                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */               
+                       uint8_t  bDescriptorSubtype; /**< Sub type value used to distinguish between audio class-specific descriptors,
+                                                     *   a value from the \ref Audio_CSEndpoint_SubTypes_t enum.
+                                                     */
                        
                        uint8_t  bmAttributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */
 
index c41907f..99a1d8f 100644 (file)
                #endif
                
        /* Macros: */
-               /** CDC class-specific request to get the current virtual serial port configuration settings. */
-               #define REQ_GetLineEncoding              0x21
-
-               /** CDC class-specific request to set the current virtual serial port configuration settings. */
-               #define REQ_SetLineEncoding              0x20
-
-               /** CDC class-specific request to set the current virtual serial port handshake line states. */
-               #define REQ_SetControlLineState          0x22
-
-               /** CDC class-specific request to send a break to the receiver via the carrier channel. */
-               #define REQ_SendBreak                    0x23
-
-               /** CDC class-specific request to send an encapsulated command to the device. */
-               #define REQ_SendEncapsulatedCommand      0x00
-
-               /** CDC class-specific request to retrieve an encapsulated command response from the device. */
-               #define REQ_GetEncapsulatedResponse      0x01
-               
-               /** Notification type constant for a change in the virtual serial port handshake line states, for
-                *  use with a USB_Notification_Header_t notification structure when sent to the host via the CDC 
-                *  notification endpoint.
-                */
-               #define NOTIF_SerialState                0x20
-
                /** Mask for the DTR handshake line for use with the REQ_SetControlLineState class-specific request
                 *  from the host, to indicate that the DTR line state should be high.
                 */
                              uint8_t                 SubType;         \
                          uint8_t                 Data[DataSize];  \
                     }
-
+                        
        /* Enums: */
+               /** Enum for the CDC class specific control requests that can be issued by the USB bus host. */
+               enum CDC_ClassRequests_t
+               {               
+                       CDC_REQ_SendEncapsulatedCommand = 0x00, /**< CDC class-specific request to send an encapsulated command to the device. */
+                       CDC_REQ_GetEncapsulatedResponse = 0x01, /**< CDC class-specific request to retrieve an encapsulated command response from the device. */        
+                       CDC_REQ_SetLineEncoding         = 0x20, /**< CDC class-specific request to set the current virtual serial port configuration settings. */
+                       CDC_REQ_GetLineEncoding         = 0x21, /**< CDC class-specific request to get the current virtual serial port configuration settings. */
+                       CDC_REQ_SetControlLineState     = 0x22, /**< CDC class-specific request to set the current virtual serial port handshake line states. */
+                       CDC_REQ_SendBreak               = 0x23, /**< CDC class-specific request to send a break to the receiver via the carrier channel. */
+               };
+               
+               /** Enum for the CDC class specific notification requests that can be issued by a CDC device to a host. */
+               enum CDC_ClassNotifications_t
+               {
+                       CDC_NOTIF_SerialState               = 0x20, /**< Notification type constant for a change in the virtual serial port
+                                                                    *   handshake line states, for use with a USB_Notification_Header_t
+                                                                    *   notification structure when sent to the host via the CDC notification
+                                                                    *   endpoint.
+                                                                    */
+               };
+       
+               /** Enum for the CDC class specific interface descriptor subtypes. */
+               enum CDC_DescriptorSubtypes_t
+               {
+                       CDC_DSUBTYPE_CSInterface_Header           = 0x00, /**< CDC class-specific Header functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_CallManagement   = 0x01, /**< CDC class-specific Call Managment functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_ACM              = 0x02, /**< CDC class-specific Abstract Control Model functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_DirectLine       = 0x03, /**< CDC class-specific Direct Line functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_TelephoneRinger  = 0x04, /**< CDC class-specific Telephone Ringer functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_TelephoneCall    = 0x05, /**< CDC class-specific Telephone Call functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_Union            = 0x06, /**< CDC class-specific Union functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_CountrySelection = 0x07, /**< CDC class-specific Country Selection functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_TelephoneOpModes = 0x08, /**< CDC class-specific Telephone Operation Modes functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_USBTerminal      = 0x09, /**< CDC class-specific USB Terminal functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_NetworkChannel   = 0x0A, /**< CDC class-specific Network Channel functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_ProtocolUnit     = 0x0B, /**< CDC class-specific Protocol Unit functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_ExtensionUnit    = 0x0C, /**< CDC class-specific Extension Unit functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_MultiChannel     = 0x0D, /**< CDC class-specific Multi-Channel Management functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_CAPI             = 0x0E, /**< CDC class-specific Common ISDN API functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_Ethernet         = 0x0F, /**< CDC class-specific Ethernet functional descriptor. */
+                       CDC_DSUBTYPE_CSInterface_ATM              = 0x10, /**< CDC class-specific Asynchronous Transfer Mode functional descriptor. */
+               };
+               
                /** Enum for the possible line encoding formats of a virtual serial port. */
                enum CDC_LineEncodingFormats_t
                {
                /** Enum for the possible line encoding parity settings of a virtual serial port. */
                enum CDC_LineEncodingParity_t
                {
-                       CDC_PARITY_None    = 0, /**< No parity bit mode on each frame. */
-                       CDC_PARITY_Odd     = 1, /**< Odd parity bit mode on each frame. */
-                       CDC_PARITY_Even    = 2, /**< Even parity bit mode on each frame. */
-                       CDC_PARITY_Mark    = 3, /**< Mark parity bit mode on each frame. */
-                       CDC_PARITY_Space   = 4, /**< Space parity bit mode on each frame. */
+                       CDC_PARITY_None  = 0, /**< No parity bit mode on each frame. */
+                       CDC_PARITY_Odd   = 1, /**< Odd parity bit mode on each frame. */
+                       CDC_PARITY_Even  = 2, /**< Even parity bit mode on each frame. */
+                       CDC_PARITY_Mark  = 3, /**< Mark parity bit mode on each frame. */
+                       CDC_PARITY_Space = 4, /**< Space parity bit mode on each frame. */
                };
 
+       /* Type Defines: */
+               /** \brief CDC class-specific Functional Header Descriptor (LUFA naming conventions).
+                *
+                *  Type define for a CDC class-specific functional header descriptor. This indicates to the host that the device
+                *  contains one or more CDC functional data descriptors, which give the CDC interface's capabilities and configuration.
+                *  See the CDC class specification for more details.
+                *
+                *  \see \ref USB_CDC_StdDescriptor_FunctionalHeader_t for the version of this type with standard element names.
+                */
+               typedef struct
+               {
+                       USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between CDC class-specific descriptors,
+                                                         *   must be \ref CDC_DSUBTYPE_CSInterface_Header.
+                                                         */
+                       uint16_t                CDCSpecification; /**< Version number of the CDC specification implemented by the device,
+                                                                  *   encoded in BCD format.
+                                                                  */
+               } USB_CDC_Descriptor_FunctionalHeader_t;
+
+               /** \brief CDC class-specific Functional Header Descriptor (USB-IF naming conventions).
+                *
+                *  Type define for a CDC class-specific functional header descriptor. This indicates to the host that the device
+                *  contains one or more CDC functional data descriptors, which give the CDC interface's capabilities and configuration.
+                *  See the CDC class specification for more details.
+                *
+                *  \see \ref USB_CDC_Descriptor_FunctionalHeader_t for the version of this type with non-standard LUFA specific
+                *       element names.
+                */
+               typedef struct
+               {
+                       uint8_t  bFunctionLength; /**< Size of the descriptor, in bytes. */
+                       uint8_t  bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
+                                                  *   given by the specific class.
+                                                  */
+                       uint8_t  bDescriptorSubType; /**< Sub type value used to distinguish between CDC class-specific descriptors,
+                                                     *   must be \ref CDC_DSUBTYPE_CSInterface_Header.
+                                                     */
+                       uint16_t bcdCDC; /**< Version number of the CDC specification implemented by the device, encoded in BCD format. */
+               } USB_CDC_StdDescriptor_FunctionalHeader_t;
+
+               /** \brief CDC class-specific Functional ACM Descriptor (LUFA naming conventions).
+                *
+                *  Type define for a CDC class-specific functional ACM descriptor. This indicates to the host that the CDC interface
+                *  supports the CDC ACM subclass of the CDC specification. See the CDC class specification for more details.
+                *
+                *  \see \ref USB_CDC_StdDescriptor_FunctionalACM_t for the version of this type with standard element names.
+                */
+               typedef struct
+               {
+                       USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between CDC class-specific descriptors,
+                                                         *   must be \ref CDC_DSUBTYPE_CSInterface_ACM.
+                                                         */
+                       uint8_t                 Capabilities; /**< Capabilities of the ACM interface, given as a bit mask. For most devices,
+                                                              *   this should be set to a fixed value of 0x06 - for other capabiltiies, refer
+                                                              *   to the CDC ACM specification.
+                                                              */
+               } USB_CDC_Descriptor_FunctionalACM_t;
+
+               /** \brief CDC class-specific Functional ACM Descriptor (USB-IF naming conventions).
+                *
+                *  Type define for a CDC class-specific functional ACM descriptor. This indicates to the host that the CDC interface
+                *  supports the CDC ACM subclass of the CDC specification. See the CDC class specification for more details.
+                *
+                *  \see \ref USB_CDC_Descriptor_FunctionalACM_t for the version of this type with non-standard LUFA specific
+                *       element names.
+                */
+               typedef struct
+               {
+                       uint8_t bFunctionLength; /**< Size of the descriptor, in bytes. */
+                       uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
+                                                 *   given by the specific class.
+                                                 */
+                       uint8_t bDescriptorSubType; /**< Sub type value used to distinguish between CDC class-specific descriptors,
+                                                    *   must be \ref CDC_DSUBTYPE_CSInterface_ACM.
+                                                    */
+                       uint8_t bmCapabilities; /**< Capabilities of the ACM interface, given as a bit mask. For most devices,
+                                                *   this should be set to a fixed value of 0x06 - for other capabiltiies, refer
+                                                *   to the CDC ACM specification.
+                                                */
+               } USB_CDC_StdDescriptor_FunctionalACM_t;
+               
+               /** \brief CDC class-specific Functional Union Descriptor (LUFA naming conventions).
+                *
+                *  Type define for a CDC class-specific functional Union descriptor. This indicates to the host that specific
+                *  CDC control and data interfaces are related. See the CDC class specification for more details.
+                *
+                *  \see \ref USB_CDC_StdDescriptor_FunctionalUnion_t for the version of this type with standard element names.
+                */
+               typedef struct
+               {
+                       USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
+                       uint8_t                 Subtype; /**< Sub type value used to distinguish between CDC class-specific descriptors,
+                                                         *   must be \ref CDC_DSUBTYPE_CSInterface_Union.
+                                                         */
+                       uint8_t                 MasterInterfaceNumber; /**< Interface number of the CDC Control interface. */
+                       uint8_t                 SlaveInterfaceNumber; /**< Interface number of the CDC Data interface. */
+               } USB_CDC_Descriptor_FunctionalUnion_t;
+               
+               /** \brief CDC class-specific Functional Union Descriptor (USB-IF naming conventions).
+                *
+                *  Type define for a CDC class-specific functional Union descriptor. This indicates to the host that specific
+                *  CDC control and data interfaces are related. See the CDC class specification for more details.
+                *
+                *  \see \ref USB_CDC_Descriptor_FunctionalUnion_t for the version of this type with non-standard LUFA specific
+                *       element names.
+                */
+               typedef struct
+               {
+                       uint8_t bFunctionLength; /**< Size of the descriptor, in bytes. */
+                       uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
+                                                 *   given by the specific class.
+                                                 */
+                       uint8_t bDescriptorSubType; /**< Sub type value used to distinguish between CDC class-specific descriptors,
+                                                    *   must be \ref CDC_DSUBTYPE_CSInterface_Union.
+                                                    */
+                       uint8_t bMasterInterface; /**< Interface number of the CDC Control interface. */
+                       uint8_t bSlaveInterface0; /**< Interface number of the CDC Data interface. */
+               } USB_CDC_StdDescriptor_FunctionalUnion_t;
+
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
                        }
index 59e262a..822a8b5 100644 (file)
                        #error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead.
                #endif
                
-       /* Macros: */
-               /** HID class-specific Request to get the current HID report from the device. */
-               #define REQ_GetReport                   0x01
-
-               /** HID class-specific Request to get the current device idle count. */
-               #define REQ_GetIdle                     0x02
-
-               /** HID class-specific Request to set the current HID report to the device. */
-               #define REQ_SetReport                   0x09
-
-               /** HID class-specific Request to set the device's idle count. */
-               #define REQ_SetIdle                     0x0A
-
-               /** HID class-specific Request to get the current HID report protocol mode. */
-               #define REQ_GetProtocol                 0x03
-
-               /** HID class-specific Request to set the current HID report protocol mode. */
-               #define REQ_SetProtocol                 0x0B
-
-               /** Descriptor header type value, to indicate a HID class HID descriptor. */
-               #define DTYPE_HID                       0x21
-               
-               /** Descriptor header type value, to indicate a HID class HID report descriptor. */
-               #define DTYPE_Report                    0x22
-               
-               /** Constant for the protocol value of a HID interface descriptor, indicating that the interface does not support
-                *  any HID class boot protocol (see HID Class Specification).
-                */
-               #define HID_NON_BOOT_PROTOCOL           0x00
-
-               /** Constant for the protocol value of a HID interface descriptor, indicating that the interface supports the
-                *  HID class Keyboard boot protocol (see HID Class Specification).
-                */
-               #define HID_BOOT_KEYBOARD_PROTOCOL      0x01
-
-               /** Constant for the protocol value of a HID interface descriptor, indicating that the interface supports the
-                *  HID class Mouse boot protocol (see HID Class Specification).
-                */
-               #define HID_BOOT_MOUSE_PROTOCOL         0x02
-               
+       /* Macros: */           
                /** Constant for a keyboard report modifier byte, indicating that the keyboard's left control key is currently pressed. */
                #define HID_KEYBOARD_MODIFER_LEFTCTRL   (1 << 0)
 
                #define HID_KEYBOARD_LED_KATANA         (1 << 3)
 
        /* Type Defines: */
+               /** Enum for the HID class specific control requests that can be issued by the USB bus host. */
+               enum HID_ClassRequests_t
+               {
+                       HID_REQ_GetReport   = 0x01, /**< HID class-specific Request to get the current HID report from the device. */
+                       HID_REQ_GetIdle     = 0x02, /**< HID class-specific Request to get the current device idle count. */
+                       HID_REQ_SetReport   = 0x09, /**< HID class-specific Request to set the current HID report to the device. */
+                       HID_REQ_SetIdle     = 0x0A, /**< HID class-specific Request to set the device's idle count. */
+                       HID_REQ_GetProtocol = 0x03, /**< HID class-specific Request to get the current HID report protocol mode. */
+                       HID_REQ_SetProtocol = 0x0B, /**< HID class-specific Request to set the current HID report protocol mode. */
+               };
+               
+               /** Enum for the HID class specific descriptor types. */
+               enum HID_DescriptorTypes_t
+               {
+                       HID_DTYPE_HID    = 0x21, /**< Descriptor header type value, to indicate a HID class HID descriptor. */
+                       HID_DTYPE_Report = 0x22, /**< Descriptor header type value, to indicate a HID class HID report descriptor. */
+               };
+               
+               /** Enum for the HID class boot protocols that may be supported by HID devices. */
+               enum HID_BootProtocols_t
+               {
+                       HID_BOOTP_NonBootProtocol      = 0x00, /**< Constant for the protocol value of a HID interface descriptor, indicating
+                                                               *   that the interface does not support any HID class boot protocol (see HID
+                                                               *   Class Specification).
+                                                               */
+                       HID_BOOTP_KeyboardBootProtocol = 0x01, /**< Constant for the protocol value of a HID interface descriptor, indicating
+                                                               *   that the interface supports the HID class Keyboard boot protocol (see HID
+                                                               *   Class Specification).
+                                                               */
+                       HID_BOOTP_MouseBootProtocol    = 0x02, /**< Constant for the protocol value of a HID interface descriptor, indicating
+                                                               *   that the interface supports the HID class Mouse boot protocol (see HID Class
+                                                               *   Specification).
+                                                               */
+               };
+       
                /** Enum for the different types of HID reports. */
                enum HID_ReportItemTypes_t
                {
-                       REPORT_ITEM_TYPE_In                   = 0, /**< Indicates that the item is an IN report type. */
-                       REPORT_ITEM_TYPE_Out                  = 1, /**< Indicates that the item is an OUT report type. */
-                       REPORT_ITEM_TYPE_Feature              = 2, /**< Indicates that the item is a FEATURE report type. */
+                       HID_REPORT_ITEM_In      = 0, /**< Indicates that the item is an IN report type. */
+                       HID_REPORT_ITEM_Out     = 1, /**< Indicates that the item is an OUT report type. */
+                       HID_REPORT_ITEM_Feature = 2, /**< Indicates that the item is a FEATURE report type. */
                };
 
                /** \brief HID class-specific HID Descriptor (LUFA naming conventions).
                
                        uint8_t                 TotalReportDescriptors; /**< Total number of HID report descriptors for the interface. */
 
-                       uint8_t                 HIDReportType; /**< Type of HID report, set to \ref DTYPE_Report. */
+                       uint8_t                 HIDReportType; /**< Type of HID report, set to \ref HID_DTYPE_Report. */
                        uint16_t                HIDReportLength; /**< Length of the associated HID report descriptor, in bytes. */
                } USB_HID_Descriptor_HID_t;
 
                
                        uint8_t  bNumDescriptors; /**< Total number of HID report descriptors for the interface. */
 
-                       uint8_t  bDescriptorType2; /**< Type of HID report, set to \ref DTYPE_Report. */
+                       uint8_t  bDescriptorType2; /**< Type of HID report, set to \ref HID_DTYPE_Report. */
                        uint16_t wDescriptorLength; /**< Length of the associated HID report descriptor, in bytes. */
                } USB_HID_StdDescriptor_HID_t;
 
index da7b2bd..b3a4038 100644 (file)
                #endif
                
        /* Macros: */
-               /** Audio class descriptor subtype value for a Audio class-specific MIDI input jack descriptor. */
-               #define DSUBTYPE_InputJack          0x02
-
-               /** Audio class descriptor subtype value for a Audio class-specific MIDI output jack descriptor. */
-               #define DSUBTYPE_OutputJack         0x03
-               
-               /** Audio class descriptor jack type value for an embedded (logical) MIDI input or output jack. */
-               #define MIDI_JACKTYPE_EMBEDDED      0x01
-
-               /** Audio class descriptor jack type value for an external (physical) MIDI input or output jack. */
-               #define MIDI_JACKTYPE_EXTERNAL      0x02
-
                /** MIDI command for a note on (activation) event. */
                #define MIDI_COMMAND_NOTE_ON        0x90
 
                 *  \param[in] channel  MIDI channel number to address.
                 */
                #define MIDI_CHANNEL(channel)        ((channel) - 1)
+       
+       /* Enums: */
+               enum MIDI_JackTypes_t
+               {
+                       MIDI_JACKTYPE_Embedded = 0x01, /**< MIDI class descriptor jack type value for an embedded (logical) MIDI input or output jack. */
+                       MIDI_JACKTYPE_External = 0x02, /**< MIDI class descriptor jack type value for an external (physical) MIDI input or output jack. */
+               };
                
        /* Type Defines: */
                /** \brief MIDI class-specific Streaming Interface Descriptor (LUFA naming conventions).
                        uint8_t                 Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
                        
                        uint16_t                AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class
-                                                                      *   specification version.
-                                                                      */
+                                                                    *   specification version.
+                                                                    */
                        uint16_t                TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
                } USB_MIDI_Descriptor_AudioInterface_AS_t;
                
                        uint8_t                 JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
                } USB_MIDI_Descriptor_InputJack_t;
 
-
                /** \brief MIDI class-specific Input Jack Descriptor (USB-IF naming conventions).
                 *
                 *  Type define for an Audio class-specific MIDI IN jack. This gives information to the host on a MIDI input, either
index 9a391ee..2dc83d9 100644 (file)
                #endif
                
        /* Macros: */
-               /** Mass Storage class-specific request to reset the Mass Storage interface, ready for the next command. */
-               #define REQ_MassStorageReset       0xFF
-
-               /** Mass Storage class-specific request to retrieve the total number of Logical Units (drives) in the SCSI device. */
-               #define REQ_GetMaxLUN              0xFE
-               
                /** Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol. */
                #define MS_CBW_SIGNATURE           0x43425355UL
 
 
                /** SCSI Additional Sense Qualifier Code to indicate that an operation is currently in progress. */
                #define SCSI_ASENSEQ_OPERATION_IN_PROGRESS             0x07
-               
-       /* Type defines: */
+       
+       /* Enums: */
+               /** Enum for the Mass Storage class specific control requests that can be issued by the USB bus host. */
+               enum MS_ClassRequests_t
+               {
+                       MS_REQ_GetMaxLUN        = 0xFE, /**< Mass Storage class-specific request to retrieve the total number of Logical
+                                                        *   Units (drives) in the SCSI device.
+                                                        */
+                       MS_REQ_MassStorageReset = 0xFF, /**< Mass Storage class-specific request to reset the Mass Storage interface,
+                                                        *   ready for the next command.
+                                                    */
+               };
+       
+               /** Enum for the possible command status wrapper return status codes. */
+               enum MS_CommandStatusCodes_t
+               {
+                       MS_SCSI_COMMAND_Pass        = 0, /**< Command completed with no error */
+                       MS_SCSI_COMMAND_Fail        = 1, /**< Command failed to complete - host may check the exact error via a
+                                                         *   SCSI REQUEST SENSE command.
+                                                         */
+                       MS_SCSI_COMMAND_PhaseError  = 2, /**< Command failed due to being invalid in the current phase. */
+               };
+
+       /* Type Defines: */
                /** \brief Mass Storage Class Command Block Wrapper.
                 *
                 *  Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
                        unsigned char EOM                 : 1;
                        unsigned char FileMark            : 1;
                        
-                       uint8_t      Information[4];
-                       uint8_t      AdditionalLength;
-                       uint8_t      CmdSpecificInformation[4];
-                       uint8_t      AdditionalSenseCode;
-                       uint8_t      AdditionalSenseQualifier;
-                       uint8_t      FieldReplaceableUnitCode;
-                       uint8_t      SenseKeySpecific[3];
+                       uint8_t       Information[4];
+                       uint8_t       AdditionalLength;
+                       uint8_t       CmdSpecificInformation[4];
+                       uint8_t       AdditionalSenseCode;
+                       uint8_t       AdditionalSenseQualifier;
+                       uint8_t       FieldReplaceableUnitCode;
+                       uint8_t       SenseKeySpecific[3];
                } SCSI_Request_Sense_Response_t;
 
                /** \brief Mass Storage Class SCSI Inquiry Structure.
                        unsigned char Reserved            : 7;
                        unsigned char Removable           : 1;
                        
-                       uint8_t      Version;
+                       uint8_t       Version;
                        
                        unsigned char ResponseDataFormat  : 4;
                        unsigned char Reserved2           : 1;
                        unsigned char TrmTsk              : 1;
                        unsigned char AERC                : 1;
 
-                       uint8_t      AdditionalLength;
-                       uint8_t      Reserved3[2];
+                       uint8_t       AdditionalLength;
+                       uint8_t       Reserved3[2];
 
                        unsigned char SoftReset           : 1;
                        unsigned char CmdQue              : 1;
                        unsigned char WideBus32Bit        : 1;
                        unsigned char RelAddr             : 1;
                        
-                       uint8_t      VendorID[8];
-                       uint8_t      ProductID[16];
-                       uint8_t      RevisionID[4];
+                       uint8_t       VendorID[8];
+                       uint8_t       ProductID[16];
+                       uint8_t       RevisionID[4];
                } SCSI_Inquiry_Response_t;
-
-       /* Enums: */
-               /** Enum for the possible command status wrapper return status codes. */
-               enum MassStorage_CommandStatusCodes_t
-               {
-                       SCSI_Command_Pass = 0, /**< Command completed with no error */
-                       SCSI_Command_Fail = 1, /**< Command failed to complete - host may check the exact error via a
-                                               *   SCSI REQUEST SENSE command.
-                                               */
-                       SCSI_Phase_Error  = 2  /**< Command failed due to being invalid in the current phase. */
-               };
        
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
index a6549c5..98d41a2 100644 (file)
 
                /** Implemented RNDIS Version Minor. */
                #define REMOTE_NDIS_VERSION_MINOR             0x00
-       
-               /** RNDIS request to issue a host-to-device NDIS command. */
-               #define REQ_SendEncapsulatedCommand           0x00
-
-               /** RNDIS request to issue a device-to-host NDIS response. */
-               #define REQ_GetEncapsulatedResponse           0x01
-               
+                       
                /** Maximum size in bytes of a RNDIS control message which can be sent or received. */
                #define RNDIS_MESSAGE_BUFFER_SIZE             128
 
                #define NOTIF_ResponseAvailable               1
                
        /* Enums: */
+               /** Enum for the RNDIS class specific control requests that can be issued by the USB bus host. */
+               enum RNDIS_ClassRequests_t
+               {
+                       RNDIS_REQ_SendEncapsulatedCommand = 0x00, /**< RNDIS request to issue a host-to-device NDIS command. */
+                       RNDIS_REQ_GetEncapsulatedResponse = 0x01, /**< RNDIS request to issue a device-to-host NDIS response. */
+               };
+               
                /** Enum for the possible NDIS adapter states. */
                enum RNDIS_States_t
                {
index 434d65a..01cffbd 100644 (file)
                 *
                 *  \return Number of bytes of the given unicode string.
                 */
-               #define UNICODE_STRING_LENGTH(Chars)   ((Chars) << 1)
+               #define UNICODE_STRING_LENGTH(Chars)  ((Chars) << 1)
                
                /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
                 *  a command container.
                 *
                 *  \param[in] Params  Number of parameters which are to be sent in the Param field of the container.
                 */
-               #define PIMA_COMMAND_SIZE(Params)      ((sizeof(SI_PIMA_Container_t) - 12) + \
-                                                       ((Params) * sizeof(uint32_t)))
+               #define PIMA_COMMAND_SIZE(Params)     ((sizeof(SI_PIMA_Container_t) - 12) + ((Params) * sizeof(uint32_t)))
 
                /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
                 *  a data container.
                 *
                 *  \param[in] DataLen  Length in bytes of the data in the container.
                 */
-               #define PIMA_DATA_SIZE(DataLen)        ((sizeof(SI_PIMA_Container_t) - 12) + \
-                                                       (DataLen))
+               #define PIMA_DATA_SIZE(DataLen)       ((sizeof(SI_PIMA_Container_t) - 12) + (DataLen))
 
        /* Enums: */
                /** Enum for the possible PIMA contains types. */
                enum SI_PIMA_Container_Types_t
                {
-                       CType_Undefined         = 0, /**< Undefined container type. */
-                       CType_CommandBlock      = 1, /**< Command Block container type. */
-                       CType_DataBlock         = 2, /**< Data Block container type. */
-                       CType_ResponseBlock     = 3, /**< Response container type. */
-                       CType_EventBlock        = 4, /**< Event Block container type. */
+                       SI_PIMA_CONTAINER_Undefined     = 0, /**< Undefined container type. */
+                       SI_PIMA_CONTAINER_CommandBlock  = 1, /**< Command Block container type. */
+                       SI_PIMA_CONTAINER_DataBlock     = 2, /**< Data Block container type. */
+                       SI_PIMA_CONTAINER_ResponseBlock = 3, /**< Response container type. */
+                       SI_PIMA_CONTAINER_EventBlock    = 4, /**< Event Block container type. */
                };      
                
        /* Enums: */
                /** Enums for the possible status codes of a returned Response Block from an attached PIMA compliant Still Image device. */
                enum SI_PIMA_ResponseCodes_t
                {
-                       PIMA_RESPONSE_OK                     = 1, /**< Response code indicating no error in the issued command. */
-                       PIMA_RESPONSE_GeneralError           = 2, /**< Response code indicating a general error while processing the
-                                                                   *  issued command.
-                                                                   */
-                       PIMA_RESPONSE_SessionNotOpen         = 3, /**< Response code indicating that the sent command requires an open
-                                                                  *   session before being issued.
-                                                                  */
-                       PIMA_RESPONSE_InvalidTransaction     = 4, /**< Response code indicating an invalid transaction occurred. */
-                       PIMA_RESPONSE_OperationNotSupported  = 5, /**< Response code indicating that the issued command is not supported
-                                                                  *   by the attached device.
-                                                                  */
-                       PIMA_RESPONSE_ParameterNotSupported  = 6, /**< Response code indicating that one or more of the issued command's
-                                                                  *   parameters are not supported by the device.
-                                                                  */
+                       SI_PIMA_RESPONSE_OK                    = 1, /**< Response code indicating no error in the issued command. */
+                       SI_PIMA_RESPONSE_GeneralError          = 2, /**< Response code indicating a general error while processing the
+                                                                    *  issued command.
+                                                                    */
+                       SI_PIMA_RESPONSE_SessionNotOpen        = 3, /**< Response code indicating that the sent command requires an open
+                                                                    *   session before being issued.
+                                                                    */
+                       SI_PIMA_RESPONSE_InvalidTransaction    = 4, /**< Response code indicating an invalid transaction occurred. */
+                       SI_PIMA_RESPONSE_OperationNotSupported = 5, /**< Response code indicating that the issued command is not supported
+                                                                    *   by the attached device.
+                                                                    */
+                       SI_PIMA_RESPONSE_ParameterNotSupported = 6, /**< Response code indicating that one or more of the issued command's
+                                                                    *   parameters are not supported by the device.
+                                                                    */
                };
        
        /* Type Defines: */
index a5a296d..44d1caa 100644 (file)
@@ -51,7 +51,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
 
        switch (USB_ControlRequest.bRequest)
        {
-               case REQ_GetLineEncoding:
+               case CDC_REQ_GetLineEncoding:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                Endpoint_ClearSETUP();
@@ -60,7 +60,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
                        }
                        
                        break;
-               case REQ_SetLineEncoding:
+               case CDC_REQ_SetLineEncoding:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                Endpoint_ClearSETUP();
@@ -71,7 +71,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
                        }
        
                        break;
-               case REQ_SetControlLineState:
+               case CDC_REQ_SetControlLineState:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
                        {                               
                                Endpoint_ClearSETUP();
@@ -83,7 +83,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
                        }
        
                        break;
-               case REQ_SendBreak:
+               case CDC_REQ_SendBreak:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
                        {                               
                                Endpoint_ClearSETUP();
@@ -248,7 +248,7 @@ void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDC
        USB_Request_Header_t Notification = (USB_Request_Header_t)
                {
                        .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
-                       .bRequest      = NOTIF_SerialState,
+                       .bRequest      = CDC_NOTIF_SerialState,
                        .wValue        = 0,
                        .wIndex        = 0,
                        .wLength       = sizeof(CDCInterfaceInfo->State.ControlLineStates.DeviceToHost),
index 1953d9f..5111eba 100644 (file)
@@ -45,7 +45,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
 
        switch (USB_ControlRequest.bRequest)
        {
-               case REQ_GetReport:
+               case HID_REQ_GetReport:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                uint16_t ReportSize = 0;
@@ -68,7 +68,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
                        }
                
                        break;
-               case REQ_SetReport:
+               case HID_REQ_SetReport:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                uint16_t ReportSize = USB_ControlRequest.wLength;
@@ -84,7 +84,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
                        }
                        
                        break;
-               case REQ_GetProtocol:
+               case HID_REQ_GetProtocol:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                Endpoint_ClearSETUP();
@@ -94,7 +94,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
                        }
                        
                        break;
-               case REQ_SetProtocol:
+               case HID_REQ_SetProtocol:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                Endpoint_ClearSETUP();
@@ -104,7 +104,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
                        }
                        
                        break;
-               case REQ_SetIdle:
+               case HID_REQ_SetIdle:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                Endpoint_ClearSETUP();
@@ -114,7 +114,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
                        }
                        
                        break;
-               case REQ_GetIdle:
+               case HID_REQ_GetIdle:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
                        {               
                                Endpoint_ClearSETUP();
@@ -158,7 +158,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
 
                memset(ReportINData, 0, sizeof(ReportINData));
 
-               bool ForceSend         = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, REPORT_ITEM_TYPE_In,
+               bool ForceSend         = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, HID_REPORT_ITEM_In,
                                                                             ReportINData, &ReportINSize);
                bool StatesChanged     = false;
                bool IdlePeriodElapsed = (HIDInterfaceInfo->State.IdleCount && !(HIDInterfaceInfo->State.IdleMSRemaining));
index 638dac1..e90f15d 100644 (file)
                         *  \param[in,out] ReportID          If preset to a non-zero value, this is the report ID being requested by the host. If zero, 
                         *                                   this should be set to the report ID of the generated HID input report (if any). If multiple
                         *                                   reports are not sent via the given HID interface, this parameter should be ignored.
-                        *  \param[in]     ReportType        Type of HID report to generate, either \ref REPORT_ITEM_TYPE_In or \ref REPORT_ITEM_TYPE_Feature.
+                        *  \param[in]     ReportType        Type of HID report to generate, either \ref HID_REPORT_ITEM_In or \ref HID_REPORT_ITEM_Feature.
                         *  \param[out]    ReportData        Pointer to a buffer where the generated HID report should be stored.
                         *  \param[out]    ReportSize        Number of bytes in the generated input report, or zero if no report is to be sent.
                         *
                         *  \param[in,out] HIDInterfaceInfo  Pointer to a structure containing a HID Class configuration and state.
                         *  \param[in]     ReportID          Report ID of the received output report. If multiple reports are not received via the given HID
                         *                                   interface, this parameter should be ignored.
-                        *  \param[in]     ReportType        Type of received HID report, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature.
+                        *  \param[in]     ReportType        Type of received HID report, either \ref HID_REPORT_ITEM_Out or \ref HID_REPORT_ITEM_Feature.
                         *  \param[in]     ReportData        Pointer to a buffer where the received HID report is stored.
                         *  \param[in]     ReportSize        Size in bytes of the received report from the host.
                         */
index 096a222..06ad2c8 100644 (file)
@@ -48,7 +48,7 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac
 
        switch (USB_ControlRequest.bRequest)
        {
-               case REQ_MassStorageReset:
+               case MS_REQ_MassStorageReset:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                Endpoint_ClearSETUP();
@@ -58,7 +58,7 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac
                        }
 
                        break;
-               case REQ_GetMaxLUN:
+               case MS_REQ_GetMaxLUN:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                Endpoint_ClearSETUP();
@@ -107,12 +107,12 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
                          Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
                          
                        MSInterfaceInfo->State.CommandStatus.Status = CALLBACK_MS_Device_SCSICommandReceived(MSInterfaceInfo) ?
-                                                                                        SCSI_Command_Pass : SCSI_Command_Fail;
+                                                                                        MS_SCSI_COMMAND_Pass : MS_SCSI_COMMAND_Fail;
                        MSInterfaceInfo->State.CommandStatus.Signature           = MS_CSW_SIGNATURE;
                        MSInterfaceInfo->State.CommandStatus.Tag                 = MSInterfaceInfo->State.CommandBlock.Tag;
                        MSInterfaceInfo->State.CommandStatus.DataTransferResidue = MSInterfaceInfo->State.CommandBlock.DataTransferLength;
 
-                       if ((MSInterfaceInfo->State.CommandStatus.Status == SCSI_Command_Fail) &&
+                       if ((MSInterfaceInfo->State.CommandStatus.Status == MS_SCSI_COMMAND_Fail) &&
                            (MSInterfaceInfo->State.CommandStatus.DataTransferResidue))
                        {
                                Endpoint_StallTransaction();
index ea9e8cf..394827e 100644 (file)
@@ -77,7 +77,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
 
        switch (USB_ControlRequest.bRequest)
        {
-               case REQ_SendEncapsulatedCommand:
+               case RNDIS_REQ_SendEncapsulatedCommand:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                Endpoint_ClearSETUP();
@@ -88,7 +88,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
                        }
                        
                        break;
-               case REQ_GetEncapsulatedResponse:
+               case RNDIS_REQ_GetEncapsulatedResponse:
                        if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
                        {
                                RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
index b9e4c9e..5a87c77 100644 (file)
@@ -212,7 +212,7 @@ void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
                USB_Request_Header_t Notification;
                Pipe_Read_Stream_LE(&Notification, sizeof(USB_Request_Header_t), NO_STREAM_CALLBACK);
                
-               if ((Notification.bRequest      == NOTIF_SerialState) &&
+               if ((Notification.bRequest      == CDC_NOTIF_SerialState) &&
                    (Notification.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)))
                {
                        Pipe_Read_Stream_LE(&CDCInterfaceInfo->State.ControlLineStates.DeviceToHost,
@@ -239,7 +239,7 @@ uint8_t CDC_Host_SetLineEncoding(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInf
        USB_ControlRequest = (USB_Request_Header_t)
        {
                .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
-               .bRequest      = REQ_SetLineEncoding,
+               .bRequest      = CDC_REQ_SetLineEncoding,
                .wValue        = 0,
                .wIndex        = CDCInterfaceInfo->State.ControlInterfaceNumber,
                .wLength       = sizeof(CDCInterfaceInfo->State.LineEncoding),
@@ -255,7 +255,7 @@ uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* const CDCI
        USB_ControlRequest = (USB_Request_Header_t)
        {
                .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
-               .bRequest      = REQ_SetControlLineState,
+               .bRequest      = CDC_REQ_SetControlLineState,
                .wValue        = CDCInterfaceInfo->State.ControlLineStates.HostToDevice,
                .wIndex        = CDCInterfaceInfo->State.ControlInterfaceNumber,
                .wLength       = 0,
@@ -272,7 +272,7 @@ uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
        USB_ControlRequest = (USB_Request_Header_t)
        {
                .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
-               .bRequest      = REQ_SendBreak,
+               .bRequest      = CDC_REQ_SendBreak,
                .wValue        = Duration,
                .wIndex        = CDCInterfaceInfo->State.ControlInterfaceNumber,
                .wLength       = 0,
index 0642ecd..bbb32cb 100644 (file)
@@ -62,12 +62,10 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
                 (CurrentHIDInterface->Protocol != HIDInterfaceInfo->Config.HIDInterfaceProtocol));
 
        HIDInterfaceInfo->State.InterfaceNumber      = CurrentHIDInterface->InterfaceNumber;
-       HIDInterfaceInfo->State.SupportsBootProtocol = (CurrentHIDInterface->SubClass != HID_NON_BOOT_PROTOCOL);
+       HIDInterfaceInfo->State.SupportsBootProtocol = (CurrentHIDInterface->SubClass != HID_BOOTP_NonBootProtocol);
 
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, DCOMP_HID_NextHID) != DESCRIPTOR_SEARCH_COMP_Found)
-       {
-               return HID_ENUMERROR_NoHIDDescriptorFound;
-       }
+         return HID_ENUMERROR_NoHIDDescriptorFound;
 
        HIDInterfaceInfo->State.HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_HID_Descriptor_HID_t).HIDReportLength;
 
@@ -127,7 +125,7 @@ static uint8_t DCOMP_HID_Host_NextHIDInterface(void* const CurrentDescriptor)
 
 static uint8_t DCOMP_HID_NextHID(void* const CurrentDescriptor)
 {
-       if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)
+       if (DESCRIPTOR_TYPE(CurrentDescriptor) == HID_DTYPE_HID)
          return DESCRIPTOR_SEARCH_Found;
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
          return DESCRIPTOR_SEARCH_Fail;
@@ -161,10 +159,10 @@ uint8_t HID_Host_ReceiveReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
        USB_ControlRequest = (USB_Request_Header_t)
        {
                .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
-               .bRequest      = REQ_SetReport,
-               .wValue        = ((REPORT_ITEM_TYPE_In + 1) << 8) | ReportID,
+               .bRequest      = HID_REQ_SetReport,
+               .wValue        = ((HID_REPORT_ITEM_In + 1) << 8) | ReportID,
                .wIndex        = HIDInterfaceInfo->State.InterfaceNumber,
-               .wLength       = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In),
+               .wLength       = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, HID_REPORT_ITEM_In),
        };
 
        Pipe_SelectPipe(PIPE_CONTROLPIPE);
@@ -198,7 +196,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
                        *(BufferPos++) = ReportID;
                }
                
-               ReportSize = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In);
+               ReportSize = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, HID_REPORT_ITEM_In);
        }
        else
 #endif
@@ -227,7 +225,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
        if ((USB_HostState != HOST_STATE_Configured) || !(HIDInterfaceInfo->State.IsActive))
          return false;
 
-       if (HIDInterfaceInfo->State.DeviceUsesOUTPipe && (ReportType == REPORT_ITEM_TYPE_Out))
+       if (HIDInterfaceInfo->State.DeviceUsesOUTPipe && (ReportType == HID_REPORT_ITEM_Out))
        {
                uint8_t ErrorCode;
        
@@ -251,7 +249,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
                USB_ControlRequest = (USB_Request_Header_t)
                {
                        .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
-                       .bRequest      = REQ_SetReport,
+                       .bRequest      = HID_REQ_SetReport,
 #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
                        .wValue        = ((ReportType + 1) << 8) | ReportID,
 #else
@@ -291,7 +289,7 @@ uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInf
        USB_ControlRequest = (USB_Request_Header_t)
                {
                        .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
-                       .bRequest      = REQ_SetProtocol,
+                       .bRequest      = HID_REQ_SetProtocol,
                        .wValue        = 0,
                        .wIndex        = HIDInterfaceInfo->State.InterfaceNumber,
                        .wLength       = 0,
@@ -322,7 +320,7 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
                {
                        .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_INTERFACE),
                        .bRequest      = REQ_GetDescriptor,
-                       .wValue        = (DTYPE_Report << 8),
+                       .wValue        = (HID_DTYPE_Report << 8),
                        .wIndex        = HIDInterfaceInfo->State.InterfaceNumber,
                        .wLength       = HIDInterfaceInfo->State.HIDReportSize,
                };
@@ -337,7 +335,7 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
                USB_ControlRequest = (USB_Request_Header_t)
                        {
                                .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
-                               .bRequest      = REQ_SetProtocol,
+                               .bRequest      = HID_REQ_SetProtocol,
                                .wValue        = 1,
                                .wIndex        = HIDInterfaceInfo->State.InterfaceNumber,
                                .wLength       = 0,
index 88d1664..914d432 100644 (file)
@@ -92,9 +92,8 @@
                                        bool     DataOUTPipeDoubleBank; /**< Indicates if the HID interface's OUT data pipe should use double banking. */
 
                                        uint8_t  HIDInterfaceProtocol; /**< HID interface protocol value to match against if a specific
-                                                                       *   boot subclass protocol is required, either \ref HID_BOOT_MOUSE_PROTOCOL,
-                                                                                                       *   \ref HID_BOOT_KEYBOARD_PROTOCOL or \ref HID_NON_BOOT_PROTOCOL if any
-                                                                                                       *   HID device should be enumerated by the interface.
+                                                                       *   boot subclass protocol is required, a value from the \ref HID_BootProtocols_t
+                                                                       *   enum.
                                                                        */
                                        #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
                                        HID_ReportInfo_t* HIDParserData; /**< HID parser data to store the parsed HID report data, when boot protocol
                         *
                         *  \param[in,out] HIDInterfaceInfo  Pointer to a structure containing a HID Class host configuration and state.
                         *  \param[in]     ReportID          Report ID of the report to send to the device, or 0 if the device does not use report IDs.
-                        *  \param[in]     ReportType        Type of report to issue to the device, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature.
+                        *  \param[in]     ReportType        Type of report to issue to the device, either \ref HID_REPORT_ITEM_Out or \ref HID_REPORT_ITEM_Feature.
                         *  \param[in]     Buffer            Buffer containing the report to send to the attached device.
                         *  \param[in]     ReportSize        Report size in bytes to send to the attached device.
                         *
index 49f9452..58ee000 100644 (file)
@@ -244,11 +244,11 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
                                        uint8_t ItemTag = (HIDReportItem & TAG_MASK);
 
                                        if (ItemTag == TAG_MAIN_INPUT)
-                                         NewReportItem.ItemType = REPORT_ITEM_TYPE_In;
+                                         NewReportItem.ItemType = HID_REPORT_ITEM_In;
                                        else if (ItemTag == TAG_MAIN_OUTPUT)
-                                         NewReportItem.ItemType = REPORT_ITEM_TYPE_Out;
+                                         NewReportItem.ItemType = HID_REPORT_ITEM_Out;
                                        else
-                                         NewReportItem.ItemType = REPORT_ITEM_TYPE_Feature;
+                                         NewReportItem.ItemType = HID_REPORT_ITEM_Feature;
                                        
                                        NewReportItem.BitOffset = CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType];
 
index dfa954c..0366703 100644 (file)
@@ -284,7 +284,7 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* const MSInterf
        Pipe_ClearIN();
        Pipe_Freeze();
        
-       if (SCSICommandStatus->Status != SCSI_Command_Pass)
+       if (SCSICommandStatus->Status != MS_SCSI_COMMAND_Pass)
          ErrorCode = MS_ERROR_LOGICAL_CMD_FAILED;
        
        return ErrorCode;
index cddd5cb..b3d0f30 100644 (file)
@@ -202,7 +202,7 @@ static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const R
        USB_ControlRequest = (USB_Request_Header_t)
                {
                        .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
-                       .bRequest      = REQ_SendEncapsulatedCommand,
+                       .bRequest      = RNDIS_REQ_SendEncapsulatedCommand,
                        .wValue        = 0,
                        .wIndex        = RNDISInterfaceInfo->State.ControlInterfaceNumber,
                        .wLength       = Length,
@@ -219,7 +219,7 @@ static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const R
        USB_ControlRequest = (USB_Request_Header_t)
                {
                        .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
-                       .bRequest      = REQ_GetEncapsulatedResponse,
+                       .bRequest      = RNDIS_REQ_GetEncapsulatedResponse,
                        .wValue        = 0,
                        .wIndex        = RNDISInterfaceInfo->State.ControlInterfaceNumber,
                        .wLength       = Length,
index e08fc76..3883d3b 100644 (file)
@@ -36,9 +36,9 @@
 #define  __INCLUDE_FROM_SI_DRIVER
 #include "StillImage.h"
 
-uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                   uint16_t ConfigDescriptorSize,
-                                   void* DeviceConfigDescriptor)
+uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                               uint16_t ConfigDescriptorSize,
+                               void* DeviceConfigDescriptor)
 {
        uint8_t  FoundEndpoints = 0;
        
@@ -145,8 +145,8 @@ uint8_t DCOMP_SI_Host_NextSIInterfaceEndpoint(void* const CurrentDescriptor)
        return DESCRIPTOR_SEARCH_NotFound;
 }
 
-uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                    SI_PIMA_Container_t* const PIMAHeader)
+uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                SI_PIMA_Container_t* const PIMAHeader)
 {
        uint8_t ErrorCode;
        
@@ -176,8 +176,8 @@ uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceIn
        return PIPE_RWSTREAM_NoError;
 }
 
-uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                       SI_PIMA_Container_t* const PIMAHeader)
+uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                   SI_PIMA_Container_t* const PIMAHeader)
 {
        uint16_t TimeoutMSRem        = COMMAND_DATA_TIMEOUT_MS;
        uint16_t PreviousFrameNumber = USB_Host_GetFrameNumber();
@@ -226,7 +226,7 @@ uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfac
        
        Pipe_Read_Stream_LE(PIMAHeader, PIMA_COMMAND_SIZE(0), NO_STREAM_CALLBACK);
        
-       if (PIMAHeader->Type == CType_ResponseBlock)
+       if (PIMAHeader->Type == SI_PIMA_CONTAINER_ResponseBlock)
        {
                uint8_t ParamBytes = (PIMAHeader->DataLength - PIMA_COMMAND_SIZE(0));
 
@@ -241,9 +241,9 @@ uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfac
        return PIPE_RWSTREAM_NoError;
 }
 
-uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                             void* Buffer,
-                             const uint16_t Bytes)
+uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                         void* Buffer,
+                         const uint16_t Bytes)
 {
        uint8_t ErrorCode;
 
@@ -261,9 +261,9 @@ uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
        return ErrorCode;
 }
 
-uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                             void* Buffer,
-                             const uint16_t Bytes)
+uint8_t SI_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                         void* Buffer,
+                         const uint16_t Bytes)
 {
        uint8_t ErrorCode;
 
@@ -280,7 +280,7 @@ uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
        return ErrorCode;
 }
 
-bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
+bool SI_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
 {
        bool IsEventReceived = false;
 
@@ -298,8 +298,8 @@ bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
        return IsEventReceived;
 }
 
-uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                       SI_PIMA_Container_t* const PIMAHeader)
+uint8_t SI_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                   SI_PIMA_Container_t* const PIMAHeader)
 {
        uint8_t ErrorCode;
 
@@ -317,7 +317,7 @@ uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfac
        return ErrorCode;
 }
 
-uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
+uint8_t SI_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
 {
        if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
          return HOST_SENDCONTROL_DeviceDisconnected;
@@ -328,20 +328,20 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
        SIInterfaceInfo->State.IsSessionOpen = false;
 
        SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
-                                                       {
-                                                               .DataLength    = PIMA_COMMAND_SIZE(1),
-                                                               .Type          = CType_CommandBlock,
-                                                               .Code          = 0x1002,
-                                                               .Params        = {1},
-                                                       };
-                                                       
-       if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
+               {
+                       .DataLength    = PIMA_COMMAND_SIZE(1),
+                       .Type          = SI_PIMA_CONTAINER_CommandBlock,
+                       .Code          = 0x1002,
+                       .Params        = {1},
+               };
+       
+       if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
          return ErrorCode;
          
-       if ((ErrorCode = SImage_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
+       if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
          return ErrorCode;
          
-       if ((PIMABlock.Type != CType_ResponseBlock) || (PIMABlock.Code != 0x2001))
+       if ((PIMABlock.Type != SI_PIMA_CONTAINER_ResponseBlock) || (PIMABlock.Code != 0x2001))
          return SI_ERROR_LOGICAL_CMD_FAILED;
          
        SIInterfaceInfo->State.IsSessionOpen = true;
@@ -349,7 +349,7 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
        return PIPE_RWSTREAM_NoError;
 }
 
-uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
+uint8_t SI_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
 {
        if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
          return HOST_SENDCONTROL_DeviceDisconnected;
@@ -357,31 +357,31 @@ uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
        uint8_t ErrorCode;
 
        SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
-                                                       {
-                                                               .DataLength    = PIMA_COMMAND_SIZE(1),
-                                                               .Type          = CType_CommandBlock,
-                                                               .Code          = 0x1003,
-                                                               .Params        = {1},
-                                                       };
-                                                       
-       if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
+               {
+                       .DataLength    = PIMA_COMMAND_SIZE(1),
+                       .Type          = SI_PIMA_CONTAINER_CommandBlock,
+                       .Code          = 0x1003,
+                       .Params        = {1},
+               };
+       
+       if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
          return ErrorCode;
          
-       if ((ErrorCode = SImage_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
+       if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
          return ErrorCode;
 
        SIInterfaceInfo->State.IsSessionOpen = false;
 
-       if ((PIMABlock.Type != CType_ResponseBlock) || (PIMABlock.Code != 0x2001))
+       if ((PIMABlock.Type != SI_PIMA_CONTAINER_ResponseBlock) || (PIMABlock.Code != 0x2001))
          return SI_ERROR_LOGICAL_CMD_FAILED;
 
        return PIPE_RWSTREAM_NoError;
 }
 
-uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                const uint16_t Operation,
-                                const uint8_t TotalParams,
-                                uint32_t* const Params)
+uint8_t SI_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                            const uint16_t Operation,
+                            const uint8_t TotalParams,
+                            uint32_t* const Params)
 {
        if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
          return HOST_SENDCONTROL_DeviceDisconnected;
@@ -389,21 +389,21 @@ uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
        uint8_t ErrorCode;
 
        SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
-                                                       {
-                                                               .DataLength    = PIMA_COMMAND_SIZE(TotalParams),
-                                                               .Type          = CType_CommandBlock,
-                                                               .Code          = Operation,
-                                                       };
+               {
+                       .DataLength    = PIMA_COMMAND_SIZE(TotalParams),
+                       .Type          = SI_PIMA_CONTAINER_CommandBlock,
+                       .Code          = Operation,
+               };
                                                        
        memcpy(&PIMABlock.Params, Params, sizeof(uint32_t) * TotalParams);
                                                        
-       if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
+       if ((ErrorCode = SI_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
          return ErrorCode;
 
        return PIPE_RWSTREAM_NoError;
 }
 
-uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
+uint8_t SI_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
 {
        uint8_t ErrorCode;
        SI_PIMA_Container_t PIMABlock;
@@ -411,10 +411,10 @@ uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceIn
        if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
          return HOST_SENDCONTROL_DeviceDisconnected;
 
-       if ((ErrorCode = SImage_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
+       if ((ErrorCode = SI_Host_ReceiveBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
          return ErrorCode;
 
-       if ((PIMABlock.Type != CType_ResponseBlock) || (PIMABlock.Code != 0x2001))
+       if ((PIMABlock.Type != SI_PIMA_CONTAINER_ResponseBlock) || (PIMABlock.Code != 0x2001))
          return SI_ERROR_LOGICAL_CMD_FAILED;
          
        return PIPE_RWSTREAM_NoError;
index a15091b..c215f10 100644 (file)
@@ -97,7 +97,7 @@
                                struct
                                {
                                        bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
-                                                       *   after \ref SImage_Host_ConfigurePipes() is called and the Host state machine is in the
+                                                       *   after \ref SI_Host_ConfigurePipes() is called and the Host state machine is in the
                                                        *   Configured state.
                                                        */
 
                        } USB_ClassInfo_SI_Host_t;
        
                /* Enums: */
-                       /** Enum for the possible error codes returned by the \ref SImage_Host_ConfigurePipes() function. */
+                       /** Enum for the possible error codes returned by the \ref SI_Host_ConfigurePipes() function. */
                        enum SIHost_EnumerationFailure_ErrorCodes_t
                        {
                                SI_ENUMERROR_NoError                    = 0, /**< Configuration Descriptor was processed successfully. */
                         *
                         *  \return A value from the \ref SIHost_EnumerationFailure_ErrorCodes_t enum.
                         */
-                       uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                                          uint16_t ConfigDescriptorSize,
-                                                          void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
+                       uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                                      uint16_t ConfigDescriptorSize,
+                                                      void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
 
                        /** Opens a new PIMA session with the attached device. This should be used before any session-orientated PIMA commands
                         *  are issued to the device. Only one session can be open at the one time.
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
                         *          returned a logical command failure.
                         */
-                       uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
+                       uint8_t SI_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
 
                        /** Closes an already opened PIMA session with the attached device. This should be used after all session-orientated
                         *  PIMA commands have been issued to the device.
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
                         *          returned a logical command failure.
                         */
-                       uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
+                       uint8_t SI_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
 
                        /** Sends a raw PIMA block header to the device, filling out the transaction ID automatically. This can be used to send
                         *  arbitrary PIMA blocks to the device with or without parameters.
                         *
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
                         */
-                       uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                                           SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
-                                                           ATTR_NON_NULL_PTR_ARG(2);
+                       uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                                       SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
+                                                       ATTR_NON_NULL_PTR_ARG(2);
                        
                        /** Receives a raw PIMA block header to the device. This can be used to receive arbitrary PIMA blocks from the device with
                         *  or without parameters.
                         *
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
                         */
-                       uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                                              SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
-                                                              ATTR_NON_NULL_PTR_ARG(2);
+                       uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                                          SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
+                                                          ATTR_NON_NULL_PTR_ARG(2);
 
                        /** Sends a given PIMA command to the attached device, filling out the PIMA command header's Transaction ID automatically.
                         *      
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
                         *          returned a logical command failure.
                         */
-                       uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                                       const uint16_t Operation,
-                                                       const uint8_t TotalParams,
-                                                       uint32_t* const Params) ATTR_NON_NULL_PTR_ARG(1);
+                       uint8_t SI_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                                   const uint16_t Operation,
+                                                   const uint8_t TotalParams,
+                                                   uint32_t* const Params) ATTR_NON_NULL_PTR_ARG(1);
 
                        /** Receives and checks a response block from the attached PIMA device, once a command has been issued and all data
                         *  associated with the command has been transferred.
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
                         *          returned a logical command failure.
                         */
-                       uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
+                       uint8_t SI_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
 
                        /** Indicates if the device has issued a PIMA event block to the host via the asynchronous events pipe.
                         *
                         *
                         *  \return Boolean true if an event is waiting to be read, false otherwise.
                         */
-                       bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
+                       bool SI_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
 
                        /** Receives an asynchronous event block from the device via the asynchronous events pipe.
                         *
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
                         *          returned a logical command failure.
                         */
-                       uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                                              SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
-                                                              ATTR_NON_NULL_PTR_ARG(2);
+                       uint8_t SI_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                                          SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
+                                                          ATTR_NON_NULL_PTR_ARG(2);
                        
                        /** Sends arbitrary data to the attached device, for use in the data phase of PIMA commands which require data
                         *  transfer beyond the regular PIMA command block parameters.
                         *
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
                         */
-                       uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                                    void* Buffer,
-                                                    const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
+                       uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                                void* Buffer,
+                                                const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
 
                        /** Receives arbitrary data from the attached device, for use in the data phase of PIMA commands which require data
                         *  transfer beyond the regular PIMA command block parameters.
                         *
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
                         */
-                       uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
-                                                    void* Buffer,
-                                                    const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
+                       uint8_t SI_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
+                                                void* Buffer,
+                                                const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
                
                /* Inline Functions: */
                        /** General management task for a given Still Image host class interface, required for the correct operation of the
                         *
                         *  \param[in,out] SIInterfaceInfo  Pointer to a structure containing a Still Image Class host configuration and state.
                         */
-                       static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
-                       static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
+                       static inline void SI_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
+                       static inline void SI_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
                        {
                                (void)SIInterfaceInfo;
                        }               
index 4339479..00b60c3 100644 (file)
                         *  \see The USB specification for more details on the possible Endpoint usage attributes.
                         */
                        #define ENDPOINT_USAGE_IMPLICIT_FEEDBACK  (2 << 4)
-
+                       
                /* Enums: */
                        /** Enum for the possible standard descriptor types, as given in each descriptor's header. */
                        enum USB_DescriptorTypes_t
                                DTYPE_Other                = 0x07, /**< Indicates that the descriptor is of other type. */
                                DTYPE_InterfacePower       = 0x08, /**< Indicates that the descriptor is an interface power descriptor. */
                                DTYPE_InterfaceAssociation = 0x0B, /**< Indicates that the descriptor is an interface association descriptor. */
+                               DTYPE_CSInterface          = 0x24, /**< Indicates that the descriptor is a class specific interface descriptor. */
+                               DTYPE_CSEndpoint           = 0x25, /**< Indicates that the descriptor is a class specific endpoint descriptor. */
                        };
 
                /* Type Defines: */
index 21bc873..b826830 100644 (file)
@@ -42,6 +42,7 @@
   *    to free up the Start of Frame flag for interrupt use in the user application
   *  - All project makefiles now correctly clean intermediate build files from assembly and C++ sources (thanks to Daniel Czigany)
   *  - Removed the EVENT_USB_InitFailure() event, not specifying a USB mode now defaults to UID selection mode
+  *  - Renamed and moved class driver common constant definitions to make the naming scheme more uniform
   *
   *  <b>Fixed:</b>
   *  - Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist
index 6e77eff..b1196d7 100644 (file)
   *      -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error
   *      -# Change makefiles to allow for absolute LUFA location to be used
   *      -# Re-add interrupt Pipe/Endpoint support
+  *      -# Fix intermittent device mode enumeration errors
   *  - Documentation/Support
   *      -# Add detailed overviews of how each demo works
   *      -# Add board overviews
   *      -# Write LUFA tutorials
-  *      -# Add makefile template
   *  - Demos/Projects
   *      -# Multiple-Report HID device
   *      -# Device/Host USB bridge
@@ -31,6 +31,7 @@
   *      -# Finish BluetoothHost demo
   *      -# Finish SideShow demo
   *      -# Finish StandaloneProgrammer project
+  *      -# Arduino Uno compatible USB-MIDI, USB-HID
   *  - Ports
   *      -# AVR32 UC3B series microcontrollers
   *      -# Atmel ARM7 series microcontrollers
index 414a4a3..40a7ec6 100644 (file)
@@ -32,6 +32,8 @@
  *      replace all references to the obsolete function name with the new function name.
  *    - The names of the class specific descriptor type defines in the USB Class drivers have changed - refer to the driver documentation
  *      for each class driver for the new class specific descriptor type names.
+ *    - The Still Image Host class' function prefix has been changed from "SImage_" to "SI_", to remain consistent with the rest of the
+ *      driver's enums, type defines and constants.
  *
  * \section Sec_Migration100807 Migrating from 100513 to 100807
  *
  *
  *  <b>Host Mode</b>
  *    - The Still Image Host Class driver SI_Host_USBTask() and SI_Host_ConfigurePipes() functions were misnamed, and are
- *      now named \ref SImage_Host_USBTask() and \ref SImage_Host_ConfigurePipes() respectively.
+ *      now named SImage_Host_USBTask() and SImage_Host_ConfigurePipes() respectively.
  *    - The HOST_SENDCONTROL_DeviceDisconnect enum value has been renamed to \ref HOST_SENDCONTROL_DeviceDisconnected to be in
  *      line with the rest of the library error codes.
  *    - The HID Parser item usages no longer contain separate minimum and maximum values, as this was a violation of the HID
index 282bbdc..a4af11c 100644 (file)
@@ -102,28 +102,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
-       .CDC_Functional_IntHeader = 
+       .CDC_Functional_Header = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
                        
-                       .Data                   = {0x01, 0x10}
+                       .CDCSpecification       = VERSION_BCD(01.10),
                },
 
-       .CDC_Functional_AbstractControlManagement = 
+       .CDC_Functional_ACM = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
-                       .SubType                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
                        
-                       .Data                   = {0x06}
+                       .Capabilities           = 0x06,
                },
                
        .CDC_Functional_Union = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
                        
-                       .Data                   = {0x00, 0x01}
+                       .MasterInterfaceNumber  = 0,
+                       .SlaveInterfaceNumber   = 1,
                },
 
        .CDC_NotificationEndpoint = 
index ce29816..361fe90 100644 (file)
@@ -67,9 +67,9 @@
                {
                        USB_Descriptor_Configuration_Header_t    Config;
                        USB_Descriptor_Interface_t               CDC_CCI_Interface;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_IntHeader;
-                       CDC_FUNCTIONAL_DESCRIPTOR(1)             CDC_Functional_AbstractControlManagement;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_Union;
+                       USB_CDC_Descriptor_FunctionalHeader_t    CDC_Functional_Header;
+                       USB_CDC_Descriptor_FunctionalACM_t       CDC_Functional_ACM;
+                       USB_CDC_Descriptor_FunctionalUnion_t     CDC_Functional_Union;
                        USB_Descriptor_Endpoint_t                CDC_NotificationEndpoint;
                        USB_Descriptor_Interface_t               CDC_DCI_Interface;
                        USB_Descriptor_Endpoint_t                CDC_DataOutEndpoint;
index 71d7813..9008584 100644 (file)
@@ -114,28 +114,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
-       .CDC_Functional_IntHeader = 
+       .CDC_Functional_Header = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
                        
-                       .Data                   = {0x01, 0x10}
+                       .CDCSpecification       = VERSION_BCD(01.10),
                },
 
-       .CDC_Functional_AbstractControlManagement = 
+       .CDC_Functional_ACM = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
-                       .SubType                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
                        
-                       .Data                   = {0x06}
+                       .Capabilities           = 0x06,
                },
                
        .CDC_Functional_Union = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
                        
-                       .Data                   = {0x00, 0x01}
+                       .MasterInterfaceNumber  = 0,
+                       .SlaveInterfaceNumber   = 1,
                },
 
        .CDC_NotificationEndpoint = 
index 1c1f469..159d8d2 100644 (file)
@@ -67,9 +67,9 @@
                {
                        USB_Descriptor_Configuration_Header_t    Config;
                        USB_Descriptor_Interface_t               CDC_CCI_Interface;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_IntHeader;
-                       CDC_FUNCTIONAL_DESCRIPTOR(1)             CDC_Functional_AbstractControlManagement;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_Union;
+                       USB_CDC_Descriptor_FunctionalHeader_t    CDC_Functional_Header;
+                       USB_CDC_Descriptor_FunctionalACM_t       CDC_Functional_ACM;
+                       USB_CDC_Descriptor_FunctionalUnion_t     CDC_Functional_Union;
                        USB_Descriptor_Endpoint_t                CDC_NotificationEndpoint;
                        USB_Descriptor_Interface_t               CDC_DCI_Interface;
                        USB_Descriptor_Endpoint_t                CDC_DataOutEndpoint;
index 41c1c4b..a041760 100644 (file)
@@ -138,12 +138,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
        .HID_KeyboardHID = 
                {  
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
                        
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(KeyboardReport)
                },
                
@@ -234,11 +234,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID:
+               case HID_DTYPE_HID:
                        Address = &ConfigurationDescriptor.HID_KeyboardHID;
                        Size    = sizeof(USB_HID_Descriptor_HID_t);
                        break;
-               case DTYPE_Report:
+               case HID_DTYPE_Report:
                        Address = &KeyboardReport;
                        Size    = sizeof(KeyboardReport);
                        break;
index afc0b93..9a551a1 100644 (file)
@@ -165,7 +165,7 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID  Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
- *  \param[in] ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out] ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out] ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -209,7 +209,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID interface structure for the HID interface being referenced
  *  \param[in] ReportID          Report ID of the received report from the host
- *  \param[in] ReportType        The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType        The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData        Pointer to the report buffer where the received report is stored
  *  \param[in] ReportSize        Size in bytes of the report received from the host
  */
index 1b8a4a2..deb88ab 100644 (file)
@@ -171,19 +171,19 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                
                        .Class                  = 0x03,
                        .SubClass               = 0x00,
-                       .Protocol               = HID_NON_BOOT_PROTOCOL,
+                       .Protocol               = HID_BOOTP_NonBootProtocol,
                                
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .HID_GenericHID = 
                {
-                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = DTYPE_HID},
+                       .Header                 = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
                                                                         
                        .HIDSpec                = VERSION_BCD(01.11),
                        .CountryCode            = 0x00,
                        .TotalReportDescriptors = 1,
-                       .HIDReportType          = DTYPE_Report,
+                       .HIDReportType          = HID_DTYPE_Report,
                        .HIDReportLength        = sizeof(GenericReport)
                },
 
@@ -275,11 +275,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                        }
                        
                        break;
-               case DTYPE_HID: 
+               case HID_DTYPE_HID: 
                        Address = &ConfigurationDescriptor.HID_GenericHID;
                        Size    = sizeof(USB_HID_Descriptor_HID_t);
                        break;
-               case DTYPE_Report: 
+               case HID_DTYPE_Report: 
                        Address = &GenericReport;
                        Size    = sizeof(GenericReport);
                        break;
index 607e225..bf5fd39 100644 (file)
@@ -272,7 +272,7 @@ bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSI
  *  \param[in]     HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in,out] ReportID    Report ID requested by the host if non-zero, otherwise callback should set to the 
  *                             generated report ID
- *  \param[in]     ReportType  Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature
+ *  \param[in]     ReportType  Type of the report to create, either HID_REPORT_ITEM_In or HID_REPORT_ITEM_Feature
  *  \param[out]    ReportData  Pointer to a buffer where the created report should be stored
  *  \param[out]    ReportSize  Number of bytes written in the report (or zero if no report is to be sent
  *
@@ -299,7 +299,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *
  *  \param[in] HIDInterfaceInfo  Pointer to the HID class interface configuration structure being referenced
  *  \param[in] ReportID    Report ID of the received report from the host
- *  \param[in] ReportType  The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
+ *  \param[in] ReportType  The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
index 7fa6ab9..a7275ae 100644 (file)
@@ -114,28 +114,29 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
-       .CDC_Functional_IntHeader = 
+       .CDC_Functional_Header = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
                        
-                       .Data                   = {0x01, 0x10}
+                       .CDCSpecification       = VERSION_BCD(01.10),
                },
 
-       .CDC_Functional_AbstractControlManagement = 
+       .CDC_Functional_ACM = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
-                       .SubType                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
                        
-                       .Data                   = {0x06}
+                       .Capabilities           = 0x06,
                },
                
        .CDC_Functional_Union = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
                        
-                       .Data                   = {0x00, 0x01}
+                       .MasterInterfaceNumber  = 0,
+                       .SlaveInterfaceNumber   = 1,
                },
 
        .CDC_NotificationEndpoint = 
index 0bd07d3..787796b 100644 (file)
@@ -67,9 +67,9 @@
                {
                        USB_Descriptor_Configuration_Header_t    Config;
                        USB_Descriptor_Interface_t               CDC_CCI_Interface;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_IntHeader;
-                       CDC_FUNCTIONAL_DESCRIPTOR(1)             CDC_Functional_AbstractControlManagement;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_Union;
+                       USB_CDC_Descriptor_FunctionalHeader_t    CDC_Functional_Header;
+                       USB_CDC_Descriptor_FunctionalACM_t       CDC_Functional_ACM;
+                       USB_CDC_Descriptor_FunctionalUnion_t     CDC_Functional_Union;
                        USB_Descriptor_Endpoint_t                CDC_NotificationEndpoint;
                        USB_Descriptor_Interface_t               CDC_DCI_Interface;
                        USB_Descriptor_Endpoint_t                CDC_DataOutEndpoint;
index 2baedd4..e0a78e3 100644 (file)
@@ -114,28 +114,29 @@ USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor =
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
-       .CDC_Functional_IntHeader = 
+       .CDC_Functional_Header = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
                        
-                       .Data                   = {0x01, 0x10}
+                       .CDCSpecification       = VERSION_BCD(01.10),
                },
 
-       .CDC_Functional_AbstractControlManagement = 
+       .CDC_Functional_ACM = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
-                       .SubType                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
                        
-                       .Data                   = {0x06}
+                       .Capabilities           = 0x06,
                },
                
        .CDC_Functional_Union = 
                {
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
-                       .SubType                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
                        
-                       .Data                   = {0x00, 0x01}
+                       .MasterInterfaceNumber  = 0,
+                       .SlaveInterfaceNumber   = 1,
                },
 
        .CDC_NotificationEndpoint = 
index 1071355..cac0a98 100644 (file)
@@ -67,9 +67,9 @@
                {
                        USB_Descriptor_Configuration_Header_t    Config;
                        USB_Descriptor_Interface_t               CDC_CCI_Interface;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_IntHeader;
-                       CDC_FUNCTIONAL_DESCRIPTOR(1)             CDC_Functional_AbstractControlManagement;
-                       CDC_FUNCTIONAL_DESCRIPTOR(2)             CDC_Functional_Union;
+                       USB_CDC_Descriptor_FunctionalHeader_t    CDC_Functional_Header;
+                       USB_CDC_Descriptor_FunctionalACM_t       CDC_Functional_ACM;
+                       USB_CDC_Descriptor_FunctionalUnion_t     CDC_Functional_Union;
                        USB_Descriptor_Endpoint_t                CDC_NotificationEndpoint;
                        USB_Descriptor_Interface_t               CDC_DCI_Interface;
                        USB_Descriptor_Endpoint_t                CDC_DataOutEndpoint;