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