2 FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
\r
4 ***************************************************************************
\r
8 * + New to FreeRTOS, *
\r
9 * + Wanting to learn FreeRTOS or multitasking in general quickly *
\r
10 * + Looking for basic training, *
\r
11 * + Wanting to improve your FreeRTOS skills and productivity *
\r
13 * then take a look at the FreeRTOS books - available as PDF or paperback *
\r
15 * "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
\r
16 * http://www.FreeRTOS.org/Documentation *
\r
18 * A pdf reference manual is also available. Both are usually delivered *
\r
19 * to your inbox within 20 minutes to two hours when purchased between 8am *
\r
20 * and 8pm GMT (although please allow up to 24 hours in case of *
\r
21 * exceptional circumstances). Thank you for your support! *
\r
23 ***************************************************************************
\r
25 This file is part of the FreeRTOS distribution.
\r
27 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
28 the terms of the GNU General Public License (version 2) as published by the
\r
29 Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
\r
30 ***NOTE*** The exception to the GPL is included to allow you to distribute
\r
31 a combined work that includes FreeRTOS without being obliged to provide the
\r
32 source code for proprietary components outside of the FreeRTOS kernel.
\r
33 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
\r
34 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
35 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
\r
36 more details. You should have received a copy of the GNU General Public
\r
37 License and the FreeRTOS license exception along with FreeRTOS; if not it
\r
38 can be viewed here: http://www.freertos.org/a00114.html and also obtained
\r
39 by writing to Richard Barry, contact details for whom are available on the
\r
44 http://www.FreeRTOS.org - Documentation, latest information, license and
\r
47 http://www.SafeRTOS.com - A version that is certified for use in safety
\r
50 http://www.OpenRTOS.com - Commercial support, development, porting,
\r
51 licensing and training services.
\r
55 - DESCRIPTOR DEFINITIONS -
\r
58 /* String descriptors used during the enumeration process.
\r
59 These take the form:
\r
62 Length of descriptor,
\r
68 const char pxLanguageStringDescriptor[] =
\r
71 usbDESCRIPTOR_TYPE_STRING,
\r
75 const char pxManufacturerStringDescriptor[] =
\r
78 usbDESCRIPTOR_TYPE_STRING,
\r
80 'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00
\r
83 const char pxProductStringDescriptor[] =
\r
86 usbDESCRIPTOR_TYPE_STRING,
\r
88 'F', 0x00, 'r', 0x00, 'e', 0x00, 'e', 0x00, 'R', 0x00, 'T', 0x00, 'O', 0x00, 'S', 0x00, ' ', 0x00, 'C', 0x00, 'D', 0x00,
\r
89 'C', 0x00, ' ', 0x00, 'D', 0x00, 'E', 0x00, 'M', 0x00, 'O', 0x00
\r
92 const char pxConfigurationStringDescriptor[] =
\r
95 usbDESCRIPTOR_TYPE_STRING,
\r
97 'C', 0x00, 'o', 0x00, 'n', 0x00, 'f', 0x00, 'i', 0x00, 'g', 0x00, 'u', 0x00, 'r', 0x00, 'a', 0x00, 't', 0x00, 'i', 0x00,
\r
98 'o', 0x00, 'n', 0x00, ' ', 0x00, 'N', 0x00, 'a', 0x00, 'm', 0x00, 'e', 0x00
\r
101 const char pxInterfaceStringDescriptor[] =
\r
104 usbDESCRIPTOR_TYPE_STRING,
\r
106 'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, ' ', 0x00, 'N', 0x00,
\r
107 'a', 0x00, 'm', 0x00, 'e', 0x00
\r
110 /* Device should properly be 0x134A:0x9001, using 0x05F9:0xFFFF for Linux testing */
\r
111 const char pxDeviceDescriptor[] =
\r
113 /* Device descriptor */
\r
114 0x12, /* bLength */
\r
115 0x01, /* bDescriptorType */
\r
116 0x10, 0x01, /* bcdUSBL */
\r
117 0x02, /* bDeviceClass: */
\r
118 0x00, /* bDeviceSubclass: */
\r
119 0x00, /* bDeviceProtocol: */
\r
120 0x08, /* bMaxPacketSize0 */
\r
121 0x03, 0xEB, /* idVendorL */
\r
122 0x20, 0x09, /* idProductL */
\r
123 0x10, 0x01, /* bcdDeviceL */
\r
124 usbMANUFACTURER_STRING, /* iManufacturer */
\r
125 usbPRODUCT_STRING, /* iProduct */
\r
126 0x00, /* SerialNumber */
\r
127 0x01 /* bNumConfigs */
\r
130 const char pxConfigDescriptor[] = {
\r
132 /* Configuration 1 descriptor
\r
133 Here we define two interfaces (0 and 1) and a total of 3 endpoints.
\r
134 Interface 0 is a CDC Abstract Control Model interface with one interrupt-in endpoint.
\r
135 Interface 1 is a CDC Data Interface class, with a bulk-in and bulk-out endpoint.
\r
136 Endpoint 0 gets used as the CDC management element.
\r
138 0x09, /* CbLength */
\r
139 0x02, /* CbDescriptorType */
\r
140 0x43, 0x00, /* CwTotalLength 2 EP + Control ? */
\r
141 0x02, /* CbNumInterfaces */
\r
142 0x01, /* CbConfigurationValue */
\r
143 usbCONFIGURATION_STRING,/* CiConfiguration */
\r
144 usbBUS_POWERED, /* CbmAttributes Bus powered + Remote Wakeup*/
\r
145 0x32, /* CMaxPower: 100mA */
\r
147 /* Communication Class Interface Descriptor Requirement */
\r
148 0x09, /* bLength */
\r
149 0x04, /* bDescriptorType */
\r
150 0x00, /* bInterfaceNumber */
\r
151 0x00, /* bAlternateSetting */
\r
152 0x01, /* bNumEndpoints */
\r
153 0x02, /* bInterfaceClass: Comm Interface Class */
\r
154 0x02, /* bInterfaceSubclass: Abstract Control Model*/
\r
155 0x00, /* bInterfaceProtocol */
\r
156 usbINTERFACE_STRING,/* iInterface */
\r
158 /* Header Functional Descriptor */
\r
159 0x05, /* bLength */
\r
160 0x24, /* bDescriptor type: CS_INTERFACE */
\r
161 0x00, /* bDescriptor subtype: Header Func Desc*/
\r
162 0x10, 0x01, /* bcdCDC:1.1 */
\r
164 /* ACM Functional Descriptor */
\r
165 0x04, /* bFunctionLength */
\r
166 0x24, /* bDescriptor type: CS_INTERFACE */
\r
167 0x02, /* bDescriptor subtype: ACM Func Desc */
\r
168 0x00, /* bmCapabilities: We don't support squat*/
\r
170 /* Union Functional Descriptor */
\r
171 0x05, /* bFunctionLength */
\r
172 0x24, /* bDescriptor type: CS_INTERFACE */
\r
173 0x06, /* bDescriptor subtype: Union Func Desc */
\r
174 0x00, /* bMasterInterface: CDC Interface */
\r
175 0x01, /* bSlaveInterface0: Data Class Interface*/
\r
177 /* Call Management Functional Descriptor
\r
178 0 in D1 and D0 indicates that device does not handle call management*/
\r
179 0x05, /* bFunctionLength */
\r
180 0x24, /* bDescriptor type: CS_INTERFACE */
\r
181 0x01, /* bDescriptor subtype: Call Management Func*/
\r
182 0x01, /* bmCapabilities: D1 + D0 */
\r
183 0x01, /* bDataInterface: Data Class Interface 1*/
\r
185 /* CDC Control - Endpoint 3 descriptor
\r
186 This endpoint serves as a notification element. */
\r
188 0x07, /* bLength */
\r
189 0x05, /* bDescriptorType */
\r
190 0x83, /* bEndpointAddress, Endpoint 03 - IN */
\r
191 0x03, /* bmAttributes INT */
\r
192 0x08, 0x00, /* wMaxPacketSize: 8 bytes */
\r
193 0xFF, /* bInterval */
\r
195 /* Data Class Interface Descriptor Requirement */
\r
196 0x09, /* bLength */
\r
197 0x04, /* bDescriptorType */
\r
198 0x01, /* bInterfaceNumber */
\r
199 0x00, /* bAlternateSetting */
\r
200 0x02, /* bNumEndPoints */
\r
201 0x0A, /* bInterfaceClass */
\r
202 0x00, /* bInterfaceSubclass */
\r
203 0x00, /* bInterfaceProtocol */
\r
204 0x00, /* iInterface */
\r
206 /* CDC Data - Endpoint 1 descriptor */
\r
207 0x07, /* bLenght */
\r
208 0x05, /* bDescriptorType */
\r
209 0x01, /* bEndPointAddress, Endpoint 01 - OUT */
\r
210 0x02, /* bmAttributes BULK */
\r
211 64, /* wMaxPacketSize */
\r
213 0x00, /* bInterval */
\r
215 /* CDC Data - Endpoint 2 descriptor */
\r
216 0x07, /* bLength */
\r
217 0x05, /* bDescriptorType */
\r
218 0x82, /* bEndPointAddress, Endpoint 02 - IN */
\r
219 0x02, /* bmAttributes BULK */
\r
220 64, /* wMaxPacketSize */
\r
222 0x00 /* bInterval */
\r