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