Merge pull request #8 from mondalaci/extract-interface-numbers

Extract interface numbers into enums.
pull/1469/head
Dean Camera 12 years ago
commit 7ce4d35c39

@ -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,

@ -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: */

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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)

@ -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,

@ -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,

@ -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,

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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;

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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;

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

@ -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,

@ -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: */

@ -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,

@ -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,

@ -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: */

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

@ -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 = 0x00, .InterfaceNumber = INTERFACE_ID_Keyboard,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

@ -56,18 +56,27 @@
// Keyboard HID Interface // Keyboard HID Interface
USB_Descriptor_Interface_t HID_Interface; /**< Keyboard interface descriptor */ USB_Descriptor_Interface_t HID_Interface; /**< Keyboard interface descriptor */
USB_HID_Descriptor_HID_t HID_KeyboardHID; /**< Keyboard HID descriptor */ USB_HID_Descriptor_HID_t HID_KeyboardHID; /**< Keyboard HID descriptor */
USB_Descriptor_Endpoint_t HID_ReportINEndpoint; /**< Keyboard key report endpoint descriptor */ USB_Descriptor_Endpoint_t HID_ReportINEndpoint; /**< Keyboard key report endpoint descriptor */
} USB_Descriptor_Configuration_t; } 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: */

@ -56,7 +56,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,

@ -122,7 +122,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_HID,
.AlternateSetting = 0x00, .AlternateSetting = 0x00,
.TotalEndpoints = 1, .TotalEndpoints = 1,

@ -53,18 +53,27 @@
// Media Controller HID Interface // Media Controller HID Interface
USB_Descriptor_Interface_t HID_Interface; USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_MediaControlHID; USB_HID_Descriptor_HID_t HID_MediaControlHID;
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_HID = 0, /**< HID 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: */

@ -47,7 +47,7 @@ USB_ClassInfo_HID_Device_t MediaControl_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 0, .InterfaceNumber = INTERFACE_ID_HID,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = MEDIACONTROL_HID_EPADDR, .Address = MEDIACONTROL_HID_EPADDR,

@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t PROGMEM RelayBoard_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_RelayBoard,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 0, .TotalEndpoints = 0,

@ -54,16 +54,25 @@
USB_Descriptor_Interface_t RelayBoardInterface; USB_Descriptor_Interface_t RelayBoardInterface;
} 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_RelayBoard = 0, /**< Relay board 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 */
STRING_ID_Serial = 3, /**< Serial number string ID */ STRING_ID_Serial = 3, /**< Serial number string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */

@ -103,7 +103,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,
@ -154,7 +154,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,

@ -80,15 +80,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: */

@ -51,7 +51,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,

@ -37,28 +37,28 @@
#ifndef _SERIALTOLCD_H_ #ifndef _SERIALTOLCD_H_
#define _SERIALTOLCD_H_ #define _SERIALTOLCD_H_
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/power.h> #include <avr/power.h>
#include "Descriptors.h" #include "Descriptors.h"
#include "Lib/HD44780.h" #include "Lib/HD44780.h"
#include <LUFA/Version.h> #include <LUFA/Version.h>
#include <LUFA/Drivers/Misc/RingBuffer.h> #include <LUFA/Drivers/Misc/RingBuffer.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h> #include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
#define COMMAND_ESCAPE 0x1B #define COMMAND_ESCAPE 0x1B
/* Function Prototypes: */ /* Function Prototypes: */
void SetupHardware(void); void SetupHardware(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void); void EVENT_USB_Device_ControlRequest(void);
#endif #endif

@ -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 = 0, .InterfaceNumber = INTERFACE_ID_MassStorage,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 2, .TotalEndpoints = 2,
@ -145,7 +145,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_HID,
.AlternateSetting = 0, .AlternateSetting = 0,
.TotalEndpoints = 1, .TotalEndpoints = 1,

@ -56,15 +56,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_HID = 1, /**< HID 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: */

@ -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,
@ -72,7 +72,7 @@ USB_ClassInfo_HID_Device_t Generic_HID_Interface =
{ {
.Config = .Config =
{ {
.InterfaceNumber = 1, .InterfaceNumber = INTERFACE_ID_HID,
.ReportINEndpoint = .ReportINEndpoint =
{ {
.Address = GENERIC_IN_EPADDR, .Address = GENERIC_IN_EPADDR,

@ -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,

@ -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: */

@ -56,7 +56,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,

@ -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,

@ -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: */

@ -44,7 +44,7 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface_Device =
{ {
.Config = .Config =
{ {
.ControlInterfaceNumber = 0, .ControlInterfaceNumber = INTERFACE_ID_CDC_CCI,
.DataINEndpoint = .DataINEndpoint =
{ {
.Address = CDC_TX_EPADDR, .Address = CDC_TX_EPADDR,
@ -76,7 +76,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,

@ -91,7 +91,7 @@ const USART_USB_Descriptor_Configuration_t PROGMEM USART_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 USART_USB_Descriptor_Configuration_t PROGMEM USART_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,

@ -81,22 +81,32 @@
USB_Descriptor_Endpoint_t CDC_DataInEndpoint; USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
} USART_USB_Descriptor_Configuration_t; } USART_USB_Descriptor_Configuration_t;
/** Enum for the device interface descriptor IDs within the device. Each interface descriptor
* should have a unique ID index associated with it, which can be used to refer to the
* interface from other descriptors.
*/
enum USART_InterfaceDescriptors_t
{
INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
};
/** Enum for the device string descriptor IDs within the device. Each string descriptor should /** 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 USART_StringDescriptors_t enum USART_StringDescriptors_t
{ {
USART_STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ USART_STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
USART_STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ USART_STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
USART_STRING_ID_Product = 2, /**< Product string ID */ USART_STRING_ID_Product = 2, /**< Product string ID */
}; };
/* Function Prototypes: */ /* Function Prototypes: */
uint16_t USART_GetDescriptor(const uint16_t wValue, uint16_t USART_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex, const uint8_t wIndex,
const void** const DescriptorAddress, const void** const DescriptorAddress,
uint8_t* const DescriptorMemorySpace); uint8_t* const DescriptorMemorySpace);
#endif #endif

@ -47,7 +47,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,

Loading…
Cancel
Save