Extract interface numbers into enums.
authorLászló Monda <laci@monda.hu>
Sun, 6 Oct 2013 20:16:20 +0000 (22:16 +0200)
committerLászló Monda <laci@monda.hu>
Sun, 6 Oct 2013 20:16:20 +0000 (22:16 +0200)
125 files changed:
Bootloaders/CDC/Descriptors.c
Bootloaders/CDC/Descriptors.h
Bootloaders/DFU/BootloaderDFU.h
Bootloaders/DFU/Descriptors.c
Bootloaders/DFU/Descriptors.h
Bootloaders/HID/Descriptors.c
Bootloaders/HID/Descriptors.h
Bootloaders/MassStorage/BootloaderMassStorage.c
Bootloaders/MassStorage/Descriptors.c
Bootloaders/MassStorage/Descriptors.h
Bootloaders/Printer/BootloaderPrinter.c
Bootloaders/Printer/Descriptors.c
Bootloaders/Printer/Descriptors.h
Demos/Device/ClassDriver/AudioInput/AudioInput.c
Demos/Device/ClassDriver/AudioInput/Descriptors.c
Demos/Device/ClassDriver/AudioInput/Descriptors.h
Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
Demos/Device/ClassDriver/AudioOutput/Descriptors.c
Demos/Device/ClassDriver/AudioOutput/Descriptors.h
Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c
Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h
Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c
Demos/Device/ClassDriver/GenericHID/Descriptors.c
Demos/Device/ClassDriver/GenericHID/Descriptors.h
Demos/Device/ClassDriver/GenericHID/GenericHID.c
Demos/Device/ClassDriver/Joystick/Descriptors.c
Demos/Device/ClassDriver/Joystick/Descriptors.h
Demos/Device/ClassDriver/Joystick/Joystick.c
Demos/Device/ClassDriver/Keyboard/Descriptors.c
Demos/Device/ClassDriver/Keyboard/Descriptors.h
Demos/Device/ClassDriver/Keyboard/Keyboard.c
Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c
Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h
Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c
Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h
Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c
Demos/Device/ClassDriver/MIDI/Descriptors.c
Demos/Device/ClassDriver/MIDI/Descriptors.h
Demos/Device/ClassDriver/MIDI/MIDI.c
Demos/Device/ClassDriver/MassStorage/Descriptors.c
Demos/Device/ClassDriver/MassStorage/Descriptors.h
Demos/Device/ClassDriver/MassStorage/MassStorage.c
Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c
Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h
Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
Demos/Device/ClassDriver/Mouse/Descriptors.c
Demos/Device/ClassDriver/Mouse/Descriptors.h
Demos/Device/ClassDriver/Mouse/Mouse.c
Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c
Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h
Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
Demos/Device/ClassDriver/VirtualSerial/Descriptors.c
Demos/Device/ClassDriver/VirtualSerial/Descriptors.h
Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c
Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c
Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h
Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c
Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c
Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h
Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c
Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c
Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h
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/DualVirtualSerial/Descriptors.c
Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h
Demos/Device/LowLevel/GenericHID/Descriptors.c
Demos/Device/LowLevel/GenericHID/Descriptors.h
Demos/Device/LowLevel/Joystick/Descriptors.c
Demos/Device/LowLevel/Joystick/Descriptors.h
Demos/Device/LowLevel/Keyboard/Descriptors.c
Demos/Device/LowLevel/Keyboard/Descriptors.h
Demos/Device/LowLevel/KeyboardMouse/Descriptors.c
Demos/Device/LowLevel/KeyboardMouse/Descriptors.h
Demos/Device/LowLevel/MIDI/Descriptors.c
Demos/Device/LowLevel/MIDI/Descriptors.h
Demos/Device/LowLevel/MassStorage/Descriptors.c
Demos/Device/LowLevel/MassStorage/Descriptors.h
Demos/Device/LowLevel/Mouse/Descriptors.c
Demos/Device/LowLevel/Mouse/Descriptors.h
Demos/Device/LowLevel/RNDISEthernet/Descriptors.c
Demos/Device/LowLevel/RNDISEthernet/Descriptors.h
Demos/Device/LowLevel/VirtualSerial/Descriptors.c
Demos/Device/LowLevel/VirtualSerial/Descriptors.h
Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c
Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h
Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c
Projects/AVRISP-MKII/AVRISPDescriptors.c
Projects/AVRISP-MKII/AVRISPDescriptors.h
Projects/Benito/Benito.c
Projects/Benito/Descriptors.c
Projects/Benito/Descriptors.h
Projects/LEDNotifier/Descriptors.c
Projects/LEDNotifier/Descriptors.h
Projects/LEDNotifier/LEDNotifier.c
Projects/MIDIToneGenerator/Descriptors.c
Projects/MIDIToneGenerator/Descriptors.h
Projects/MIDIToneGenerator/MIDIToneGenerator.c
Projects/Magstripe/Descriptors.c
Projects/Magstripe/Descriptors.h
Projects/Magstripe/Magstripe.c
Projects/MediaController/Descriptors.c
Projects/MediaController/Descriptors.h
Projects/MediaController/MediaController.c
Projects/RelayBoard/Descriptors.c
Projects/RelayBoard/Descriptors.h
Projects/SerialToLCD/Descriptors.c
Projects/SerialToLCD/Descriptors.h
Projects/SerialToLCD/SerialToLCD.c
Projects/SerialToLCD/SerialToLCD.h
Projects/TempDataLogger/Descriptors.c
Projects/TempDataLogger/Descriptors.h
Projects/TempDataLogger/TempDataLogger.c
Projects/USBtoSerial/Descriptors.c
Projects/USBtoSerial/Descriptors.h
Projects/USBtoSerial/USBtoSerial.c
Projects/Webserver/Descriptors.c
Projects/Webserver/Descriptors.h
Projects/Webserver/USBDeviceMode.c
Projects/XPLAINBridge/USARTDescriptors.c
Projects/XPLAINBridge/USARTDescriptors.h
Projects/XPLAINBridge/XPLAINBridge.c

index bbf4e76..2b85b01 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -141,7 +141,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 24d1a39..f35a4d1 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 3d6d906..949f7e8 100644 (file)
                        dfuMANIFEST                  = 7,
                        dfuMANIFEST_WAIT_RESET       = 8,
                        dfuUPLOAD_IDLE               = 9,
-                       dfuERROR                         = 10
+                       dfuERROR                     = 10
                };
 
                /** DFU command status error codes. Refer to the DFU class specification for information on each error code. */
                        errUSBR                      = 12,
                        errPOR                       = 13,
                        errUNKNOWN                   = 14,
-                       errSTALLEDPKT                = 15
+                       errSTALLEDPKT                = 15
                };
 
        /* Function Prototypes: */
index 5901dad..9cd74cf 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_DFU,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 0,
index c33e388..8bd4679 100644 (file)
                        USB_Descriptor_DFU_Functional_t       DFU_Functional;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_DFU = 0, /**< DFU interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index ac27b76..6754d81 100644 (file)
@@ -110,7 +110,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Printer,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index 4ef30ed..c10b516 100644 (file)
                        // Generic HID Interface
                        USB_Descriptor_Interface_t            HID_Interface;
                        USB_HID_Descriptor_HID_t              HID_VendorHID;
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Printer = 0, /**< Printer interface descriptor ID */
+               };
+
        /* Macros: */
                /** Endpoint address of the HID data IN endpoint. */
                #define HID_IN_EPADDR                (ENDPOINT_DIR_IN | 1)
index 1b6eda4..9d15a81 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber           = 0,
+                               .InterfaceNumber           = INTERFACE_ID_MassStorage,
                                .DataINEndpoint            =
                                        {
                                                .Address           = MASS_STORAGE_IN_EPADDR,
index 7ae0a7d..1186ea0 100644 (file)
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_MassStorage,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 2e97c6d..ea89cb2 100644 (file)
                        USB_Descriptor_Endpoint_t             MS_DataOutEndpoint;
                } USB_Descriptor_Configuration_t;
 
+
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_MassStorage = 0, /**< Mass storage interface descriptor ID */
+               };
+
        /* Function Prototypes: */
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
                                                    const uint8_t wIndex,
index 1e60cdd..3fec721 100644 (file)
@@ -43,7 +43,7 @@ USB_ClassInfo_PRNT_Device_t TextOnly_Printer_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber          = 0,
+                               .InterfaceNumber          = INTERFACE_ID_Printer,
                                .DataINEndpoint           =
                                        {
                                                .Address          = PRINTER_IN_EPADDR,
index 0fbb3ae..5329afc 100644 (file)
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_Printer,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index fba326a..d5c9b71 100644 (file)
                        USB_Descriptor_Endpoint_t             Printer_DataOutEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each string descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Printer      = 0, /**< Printer interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 9eec39c..02bd1e4 100644 (file)
@@ -44,8 +44,8 @@ USB_ClassInfo_Audio_Device_t Microphone_Audio_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 0,
-                               .StreamingInterfaceNumber = 1,
+                               .ControlInterfaceNumber   = INTERFACE_ID_AudioControl,
+                               .StreamingInterfaceNumber = INTERFACE_ID_AudioStream,
                                .DataINEndpoint           =
                                        {
                                                .Address          = AUDIO_STREAM_EPADDR,
index eb4c21c..a487387 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 0,
+                       .InterfaceNumber          = INTERFACE_ID_AudioControl,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -150,7 +150,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -166,7 +166,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 1,
 
                        .TotalEndpoints           = 1,
index 1bb38ff..fe09957 100644 (file)
                        USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_AudioControl = 0, /**< Audio control interface descriptor ID */
+                       INTERFACE_ID_AudioStream  = 1, /**< Audio stream interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 81fd95b..432f5e0 100644 (file)
@@ -44,8 +44,8 @@ USB_ClassInfo_Audio_Device_t Speaker_Audio_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 0,
-                               .StreamingInterfaceNumber = 1,
+                               .ControlInterfaceNumber   = INTERFACE_ID_AudioControl,
+                               .StreamingInterfaceNumber = INTERFACE_ID_AudioStream,
                                .DataOUTEndpoint          =
                                        {
                                                .Address          = AUDIO_STREAM_EPADDR,
index 4ced7a0..aec2c5f 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 0,
+                       .InterfaceNumber          = INTERFACE_ID_AudioControl,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -150,7 +150,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -166,7 +166,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 1,
 
                        .TotalEndpoints           = 1,
index 80f1426..cb67f02 100644 (file)
                        USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_AudioControl = 0, /**< Audio control interface descriptor ID */
+                       INTERFACE_ID_AudioStream  = 1, /**< Audio stream interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index d0992de..2452318 100644 (file)
@@ -105,7 +105,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC1_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -156,7 +156,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC1_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
@@ -206,7 +206,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 2,
+                       .InterfaceNumber        = INTERFACE_ID_CDC2_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -257,7 +257,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 3,
+                       .InterfaceNumber        = INTERFACE_ID_CDC2_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 1105ab7..9817026 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC2_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC1_CCI = 0, /**< CDC1 CCI interface descriptor ID */
+                       INTERFACE_ID_CDC1_DCI = 1, /**< CDC1 DCI interface descriptor ID */
+                       INTERFACE_ID_CDC2_CCI = 2, /**< CDC2 CCI interface descriptor ID */
+                       INTERFACE_ID_CDC2_DCI = 3, /**< CDC2 DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index eaba618..070ebc7 100644 (file)
@@ -45,7 +45,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial1_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 0,
+                               .ControlInterfaceNumber   = INTERFACE_ID_CDC1_CCI,
                                .DataINEndpoint           =
                                        {
                                                .Address          = CDC1_TX_EPADDR,
@@ -76,7 +76,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 2,
+                               .ControlInterfaceNumber   = INTERFACE_ID_CDC2_CCI,
                                .DataINEndpoint           =
                                        {
                                                .Address          = CDC2_TX_EPADDR,
index 57c3502..b070d86 100644 (file)
@@ -108,7 +108,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_GenericHID,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index b598e98..4500f2c 100644 (file)
                        // Generic HID Interface
                        USB_Descriptor_Interface_t            HID_Interface;
                        USB_HID_Descriptor_HID_t              HID_GenericHID;
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_GenericHID = 0, /**< GenericHID interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index 182aa5a..8f5b861 100644 (file)
@@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Generic_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 0,
+                               .InterfaceNumber              = INTERFACE_ID_GenericHID,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = GENERIC_IN_EPADDR,
index 8a6ef20..2d41652 100644 (file)
@@ -108,7 +108,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Joystick,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index 89c0584..839cd28 100644 (file)
                USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Joystick = 0, /**< Joystick interface desciptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index 809c410..bbe8558 100644 (file)
@@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Joystick_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 0,
+                               .InterfaceNumber              = INTERFACE_ID_Joystick,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = JOYSTICK_EPADDR,
index f40e3b9..4340ec6 100644 (file)
@@ -104,7 +104,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Keyboard,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index abaf9c6..ce029bb 100644 (file)
                USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Keyboard = 0, /**< Keyboard interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index b3cc67e..68e3fbe 100644 (file)
@@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 0,
+                               .InterfaceNumber              = INTERFACE_ID_Keyboard,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = KEYBOARD_EPADDR,
index c3b2e2c..0d350c7 100644 (file)
@@ -120,7 +120,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Keyboard,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x01,
+                       .InterfaceNumber        = INTERFACE_ID_Mouse,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
@@ -269,28 +269,30 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
 
                        break;
                case HID_DTYPE_HID:
-                       if (!(wIndex))
+                       switch (wIndex)
                        {
-                               Address = &ConfigurationDescriptor.HID1_KeyboardHID;
-                               Size    = sizeof(USB_HID_Descriptor_HID_t);
-                       }
-                       else
-                       {
-                               Address = &ConfigurationDescriptor.HID2_MouseHID;
-                               Size    = sizeof(USB_HID_Descriptor_HID_t);
+                               case INTERFACE_ID_Keyboard:
+                                       Address = &ConfigurationDescriptor.HID1_KeyboardHID;
+                                       Size    = sizeof(USB_HID_Descriptor_HID_t);
+                                       break;
+                               case INTERFACE_ID_Mouse:
+                                       Address = &ConfigurationDescriptor.HID2_MouseHID;
+                                       Size    = sizeof(USB_HID_Descriptor_HID_t);
+                                       break;
                        }
 
                        break;
                case HID_DTYPE_Report:
-                       if (!(wIndex))
+                       switch (wIndex)
                        {
-                               Address = &KeyboardReport;
-                               Size    = sizeof(KeyboardReport);
-                       }
-                       else
-                       {
-                               Address = &MouseReport;
-                               Size    = sizeof(MouseReport);
+                               case INTERFACE_ID_Keyboard:
+                                       Address = &KeyboardReport;
+                                       Size    = sizeof(KeyboardReport);
+                                       break;
+                               case INTERFACE_ID_Mouse:
+                                       Address = &MouseReport;
+                                       Size    = sizeof(MouseReport);
+                                       break;
                        }
 
                        break;
index 27120eb..1a45f74 100644 (file)
                        USB_Descriptor_Endpoint_t             HID2_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Keyboard = 0, /**< Keyboard interface descriptor ID */
+                       INTERFACE_ID_Mouse    = 1, /**< Mouse interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index f663f16..789fc21 100644 (file)
@@ -51,7 +51,7 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 0,
+                               .InterfaceNumber              = INTERFACE_ID_Keyboard,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = KEYBOARD_IN_EPADDR,
@@ -72,7 +72,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 1,
+                               .InterfaceNumber              = INTERFACE_ID_Mouse,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = MOUSE_IN_EPADDR,
index a361473..477cad0 100644 (file)
@@ -167,7 +167,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_KeyboardAndMouse,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index a47d185..f5d68be 100644 (file)
                        USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_KeyboardAndMouse = 0, /**< Combined keyboard and mouse interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index f15d134..0ec8788 100644 (file)
@@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Device_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 0,
+                               .InterfaceNumber              = INTERFACE_ID_KeyboardAndMouse,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = HID_IN_EPADDR,
index 5413f27..746bcc4 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 0,
+                       .InterfaceNumber          = INTERFACE_ID_MidiAudioControl,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -118,7 +118,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_MidiAudioStreaming,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 2,
index 92c6c38..d6f230a 100644 (file)
                        USB_MIDI_Descriptor_Jack_Endpoint_t       MIDI_Out_Jack_Endpoint_SPC;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_MidiAudioControl   = 0, /**< MIDI audio control interface descriptor ID */
+                       INTERFACE_ID_MidiAudioStreaming = 1, /**< MIDI audio streaming interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index bec4428..79a8317 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =
        {
                .Config =
                        {
-                               .StreamingInterfaceNumber = 1,
+                               .StreamingInterfaceNumber = INTERFACE_ID_MidiAudioStreaming,
                                .DataINEndpoint           =
                                        {
                                                .Address          = MIDI_STREAM_IN_EPADDR,
index d069bce..2be052b 100644 (file)
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_MassStorage,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 3b9a96c..674bd29 100644 (file)
                        USB_Descriptor_Endpoint_t             MS_DataOutEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_MassStorage = 0, /**< Mass storage interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 82f02b9..32b4c26 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber           = 0,
+                               .InterfaceNumber           = INTERFACE_ID_MassStorage,
                                .DataINEndpoint            =
                                        {
                                                .Address           = MASS_STORAGE_IN_EPADDR,
index 2209d51..5749b36 100644 (file)
@@ -106,7 +106,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_MassStorage,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
@@ -142,7 +142,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_Keyboard,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
index 2b70e11..606e47d 100644 (file)
                USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_MassStorage = 0, /**< Mass storage interface descriptor ID */
+                       INTERFACE_ID_Keyboard    = 1, /**< Keyboard interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 2ed3f41..8ed0d3b 100644 (file)
@@ -45,7 +45,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber           = 0,
+                               .InterfaceNumber           = INTERFACE_ID_MassStorage,
                                .DataINEndpoint            =
                                        {
                                                .Address           = MASS_STORAGE_IN_EPADDR,
@@ -73,7 +73,7 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 1,
+                               .InterfaceNumber              = INTERFACE_ID_Keyboard,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = KEYBOARD_EPADDR,
index c21a8cc..09278a7 100644 (file)
@@ -109,7 +109,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Mouse,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index a5380a1..3b637e2 100644 (file)
                        // Mouse HID Interface
                        USB_Descriptor_Interface_t            HID_Interface;
                        USB_HID_Descriptor_HID_t              HID_MouseHID;
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Mouse = 0, /**< Mouse interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 8432b65..1e8f7ab 100644 (file)
@@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 0,
+                               .InterfaceNumber              = INTERFACE_ID_Mouse,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = MOUSE_EPADDR,
index ca70633..7474e54 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -141,7 +141,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index be50157..c782a5e 100644 (file)
                        USB_Descriptor_Endpoint_t             RNDIS_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 54d5511..e38dfec 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber         = 0,
+                               .ControlInterfaceNumber         = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint                 =
                                        {
                                                .Address                = CDC_TX_EPADDR,
index 9432562..33f6337 100644 (file)
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -142,7 +142,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index e2d09b2..20caec0 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 0079acb..56b248d 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 0,
+                               .ControlInterfaceNumber   = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint           =
                                        {
                                                .Address          = CDC_TX_EPADDR,
index e41a91a..b8a07f4 100644 (file)
@@ -105,7 +105,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -156,7 +156,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
@@ -192,7 +192,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 2,
+                       .InterfaceNumber        = INTERFACE_ID_MassStorage,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 25d31bf..ac6e4fa 100644 (file)
                        USB_Descriptor_Endpoint_t                MS_DataOutEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI     = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI     = 1, /**< CDC DCI interface descriptor ID */
+                       INTERFACE_ID_MassStorage = 2, /**< Mass storage interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 03f422b..6dc1ab6 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber         = 0,
+                               .ControlInterfaceNumber         = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint                 =
                                        {
                                                .Address                = CDC_TX_EPADDR,
@@ -74,7 +74,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber                = 2,
+                               .InterfaceNumber                = INTERFACE_ID_MassStorage,
                                .DataINEndpoint                 =
                                        {
                                                .Address                = MASS_STORAGE_IN_EPADDR,
index 42c77dd..43c849b 100644 (file)
@@ -124,7 +124,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -175,7 +175,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
@@ -211,7 +211,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 2,
+                       .InterfaceNumber        = INTERFACE_ID_Mouse,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
index 1bce496..7ac638b 100644 (file)
                USB_Descriptor_Endpoint_t                HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+                       INTERFACE_ID_Mouse   = 2, /**< Mouse interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 73f9e38..d4aba48 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber         = 0,
+                               .ControlInterfaceNumber         = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint                 =
                                        {
                                                .Address                = CDC_TX_EPADDR,
@@ -77,7 +77,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber                = 2,
+                               .InterfaceNumber                = INTERFACE_ID_Mouse,
                                .ReportINEndpoint               =
                                        {
                                                .Address                = MOUSE_EPADDR,
index 8bf9237..6b27db8 100644 (file)
@@ -92,7 +92,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_TestAndMeasurement,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 3,
index 9beb3d2..0746448 100644 (file)
                        USB_Descriptor_Endpoint_t             TM_NotificationEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_TestAndMeasurement = 0, /**< Test and measurement interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index b3490d0..444f160 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 0,
+                       .InterfaceNumber          = INTERFACE_ID_AudioControl,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -150,7 +150,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -166,7 +166,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 1,
 
                        .TotalEndpoints           = 1,
index a3d3ec3..7dbb9aa 100644 (file)
                        USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_AudioControl = 0, /**< Audio control interface descriptor ID */
+                       INTERFACE_ID_AudioStream  = 1, /**< Audio stream interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 43f7175..7879c34 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 0,
+                       .InterfaceNumber          = INTERFACE_ID_AudioControl,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -150,7 +150,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -166,7 +166,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 1,
 
                        .TotalEndpoints           = 1,
index b8ae901..07d1bec 100644 (file)
                        USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_AudioControl = 0, /**< Audio control interface descriptor ID */
+                       INTERFACE_ID_AudioStream  = 1, /**< Audio stream interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index d0992de..2452318 100644 (file)
@@ -105,7 +105,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC1_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -156,7 +156,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC1_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
@@ -206,7 +206,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 2,
+                       .InterfaceNumber        = INTERFACE_ID_CDC2_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -257,7 +257,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 3,
+                       .InterfaceNumber        = INTERFACE_ID_CDC2_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index a5a87dc..dc19cfe 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC2_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC1_CCI = 0, /**< CDC1 CCI interface descriptor ID */
+                       INTERFACE_ID_CDC1_DCI = 1, /**< CDC1 DCI interface descriptor ID */
+                       INTERFACE_ID_CDC2_CCI = 2, /**< CDC2 CCI interface descriptor ID */
+                       INTERFACE_ID_CDC2_DCI = 3, /**< CDC2 DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index bcbb386..2e75360 100644 (file)
@@ -116,7 +116,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_GenericHID,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 2,
index 8842334..c37c68b 100644 (file)
                        // Generic HID Interface
                        USB_Descriptor_Interface_t            HID_Interface;
                        USB_HID_Descriptor_HID_t              HID_GenericHID;
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
-               USB_Descriptor_Endpoint_t             HID_ReportOUTEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportOUTEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_GenericHID = 0, /**< GenericHID interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index 3762387..2f9eb00 100644 (file)
@@ -128,7 +128,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Joystick,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index f06b3ca..2600e0c 100644 (file)
                        // Joystick HID Interface
                        USB_Descriptor_Interface_t            HID_Interface;
                        USB_HID_Descriptor_HID_t              HID_JoystickHID;
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Joystick = 0, /**< Joystick interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index e3da4b6..6a644d8 100644 (file)
@@ -133,7 +133,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Keyboard,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 2,
index f9d5424..dcd7572 100644 (file)
                        // Keyboard HID Interface
                        USB_Descriptor_Interface_t            HID_Interface;
                        USB_HID_Descriptor_HID_t              HID_KeyboardHID;
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
-               USB_Descriptor_Endpoint_t             HID_ReportOUTEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportOUTEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Keyboard = 0, /**< Keyboard interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index d45cd59..4a339f4 100644 (file)
@@ -168,7 +168,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Keyboard,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 2,
@@ -215,7 +215,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x01,
+                       .InterfaceNumber        = INTERFACE_ID_Mouse,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
@@ -327,27 +327,29 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
 
                        break;
                case HID_DTYPE_HID:
-                       if (!(wIndex))
+                       switch (wIndex)
                        {
-                               Address = &ConfigurationDescriptor.HID1_KeyboardHID;
-                               Size    = sizeof(USB_HID_Descriptor_HID_t);
-                       }
-                       else
-                       {
-                               Address = &ConfigurationDescriptor.HID2_MouseHID;
-                               Size    = sizeof(USB_HID_Descriptor_HID_t);
+                               case (INTERFACE_ID_Keyboard):
+                                       Address = &ConfigurationDescriptor.HID1_KeyboardHID;
+                                       Size    = sizeof(USB_HID_Descriptor_HID_t);
+                                       break;
+                               case (INTERFACE_ID_Mouse):
+                                       Address = &ConfigurationDescriptor.HID2_MouseHID;
+                                       Size    = sizeof(USB_HID_Descriptor_HID_t);
+                                       break;
                        }
                        break;
                case HID_DTYPE_Report:
-                       if (!(wIndex))
+                       switch (wIndex)
                        {
-                               Address = &KeyboardReport;
-                               Size    = sizeof(KeyboardReport);
-                       }
-                       else
-                       {
-                               Address = &MouseReport;
-                               Size    = sizeof(MouseReport);
+                               case INTERFACE_ID_Keyboard:
+                                       Address = &KeyboardReport;
+                                       Size    = sizeof(KeyboardReport);
+                                       break;
+                               case INTERFACE_ID_Mouse:
+                                       Address = &MouseReport;
+                                       Size    = sizeof(MouseReport);
+                                       break;
                        }
 
                        break;
index 6d2543a..99f423e 100644 (file)
                        USB_Descriptor_Endpoint_t             HID2_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Keyboard = 0, /**< Keyboard interface descriptor ID */
+                       INTERFACE_ID_Mouse    = 1, /**< Mouse interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index 5413f27..220d37d 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 0,
+                       .InterfaceNumber          = INTERFACE_ID_AudioControl,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -118,7 +118,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 2,
index 1572b1c..649b2ac 100644 (file)
                        USB_MIDI_Descriptor_Jack_Endpoint_t       MIDI_Out_Jack_Endpoint_SPC;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_AudioControl = 0, /**< Audio control interface descriptor ID */
+                       INTERFACE_ID_AudioStream  = 1, /**< Audio stream interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index d069bce..2be052b 100644 (file)
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_MassStorage,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index dc6748f..7c3196b 100644 (file)
                        USB_Descriptor_Endpoint_t             MS_DataOutEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_MassStorage = 0, /**< Mass storage interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 99780a4..23e8d7f 100644 (file)
@@ -128,7 +128,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Mouse,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index a5380a1..3b637e2 100644 (file)
                        // Mouse HID Interface
                        USB_Descriptor_Interface_t            HID_Interface;
                        USB_HID_Descriptor_HID_t              HID_MouseHID;
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Mouse = 0, /**< Mouse interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index ca70633..7474e54 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -141,7 +141,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 763bc0c..9db6796 100644 (file)
                        USB_Descriptor_Endpoint_t             RNDIS_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 9432562..33f6337 100644 (file)
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -142,7 +142,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index a704614..8ece697 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 6b714eb..13c6cbc 100644 (file)
@@ -109,7 +109,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Mouse,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index eca1e79..a19b612 100644 (file)
                        // Mouse HID Interface
                        USB_Descriptor_Interface_t            HID_Interface;
                        USB_HID_Descriptor_HID_t              HID_MouseHID;
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Mouse = 0, /**< Mouse interface descriptor ID (must be zero) */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index ef9280c..2bbeb2d 100644 (file)
@@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Device_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber            = 0,
+                               .InterfaceNumber            = INTERFACE_ID_Mouse,
                                .ReportINEndpoint           =
                                        {
                                                .Address            = MOUSE_EPADDR,
index cb19051..c185cb9 100644 (file)
@@ -101,7 +101,7 @@ AVRISP_USB_Descriptor_Configuration_t AVRISP_ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_AVRISP,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 2f11923..68bb103 100644 (file)
                        USB_Descriptor_Endpoint_t                AVRISP_DataOutEndpoint;
                } AVRISP_USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_AVRISP = 0, /**< AVRISP interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum AVRISP_StringDescriptors_t
                {
-                   AVRISP_STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   AVRISP_STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   AVRISP_STRING_ID_Product       = 2, /**< Product string ID */
-                   AVRISP_STRING_ID_Serial        = 3, /**< Serial number string ID */
+                       AVRISP_STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       AVRISP_STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       AVRISP_STRING_ID_Product      = 2, /**< Product string ID */
+                       AVRISP_STRING_ID_Serial       = 3, /**< Serial number string ID */
                };
 
        /* External Variables: */
index a89e6ca..2ecee07 100644 (file)
@@ -62,7 +62,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 0,
+                               .ControlInterfaceNumber   = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint           =
                                        {
                                                .Address          = CDC_TX_EPADDR,
index ebb11ca..8bd0907 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -141,7 +141,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 12be7bf..5c67e71 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 1875bba..f228c69 100644 (file)
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -142,7 +142,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 363951c..ed19d84 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index d6a8fdc..e1d5dd9 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 0,
+                               .ControlInterfaceNumber   = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint           =
                                        {
                                                .Address          = CDC_TX_EPADDR,
index 5413f27..220d37d 100644 (file)
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 0,
+                       .InterfaceNumber          = INTERFACE_ID_AudioControl,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 0,
@@ -118,7 +118,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                   = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber          = 1,
+                       .InterfaceNumber          = INTERFACE_ID_AudioStream,
                        .AlternateSetting         = 0,
 
                        .TotalEndpoints           = 2,
index cb87891..dab2fd5 100644 (file)
                        USB_MIDI_Descriptor_Jack_Endpoint_t       MIDI_Out_Jack_Endpoint_SPC;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_AudioControl = 0, /**< Audio control interface descriptor ID */
+                       INTERFACE_ID_AudioStream  = 1, /**< Audio stream interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 662c815..ed2d334 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =
        {
                .Config =
                        {
-                               .StreamingInterfaceNumber = 1,
+                               .StreamingInterfaceNumber = INTERFACE_ID_AudioStream,
                                .DataINEndpoint           =
                                        {
                                                .Address          = MIDI_STREAM_IN_EPADDR,
index 6809440..c707c1c 100644 (file)
@@ -105,7 +105,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_Keyboard,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index 0f4869f..46218fc 100644 (file)
                        // Keyboard HID Interface
                        USB_Descriptor_Interface_t            HID_Interface; /**< Keyboard interface descriptor */
                        USB_HID_Descriptor_HID_t              HID_KeyboardHID; /**< Keyboard HID descriptor */
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint; /**< Keyboard key report endpoint descriptor */
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint; /**< Keyboard key report endpoint descriptor */
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_Keyboard = 0, /**< Keyboard interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index 8dba737..a0b6f1b 100644 (file)
@@ -56,7 +56,7 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber            = 0,
+                               .InterfaceNumber            = INTERFACE_ID_Keyboard,
                                .ReportINEndpoint           =
                                        {
                                                .Address            = KEYBOARD_EPADDR,
index 636bbb6..353e5fe 100644 (file)
@@ -122,7 +122,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0x00,
+                       .InterfaceNumber        = INTERFACE_ID_HID,
                        .AlternateSetting       = 0x00,
 
                        .TotalEndpoints         = 1,
index 9f88964..827885d 100644 (file)
                        // Media Controller HID Interface
                        USB_Descriptor_Interface_t            HID_Interface;
                        USB_HID_Descriptor_HID_t              HID_MediaControlHID;
-               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
+                       USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_HID = 0, /**< HID interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Macros: */
index d12a21a..bda252a 100644 (file)
@@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t MediaControl_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 0,
+                               .InterfaceNumber              = INTERFACE_ID_HID,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = MEDIACONTROL_HID_EPADDR,
index c6b2d8f..646f7ca 100644 (file)
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM RelayBoard_ConfigurationDescriptor
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_RelayBoard,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 0,
index 97ed225..c2fc16e 100644 (file)
                        USB_Descriptor_Interface_t            RelayBoardInterface;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_RelayBoard = 0, /**< Relay board interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
-                   STRING_ID_Serial        = 3, /**< Serial number string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
+                       STRING_ID_Serial       = 3, /**< Serial number string ID */
                };
 
        /* Function Prototypes: */
index 8a55f82..baf33c0 100644 (file)
@@ -103,7 +103,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -154,7 +154,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 5776098..f661929 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index aac4fad..21a5d68 100644 (file)
@@ -51,7 +51,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber   = 0,
+                               .ControlInterfaceNumber   = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint           =
                                        {
                                                .Address          = CDC_TX_EPADDR,
index 22537d6..bafc03c 100644 (file)
 #ifndef _SERIALTOLCD_H_
 #define _SERIALTOLCD_H_
 
-    /* Includes: */
-        #include <avr/io.h>
-        #include <avr/wdt.h>
-        #include <avr/interrupt.h>
-        #include <avr/power.h>
+       /* Includes: */
+               #include <avr/io.h>
+               #include <avr/wdt.h>
+               #include <avr/interrupt.h>
+               #include <avr/power.h>
 
-        #include "Descriptors.h"
+               #include "Descriptors.h"
                #include "Lib/HD44780.h"
 
-        #include <LUFA/Version.h>
-        #include <LUFA/Drivers/Misc/RingBuffer.h>
-        #include <LUFA/Drivers/USB/USB.h>
+               #include <LUFA/Version.h>
+               #include <LUFA/Drivers/Misc/RingBuffer.h>
+               #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                #define COMMAND_ESCAPE     0x1B
 
-    /* Function Prototypes: */
-        void SetupHardware(void);
+       /* Function Prototypes: */
+               void SetupHardware(void);
 
-        void EVENT_USB_Device_ConfigurationChanged(void);
-        void EVENT_USB_Device_ControlRequest(void);
+               void EVENT_USB_Device_ConfigurationChanged(void);
+               void EVENT_USB_Device_ControlRequest(void);
 
 #endif
 
index 6ec6f64..452c4c6 100644 (file)
@@ -109,7 +109,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_MassStorage,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
@@ -145,7 +145,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_HID,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
index 91e238f..63c3fae 100644 (file)
                        USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_MassStorage = 0, /**< Mass storage interface descriptor ID */
+                       INTERFACE_ID_HID         = 1, /**< HID interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index bbbea47..66f9335 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber           = 0,
+                               .InterfaceNumber           = INTERFACE_ID_MassStorage,
                                .DataINEndpoint            =
                                        {
                                                .Address           = MASS_STORAGE_IN_EPADDR,
@@ -72,7 +72,7 @@ USB_ClassInfo_HID_Device_t Generic_HID_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber              = 1,
+                               .InterfaceNumber              = INTERFACE_ID_HID,
                                .ReportINEndpoint             =
                                        {
                                                .Address              = GENERIC_IN_EPADDR,
index b2d2285..ea0a84a 100644 (file)
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -142,7 +142,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 363951c..ed19d84 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC_DataInEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 6df9063..84ec2be 100644 (file)
@@ -56,7 +56,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber         = 0,
+                               .ControlInterfaceNumber         = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint                 =
                                        {
                                                .Address                = CDC_TX_EPADDR,
index 8fcba5c..b8acf42 100644 (file)
@@ -105,7 +105,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -156,7 +156,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
@@ -192,7 +192,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 2,
+                       .InterfaceNumber        = INTERFACE_ID_MassStorage,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 2c25512..c649cf5 100644 (file)
                        USB_Descriptor_Endpoint_t              MS_DataOutEndpoint;
                } USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI     = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI     = 1, /**< CDC DCI interface descriptor ID */
+                       INTERFACE_ID_MassStorage = 2, /**< Mass storage interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum StringDescriptors_t
                {
-                   STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   STRING_ID_Product       = 2, /**< Product string ID */
+                       STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
index 7d5beb9..f889b6b 100644 (file)
@@ -44,7 +44,7 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface_Device =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber         = 0,
+                               .ControlInterfaceNumber         = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint                 =
                                        {
                                                .Address                = CDC_TX_EPADDR,
@@ -76,7 +76,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
        {
                .Config =
                        {
-                               .InterfaceNumber                = 2,
+                               .InterfaceNumber                = INTERFACE_ID_MassStorage,
                                .DataINEndpoint                 =
                                        {
                                                .Address                = MASS_STORAGE_IN_EPADDR,
index 0e0ac85..b1bfd4e 100644 (file)
@@ -91,7 +91,7 @@ const USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 0,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_CCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 1,
@@ -142,7 +142,7 @@ const USART_USB_Descriptor_Configuration_t PROGMEM USART_ConfigurationDescriptor
                {
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
 
-                       .InterfaceNumber        = 1,
+                       .InterfaceNumber        = INTERFACE_ID_CDC_DCI,
                        .AlternateSetting       = 0,
 
                        .TotalEndpoints         = 2,
index 954867c..130c695 100644 (file)
                        USB_Descriptor_Endpoint_t                CDC_DataInEndpoint;
                } USART_USB_Descriptor_Configuration_t;
 
+               /** Enum for the device interface descriptor IDs within the device. Each interface descriptor
+                *  should have a unique ID index associated with it, which can be used to refer to the
+                *  interface from other descriptors.
+                */
+               enum USART_InterfaceDescriptors_t
+               {
+                       INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
+                       INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
+               };
+
                /** Enum for the device string descriptor IDs within the device. Each string descriptor should
                 *  have a unique ID index associated with it, which can be used to refer to the string from
                 *  other descriptors.
                 */
                enum USART_StringDescriptors_t
                {
-                   USART_STRING_ID_Language      = 0, /**< Supported Languages string descriptor ID (must be zero) */
-                   USART_STRING_ID_Manufacturer  = 1, /**< Manufacturer string ID */
-                   USART_STRING_ID_Product       = 2, /**< Product string ID */
+                       USART_STRING_ID_Language     = 0, /**< Supported Languages string descriptor ID (must be zero) */
+                       USART_STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+                       USART_STRING_ID_Product      = 2, /**< Product string ID */
                };
 
        /* Function Prototypes: */
                uint16_t USART_GetDescriptor(const uint16_t wValue,
                                             const uint8_t wIndex,
                                             const void** const DescriptorAddress,
-                                                                        uint8_t* const DescriptorMemorySpace);
+                                            uint8_t* const DescriptorMemorySpace);
 
 #endif
 
index 2ef1d20..1c63b71 100644 (file)
@@ -47,7 +47,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
        {
                .Config =
                        {
-                               .ControlInterfaceNumber         = 0,
+                               .ControlInterfaceNumber         = INTERFACE_ID_CDC_CCI,
                                .DataINEndpoint                 =
                                        {
                                                .Address                = CDC_TX_EPADDR,