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