]> git.sur5r.net Git - freertos/blob - Demo/lwIP_Demo_Rowley_ARM7/USB/descriptors.h
Update to V5.0.0.
[freertos] / Demo / lwIP_Demo_Rowley_ARM7 / USB / descriptors.h
1 /*\r
2         FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry.\r
3 \r
4         This file is part of the FreeRTOS.org distribution.\r
5 \r
6         FreeRTOS.org is free software; you can redistribute it and/or modify\r
7         it under the terms of the GNU General Public License as published by\r
8         the Free Software Foundation; either version 2 of the License, or\r
9         (at your option) any later version.\r
10 \r
11         FreeRTOS.org is distributed in the hope that it will be useful,\r
12         but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14         GNU General Public License for more details.\r
15 \r
16         You should have received a copy of the GNU General Public License\r
17         along with FreeRTOS.org; if not, write to the Free Software\r
18         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 \r
20         A special exception to the GPL can be applied should you wish to distribute\r
21         a combined work that includes FreeRTOS.org, without being obliged to provide\r
22         the source code for any proprietary components.  See the licensing section\r
23         of http://www.FreeRTOS.org for full details of how and when the exception\r
24         can be applied.\r
25 \r
26     ***************************************************************************\r
27     ***************************************************************************\r
28     *                                                                         *\r
29     * SAVE TIME AND MONEY!  We can port FreeRTOS.org to your own hardware,    *\r
30     * and even write all or part of your application on your behalf.          *\r
31     * See http://www.OpenRTOS.com for details of the services we provide to   *\r
32     * expedite your project.                                                  *\r
33     *                                                                         *\r
34     ***************************************************************************\r
35     ***************************************************************************\r
36 \r
37         Please ensure to read the configuration and relevant port sections of the\r
38         online documentation.\r
39 \r
40         http://www.FreeRTOS.org - Documentation, latest information, license and \r
41         contact details.\r
42 \r
43         http://www.SafeRTOS.com - A version that is certified for use in safety \r
44         critical systems.\r
45 \r
46         http://www.OpenRTOS.com - Commercial support, development, porting, \r
47         licensing and training services.\r
48 */\r
49 \r
50 /*\r
51         - DESCRIPTOR DEFINITIONS -\r
52 */\r
53 \r
54 /* String descriptors used during the enumeration process.\r
55 These take the form:\r
56 \r
57 {\r
58         Length of descriptor,\r
59         Descriptor type,\r
60         Data\r
61 }\r
62 */\r
63 \r
64 const portCHAR pxLanguageStringDescriptor[] =\r
65 {\r
66         4,\r
67         usbDESCRIPTOR_TYPE_STRING,\r
68         0x09, 0x04\r
69 };\r
70 \r
71 const portCHAR pxManufacturerStringDescriptor[] = \r
72 {\r
73         18,\r
74         usbDESCRIPTOR_TYPE_STRING,\r
75 \r
76         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00\r
77 };\r
78 \r
79 const portCHAR pxProductStringDescriptor[] = \r
80 {\r
81         36,\r
82         usbDESCRIPTOR_TYPE_STRING,\r
83 \r
84         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00, ' ', 0x00, 'C', 0x00, 'D', 0x00,\r
85         'C', 0x00, ' ', 0x00, 'D', 0x00, 'E', 0x00, 'M', 0x00, 'O', 0x00\r
86 };\r
87 \r
88 const portCHAR pxConfigurationStringDescriptor[] = \r
89 {\r
90         38,\r
91         usbDESCRIPTOR_TYPE_STRING,\r
92 \r
93         'C', 0x00, 'o', 0x00, 'n', 0x00, 'f', 0x00, 'i', 0x00, 'g', 0x00, 'u', 0x00, 'r', 0x00, 'a', 0x00, 't', 0x00, 'i', 0x00,\r
94         'o', 0x00, 'n', 0x00, ' ', 0x00, 'N', 0x00, 'a', 0x00, 'm', 0x00, 'e', 0x00\r
95 };\r
96 \r
97 const portCHAR pxInterfaceStringDescriptor[] = \r
98 {\r
99         30,\r
100         usbDESCRIPTOR_TYPE_STRING,\r
101 \r
102         'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, ' ', 0x00, 'N', 0x00,\r
103         'a', 0x00, 'm', 0x00, 'e', 0x00\r
104 };\r
105 \r
106 /* Device should properly be 0x134A:0x9001, using 0x05F9:0xFFFF for Linux testing */\r
107 const char pxDeviceDescriptor[] = \r
108 {\r
109         /* Device descriptor */\r
110         0x12,                                                           /* bLength                              */\r
111         0x01,                                                           /* bDescriptorType              */\r
112         0x10, 0x01,                                                     /* bcdUSBL                              */\r
113         0x02,                                                           /* bDeviceClass:                */\r
114         0x00,                                                           /* bDeviceSubclass:             */\r
115         0x00,                                                           /* bDeviceProtocol:             */\r
116         0x08,                                                           /* bMaxPacketSize0              */\r
117         0x03, 0xEB,                                                     /* idVendorL                    */\r
118         0x20, 0x09,                                                     /* idProductL                   */\r
119         0x10, 0x01,                                                     /* bcdDeviceL                   */\r
120         usbMANUFACTURER_STRING,                         /* iManufacturer                */\r
121         usbPRODUCT_STRING,                                      /* iProduct                             */\r
122         0x00,                                                           /* SerialNumber                 */\r
123         0x01                                                            /* bNumConfigs                  */\r
124 };\r
125 \r
126 const char pxConfigDescriptor[] = {\r
127 \r
128         /* Configuration 1 descriptor\r
129         Here we define two interfaces (0 and 1) and a total of 3 endpoints.\r
130         Interface 0 is a CDC Abstract Control Model interface with one interrupt-in endpoint.\r
131         Interface 1 is a CDC Data Interface class, with a bulk-in and bulk-out endpoint.\r
132         Endpoint 0 gets used as the CDC management element.\r
133         */\r
134         0x09,                           /* CbLength                                                             */\r
135         0x02,                           /* CbDescriptorType                                             */\r
136         0x43, 0x00,                     /* CwTotalLength 2 EP + Control         ?       */\r
137         0x02,                           /* CbNumInterfaces                                              */\r
138         0x01,                           /* CbConfigurationValue                                 */\r
139         usbCONFIGURATION_STRING,/* CiConfiguration                                      */\r
140         usbBUS_POWERED,         /* CbmAttributes Bus powered + Remote Wakeup*/\r
141         0x32,                           /* CMaxPower: 100mA                                             */\r
142 \r
143         /* Communication Class Interface Descriptor Requirement         */\r
144         0x09,                           /* bLength                                                              */\r
145         0x04,                           /* bDescriptorType                                              */\r
146         0x00,                           /* bInterfaceNumber                                             */\r
147         0x00,                           /* bAlternateSetting                                    */\r
148         0x01,                           /* bNumEndpoints                                                */\r
149         0x02,                           /* bInterfaceClass: Comm Interface Class */\r
150         0x02,                           /* bInterfaceSubclass: Abstract Control Model*/\r
151         0x00,                           /* bInterfaceProtocol                                   */\r
152         usbINTERFACE_STRING,/* iInterface                                                       */\r
153 \r
154         /* Header Functional Descriptor                                                         */\r
155         0x05,                           /* bLength                                                              */\r
156         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
157         0x00,                           /* bDescriptor subtype: Header Func Desc*/\r
158         0x10, 0x01,                     /* bcdCDC:1.1                                                   */\r
159 \r
160         /* ACM Functional Descriptor                                                            */\r
161         0x04,                           /* bFunctionLength                                              */\r
162         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
163         0x02,                           /* bDescriptor subtype: ACM Func Desc   */\r
164         0x00,                           /* bmCapabilities: We don't support squat*/\r
165 \r
166         /* Union Functional Descriptor                                                          */\r
167         0x05,                           /* bFunctionLength                                              */\r
168         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
169         0x06,                           /* bDescriptor subtype: Union Func Desc */\r
170         0x00,                           /* bMasterInterface: CDC Interface              */\r
171         0x01,                           /* bSlaveInterface0: Data Class Interface*/\r
172 \r
173         /* Call Management Functional Descriptor\r
174         0 in D1 and D0 indicates that device does not handle call management*/\r
175         0x05,                           /* bFunctionLength                                              */\r
176         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
177         0x01,                           /* bDescriptor subtype: Call Management Func*/\r
178         0x00,                           /* bmCapabilities: D1 + D0                              */\r
179         0x01,                           /* bDataInterface: Data Class Interface 1*/\r
180 \r
181         /* CDC Control - Endpoint 3 descriptor\r
182         This endpoint serves as a notification element.                         */\r
183 \r
184         0x07,                           /* bLength                                                              */\r
185         0x05,                           /* bDescriptorType                                              */\r
186         0x83,                           /* bEndpointAddress, Endpoint 03 - IN   */\r
187         0x03,                           /* bmAttributes   INT                                   */\r
188         0x08, 0x00,                     /* wMaxPacketSize: 8 bytes                              */\r
189         0xFF,                           /* bInterval                                                    */\r
190 \r
191         /* Data Class Interface Descriptor Requirement                          */\r
192         0x09,                           /* bLength                                                              */\r
193         0x04,                           /* bDescriptorType                                              */\r
194         0x01,                           /* bInterfaceNumber                                             */\r
195         0x00,                           /* bAlternateSetting                                    */\r
196         0x02,                           /* bNumEndPoints                                                */\r
197         0x0A,                           /* bInterfaceClass                                              */\r
198         0x00,                           /* bInterfaceSubclass                                   */\r
199         0x00,                           /* bInterfaceProtocol                                   */\r
200         0x00,                           /* iInterface                                                   */\r
201 \r
202         /* CDC Data - Endpoint 1 descriptor */\r
203         0x07,                           /* bLenght                                                              */\r
204         0x05,                           /* bDescriptorType                                              */\r
205         0x01,                           /* bEndPointAddress, Endpoint 01 - OUT  */\r
206         0x02,                           /* bmAttributes BULK                                    */\r
207         64,                                     /* wMaxPacketSize                                               */\r
208         0x00,\r
209         0x00,                           /* bInterval                                                    */\r
210 \r
211         /* CDC Data - Endpoint 2 descriptor */\r
212         0x07,                           /* bLength                                                              */\r
213         0x05,                           /* bDescriptorType                                              */\r
214         0x82,                           /* bEndPointAddress, Endpoint 02 - IN   */\r
215         0x02,                           /* bmAttributes BULK                                    */\r
216         64,                                     /* wMaxPacketSize                                               */\r
217         0x00,\r
218         0x00                            /* bInterval                                                    */\r
219 };\r
220 \r