]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/USB/descriptors.h
Update to MIT licensed FreeRTOS V10.0.0 - see https://www.freertos.org/History.txt
[freertos] / FreeRTOS / Demo / lwIP_Demo_Rowley_ARM7 / USB / descriptors.h
1 /*\r
2  * FreeRTOS Kernel V10.0.0\r
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
6  * this software and associated documentation files (the "Software"), to deal in\r
7  * the Software without restriction, including without limitation the rights to\r
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
9  * the Software, and to permit persons to whom the Software is furnished to do so,\r
10  * subject to the following conditions:\r
11  *\r
12  * The above copyright notice and this permission notice shall be included in all\r
13  * copies or substantial portions of the Software. If you wish to use our Amazon\r
14  * FreeRTOS name, please do so in a fair use way that does not cause confusion.\r
15  *\r
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
22  *\r
23  * http://www.FreeRTOS.org\r
24  * http://aws.amazon.com/freertos\r
25  *\r
26  * 1 tab == 4 spaces!\r
27  */\r
28 \r
29 /*\r
30         - DESCRIPTOR DEFINITIONS -\r
31 */\r
32 \r
33 /* String descriptors used during the enumeration process.\r
34 These take the form:\r
35 \r
36 {\r
37         Length of descriptor,\r
38         Descriptor type,\r
39         Data\r
40 }\r
41 */\r
42 \r
43 const char pxLanguageStringDescriptor[] =\r
44 {\r
45         4,\r
46         usbDESCRIPTOR_TYPE_STRING,\r
47         0x09, 0x04\r
48 };\r
49 \r
50 const char pxManufacturerStringDescriptor[] = \r
51 {\r
52         18,\r
53         usbDESCRIPTOR_TYPE_STRING,\r
54 \r
55         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00\r
56 };\r
57 \r
58 const char pxProductStringDescriptor[] = \r
59 {\r
60         36,\r
61         usbDESCRIPTOR_TYPE_STRING,\r
62 \r
63         'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00, ' ', 0x00, 'C', 0x00, 'D', 0x00,\r
64         'C', 0x00, ' ', 0x00, 'D', 0x00, 'E', 0x00, 'M', 0x00, 'O', 0x00\r
65 };\r
66 \r
67 const char pxConfigurationStringDescriptor[] = \r
68 {\r
69         38,\r
70         usbDESCRIPTOR_TYPE_STRING,\r
71 \r
72         'C', 0x00, 'o', 0x00, 'n', 0x00, 'f', 0x00, 'i', 0x00, 'g', 0x00, 'u', 0x00, 'r', 0x00, 'a', 0x00, 't', 0x00, 'i', 0x00,\r
73         'o', 0x00, 'n', 0x00, ' ', 0x00, 'N', 0x00, 'a', 0x00, 'm', 0x00, 'e', 0x00\r
74 };\r
75 \r
76 const char pxInterfaceStringDescriptor[] = \r
77 {\r
78         30,\r
79         usbDESCRIPTOR_TYPE_STRING,\r
80 \r
81         'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, ' ', 0x00, 'N', 0x00,\r
82         'a', 0x00, 'm', 0x00, 'e', 0x00\r
83 };\r
84 \r
85 /* Device should properly be 0x134A:0x9001, using 0x05F9:0xFFFF for Linux testing */\r
86 const char pxDeviceDescriptor[] = \r
87 {\r
88         /* Device descriptor */\r
89         0x12,                                                           /* bLength                              */\r
90         0x01,                                                           /* bDescriptorType              */\r
91         0x10, 0x01,                                                     /* bcdUSBL                              */\r
92         0x02,                                                           /* bDeviceClass:                */\r
93         0x00,                                                           /* bDeviceSubclass:             */\r
94         0x00,                                                           /* bDeviceProtocol:             */\r
95         0x08,                                                           /* bMaxPacketSize0              */\r
96         0x03, 0xEB,                                                     /* idVendorL                    */\r
97         0x20, 0x09,                                                     /* idProductL                   */\r
98         0x10, 0x01,                                                     /* bcdDeviceL                   */\r
99         usbMANUFACTURER_STRING,                         /* iManufacturer                */\r
100         usbPRODUCT_STRING,                                      /* iProduct                             */\r
101         0x00,                                                           /* SerialNumber                 */\r
102         0x01                                                            /* bNumConfigs                  */\r
103 };\r
104 \r
105 const char pxConfigDescriptor[] = {\r
106 \r
107         /* Configuration 1 descriptor\r
108         Here we define two interfaces (0 and 1) and a total of 3 endpoints.\r
109         Interface 0 is a CDC Abstract Control Model interface with one interrupt-in endpoint.\r
110         Interface 1 is a CDC Data Interface class, with a bulk-in and bulk-out endpoint.\r
111         Endpoint 0 gets used as the CDC management element.\r
112         */\r
113         0x09,                           /* CbLength                                                             */\r
114         0x02,                           /* CbDescriptorType                                             */\r
115         0x43, 0x00,                     /* CwTotalLength 2 EP + Control         ?       */\r
116         0x02,                           /* CbNumInterfaces                                              */\r
117         0x01,                           /* CbConfigurationValue                                 */\r
118         usbCONFIGURATION_STRING,/* CiConfiguration                                      */\r
119         usbBUS_POWERED,         /* CbmAttributes Bus powered + Remote Wakeup*/\r
120         0x32,                           /* CMaxPower: 100mA                                             */\r
121 \r
122         /* Communication Class Interface Descriptor Requirement         */\r
123         0x09,                           /* bLength                                                              */\r
124         0x04,                           /* bDescriptorType                                              */\r
125         0x00,                           /* bInterfaceNumber                                             */\r
126         0x00,                           /* bAlternateSetting                                    */\r
127         0x01,                           /* bNumEndpoints                                                */\r
128         0x02,                           /* bInterfaceClass: Comm Interface Class */\r
129         0x02,                           /* bInterfaceSubclass: Abstract Control Model*/\r
130         0x00,                           /* bInterfaceProtocol                                   */\r
131         usbINTERFACE_STRING,/* iInterface                                                       */\r
132 \r
133         /* Header Functional Descriptor                                                         */\r
134         0x05,                           /* bLength                                                              */\r
135         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
136         0x00,                           /* bDescriptor subtype: Header Func Desc*/\r
137         0x10, 0x01,                     /* bcdCDC:1.1                                                   */\r
138 \r
139         /* ACM Functional Descriptor                                                            */\r
140         0x04,                           /* bFunctionLength                                              */\r
141         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
142         0x02,                           /* bDescriptor subtype: ACM Func Desc   */\r
143         0x00,                           /* bmCapabilities: We don't support squat*/\r
144 \r
145         /* Union Functional Descriptor                                                          */\r
146         0x05,                           /* bFunctionLength                                              */\r
147         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
148         0x06,                           /* bDescriptor subtype: Union Func Desc */\r
149         0x00,                           /* bMasterInterface: CDC Interface              */\r
150         0x01,                           /* bSlaveInterface0: Data Class Interface*/\r
151 \r
152         /* Call Management Functional Descriptor\r
153         0 in D1 and D0 indicates that device does not handle call management*/\r
154         0x05,                           /* bFunctionLength                                              */\r
155         0x24,                           /* bDescriptor type: CS_INTERFACE               */\r
156         0x01,                           /* bDescriptor subtype: Call Management Func*/\r
157         0x01,                           /* bmCapabilities: D1 + D0                              */\r
158         0x01,                           /* bDataInterface: Data Class Interface 1*/\r
159 \r
160         /* CDC Control - Endpoint 3 descriptor\r
161         This endpoint serves as a notification element.                         */\r
162 \r
163         0x07,                           /* bLength                                                              */\r
164         0x05,                           /* bDescriptorType                                              */\r
165         0x83,                           /* bEndpointAddress, Endpoint 03 - IN   */\r
166         0x03,                           /* bmAttributes   INT                                   */\r
167         0x08, 0x00,                     /* wMaxPacketSize: 8 bytes                              */\r
168         0xFF,                           /* bInterval                                                    */\r
169 \r
170         /* Data Class Interface Descriptor Requirement                          */\r
171         0x09,                           /* bLength                                                              */\r
172         0x04,                           /* bDescriptorType                                              */\r
173         0x01,                           /* bInterfaceNumber                                             */\r
174         0x00,                           /* bAlternateSetting                                    */\r
175         0x02,                           /* bNumEndPoints                                                */\r
176         0x0A,                           /* bInterfaceClass                                              */\r
177         0x00,                           /* bInterfaceSubclass                                   */\r
178         0x00,                           /* bInterfaceProtocol                                   */\r
179         0x00,                           /* iInterface                                                   */\r
180 \r
181         /* CDC Data - Endpoint 1 descriptor */\r
182         0x07,                           /* bLenght                                                              */\r
183         0x05,                           /* bDescriptorType                                              */\r
184         0x01,                           /* bEndPointAddress, Endpoint 01 - OUT  */\r
185         0x02,                           /* bmAttributes BULK                                    */\r
186         64,                                     /* wMaxPacketSize                                               */\r
187         0x00,\r
188         0x00,                           /* bInterval                                                    */\r
189 \r
190         /* CDC Data - Endpoint 2 descriptor */\r
191         0x07,                           /* bLength                                                              */\r
192         0x05,                           /* bDescriptorType                                              */\r
193         0x82,                           /* bEndPointAddress, Endpoint 02 - IN   */\r
194         0x02,                           /* bmAttributes BULK                                    */\r
195         64,                                     /* wMaxPacketSize                                               */\r
196         0x00,\r
197         0x00                            /* bInterval                                                    */\r
198 };\r
199 \r