]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/descriptors.h
Update version numbers in preparation for V8.2.0 release candidate 1.
[freertos] / FreeRTOS / Demo / lwIP_Demo_Rowley_ARM7 / USB / descriptors.h
1 /*\r
2     FreeRTOS V8.2.0rc1 - Copyright (C) 2014 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \r
9     FreeRTOS is free software; you can redistribute it and/or modify it under\r
10     the terms of the GNU General Public License (version 2) as published by the\r
11     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
12 \r
13     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
14     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
15     >>!   obliged to provide the source code for proprietary components     !<<\r
16     >>!   outside of the FreeRTOS kernel.                                   !<<\r
17 \r
18     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
19     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
20     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
21     link: http://www.freertos.org/a00114.html\r
22 \r
23     1 tab == 4 spaces!\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    Having a problem?  Start by reading the FAQ "My application does   *\r
28      *    not run, what could be wrong?".  Have you defined configASSERT()?  *\r
29      *                                                                       *\r
30      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
31      *                                                                       *\r
32     ***************************************************************************\r
33 \r
34     ***************************************************************************\r
35      *                                                                       *\r
36      *    FreeRTOS provides completely free yet professionally developed,    *\r
37      *    robust, strictly quality controlled, supported, and cross          *\r
38      *    platform software that is more than just the market leader, it     *\r
39      *    is the industry's de facto standard.                               *\r
40      *                                                                       *\r
41      *    Help yourself get started quickly while simultaneously helping     *\r
42      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
43      *    tutorial book, reference manual, or both:                          *\r
44      *    http://www.FreeRTOS.org/Documentation                              *\r
45      *                                                                       *\r
46     ***************************************************************************\r
47 \r
48     ***************************************************************************\r
49      *                                                                       *\r
50      *   Investing in training allows your team to be as productive as       *\r
51      *   possible as early as possible, lowering your overall development    *\r
52      *   cost, and enabling you to bring a more robust product to market     *\r
53      *   earlier than would otherwise be possible.  Richard Barry is both    *\r
54      *   the architect and key author of FreeRTOS, and so also the world's   *\r
55      *   leading authority on what is the world's most popular real time     *\r
56      *   kernel for deeply embedded MCU designs.  Obtaining your training    *\r
57      *   from Richard ensures your team will gain directly from his in-depth *\r
58      *   product knowledge and years of usage experience.  Contact Real Time *\r
59      *   Engineers Ltd to enquire about the FreeRTOS Masterclass, presented  *\r
60      *   by Richard Barry:  http://www.FreeRTOS.org/contact\r
61      *                                                                       *\r
62     ***************************************************************************\r
63 \r
64     ***************************************************************************\r
65      *                                                                       *\r
66      *    You are receiving this top quality software for free.  Please play *\r
67      *    fair and reciprocate by reporting any suspected issues and         *\r
68      *    participating in the community forum:                              *\r
69      *    http://www.FreeRTOS.org/support                                    *\r
70      *                                                                       *\r
71      *    Thank you!                                                         *\r
72      *                                                                       *\r
73     ***************************************************************************\r
74 \r
75     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
76     license and Real Time Engineers Ltd. contact details.\r
77 \r
78     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
79     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
80     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
81 \r
82     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
83     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
84 \r
85     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
86     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
87     licenses offer ticketed support, indemnification and commercial middleware.\r
88 \r
89     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
90     engineered and independently SIL3 certified version for use in safety and\r
91     mission critical applications that require provable dependability.\r
92 \r
93     1 tab == 4 spaces!\r
94 */\r
95 \r
96 /*\r
97         - DESCRIPTOR DEFINITIONS -\r
98 */\r
99 \r
100 /* String descriptors used during the enumeration process.\r
101 These take the form:\r
102 \r
103 {\r
104         Length of descriptor,\r
105         Descriptor type,\r
106         Data\r
107 }\r
108 */\r
109 \r
110 const char pxLanguageStringDescriptor[] =\r
111 {\r
112         4,\r
113         usbDESCRIPTOR_TYPE_STRING,\r
114         0x09, 0x04\r
115 };\r
116 \r
117 const char pxManufacturerStringDescriptor[] = \r
118 {\r
119         18,\r
120         usbDESCRIPTOR_TYPE_STRING,\r
121 \r
122         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00\r
123 };\r
124 \r
125 const char pxProductStringDescriptor[] = \r
126 {\r
127         36,\r
128         usbDESCRIPTOR_TYPE_STRING,\r
129 \r
130         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00, ' ', 0x00, 'C', 0x00, 'D', 0x00,\r
131         'C', 0x00, ' ', 0x00, 'D', 0x00, 'E', 0x00, 'M', 0x00, 'O', 0x00\r
132 };\r
133 \r
134 const char pxConfigurationStringDescriptor[] = \r
135 {\r
136         38,\r
137         usbDESCRIPTOR_TYPE_STRING,\r
138 \r
139         'C', 0x00, 'o', 0x00, 'n', 0x00, 'f', 0x00, 'i', 0x00, 'g', 0x00, 'u', 0x00, 'r', 0x00, 'a', 0x00, 't', 0x00, 'i', 0x00,\r
140         'o', 0x00, 'n', 0x00, ' ', 0x00, 'N', 0x00, 'a', 0x00, 'm', 0x00, 'e', 0x00\r
141 };\r
142 \r
143 const char pxInterfaceStringDescriptor[] = \r
144 {\r
145         30,\r
146         usbDESCRIPTOR_TYPE_STRING,\r
147 \r
148         'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, ' ', 0x00, 'N', 0x00,\r
149         'a', 0x00, 'm', 0x00, 'e', 0x00\r
150 };\r
151 \r
152 /* Device should properly be 0x134A:0x9001, using 0x05F9:0xFFFF for Linux testing */\r
153 const char pxDeviceDescriptor[] = \r
154 {\r
155         /* Device descriptor */\r
156         0x12,                                                           /* bLength                              */\r
157         0x01,                                                           /* bDescriptorType              */\r
158         0x10, 0x01,                                                     /* bcdUSBL                              */\r
159         0x02,                                                           /* bDeviceClass:                */\r
160         0x00,                                                           /* bDeviceSubclass:             */\r
161         0x00,                                                           /* bDeviceProtocol:             */\r
162         0x08,                                                           /* bMaxPacketSize0              */\r
163         0x03, 0xEB,                                                     /* idVendorL                    */\r
164         0x20, 0x09,                                                     /* idProductL                   */\r
165         0x10, 0x01,                                                     /* bcdDeviceL                   */\r
166         usbMANUFACTURER_STRING,                         /* iManufacturer                */\r
167         usbPRODUCT_STRING,                                      /* iProduct                             */\r
168         0x00,                                                           /* SerialNumber                 */\r
169         0x01                                                            /* bNumConfigs                  */\r
170 };\r
171 \r
172 const char pxConfigDescriptor[] = {\r
173 \r
174         /* Configuration 1 descriptor\r
175         Here we define two interfaces (0 and 1) and a total of 3 endpoints.\r
176         Interface 0 is a CDC Abstract Control Model interface with one interrupt-in endpoint.\r
177         Interface 1 is a CDC Data Interface class, with a bulk-in and bulk-out endpoint.\r
178         Endpoint 0 gets used as the CDC management element.\r
179         */\r
180         0x09,                           /* CbLength                                                             */\r
181         0x02,                           /* CbDescriptorType                                             */\r
182         0x43, 0x00,                     /* CwTotalLength 2 EP + Control         ?       */\r
183         0x02,                           /* CbNumInterfaces                                              */\r
184         0x01,                           /* CbConfigurationValue                                 */\r
185         usbCONFIGURATION_STRING,/* CiConfiguration                                      */\r
186         usbBUS_POWERED,         /* CbmAttributes Bus powered + Remote Wakeup*/\r
187         0x32,                           /* CMaxPower: 100mA                                             */\r
188 \r
189         /* Communication Class Interface Descriptor Requirement         */\r
190         0x09,                           /* bLength                                                              */\r
191         0x04,                           /* bDescriptorType                                              */\r
192         0x00,                           /* bInterfaceNumber                                             */\r
193         0x00,                           /* bAlternateSetting                                    */\r
194         0x01,                           /* bNumEndpoints                                                */\r
195         0x02,                           /* bInterfaceClass: Comm Interface Class */\r
196         0x02,                           /* bInterfaceSubclass: Abstract Control Model*/\r
197         0x00,                           /* bInterfaceProtocol                                   */\r
198         usbINTERFACE_STRING,/* iInterface                                                       */\r
199 \r
200         /* Header Functional Descriptor                                                         */\r
201         0x05,                           /* bLength                                                              */\r
202         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
203         0x00,                           /* bDescriptor subtype: Header Func Desc*/\r
204         0x10, 0x01,                     /* bcdCDC:1.1                                                   */\r
205 \r
206         /* ACM Functional Descriptor                                                            */\r
207         0x04,                           /* bFunctionLength                                              */\r
208         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
209         0x02,                           /* bDescriptor subtype: ACM Func Desc   */\r
210         0x00,                           /* bmCapabilities: We don't support squat*/\r
211 \r
212         /* Union Functional Descriptor                                                          */\r
213         0x05,                           /* bFunctionLength                                              */\r
214         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
215         0x06,                           /* bDescriptor subtype: Union Func Desc */\r
216         0x00,                           /* bMasterInterface: CDC Interface              */\r
217         0x01,                           /* bSlaveInterface0: Data Class Interface*/\r
218 \r
219         /* Call Management Functional Descriptor\r
220         0 in D1 and D0 indicates that device does not handle call management*/\r
221         0x05,                           /* bFunctionLength                                              */\r
222         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
223         0x01,                           /* bDescriptor subtype: Call Management Func*/\r
224         0x01,                           /* bmCapabilities: D1 + D0                              */\r
225         0x01,                           /* bDataInterface: Data Class Interface 1*/\r
226 \r
227         /* CDC Control - Endpoint 3 descriptor\r
228         This endpoint serves as a notification element.                         */\r
229 \r
230         0x07,                           /* bLength                                                              */\r
231         0x05,                           /* bDescriptorType                                              */\r
232         0x83,                           /* bEndpointAddress, Endpoint 03 - IN   */\r
233         0x03,                           /* bmAttributes   INT                                   */\r
234         0x08, 0x00,                     /* wMaxPacketSize: 8 bytes                              */\r
235         0xFF,                           /* bInterval                                                    */\r
236 \r
237         /* Data Class Interface Descriptor Requirement                          */\r
238         0x09,                           /* bLength                                                              */\r
239         0x04,                           /* bDescriptorType                                              */\r
240         0x01,                           /* bInterfaceNumber                                             */\r
241         0x00,                           /* bAlternateSetting                                    */\r
242         0x02,                           /* bNumEndPoints                                                */\r
243         0x0A,                           /* bInterfaceClass                                              */\r
244         0x00,                           /* bInterfaceSubclass                                   */\r
245         0x00,                           /* bInterfaceProtocol                                   */\r
246         0x00,                           /* iInterface                                                   */\r
247 \r
248         /* CDC Data - Endpoint 1 descriptor */\r
249         0x07,                           /* bLenght                                                              */\r
250         0x05,                           /* bDescriptorType                                              */\r
251         0x01,                           /* bEndPointAddress, Endpoint 01 - OUT  */\r
252         0x02,                           /* bmAttributes BULK                                    */\r
253         64,                                     /* wMaxPacketSize                                               */\r
254         0x00,\r
255         0x00,                           /* bInterval                                                    */\r
256 \r
257         /* CDC Data - Endpoint 2 descriptor */\r
258         0x07,                           /* bLength                                                              */\r
259         0x05,                           /* bDescriptorType                                              */\r
260         0x82,                           /* bEndPointAddress, Endpoint 02 - IN   */\r
261         0x02,                           /* bmAttributes BULK                                    */\r
262         64,                                     /* wMaxPacketSize                                               */\r
263         0x00,\r
264         0x00                            /* bInterval                                                    */\r
265 };\r
266 \r