flatUSB/desc/usb_desc.c

177 lines
7.8 KiB
C

#include "usb_desc.h"
const USB_DeviceDesc devDesc = { /* Device Descriptor */
0x12, //bLength
UD_Device, //bDescriptorType
0x200, //bcdUSB
0x2, //bDeviceClass
0x0, //bDeviceSubclass
0x0, //bDeviceProtocol
0x40, //bMaxPacketSize0
0x925, //idVendor
0x9050, //idProduct
0x100, //bcdDevice
0x1, //iManufacturer
0x2, //iProduct
0x3, //iSerialNumber
0x1, //bNumConfigurations
};
const USB_DeviceQualifierDesc devQualDesc = { /* Device Qualifier descriptor */
0x9, //bLength
UD_DeviceQualifier, //bDescriptorType
0x200, //bcdUSB
0x2, //bDeviceClass
0x0, //bDeviceSubclass
0x0, //bDeviceProtocol
0x40, //bMaxPacketSize
0x1, //bNumConfigurations
};
const FullConfigurations0 fullConfDescs0 = {
{ /* Configuration descriptor */
0x9, //bLength
UD_Configuration, //bDescriptorType
sizeof(struct _FullConfigurations0), //wTotalLength
0x3, //bNumInterfaces
0x1, //bConfigurationValue
0x0, //iConfiguration
USB_CONFIG_ATTR_USB1_1_FLAG, //bmAttributes
0x32, //bMaxPower
}, //config
{ /* Interface descriptor : 0 */
0x9, //bLength
UD_Interface, //bDescriptorType
0x0, //bInterfaceNumber
0x0, //bAlternateSetting
0x1, //bNumEndpoints
0x2, //bInterfaceClass
0x2, //bInterfaceSubclass
0x1, //bInterfaceProtocol
0x0, //iInterface
}, //intf0
{ /* Header Functional descriptor */
0x5, //bLength
0x24, //bDescriptorType
0x0, //bDescriptorSubType
0x110, //bcdCDC
}, //intf0hfd
{ /* Abstract Control Management Functional descriptor */
0x4, //bLength
0x24, //bDescriptorType
0x2, //bDescriptorSubType
0x2, //bmCapabilities
}, //intf0acmfd
{ /* Union Functional descriptor */
0x5, //bLength
0x24, //bDescriptorType
0x6, //bDescriptorSubType
0x0, //bMasterInterface
0x1, //bSlaveInterface0
}, //intf0ufd
{ /* Call Management Functional descriptor */
0x5, //bLength
0x24, //bDescriptorType
0x1, //bDescriptorSubType
0x0, //bmCapabilities
0x1, //dDataInterface
}, //intf0cmfd
{ /* Endpoint descriptor : 2 in */
0x7, //bLength
UD_Endpoint, //bDescriptorType
(USB_IN << 7) | (2), //bEndpointAddress
UT_Interrupt, //bmAttributes
0x40, //wMaxPacketSize
0x2, //bInterval
}, //ep2in
{ /* Interface descriptor : 1 */
0x9, //bLength
UD_Interface, //bDescriptorType
0x1, //bInterfaceNumber
0x0, //bAlternateSetting
0x2, //bNumEndpoints
0xa, //bInterfaceClass
0x0, //bInterfaceSubclass
0x0, //bInterfaceProtocol
0x0, //iInterface
}, //intf1
{ /* Endpoint descriptor : 1 in */
0x7, //bLength
UD_Endpoint, //bDescriptorType
(USB_IN << 7) | (1), //bEndpointAddress
UT_Bulk, //bmAttributes
0x40, //wMaxPacketSize
0x14, //bInterval
}, //ep1in
{ /* Endpoint descriptor : 1 out */
0x7, //bLength
UD_Endpoint, //bDescriptorType
(USB_OUT << 7) | (1), //bEndpointAddress
UT_Bulk, //bmAttributes
0x40, //wMaxPacketSize
0x14, //bInterval
}, //ep1out
{ /* Interface descriptor : 2 */
0x9, //bLength
UD_Interface, //bDescriptorType
0x2, //bInterfaceNumber
0x0, //bAlternateSetting
0x2, //bNumEndpoints
0x2, //bInterfaceClass
0xc, //bInterfaceSubclass
0x7, //bInterfaceProtocol
0x0, //iInterface
}, //intf2
{ /* Endpoint descriptor : 3 in */
0x7, //bLength
UD_Endpoint, //bDescriptorType
(USB_IN << 7) | (3), //bEndpointAddress
UT_Bulk, //bmAttributes
0x40, //wMaxPacketSize
0xa, //bInterval
}, //ep3in
{ /* Endpoint descriptor : 3 out */
0x7, //bLength
UD_Endpoint, //bDescriptorType
(USB_OUT << 7) | (3), //bEndpointAddress
UT_Bulk, //bmAttributes
0x40, //wMaxPacketSize
0xa, //bInterval
}, //ep3out
};
const ConfDescs confDescs = {
(USB_ConfigurationDesc *) & fullConfDescs0, //fullConfDescs0
};
const USB_StrDesc_lang_id lang_id = { /* String descriptor */
0x4, //bLength
UD_String, //bDescriptorType
0x409, //bString
};
const USB_StrDesc_vendor_string vendor_string = { /* String descriptor */
0x10, //bLength
UD_String, //bDescriptorType
{'E', 'p', 'a', 'g', 'r', 'i', 's',}, //bString
};
const USB_StrDesc_product_string product_string = { /* String descriptor */
0x16, //bLength
UD_String, //bDescriptorType
{'T', 'e', 's', 't', 'd', 'e', 'v', 'i', 'c', 'e',}, //bString
};
const USB_StrDesc_serial_number serial_number = { /* String descriptor */
0xa, //bLength
UD_String, //bDescriptorType
{'1', '5', '5', '2',}, //bString
};
const StringDescs strDescs = {
(USB_StringDesc *) & lang_id, //lang_id
(USB_StringDesc *) & vendor_string, //vendor_string
(USB_StringDesc *) & product_string, //product_string
(USB_StringDesc *) & serial_number, //serial_number
};