1 |
/*---------------------------------------------------------------------------- |
---|
2 |
* U S B - K e r n e l |
---|
3 |
*---------------------------------------------------------------------------- |
---|
4 |
* Name: USBDESC.C |
---|
5 |
* Purpose: USB Descriptors |
---|
6 |
* Version: V1.10 |
---|
7 |
*---------------------------------------------------------------------------- |
---|
8 |
* This file is part of the uVision/ARM development tools. |
---|
9 |
* This software may only be used under the terms of a valid, current, |
---|
10 |
* end user licence from KEIL for a compatible version of KEIL software |
---|
11 |
* development tools. Nothing else gives you the right to use it. |
---|
12 |
* |
---|
13 |
* Copyright (c) 2005-2007 Keil Software. |
---|
14 |
*---------------------------------------------------------------------------*/ |
---|
15 |
|
---|
16 |
#include "type.h" |
---|
17 |
|
---|
18 |
#include "usb.h" |
---|
19 |
#include "msc.h" |
---|
20 |
#include "usbcfg.h" |
---|
21 |
#include "usbdesc.h" |
---|
22 |
|
---|
23 |
|
---|
24 |
/* USB Standard Device Descriptor */ |
---|
25 |
const BYTE USB_DeviceDescriptor[] = { |
---|
26 |
USB_DEVICE_DESC_SIZE, /* bLength */ |
---|
27 |
USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType */ |
---|
28 |
WBVAL(0x0110), /* 1.10 */ /* bcdUSB */ |
---|
29 |
0x00, /* bDeviceClass */ |
---|
30 |
0x00, /* bDeviceSubClass */ |
---|
31 |
0x00, /* bDeviceProtocol */ |
---|
32 |
USB_MAX_PACKET0, /* bMaxPacketSize0 */ |
---|
33 |
WBVAL(0xC251), /* idVendor */ |
---|
34 |
WBVAL(0x1703), /* idProduct */ |
---|
35 |
WBVAL(0x0100), /* 1.00 */ /* bcdDevice */ |
---|
36 |
0x04, /* iManufacturer */ |
---|
37 |
0x20, /* iProduct */ |
---|
38 |
0x48, /* iSerialNumber */ |
---|
39 |
0x01 /* bNumConfigurations */ |
---|
40 |
}; |
---|
41 |
|
---|
42 |
/* USB Configuration Descriptor */ |
---|
43 |
/* All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */ |
---|
44 |
const BYTE USB_ConfigDescriptor[] = { |
---|
45 |
/* Configuration 1 */ |
---|
46 |
USB_CONFIGUARTION_DESC_SIZE, /* bLength */ |
---|
47 |
USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType */ |
---|
48 |
WBVAL( /* wTotalLength */ |
---|
49 |
1*USB_CONFIGUARTION_DESC_SIZE + |
---|
50 |
1*USB_INTERFACE_DESC_SIZE + |
---|
51 |
2*USB_ENDPOINT_DESC_SIZE |
---|
52 |
), |
---|
53 |
0x01, /* bNumInterfaces */ |
---|
54 |
0x01, /* bConfigurationValue */ |
---|
55 |
0x00, /* iConfiguration */ |
---|
56 |
USB_CONFIG_BUS_POWERED /*|*/ /* bmAttributes */ |
---|
57 |
/*USB_CONFIG_REMOTE_WAKEUP*/, |
---|
58 |
USB_CONFIG_POWER_MA(100), /* bMaxPower */ |
---|
59 |
/* Interface 0, Alternate Setting 0, MSC Class */ |
---|
60 |
USB_INTERFACE_DESC_SIZE, /* bLength */ |
---|
61 |
USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */ |
---|
62 |
0x00, /* bInterfaceNumber */ |
---|
63 |
0x00, /* bAlternateSetting */ |
---|
64 |
0x02, /* bNumEndpoints */ |
---|
65 |
USB_DEVICE_CLASS_STORAGE, /* bInterfaceClass */ |
---|
66 |
MSC_SUBCLASS_SCSI, /* bInterfaceSubClass */ |
---|
67 |
MSC_PROTOCOL_BULK_ONLY, /* bInterfaceProtocol */ |
---|
68 |
0x62, /* iInterface */ |
---|
69 |
/* Bulk In Endpoint */ |
---|
70 |
USB_ENDPOINT_DESC_SIZE, /* bLength */ |
---|
71 |
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ |
---|
72 |
USB_ENDPOINT_IN(2), /* bEndpointAddress */ |
---|
73 |
USB_ENDPOINT_TYPE_BULK, /* bmAttributes */ |
---|
74 |
WBVAL(0x0040), /* wMaxPacketSize */ |
---|
75 |
0, /* bInterval */ |
---|
76 |
/* Bulk Out Endpoint */ |
---|
77 |
USB_ENDPOINT_DESC_SIZE, /* bLength */ |
---|
78 |
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ |
---|
79 |
USB_ENDPOINT_OUT(2), /* bEndpointAddress */ |
---|
80 |
USB_ENDPOINT_TYPE_BULK, /* bmAttributes */ |
---|
81 |
WBVAL(0x0040), /* wMaxPacketSize */ |
---|
82 |
0, /* bInterval */ |
---|
83 |
/* Terminator */ |
---|
84 |
0 /* bLength */ |
---|
85 |
}; |
---|
86 |
|
---|
87 |
/* USB String Descriptor (optional) */ |
---|
88 |
const BYTE USB_StringDescriptor[] = { |
---|
89 |
/* Index 0x00: LANGID Codes */ |
---|
90 |
0x04, /* bLength */ |
---|
91 |
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */ |
---|
92 |
WBVAL(0x0409), /* US English */ /* wLANGID */ |
---|
93 |
|
---|
94 |
/* Index 0x04: Manufacturer */ |
---|
95 |
0x1C, // (1 Byte)bLength = 28 |
---|
96 |
USB_STRING_DESCRIPTOR_TYPE, // (1 Byte)bDescriptorType = 03H |
---|
97 |
'E',0, // 26 Byte String |
---|
98 |
'T',0, |
---|
99 |
'T',0, |
---|
100 |
' ',0, |
---|
101 |
'C',0, |
---|
102 |
'O',0, |
---|
103 |
'.',0, |
---|
104 |
',',0, |
---|
105 |
'L',0, |
---|
106 |
'T',0, |
---|
107 |
'D',0, |
---|
108 |
'.',0, |
---|
109 |
' ',0, |
---|
110 |
|
---|
111 |
/* Index 0x20: Product */ |
---|
112 |
0x30, // (1 Byte)bLength = 48 |
---|
113 |
USB_STRING_DESCRIPTOR_TYPE, // (1 Byte)bDescriptorType = 03H |
---|
114 |
'E',0, // 46 Byte String |
---|
115 |
'T',0, |
---|
116 |
'-',0, |
---|
117 |
'A',0, |
---|
118 |
'R',0, |
---|
119 |
'M',0, |
---|
120 |
'7',0, |
---|
121 |
'(',0, |
---|
122 |
'L',0, |
---|
123 |
'P',0, |
---|
124 |
'C',0, |
---|
125 |
'2',0, |
---|
126 |
'3',0, |
---|
127 |
'6',0, |
---|
128 |
'8',0, |
---|
129 |
')',0, |
---|
130 |
' ',0, |
---|
131 |
'M',0, |
---|
132 |
'e',0, |
---|
133 |
'm',0, |
---|
134 |
'o',0, |
---|
135 |
'r',0, |
---|
136 |
'y',0, |
---|
137 |
|
---|
138 |
/* Index 0x48: Serial Number */ |
---|
139 |
0x1A, /* bLength */ |
---|
140 |
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */ |
---|
141 |
'D',0, |
---|
142 |
'E',0, |
---|
143 |
'M',0, |
---|
144 |
'O',0, |
---|
145 |
'0',0, |
---|
146 |
'0',0, |
---|
147 |
'0',0, |
---|
148 |
'0',0, |
---|
149 |
'0',0, |
---|
150 |
'0',0, |
---|
151 |
'0',0, |
---|
152 |
'0',0, |
---|
153 |
/* Index 0x62: Interface 0, Alternate Setting 0 */ |
---|
154 |
0x0E, /* bLength */ |
---|
155 |
USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */ |
---|
156 |
'M',0, |
---|
157 |
'e',0, |
---|
158 |
'm',0, |
---|
159 |
'o',0, |
---|
160 |
'r',0, |
---|
161 |
'y',0, |
---|
162 |
}; |
---|