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