1 #ifndef _USB_DESCRIPTORS_H
2 #define _USB_DESCRIPTORS_H
10 #include "../config.h"
12 /* The USB descriptor set for emulating a HID device */
14 const struct usb_device_descriptor dev_descriptor
= {
15 .bLength
= USB_DT_DEVICE_SIZE
,
16 .bDescriptorType
= USB_DT_DEVICE
,
19 .bDeviceSubClass
= 0x00,
20 .bDeviceProtocol
= 0x00,
21 .bMaxPacketSize0
= 0x08,
22 .idVendor
= USB_VENDOR_ID
,
23 .idProduct
= USB_PRODUCT_ID
,
24 .bcdDevice
= 0x0030, /* Version 0.3 */
25 #ifdef CONFIG_USB_STRING
34 .bNumConfigurations
= 0x01,
38 struct usb_config_descriptor ucfg
;
39 struct usb_interface_descriptor uif
;
40 struct usb_hid_descriptor hid
;
41 struct usb_endpoint_descriptor ep
[1];
43 struct usb_interface_descriptor uif_dfu
[2];
47 const struct _desc cfg_descriptor
= {
49 .bLength
= USB_DT_CONFIG_SIZE
,
50 .bDescriptorType
= USB_DT_CONFIG
,
51 .wTotalLength
= USB_DT_CONFIG_SIZE
+
53 3 * USB_DT_INTERFACE_SIZE
+
54 1 * USB_DT_ENDPOINT_SIZE
,
57 1 * USB_DT_INTERFACE_SIZE
+
58 1 * USB_DT_ENDPOINT_SIZE
,
61 .bConfigurationValue
= 1,
62 #ifdef CONFIG_USB_STRING
67 .bmAttributes
= USB_CONFIG_ATT_ONE
,
68 .bMaxPower
= 250, /* 500mA */
71 .bLength
= USB_DT_INTERFACE_SIZE
,
72 .bDescriptorType
= USB_DT_INTERFACE
,
73 .bInterfaceNumber
= 0,
74 .bAlternateSetting
= 0,
76 .bInterfaceClass
= USB_CLASS_HID
,
77 .bInterfaceSubClass
= 0,
78 .bInterfaceProtocol
= 0x01,
79 #ifdef CONFIG_USB_STRING
87 .bDescriptorType
= HID_DT_HID
,
92 .bDescriptorType
= HID_DT_REPORT
,
98 .bLength
= USB_DT_ENDPOINT_SIZE
,
99 .bDescriptorType
= USB_DT_ENDPOINT
,
100 .bEndpointAddress
= OPENPCD_IRQ_EP
,
101 .bmAttributes
= USB_ENDPOINT_XFER_INT
,
102 .wMaxPacketSize
= AT91C_EP_IN_SIZE
,
103 .bInterval
= 0x0a, /* FIXME */
108 .uif_dfu
= DFU_RT_IF_DESC
,
112 #endif /* _USB_DESCRIPTORS_H */