1 |
633c646a
|
henryk
|
/*
|
2 |
|
|
FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 Richard Barry.
|
3 |
|
|
|
4 |
|
|
This file is part of the FreeRTOS.org distribution.
|
5 |
|
|
|
6 |
|
|
FreeRTOS.org is free software; you can redistribute it and/or modify
|
7 |
|
|
it under the terms of the GNU General Public License as published by
|
8 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
9 |
|
|
(at your option) any later version.
|
10 |
|
|
|
11 |
|
|
FreeRTOS.org is distributed in the hope that it will be useful,
|
12 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
|
|
GNU General Public License for more details.
|
15 |
|
|
|
16 |
|
|
You should have received a copy of the GNU General Public License
|
17 |
|
|
along with FreeRTOS.org; if not, write to the Free Software
|
18 |
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19 |
|
|
|
20 |
|
|
A special exception to the GPL can be applied should you wish to distribute
|
21 |
|
|
a combined work that includes FreeRTOS.org, without being obliged to provide
|
22 |
|
|
the source code for any proprietary components. See the licensing section
|
23 |
|
|
of http://www.FreeRTOS.org for full details of how and when the exception
|
24 |
|
|
can be applied.
|
25 |
|
|
|
26 |
|
|
***************************************************************************
|
27 |
|
|
See http://www.FreeRTOS.org for documentation, latest information, license
|
28 |
|
|
and contact details. Please ensure to read the configuration and relevant
|
29 |
|
|
port sections of the online documentation.
|
30 |
|
|
|
31 |
|
|
Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
|
32 |
|
|
with commercial development and support options.
|
33 |
|
|
***************************************************************************
|
34 |
|
|
*/
|
35 |
|
|
|
36 |
|
|
/*
|
37 |
|
|
- DESCRIPTOR DEFINITIONS -
|
38 |
|
|
*/
|
39 |
|
|
|
40 |
|
|
/* String descriptors used during the enumeration process.
|
41 |
|
|
These take the form:
|
42 |
|
|
|
43 |
|
|
{
|
44 |
|
|
Length of descriptor,
|
45 |
|
|
Descriptor type,
|
46 |
|
|
Data
|
47 |
|
|
}
|
48 |
|
|
*/
|
49 |
|
|
|
50 |
|
|
const portCHAR pxLanguageStringDescriptor[] = {
|
51 |
|
|
4,
|
52 |
|
|
usbDESCRIPTOR_TYPE_STRING,
|
53 |
|
|
0x09, 0x04
|
54 |
|
|
};
|
55 |
|
|
|
56 |
|
|
const portCHAR pxManufacturerStringDescriptor[] = {
|
57 |
|
|
28,
|
58 |
|
|
usbDESCRIPTOR_TYPE_STRING,
|
59 |
|
|
|
60 |
|
|
'b', 0x00, 'i', 0x00, 't', 0x00, 'm', 0x00,
|
61 |
|
|
'a', 0x00, 'n', 0x00, 'u', 0x00, 'f', 0x00,
|
62 |
|
|
'a', 0x00, 'k', 0x00, 't', 0x00, 'u', 0x00,
|
63 |
|
|
'r', 0x00
|
64 |
|
|
};
|
65 |
|
|
|
66 |
|
|
const portCHAR pxProductStringDescriptor[] = {
|
67 |
7911988d
|
henryk
|
46,
|
68 |
633c646a
|
henryk
|
usbDESCRIPTOR_TYPE_STRING,
|
69 |
|
|
|
70 |
|
|
'O', 0x00, 'p', 0x00, 'e', 0x00, 'n', 0x00,
|
71 |
7911988d
|
henryk
|
'P', 0x00, 'I', 0x00, 'C', 0x00, 'C', 0x00,
|
72 |
|
|
' ', 0x00, 'R', 0x00, 'F', 0x00, 'I', 0x00,
|
73 |
|
|
'D', 0x00, '-', 0x00, 'E', 0x00, 'm', 0x00,
|
74 |
|
|
'u', 0x00, 'l', 0x00, 'a', 0x00, 't', 0x00,
|
75 |
|
|
'o', 0x00, 'r', 0x00
|
76 |
633c646a
|
henryk
|
};
|
77 |
|
|
|
78 |
|
|
/* Device should properly be 0x134A:0x9001, using 0x05F9:0xFFFF for Linux testing */
|
79 |
|
|
const char pxDeviceDescriptor[] = {
|
80 |
|
|
/* Device descriptor */
|
81 |
|
|
0x12, /* bLength */
|
82 |
|
|
0x01, /* bDescriptorType */
|
83 |
|
|
0x10, 0x01, /* bcdUSBL */
|
84 |
|
|
0x02, /* bDeviceClass: */
|
85 |
|
|
0x00, /* bDeviceSubclass: */
|
86 |
|
|
0x00, /* bDeviceProtocol: */
|
87 |
|
|
0x08, /* bMaxPacketSize0 */
|
88 |
|
|
0xC0, 0x16, /* idVendorL */
|
89 |
|
|
0xAC, 0x08, /* idProductL */
|
90 |
|
|
0x10, 0x01, /* bcdDeviceL */
|
91 |
|
|
usbMANUFACTURER_STRING, /* iManufacturer */
|
92 |
|
|
usbPRODUCT_STRING, /* iProduct */
|
93 |
|
|
0x00, /* SerialNumber */
|
94 |
|
|
0x01 /* bNumConfigs */
|
95 |
|
|
};
|
96 |
|
|
|
97 |
|
|
const char pxConfigDescriptor[] = {
|
98 |
|
|
|
99 |
|
|
/* Configuration 1 descriptor
|
100 |
|
|
Here we define two interfaces (0 and 1) and a total of 3 endpoints.
|
101 |
|
|
Interface 0 is a CDC Abstract Control Model interface with one interrupt-in endpoint.
|
102 |
|
|
Interface 1 is a CDC Data Interface class, with a bulk-in and bulk-out endpoint.
|
103 |
|
|
Endpoint 0 gets used as the CDC management element.
|
104 |
|
|
*/
|
105 |
|
|
0x09, /* CbLength */
|
106 |
|
|
0x02, /* CbDescriptorType */
|
107 |
|
|
0x43, 0x00, /* CwTotalLength 2 EP + Control ? */
|
108 |
|
|
0x02, /* CbNumInterfaces */
|
109 |
|
|
0x01, /* CbConfigurationValue */
|
110 |
|
|
0x00, /* CiConfiguration */
|
111 |
|
|
usbBUS_POWERED, /* CbmAttributes Bus powered + Remote Wakeup */
|
112 |
|
|
0x32, /* CMaxPower: 100mA */
|
113 |
|
|
|
114 |
|
|
/* Communication Class Interface Descriptor Requirement */
|
115 |
|
|
0x09, /* bLength */
|
116 |
|
|
0x04, /* bDescriptorType */
|
117 |
|
|
0x00, /* bInterfaceNumber */
|
118 |
|
|
0x00, /* bAlternateSetting */
|
119 |
|
|
0x01, /* bNumEndpoints */
|
120 |
|
|
0x02, /* bInterfaceClass: Comm Interface Class */
|
121 |
|
|
0x02, /* bInterfaceSubclass: Abstract Control Model */
|
122 |
|
|
0x01, /* bInterfaceProtocol */
|
123 |
|
|
usbINTERFACE_STRING, /* iInterface */
|
124 |
|
|
|
125 |
|
|
/* Header Functional Descriptor */
|
126 |
|
|
0x05, /* bLength */
|
127 |
|
|
0x24, /* bDescriptor type: CS_INTERFACE */
|
128 |
|
|
0x00, /* bDescriptor subtype: Header Func Desc */
|
129 |
|
|
0x10, 0x01, /* bcdCDC:1.1 */
|
130 |
|
|
|
131 |
|
|
/* ACM Functional Descriptor */
|
132 |
|
|
0x04, /* bFunctionLength */
|
133 |
|
|
0x24, /* bDescriptor type: CS_INTERFACE */
|
134 |
|
|
0x02, /* bDescriptor subtype: ACM Func Desc */
|
135 |
|
|
0x00, /* bmCapabilities: We don't support squat */
|
136 |
|
|
|
137 |
|
|
/* Union Functional Descriptor */
|
138 |
|
|
0x05, /* bFunctionLength */
|
139 |
|
|
0x24, /* bDescriptor type: CS_INTERFACE */
|
140 |
|
|
0x06, /* bDescriptor subtype: Union Func Desc */
|
141 |
|
|
0x00, /* bMasterInterface: CDC Interface */
|
142 |
|
|
0x01, /* bSlaveInterface0: Data Class Interface */
|
143 |
|
|
|
144 |
|
|
/* Call Management Functional Descriptor
|
145 |
|
|
0 in D1 and D0 indicates that device does not handle call management */
|
146 |
|
|
0x05, /* bFunctionLength */
|
147 |
|
|
0x24, /* bDescriptor type: CS_INTERFACE */
|
148 |
|
|
0x01, /* bDescriptor subtype: Call Management Func */
|
149 |
|
|
0x00, /* bmCapabilities: D1 + D0 */
|
150 |
|
|
0x01, /* bDataInterface: Data Class Interface 1 */
|
151 |
|
|
|
152 |
|
|
/* CDC Control - Endpoint 3 descriptor
|
153 |
|
|
This endpoint serves as a notification element. */
|
154 |
|
|
|
155 |
|
|
0x07, /* bLength */
|
156 |
|
|
0x05, /* bDescriptorType */
|
157 |
|
|
0x83, /* bEndpointAddress, Endpoint 03 - IN */
|
158 |
|
|
0x03, /* bmAttributes INT */
|
159 |
|
|
0x08, 0x00, /* wMaxPacketSize: 8 bytes */
|
160 |
|
|
0xFF, /* bInterval */
|
161 |
|
|
|
162 |
|
|
/* Data Class Interface Descriptor Requirement */
|
163 |
|
|
0x09, /* bLength */
|
164 |
|
|
0x04, /* bDescriptorType */
|
165 |
|
|
0x01, /* bInterfaceNumber */
|
166 |
|
|
0x00, /* bAlternateSetting */
|
167 |
|
|
0x02, /* bNumEndPoints */
|
168 |
|
|
0x0A, /* bInterfaceClass */
|
169 |
|
|
0x00, /* bInterfaceSubclass */
|
170 |
|
|
0x00, /* bInterfaceProtocol */
|
171 |
|
|
0x00, /* iInterface */
|
172 |
|
|
|
173 |
|
|
/* CDC Data - Endpoint 1 descriptor */
|
174 |
|
|
0x07, /* bLenght */
|
175 |
|
|
0x05, /* bDescriptorType */
|
176 |
|
|
0x01, /* bEndPointAddress, Endpoint 01 - OUT */
|
177 |
|
|
0x02, /* bmAttributes BULK */
|
178 |
|
|
64, /* wMaxPacketSize */
|
179 |
|
|
0x00,
|
180 |
|
|
0x00, /* bInterval */
|
181 |
|
|
|
182 |
|
|
/* CDC Data - Endpoint 2 descriptor */
|
183 |
|
|
0x07, /* bLength */
|
184 |
|
|
0x05, /* bDescriptorType */
|
185 |
|
|
0x82, /* bEndPointAddress, Endpoint 02 - IN */
|
186 |
|
|
0x02, /* bmAttributes BULK */
|
187 |
|
|
64, /* wMaxPacketSize */
|
188 |
|
|
0x00,
|
189 |
|
|
0x00 /* bInterval */
|
190 |
|
|
};
|