/* Manifest constants defining interface numbers and endpoints used by a
particular interface in this application.
*/
#define USB_MSC_IF_NUM 0
#define USB_MSC_IN_EP 0x81
#define USB_MSC_OUT_EP 0x01
/* Manifest constants defining interface numbers and endpoints used by a
particular interface in this application.
*/
#define USB_CDC_CIF_NUM 1
#define USB_CDC_DIF_NUM 2
#define USB_CDC_IN_EP 0x82
#define USB_CDC_OUT_EP 0x02
#define USB_CDC_INT_EP 0x83
#ifdef Composite_CDCMSC
//
//===========================================================================USB Standard Device Descriptor
//
ALIGNED(4) const uint8_t USB_DeviceDescriptor[] = {
USB_DEVICE_DESC_SIZE,// bLength //
USB_DEVICE_DESCRIPTOR_TYPE,// bDescriptorType //
WBVAL(0x0200),// bcdUSB = USB 2.00//
0x00, //USB_DEVICE_CLASS_MISCELLANEOUS,// bDeviceClass //
0x00,// bDeviceSubClass //
0x01,// bDeviceProtocol //
USB_MAX_PACKET0,// bMaxPacketSize0 //
WBVAL(0x1FC9),// idVendor //
WBVAL(0x0087),// idProduct //
WBVAL(0x0100),// bcdDevice //
0x01,// iManufacturer //
0x02,// iProduct //
0x03,// iSerialNumber //
0x01// bNumConfigurations //
};
//
// ===========================================================================USB FSConfiguration Descriptor
// All Descriptors (Configuration, Interface, Endpoint, Class, Vendor)
//
ALIGNED(4) uint8_t USB_FsConfigDescriptor[] = {
// Configuration 1 //
USB_CONFIGURATION_DESC_SIZE,// bLength //
USB_CONFIGURATION_DESCRIPTOR_TYPE,// bDescriptorType //
WBVAL(// wTotalLength //
1 * USB_CONFIGURATION_DESC_SIZE +
//-------------------------------------MSC Class
1 * USB_INTERFACE_DESC_SIZE +// MSC interface //
2 * USB_ENDPOINT_DESC_SIZE +// bulk endpoints //
//-------------------------------------CDC Class
1 * USB_INTERFACE_ASSOC_DESC_SIZE +// interface association descriptor //
1 * USB_INTERFACE_DESC_SIZE +// communication control interface //
0x0013 +// CDC functions //
1 * USB_ENDPOINT_DESC_SIZE +// interrupt endpoint //
1 * USB_INTERFACE_DESC_SIZE +// communication data interface //
2 * USB_ENDPOINT_DESC_SIZE +// bulk endpoints //
0
),
0x03,// bNumInterfaces //
0x01,// bConfigurationValue //
0x00,// iConfiguration //
USB_CONFIG_BUS_POWERED,// bmAttributes //Power from USB.
USB_CONFIG_POWER_MA(500),// bMaxPower //
//==============================================================MSC Section
//-------------------------------------Interface 0, Alternate Setting 0, MSC class interface descriptor //
USB_INTERFACE_DESC_SIZE,// bLength //
USB_INTERFACE_DESCRIPTOR_TYPE,// bDescriptorType //
USB_MSC_IF_NUM,// bInterfaceNumber: Number of Interface //
0x00,// bAlternateSetting: Alternate setting //
0x02,// bNumEndpoints: Two endpoint used //
USB_DEVICE_CLASS_STORAGE,// bInterfaceClass: Communication Interface Class //
MSC_SUBCLASS_SCSI,// bInterfaceSubClass: Abstract Control Model //
MSC_PROTOCOL_BULK_ONLY,// bInterfaceProtocol: no protocol used //
0x06,// iInterface: //
//----------------------------------Endpoint, EP Bulk In //
USB_ENDPOINT_DESC_SIZE,// bLength //
USB_ENDPOINT_DESCRIPTOR_TYPE,// bDescriptorType //
USB_MSC_IN_EP,// bEndpointAddress //
USB_ENDPOINT_TYPE_BULK,// bmAttributes //
WBVAL(USB_FS_MAX_BULK_PACKET),// wMaxPacketSize //
0x00,// bInterval: ignore for Bulk transfer //
//----------------------------------Endpoint, EP Bulk Out //
USB_ENDPOINT_DESC_SIZE,// bLength //
USB_ENDPOINT_DESCRIPTOR_TYPE,// bDescriptorType //
USB_MSC_OUT_EP,// bEndpointAddress //
USB_ENDPOINT_TYPE_BULK,// bmAttributes //
WBVAL(USB_FS_MAX_BULK_PACKET),// wMaxPacketSize //
0x00,// bInterval: ignore for Bulk transfer //
//==============================================================CDC Section
//-------------------------------------Interface association descriptor IAD//
USB_INTERFACE_ASSOC_DESC_SIZE,// bLength //
USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE,// bDescriptorType //
USB_CDC_CIF_NUM,// bFirstInterface //
0x02,// bInterfaceCount //
CDC_COMMUNICATION_INTERFACE_CLASS,// bFunctionClass //
CDC_ABSTRACT_CONTROL_MODEL,// bFunctionSubClass //
0x00,// bFunctionProtocol //
0x05,// iFunction //
//==============================================================
//-------------------------------------Interface 1, Alternate Setting 0, Communication class interface descriptor //
USB_INTERFACE_DESC_SIZE,// bLength //
USB_INTERFACE_DESCRIPTOR_TYPE,// bDescriptorType //
USB_CDC_CIF_NUM,// bInterfaceNumber: Number of Interface //
0x00,// bAlternateSetting: Alternate setting //
0x01,// bNumEndpoints: One endpoint used //
CDC_COMMUNICATION_INTERFACE_CLASS,// bInterfaceClass: Communication Interface Class //
CDC_ABSTRACT_CONTROL_MODEL,// bInterfaceSubClass: Abstract Control Model //
0x00,// bInterfaceProtocol: no protocol used //
0x06,// iInterface: //
// Header Functional Descriptor//
0x05,// bLength: CDC header Descriptor size //
CDC_CS_INTERFACE,// bDescriptorType: CS_INTERFACE //
CDC_HEADER,// bDescriptorSubtype: Header Func Desc //
WBVAL(CDC_V1_10),// bcdCDC 1.10 //
// Call Management Functional Descriptor//
0x05,// bFunctionLength //
CDC_CS_INTERFACE,// bDescriptorType: CS_INTERFACE //
CDC_CALL_MANAGEMENT,// bDescriptorSubtype: Call Management Func Desc //
0x01,// bmCapabilities: device handles call management //
USB_CDC_DIF_NUM,// bDataInterface: CDC data IF ID //
// Abstract Control Management Functional Descriptor//
0x04,// bFunctionLength //
CDC_CS_INTERFACE,// bDescriptorType: CS_INTERFACE //
CDC_ABSTRACT_CONTROL_MANAGEMENT,// bDescriptorSubtype: Abstract Control Management desc //
0x02,// bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported //
// Union Functional Descriptor//
0x05,// bFunctionLength //
CDC_CS_INTERFACE,// bDescriptorType: CS_INTERFACE //
CDC_UNION,// bDescriptorSubtype: Union func desc //
USB_CDC_CIF_NUM,// bMasterInterface: Communication class interface is master //
USB_CDC_DIF_NUM,// bSlaveInterface0: Data class interface is slave 0 //
//-------------------------------------Endpoint 1 Descriptor//
USB_ENDPOINT_DESC_SIZE,// bLength //
USB_ENDPOINT_DESCRIPTOR_TYPE,// bDescriptorType //
USB_CDC_INT_EP,// bEndpointAddress //
USB_ENDPOINT_TYPE_INTERRUPT,// bmAttributes //
WBVAL(0x0010),// wMaxPacketSize //
0x02,// 2ms // // bInterval //
//===========================================================
//-------------------------------------Interface 2, Alternate Setting 0, Data class interface descriptor//
USB_INTERFACE_DESC_SIZE,// bLength //
USB_INTERFACE_DESCRIPTOR_TYPE,// bDescriptorType //
USB_CDC_DIF_NUM,// bInterfaceNumber: Number of Interface //
0x00,// bAlternateSetting: no alternate setting //
0x02,// bNumEndpoints: two endpoints used //
CDC_DATA_INTERFACE_CLASS,// bInterfaceClass: Data Interface Class //
0x00,// bInterfaceSubClass: no subclass available //
0x00,// bInterfaceProtocol: no protocol used //
0x05,// iInterface: //
//-------------------------------------Endpoint, EP Bulk Out //
USB_ENDPOINT_DESC_SIZE,// bLength //
USB_ENDPOINT_DESCRIPTOR_TYPE,// bDescriptorType //
USB_CDC_OUT_EP,// bEndpointAddress //
USB_ENDPOINT_TYPE_BULK,// bmAttributes //
WBVAL(USB_FS_MAX_BULK_PACKET),// wMaxPacketSize //
0x00,// bInterval: ignore for Bulk transfer //
//-------------------------------------Endpoint, EP Bulk In //
USB_ENDPOINT_DESC_SIZE,// bLength //
USB_ENDPOINT_DESCRIPTOR_TYPE,// bDescriptorType //
USB_CDC_IN_EP,// bEndpointAddress //
USB_ENDPOINT_TYPE_BULK,// bmAttributes //
WBVAL(64),// wMaxPacketSize //
0x00,// bInterval: ignore for Bulk transfer //
// Terminator //
0// bLength //
};
//
//=========================================================================== USB Device Qualifier (Do we need this??)
//
ALIGNED(4) const uint8_t USB_DeviceQualifier[] = {
USB_DEVICE_QUALI_SIZE,// bLength
USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE,// bDescriptorType
WBVAL(0x0200),// bcdUSB: 2.00
0x00,// bDeviceClass
0x00,// bDeviceSubClass
0x00,// bDeviceProtocol
USB_MAX_PACKET0,// bMaxPacketSize0
0x01,// bNumOtherSpeedConfigurations
0x00// bReserved
};
/* USB String Descriptor (optional) */
const uint8_t USB_StringDescriptor[] = {
/* Index 0x00: LANGID Codes */
0x04, /* bLength */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
WBVAL(0x0409), /* US English */ /* wLANGID */
/* Index 0x01: Manufacturer */
(13*2 + 2), /* bLength (13 Char + Type + lenght) */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
'I',0,
'D',0,
'T',0,
' ',0,
'E',0,
'V',0,
'K',0,
'I',0,
'T',0,
' ',0,
' ',0,
'1',0,
'5',0,
/* Index 0x02: Product */
(21*2 + 2), /* bLength ( 21 Char + Type + lenght) */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
'E',0,
'Z',0,
'K',0,
'I',0,
'T',0,
' ',0,
'C',0,
'D',0,
'C',0,
'/',0,
'M',0,
'S',0,
'C',0,
' ',0,
'(',0,
'R',0,
'G',0,
'P',0,
'1',0,
'5',0,
')',0,
/* Index 0x03: Serial Number */
(16*2 + 2), /* bLength (12 Char + Type + lenght) */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
'P',0,
'R',0,
'O',0,
'T',0,
'O',0,
'T',0,
'Y',0,
'P',0,
'E',0,
' ',0,
'2',0,
'0',0,
'1',0,
'5',0,
' ',0,
' ',0,
/* Index 0x04: Interface 0, Alternate Setting 0 */
( 6*2 + 2), /* bLength (6 Char + Type + lenght) */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
'M',0,
'e',0,
'm',0,
'o',0,
'r',0,
'y',0,
/* Index 0x05: Interface 0, Alternate Setting 0 */
( 4*2 + 2), /* bLength (4 Char + Type + lenght) */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
'V',0,
'C',0,
'O',0,
'M',0,
/* Index 0x06: Interface 0, Alternate Setting 0 */
( 8*2 + 2), /* bLength (4 Char + Type + lenght) */
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
'C',0,
'O',0,
'M',0,
'/',0,
'D',0,
'A',0,
'T',0,
'A',0,
};
#endif
|