Extract interface numbers into enums.

This commit is contained in:
László Monda 2013-10-06 22:16:20 +02:00
parent cd3aae87da
commit 9ef29ea229
125 changed files with 780 additions and 319 deletions

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -141,7 +141,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -127,15 +127,25 @@
USB_Descriptor_Endpoint_t CDC_DataInEndpoint; USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -170,7 +170,7 @@
dfuMANIFEST = 7, dfuMANIFEST = 7,
dfuMANIFEST_WAIT_RESET = 8, dfuMANIFEST_WAIT_RESET = 8,
dfuUPLOAD_IDLE = 9, dfuUPLOAD_IDLE = 9,
dfuERROR = 10 dfuERROR = 10
}; };
/** DFU command status error codes. Refer to the DFU class specification for information on each error code. */ /** DFU command status error codes. Refer to the DFU class specification for information on each error code. */
@ -191,7 +191,7 @@
errUSBR = 12, errUSBR = 12,
errPOR = 13, errPOR = 13,
errUNKNOWN = 14, errUNKNOWN = 14,
errSTALLEDPKT = 15 errSTALLEDPKT = 15
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_DFU,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,

View File

@ -164,15 +164,24 @@
USB_Descriptor_DFU_Functional_t DFU_Functional; USB_Descriptor_DFU_Functional_t DFU_Functional;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -110,7 +110,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Printer,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -51,9 +51,18 @@
// Generic HID Interface // Generic HID Interface
USB_Descriptor_Interface_t HID_Interface; USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_VendorHID; USB_HID_Descriptor_HID_t HID_VendorHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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: */ /* Macros: */
/** Endpoint address of the HID data IN endpoint. */ /** Endpoint address of the HID data IN endpoint. */
#define HID_IN_EPADDR (ENDPOINT_DIR_IN | 1) #define HID_IN_EPADDR (ENDPOINT_DIR_IN | 1)

View File

@ -44,7 +44,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_MassStorage,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = MASS_STORAGE_IN_EPADDR, .Address = MASS_STORAGE_IN_EPADDR,

View File

@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_MassStorage,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -68,6 +68,16 @@
USB_Descriptor_Endpoint_t MS_DataOutEndpoint; USB_Descriptor_Endpoint_t MS_DataOutEndpoint;
} USB_Descriptor_Configuration_t; } 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: */ /* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex, const uint8_t wIndex,

View File

@ -43,7 +43,7 @@ USB_ClassInfo_PRNT_Device_t TextOnly_Printer_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_Printer,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = PRINTER_IN_EPADDR, .Address = PRINTER_IN_EPADDR,

View File

@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_Printer,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -66,15 +66,24 @@
USB_Descriptor_Endpoint_t Printer_DataOutEndpoint; USB_Descriptor_Endpoint_t Printer_DataOutEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -44,8 +44,8 @@ USB_ClassInfo_Audio_Device_t Microphone_Audio_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_AudioControl,
.StreamingInterfaceNumber = 1, .StreamingInterfaceNumber = INTERFACE_ID_AudioStream,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = AUDIO_STREAM_EPADDR, .Address = AUDIO_STREAM_EPADDR,

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_AudioControl,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -150,7 +150,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -166,7 +166,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 1, .AlternateSetting = 1,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -75,15 +75,25 @@
USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC; USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -44,8 +44,8 @@ USB_ClassInfo_Audio_Device_t Speaker_Audio_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_AudioControl,
.StreamingInterfaceNumber = 1, .StreamingInterfaceNumber = INTERFACE_ID_AudioStream,
.DataOUTEndpoint = .DataOUTEndpoint =
{ {
.Address = AUDIO_STREAM_EPADDR, .Address = AUDIO_STREAM_EPADDR,

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_AudioControl,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -150,7 +150,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -166,7 +166,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 1, .AlternateSetting = 1,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -75,15 +75,25 @@
USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC; USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -105,7 +105,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC1_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -156,7 +156,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC1_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,
@ -206,7 +206,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 2, .InterfaceNumber = INTERFACE_ID_CDC2_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -257,7 +257,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 3, .InterfaceNumber = INTERFACE_ID_CDC2_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -102,15 +102,27 @@
USB_Descriptor_Endpoint_t CDC2_DataInEndpoint; USB_Descriptor_Endpoint_t CDC2_DataInEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -45,7 +45,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial1_CDC_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_CDC1_CCI,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = CDC1_TX_EPADDR, .Address = CDC1_TX_EPADDR,
@ -76,7 +76,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 2, .ControlInterfaceNumber = INTERFACE_ID_CDC2_CCI,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = CDC2_TX_EPADDR, .Address = CDC2_TX_EPADDR,

View File

@ -108,7 +108,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_GenericHID,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -55,18 +55,27 @@
// Generic HID Interface // Generic HID Interface
USB_Descriptor_Interface_t HID_Interface; USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_GenericHID; USB_HID_Descriptor_HID_t HID_GenericHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Generic_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_GenericHID,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = GENERIC_IN_EPADDR, .Address = GENERIC_IN_EPADDR,

View File

@ -108,7 +108,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Joystick,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -56,15 +56,24 @@
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Joystick_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_Joystick,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = JOYSTICK_EPADDR, .Address = JOYSTICK_EPADDR,

View File

@ -104,7 +104,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Keyboard,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -56,15 +56,24 @@
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_Keyboard,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = KEYBOARD_EPADDR, .Address = KEYBOARD_EPADDR,

View File

@ -120,7 +120,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Keyboard,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x01, .InterfaceNumber = INTERFACE_ID_Mouse,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -269,28 +269,30 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
break; break;
case HID_DTYPE_HID: case HID_DTYPE_HID:
if (!(wIndex)) switch (wIndex)
{ {
Address = &ConfigurationDescriptor.HID1_KeyboardHID; case INTERFACE_ID_Keyboard:
Size = sizeof(USB_HID_Descriptor_HID_t); Address = &ConfigurationDescriptor.HID1_KeyboardHID;
} Size = sizeof(USB_HID_Descriptor_HID_t);
else break;
{ case INTERFACE_ID_Mouse:
Address = &ConfigurationDescriptor.HID2_MouseHID; Address = &ConfigurationDescriptor.HID2_MouseHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break;
} }
break; break;
case HID_DTYPE_Report: case HID_DTYPE_Report:
if (!(wIndex)) switch (wIndex)
{ {
Address = &KeyboardReport; case INTERFACE_ID_Keyboard:
Size = sizeof(KeyboardReport); Address = &KeyboardReport;
} Size = sizeof(KeyboardReport);
else break;
{ case INTERFACE_ID_Mouse:
Address = &MouseReport; Address = &MouseReport;
Size = sizeof(MouseReport); Size = sizeof(MouseReport);
break;
} }
break; break;

View File

@ -61,15 +61,25 @@
USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; USB_Descriptor_Endpoint_t HID2_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -51,7 +51,7 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_Keyboard,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = KEYBOARD_IN_EPADDR, .Address = KEYBOARD_IN_EPADDR,
@ -72,7 +72,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_Mouse,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = MOUSE_IN_EPADDR, .Address = MOUSE_IN_EPADDR,

View File

@ -167,7 +167,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_KeyboardAndMouse,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -56,15 +56,24 @@
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Device_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_KeyboardAndMouse,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = HID_IN_EPADDR, .Address = HID_IN_EPADDR,

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_MidiAudioControl,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -118,7 +118,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_MidiAudioStreaming,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -77,15 +77,25 @@
USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC; USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -44,7 +44,7 @@ USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =
{ {
.Config = .Config =
{ {
.StreamingInterfaceNumber = 1, .StreamingInterfaceNumber = INTERFACE_ID_MidiAudioStreaming,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = MIDI_STREAM_IN_EPADDR, .Address = MIDI_STREAM_IN_EPADDR,

View File

@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_MassStorage,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -68,15 +68,24 @@
USB_Descriptor_Endpoint_t MS_DataOutEndpoint; USB_Descriptor_Endpoint_t MS_DataOutEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -44,7 +44,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_MassStorage,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = MASS_STORAGE_IN_EPADDR, .Address = MASS_STORAGE_IN_EPADDR,

View File

@ -106,7 +106,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_MassStorage,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,
@ -142,7 +142,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_Keyboard,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -80,15 +80,25 @@
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -45,7 +45,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_MassStorage,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = MASS_STORAGE_IN_EPADDR, .Address = MASS_STORAGE_IN_EPADDR,
@ -73,7 +73,7 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_Keyboard,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = KEYBOARD_EPADDR, .Address = KEYBOARD_EPADDR,

View File

@ -109,7 +109,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Mouse,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -60,18 +60,27 @@
// Mouse HID Interface // Mouse HID Interface
USB_Descriptor_Interface_t HID_Interface; USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_MouseHID; USB_HID_Descriptor_HID_t HID_MouseHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_Mouse,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = MOUSE_EPADDR, .Address = MOUSE_EPADDR,

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -141,7 +141,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -81,15 +81,25 @@
USB_Descriptor_Endpoint_t RNDIS_DataInEndpoint; USB_Descriptor_Endpoint_t RNDIS_DataInEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -44,7 +44,7 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_CDC_CCI,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = CDC_TX_EPADDR, .Address = CDC_TX_EPADDR,

View File

@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -142,7 +142,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -79,15 +79,25 @@
USB_Descriptor_Endpoint_t CDC_DataInEndpoint; USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -44,7 +44,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_CDC_CCI,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = CDC_TX_EPADDR, .Address = CDC_TX_EPADDR,

View File

@ -105,7 +105,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -156,7 +156,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,
@ -192,7 +192,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 2, .InterfaceNumber = INTERFACE_ID_MassStorage,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -96,15 +96,26 @@
USB_Descriptor_Endpoint_t MS_DataOutEndpoint; USB_Descriptor_Endpoint_t MS_DataOutEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -44,7 +44,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_CDC_CCI,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = CDC_TX_EPADDR, .Address = CDC_TX_EPADDR,
@ -74,7 +74,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 2, .InterfaceNumber = INTERFACE_ID_MassStorage,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = MASS_STORAGE_IN_EPADDR, .Address = MASS_STORAGE_IN_EPADDR,

View File

@ -124,7 +124,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -175,7 +175,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,
@ -211,7 +211,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 2, .InterfaceNumber = INTERFACE_ID_Mouse,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -91,15 +91,26 @@
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -44,7 +44,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_CDC_CCI,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = CDC_TX_EPADDR, .Address = CDC_TX_EPADDR,
@ -77,7 +77,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 2, .InterfaceNumber = INTERFACE_ID_Mouse,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = MOUSE_EPADDR, .Address = MOUSE_EPADDR,

View File

@ -92,7 +92,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_TestAndMeasurement,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 3, .TotalEndpoints = 3,

View File

@ -74,15 +74,24 @@
USB_Descriptor_Endpoint_t TM_NotificationEndpoint; USB_Descriptor_Endpoint_t TM_NotificationEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_AudioControl,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -150,7 +150,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -166,7 +166,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 1, .AlternateSetting = 1,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -75,15 +75,25 @@
USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC; USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_AudioControl,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -150,7 +150,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -166,7 +166,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 1, .AlternateSetting = 1,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -75,15 +75,25 @@
USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC; USB_Audio_Descriptor_StreamEndpoint_Spc_t Audio_StreamEndpoint_SPC;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -105,7 +105,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC1_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -156,7 +156,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC1_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,
@ -206,7 +206,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 2, .InterfaceNumber = INTERFACE_ID_CDC2_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -257,7 +257,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 3, .InterfaceNumber = INTERFACE_ID_CDC2_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -102,15 +102,27 @@
USB_Descriptor_Endpoint_t CDC2_DataInEndpoint; USB_Descriptor_Endpoint_t CDC2_DataInEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -116,7 +116,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_GenericHID,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -55,19 +55,28 @@
// Generic HID Interface // Generic HID Interface
USB_Descriptor_Interface_t HID_Interface; USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_GenericHID; USB_HID_Descriptor_HID_t HID_GenericHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
USB_Descriptor_Endpoint_t HID_ReportOUTEndpoint; USB_Descriptor_Endpoint_t HID_ReportOUTEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -128,7 +128,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Joystick,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -53,18 +53,27 @@
// Joystick HID Interface // Joystick HID Interface
USB_Descriptor_Interface_t HID_Interface; USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_JoystickHID; USB_HID_Descriptor_HID_t HID_JoystickHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -133,7 +133,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Keyboard,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -54,19 +54,28 @@
// Keyboard HID Interface // Keyboard HID Interface
USB_Descriptor_Interface_t HID_Interface; USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_KeyboardHID; USB_HID_Descriptor_HID_t HID_KeyboardHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
USB_Descriptor_Endpoint_t HID_ReportOUTEndpoint; USB_Descriptor_Endpoint_t HID_ReportOUTEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -168,7 +168,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Keyboard,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 2, .TotalEndpoints = 2,
@ -215,7 +215,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x01, .InterfaceNumber = INTERFACE_ID_Mouse,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -327,27 +327,29 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
break; break;
case HID_DTYPE_HID: case HID_DTYPE_HID:
if (!(wIndex)) switch (wIndex)
{ {
Address = &ConfigurationDescriptor.HID1_KeyboardHID; case (INTERFACE_ID_Keyboard):
Size = sizeof(USB_HID_Descriptor_HID_t); Address = &ConfigurationDescriptor.HID1_KeyboardHID;
} Size = sizeof(USB_HID_Descriptor_HID_t);
else break;
{ case (INTERFACE_ID_Mouse):
Address = &ConfigurationDescriptor.HID2_MouseHID; Address = &ConfigurationDescriptor.HID2_MouseHID;
Size = sizeof(USB_HID_Descriptor_HID_t); Size = sizeof(USB_HID_Descriptor_HID_t);
break;
} }
break; break;
case HID_DTYPE_Report: case HID_DTYPE_Report:
if (!(wIndex)) switch (wIndex)
{ {
Address = &KeyboardReport; case INTERFACE_ID_Keyboard:
Size = sizeof(KeyboardReport); Address = &KeyboardReport;
} Size = sizeof(KeyboardReport);
else break;
{ case INTERFACE_ID_Mouse:
Address = &MouseReport; Address = &MouseReport;
Size = sizeof(MouseReport); Size = sizeof(MouseReport);
break;
} }
break; break;

View File

@ -63,15 +63,25 @@
USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; USB_Descriptor_Endpoint_t HID2_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_AudioControl,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -118,7 +118,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -77,15 +77,25 @@
USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC; USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_MassStorage,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -68,15 +68,24 @@
USB_Descriptor_Endpoint_t MS_DataOutEndpoint; USB_Descriptor_Endpoint_t MS_DataOutEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -128,7 +128,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Mouse,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -60,18 +60,27 @@
// Mouse HID Interface // Mouse HID Interface
USB_Descriptor_Interface_t HID_Interface; USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_MouseHID; USB_HID_Descriptor_HID_t HID_MouseHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -141,7 +141,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -81,15 +81,25 @@
USB_Descriptor_Endpoint_t RNDIS_DataInEndpoint; USB_Descriptor_Endpoint_t RNDIS_DataInEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -142,7 +142,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -79,15 +79,25 @@
USB_Descriptor_Endpoint_t CDC_DataInEndpoint; USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -109,7 +109,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00, .InterfaceNumber = INTERFACE_ID_Mouse,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

View File

@ -53,18 +53,27 @@
// Mouse HID Interface // Mouse HID Interface
USB_Descriptor_Interface_t HID_Interface; USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_MouseHID; USB_HID_Descriptor_HID_t HID_MouseHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Macros: */ /* Macros: */

View File

@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Device_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_Mouse,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = MOUSE_EPADDR, .Address = MOUSE_EPADDR,

View File

@ -101,7 +101,7 @@ AVRISP_USB_Descriptor_Configuration_t AVRISP_ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_AVRISP,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -86,16 +86,25 @@
USB_Descriptor_Endpoint_t AVRISP_DataOutEndpoint; USB_Descriptor_Endpoint_t AVRISP_DataOutEndpoint;
} AVRISP_USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum AVRISP_StringDescriptors_t enum AVRISP_StringDescriptors_t
{ {
AVRISP_STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ AVRISP_STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
AVRISP_STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ AVRISP_STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
AVRISP_STRING_ID_Product = 2, /**< Product string ID */ AVRISP_STRING_ID_Product = 2, /**< Product string ID */
AVRISP_STRING_ID_Serial = 3, /**< Serial number string ID */ AVRISP_STRING_ID_Serial = 3, /**< Serial number string ID */
}; };
/* External Variables: */ /* External Variables: */

View File

@ -62,7 +62,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_CDC_CCI,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = CDC_TX_EPADDR, .Address = CDC_TX_EPADDR,

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -141,7 +141,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -81,15 +81,25 @@
USB_Descriptor_Endpoint_t CDC_DataInEndpoint; USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,
@ -142,7 +142,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -79,15 +79,25 @@
USB_Descriptor_Endpoint_t CDC_DataInEndpoint; USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

View File

@ -44,7 +44,7 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_CDC_CCI,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = CDC_TX_EPADDR, .Address = CDC_TX_EPADDR,

View File

@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_AudioControl,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,
@ -118,7 +118,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{ {
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_AudioStream,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,

View File

@ -79,15 +79,25 @@
USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC; USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC;
} USB_Descriptor_Configuration_t; } 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 /** 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 * have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors. * other descriptors.
*/ */
enum StringDescriptors_t enum StringDescriptors_t
{ {
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */ STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

Some files were not shown because too many files have changed in this diff Show More