2 * FreeRTOS Kernel V10.1.1
3 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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:
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
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.
22 * http://www.FreeRTOS.org
23 * http://aws.amazon.com/freertos
29 - DESCRIPTOR DEFINITIONS -
32 /* String descriptors used during the enumeration process.
42 const char pxLanguageStringDescriptor[] =
45 usbDESCRIPTOR_TYPE_STRING,
49 const char pxManufacturerStringDescriptor[] =
52 usbDESCRIPTOR_TYPE_STRING,
54 'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00
57 const char pxProductStringDescriptor[] =
60 usbDESCRIPTOR_TYPE_STRING,
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
66 const char pxConfigurationStringDescriptor[] =
69 usbDESCRIPTOR_TYPE_STRING,
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
75 const char pxInterfaceStringDescriptor[] =
78 usbDESCRIPTOR_TYPE_STRING,
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
84 /* Device should properly be 0x134A:0x9001, using 0x05F9:0xFFFF for Linux testing */
85 const char pxDeviceDescriptor[] =
87 /* Device descriptor */
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 */
104 const char pxConfigDescriptor[] = {
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.
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 */
121 /* Communication Class Interface Descriptor Requirement */
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 */
132 /* Header Functional Descriptor */
134 0x24, /* bDescriptor type: CS_INTERFACE */
135 0x00, /* bDescriptor subtype: Header Func Desc*/
136 0x10, 0x01, /* bcdCDC:1.1 */
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*/
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*/
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*/
159 /* CDC Control - Endpoint 3 descriptor
160 This endpoint serves as a notification element. */
163 0x05, /* bDescriptorType */
164 0x83, /* bEndpointAddress, Endpoint 03 - IN */
165 0x03, /* bmAttributes INT */
166 0x08, 0x00, /* wMaxPacketSize: 8 bytes */
167 0xFF, /* bInterval */
169 /* Data Class Interface Descriptor Requirement */
171 0x04, /* bDescriptorType */
172 0x01, /* bInterfaceNumber */
173 0x00, /* bAlternateSetting */
174 0x02, /* bNumEndPoints */
175 0x0A, /* bInterfaceClass */
176 0x00, /* bInterfaceSubclass */
177 0x00, /* bInterfaceProtocol */
178 0x00, /* iInterface */
180 /* CDC Data - Endpoint 1 descriptor */
182 0x05, /* bDescriptorType */
183 0x01, /* bEndPointAddress, Endpoint 01 - OUT */
184 0x02, /* bmAttributes BULK */
185 64, /* wMaxPacketSize */
187 0x00, /* bInterval */
189 /* CDC Data - Endpoint 2 descriptor */
191 0x05, /* bDescriptorType */
192 0x82, /* bEndPointAddress, Endpoint 02 - IN */
193 0x02, /* bmAttributes BULK */
194 64, /* wMaxPacketSize */