]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/descriptors.h
Prepare for V7.4.0 release.
[freertos] / FreeRTOS / Demo / lwIP_Demo_Rowley_ARM7 / USB / descriptors.h
1 /*\r
2     FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
3 \r
4     FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
5     http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     ***************************************************************************\r
8      *                                                                       *\r
9      *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
10      *    Complete, revised, and edited pdf reference manuals are also       *\r
11      *    available.                                                         *\r
12      *                                                                       *\r
13      *    Purchasing FreeRTOS documentation will not only help you, by       *\r
14      *    ensuring you get running as quickly as possible and with an        *\r
15      *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
16      *    the FreeRTOS project to continue with its mission of providing     *\r
17      *    professional grade, cross platform, de facto standard solutions    *\r
18      *    for microcontrollers - completely free of charge!                  *\r
19      *                                                                       *\r
20      *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
21      *                                                                       *\r
22      *    Thank you for using FreeRTOS, and thank you for your support!      *\r
23      *                                                                       *\r
24     ***************************************************************************\r
25 \r
26 \r
27     This file is part of the FreeRTOS distribution.\r
28 \r
29     FreeRTOS is free software; you can redistribute it and/or modify it under\r
30     the terms of the GNU General Public License (version 2) as published by the\r
31     Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
32 \r
33     >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
34     distribute a combined work that includes FreeRTOS without being obliged to\r
35     provide the source code for proprietary components outside of the FreeRTOS\r
36     kernel.\r
37 \r
38     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
39     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
40     FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
41     details. You should have received a copy of the GNU General Public License\r
42     and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
43     viewed here: http://www.freertos.org/a00114.html and also obtained by\r
44     writing to Real Time Engineers Ltd., contact details for whom are available\r
45     on the FreeRTOS WEB site.\r
46 \r
47     1 tab == 4 spaces!\r
48 \r
49     ***************************************************************************\r
50      *                                                                       *\r
51      *    Having a problem?  Start by reading the FAQ "My application does   *\r
52      *    not run, what could be wrong?"                                     *\r
53      *                                                                       *\r
54      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
55      *                                                                       *\r
56     ***************************************************************************\r
57 \r
58 \r
59     http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
60     license and Real Time Engineers Ltd. contact details.\r
61 \r
62     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
63     including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
64     fully thread aware and reentrant UDP/IP stack.\r
65 \r
66     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
67     Integrity Systems, who sell the code with commercial support, \r
68     indemnification and middleware, under the OpenRTOS brand.\r
69     \r
70     http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
71     engineered and independently SIL3 certified version for use in safety and \r
72     mission critical applications that require provable dependability.\r
73 */\r
74 \r
75 /*\r
76         - DESCRIPTOR DEFINITIONS -\r
77 */\r
78 \r
79 /* String descriptors used during the enumeration process.\r
80 These take the form:\r
81 \r
82 {\r
83         Length of descriptor,\r
84         Descriptor type,\r
85         Data\r
86 }\r
87 */\r
88 \r
89 const char pxLanguageStringDescriptor[] =\r
90 {\r
91         4,\r
92         usbDESCRIPTOR_TYPE_STRING,\r
93         0x09, 0x04\r
94 };\r
95 \r
96 const char pxManufacturerStringDescriptor[] = \r
97 {\r
98         18,\r
99         usbDESCRIPTOR_TYPE_STRING,\r
100 \r
101         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00\r
102 };\r
103 \r
104 const char pxProductStringDescriptor[] = \r
105 {\r
106         36,\r
107         usbDESCRIPTOR_TYPE_STRING,\r
108 \r
109         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00, ' ', 0x00, 'C', 0x00, 'D', 0x00,\r
110         'C', 0x00, ' ', 0x00, 'D', 0x00, 'E', 0x00, 'M', 0x00, 'O', 0x00\r
111 };\r
112 \r
113 const char pxConfigurationStringDescriptor[] = \r
114 {\r
115         38,\r
116         usbDESCRIPTOR_TYPE_STRING,\r
117 \r
118         'C', 0x00, 'o', 0x00, 'n', 0x00, 'f', 0x00, 'i', 0x00, 'g', 0x00, 'u', 0x00, 'r', 0x00, 'a', 0x00, 't', 0x00, 'i', 0x00,\r
119         'o', 0x00, 'n', 0x00, ' ', 0x00, 'N', 0x00, 'a', 0x00, 'm', 0x00, 'e', 0x00\r
120 };\r
121 \r
122 const char pxInterfaceStringDescriptor[] = \r
123 {\r
124         30,\r
125         usbDESCRIPTOR_TYPE_STRING,\r
126 \r
127         'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, ' ', 0x00, 'N', 0x00,\r
128         'a', 0x00, 'm', 0x00, 'e', 0x00\r
129 };\r
130 \r
131 /* Device should properly be 0x134A:0x9001, using 0x05F9:0xFFFF for Linux testing */\r
132 const char pxDeviceDescriptor[] = \r
133 {\r
134         /* Device descriptor */\r
135         0x12,                                                           /* bLength                              */\r
136         0x01,                                                           /* bDescriptorType              */\r
137         0x10, 0x01,                                                     /* bcdUSBL                              */\r
138         0x02,                                                           /* bDeviceClass:                */\r
139         0x00,                                                           /* bDeviceSubclass:             */\r
140         0x00,                                                           /* bDeviceProtocol:             */\r
141         0x08,                                                           /* bMaxPacketSize0              */\r
142         0x03, 0xEB,                                                     /* idVendorL                    */\r
143         0x20, 0x09,                                                     /* idProductL                   */\r
144         0x10, 0x01,                                                     /* bcdDeviceL                   */\r
145         usbMANUFACTURER_STRING,                         /* iManufacturer                */\r
146         usbPRODUCT_STRING,                                      /* iProduct                             */\r
147         0x00,                                                           /* SerialNumber                 */\r
148         0x01                                                            /* bNumConfigs                  */\r
149 };\r
150 \r
151 const char pxConfigDescriptor[] = {\r
152 \r
153         /* Configuration 1 descriptor\r
154         Here we define two interfaces (0 and 1) and a total of 3 endpoints.\r
155         Interface 0 is a CDC Abstract Control Model interface with one interrupt-in endpoint.\r
156         Interface 1 is a CDC Data Interface class, with a bulk-in and bulk-out endpoint.\r
157         Endpoint 0 gets used as the CDC management element.\r
158         */\r
159         0x09,                           /* CbLength                                                             */\r
160         0x02,                           /* CbDescriptorType                                             */\r
161         0x43, 0x00,                     /* CwTotalLength 2 EP + Control         ?       */\r
162         0x02,                           /* CbNumInterfaces                                              */\r
163         0x01,                           /* CbConfigurationValue                                 */\r
164         usbCONFIGURATION_STRING,/* CiConfiguration                                      */\r
165         usbBUS_POWERED,         /* CbmAttributes Bus powered + Remote Wakeup*/\r
166         0x32,                           /* CMaxPower: 100mA                                             */\r
167 \r
168         /* Communication Class Interface Descriptor Requirement         */\r
169         0x09,                           /* bLength                                                              */\r
170         0x04,                           /* bDescriptorType                                              */\r
171         0x00,                           /* bInterfaceNumber                                             */\r
172         0x00,                           /* bAlternateSetting                                    */\r
173         0x01,                           /* bNumEndpoints                                                */\r
174         0x02,                           /* bInterfaceClass: Comm Interface Class */\r
175         0x02,                           /* bInterfaceSubclass: Abstract Control Model*/\r
176         0x00,                           /* bInterfaceProtocol                                   */\r
177         usbINTERFACE_STRING,/* iInterface                                                       */\r
178 \r
179         /* Header Functional Descriptor                                                         */\r
180         0x05,                           /* bLength                                                              */\r
181         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
182         0x00,                           /* bDescriptor subtype: Header Func Desc*/\r
183         0x10, 0x01,                     /* bcdCDC:1.1                                                   */\r
184 \r
185         /* ACM Functional Descriptor                                                            */\r
186         0x04,                           /* bFunctionLength                                              */\r
187         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
188         0x02,                           /* bDescriptor subtype: ACM Func Desc   */\r
189         0x00,                           /* bmCapabilities: We don't support squat*/\r
190 \r
191         /* Union Functional Descriptor                                                          */\r
192         0x05,                           /* bFunctionLength                                              */\r
193         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
194         0x06,                           /* bDescriptor subtype: Union Func Desc */\r
195         0x00,                           /* bMasterInterface: CDC Interface              */\r
196         0x01,                           /* bSlaveInterface0: Data Class Interface*/\r
197 \r
198         /* Call Management Functional Descriptor\r
199         0 in D1 and D0 indicates that device does not handle call management*/\r
200         0x05,                           /* bFunctionLength                                              */\r
201         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
202         0x01,                           /* bDescriptor subtype: Call Management Func*/\r
203         0x01,                           /* bmCapabilities: D1 + D0                              */\r
204         0x01,                           /* bDataInterface: Data Class Interface 1*/\r
205 \r
206         /* CDC Control - Endpoint 3 descriptor\r
207         This endpoint serves as a notification element.                         */\r
208 \r
209         0x07,                           /* bLength                                                              */\r
210         0x05,                           /* bDescriptorType                                              */\r
211         0x83,                           /* bEndpointAddress, Endpoint 03 - IN   */\r
212         0x03,                           /* bmAttributes   INT                                   */\r
213         0x08, 0x00,                     /* wMaxPacketSize: 8 bytes                              */\r
214         0xFF,                           /* bInterval                                                    */\r
215 \r
216         /* Data Class Interface Descriptor Requirement                          */\r
217         0x09,                           /* bLength                                                              */\r
218         0x04,                           /* bDescriptorType                                              */\r
219         0x01,                           /* bInterfaceNumber                                             */\r
220         0x00,                           /* bAlternateSetting                                    */\r
221         0x02,                           /* bNumEndPoints                                                */\r
222         0x0A,                           /* bInterfaceClass                                              */\r
223         0x00,                           /* bInterfaceSubclass                                   */\r
224         0x00,                           /* bInterfaceProtocol                                   */\r
225         0x00,                           /* iInterface                                                   */\r
226 \r
227         /* CDC Data - Endpoint 1 descriptor */\r
228         0x07,                           /* bLenght                                                              */\r
229         0x05,                           /* bDescriptorType                                              */\r
230         0x01,                           /* bEndPointAddress, Endpoint 01 - OUT  */\r
231         0x02,                           /* bmAttributes BULK                                    */\r
232         64,                                     /* wMaxPacketSize                                               */\r
233         0x00,\r
234         0x00,                           /* bInterval                                                    */\r
235 \r
236         /* CDC Data - Endpoint 2 descriptor */\r
237         0x07,                           /* bLength                                                              */\r
238         0x05,                           /* bDescriptorType                                              */\r
239         0x82,                           /* bEndPointAddress, Endpoint 02 - IN   */\r
240         0x02,                           /* bmAttributes BULK                                    */\r
241         64,                                     /* wMaxPacketSize                                               */\r
242         0x00,\r
243         0x00                            /* bInterval                                                    */\r
244 };\r
245 \r