]> begriffs open source - freertos/blob - Demo/lwIP_Demo_Rowley_ARM7/USB/descriptors.h
Changes between V4.5.0 and V4.6.0 released October 28 2007
[freertos] / Demo / lwIP_Demo_Rowley_ARM7 / USB / descriptors.h
1 /*\r
2         FreeRTOS.org V4.6.0 - Copyright (C) 2003-2007 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         See http://www.FreeRTOS.org for documentation, latest information, license\r
28         and contact details.  Please ensure to read the configuration and relevant\r
29         port sections of the online documentation.\r
30 \r
31         Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along\r
32         with commercial development and support options.\r
33         ***************************************************************************\r
34 */\r
35 \r
36 /*\r
37         - DESCRIPTOR DEFINITIONS -\r
38 */\r
39 \r
40 /* String descriptors used during the enumeration process.\r
41 These take the form:\r
42 \r
43 {\r
44         Length of descriptor,\r
45         Descriptor type,\r
46         Data\r
47 }\r
48 */\r
49 \r
50 const portCHAR pxLanguageStringDescriptor[] =\r
51 {\r
52         4,\r
53         usbDESCRIPTOR_TYPE_STRING,\r
54         0x09, 0x04\r
55 };\r
56 \r
57 const portCHAR pxManufacturerStringDescriptor[] = \r
58 {\r
59         18,\r
60         usbDESCRIPTOR_TYPE_STRING,\r
61 \r
62         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00\r
63 };\r
64 \r
65 const portCHAR pxProductStringDescriptor[] = \r
66 {\r
67         36,\r
68         usbDESCRIPTOR_TYPE_STRING,\r
69 \r
70         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00, ' ', 0x00, 'C', 0x00, 'D', 0x00,\r
71         'C', 0x00, ' ', 0x00, 'D', 0x00, 'E', 0x00, 'M', 0x00, 'O', 0x00\r
72 };\r
73 \r
74 const portCHAR pxConfigurationStringDescriptor[] = \r
75 {\r
76         38,\r
77         usbDESCRIPTOR_TYPE_STRING,\r
78 \r
79         'C', 0x00, 'o', 0x00, 'n', 0x00, 'f', 0x00, 'i', 0x00, 'g', 0x00, 'u', 0x00, 'r', 0x00, 'a', 0x00, 't', 0x00, 'i', 0x00,\r
80         'o', 0x00, 'n', 0x00, ' ', 0x00, 'N', 0x00, 'a', 0x00, 'm', 0x00, 'e', 0x00\r
81 };\r
82 \r
83 const portCHAR pxInterfaceStringDescriptor[] = \r
84 {\r
85         30,\r
86         usbDESCRIPTOR_TYPE_STRING,\r
87 \r
88         'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, ' ', 0x00, 'N', 0x00,\r
89         'a', 0x00, 'm', 0x00, 'e', 0x00\r
90 };\r
91 \r
92 /* Device should properly be 0x134A:0x9001, using 0x05F9:0xFFFF for Linux testing */\r
93 const char pxDeviceDescriptor[] = \r
94 {\r
95         /* Device descriptor */\r
96         0x12,                                                           /* bLength                              */\r
97         0x01,                                                           /* bDescriptorType              */\r
98         0x10, 0x01,                                                     /* bcdUSBL                              */\r
99         0x02,                                                           /* bDeviceClass:                */\r
100         0x00,                                                           /* bDeviceSubclass:             */\r
101         0x00,                                                           /* bDeviceProtocol:             */\r
102         0x08,                                                           /* bMaxPacketSize0              */\r
103         0x03, 0xEB,                                                     /* idVendorL                    */\r
104         0x20, 0x09,                                                     /* idProductL                   */\r
105         0x10, 0x01,                                                     /* bcdDeviceL                   */\r
106         usbMANUFACTURER_STRING,                         /* iManufacturer                */\r
107         usbPRODUCT_STRING,                                      /* iProduct                             */\r
108         0x00,                                                           /* SerialNumber                 */\r
109         0x01                                                            /* bNumConfigs                  */\r
110 };\r
111 \r
112 const char pxConfigDescriptor[] = {\r
113 \r
114         /* Configuration 1 descriptor\r
115         Here we define two interfaces (0 and 1) and a total of 3 endpoints.\r
116         Interface 0 is a CDC Abstract Control Model interface with one interrupt-in endpoint.\r
117         Interface 1 is a CDC Data Interface class, with a bulk-in and bulk-out endpoint.\r
118         Endpoint 0 gets used as the CDC management element.\r
119         */\r
120         0x09,                           /* CbLength                                                             */\r
121         0x02,                           /* CbDescriptorType                                             */\r
122         0x43, 0x00,                     /* CwTotalLength 2 EP + Control         ?       */\r
123         0x02,                           /* CbNumInterfaces                                              */\r
124         0x01,                           /* CbConfigurationValue                                 */\r
125         usbCONFIGURATION_STRING,/* CiConfiguration                                      */\r
126         usbBUS_POWERED,         /* CbmAttributes Bus powered + Remote Wakeup*/\r
127         0x32,                           /* CMaxPower: 100mA                                             */\r
128 \r
129         /* Communication Class Interface Descriptor Requirement         */\r
130         0x09,                           /* bLength                                                              */\r
131         0x04,                           /* bDescriptorType                                              */\r
132         0x00,                           /* bInterfaceNumber                                             */\r
133         0x00,                           /* bAlternateSetting                                    */\r
134         0x01,                           /* bNumEndpoints                                                */\r
135         0x02,                           /* bInterfaceClass: Comm Interface Class */\r
136         0x02,                           /* bInterfaceSubclass: Abstract Control Model*/\r
137         0x00,                           /* bInterfaceProtocol                                   */\r
138         usbINTERFACE_STRING,/* iInterface                                                       */\r
139 \r
140         /* Header Functional Descriptor                                                         */\r
141         0x05,                           /* bLength                                                              */\r
142         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
143         0x00,                           /* bDescriptor subtype: Header Func Desc*/\r
144         0x10, 0x01,                     /* bcdCDC:1.1                                                   */\r
145 \r
146         /* ACM Functional Descriptor                                                            */\r
147         0x04,                           /* bFunctionLength                                              */\r
148         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
149         0x02,                           /* bDescriptor subtype: ACM Func Desc   */\r
150         0x00,                           /* bmCapabilities: We don't support squat*/\r
151 \r
152         /* Union Functional Descriptor                                                          */\r
153         0x05,                           /* bFunctionLength                                              */\r
154         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
155         0x06,                           /* bDescriptor subtype: Union Func Desc */\r
156         0x00,                           /* bMasterInterface: CDC Interface              */\r
157         0x01,                           /* bSlaveInterface0: Data Class Interface*/\r
158 \r
159         /* Call Management Functional Descriptor\r
160         0 in D1 and D0 indicates that device does not handle call management*/\r
161         0x05,                           /* bFunctionLength                                              */\r
162         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
163         0x01,                           /* bDescriptor subtype: Call Management Func*/\r
164         0x00,                           /* bmCapabilities: D1 + D0                              */\r
165         0x01,                           /* bDataInterface: Data Class Interface 1*/\r
166 \r
167         /* CDC Control - Endpoint 3 descriptor\r
168         This endpoint serves as a notification element.                         */\r
169 \r
170         0x07,                           /* bLength                                                              */\r
171         0x05,                           /* bDescriptorType                                              */\r
172         0x83,                           /* bEndpointAddress, Endpoint 03 - IN   */\r
173         0x03,                           /* bmAttributes   INT                                   */\r
174         0x08, 0x00,                     /* wMaxPacketSize: 8 bytes                              */\r
175         0xFF,                           /* bInterval                                                    */\r
176 \r
177         /* Data Class Interface Descriptor Requirement                          */\r
178         0x09,                           /* bLength                                                              */\r
179         0x04,                           /* bDescriptorType                                              */\r
180         0x01,                           /* bInterfaceNumber                                             */\r
181         0x00,                           /* bAlternateSetting                                    */\r
182         0x02,                           /* bNumEndPoints                                                */\r
183         0x0A,                           /* bInterfaceClass                                              */\r
184         0x00,                           /* bInterfaceSubclass                                   */\r
185         0x00,                           /* bInterfaceProtocol                                   */\r
186         0x00,                           /* iInterface                                                   */\r
187 \r
188         /* CDC Data - Endpoint 1 descriptor */\r
189         0x07,                           /* bLenght                                                              */\r
190         0x05,                           /* bDescriptorType                                              */\r
191         0x01,                           /* bEndPointAddress, Endpoint 01 - OUT  */\r
192         0x02,                           /* bmAttributes BULK                                    */\r
193         64,                                     /* wMaxPacketSize                                               */\r
194         0x00,\r
195         0x00,                           /* bInterval                                                    */\r
196 \r
197         /* CDC Data - Endpoint 2 descriptor */\r
198         0x07,                           /* bLength                                                              */\r
199         0x05,                           /* bDescriptorType                                              */\r
200         0x82,                           /* bEndPointAddress, Endpoint 02 - IN   */\r
201         0x02,                           /* bmAttributes BULK                                    */\r
202         64,                                     /* wMaxPacketSize                                               */\r
203         0x00,\r
204         0x00                            /* bInterval                                                    */\r
205 };\r
206 \r