devreqst.c
5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/*HEADER******************************************************************
**************************************************************************
***
*** Copyright (c) 2001-2002 ARC International.
*** All rights reserved
***
*** This software embodies materials and concepts which are
*** confidential to ARC International and is made
*** available solely pursuant to the terms of a written license
*** agreement with ARC International
***
*** $Workfile:devreqst.c$
*** $Revision: 1.2 $
*** $Date: 2003/05/08 03:44:09 $
***
*** Description:
*** This file contains the Device Framework Requests
***
**************************************************************************
*END*********************************************************************/
#include "osint.h"
#include "host.h"
USB_SETUP tx_get_status =
{
0x80, /* device-to-host, 0x80: default, 0x81: Interface, 0x82: Endpoint*/
0, /* Get Status */
0, /* wValue: 0: Default */
0, /* wIndex: 0, Interface or Endpoint */
#ifdef BIG_ENDIAN
0x0200 /* wLength: 2 bytes */
#else
2 /* wLength: 2 bytes */
#endif
};
USB_SETUP tx_clear_feature =
{
0x00, /* host-to-device, 0: default, 1: Interface, 2: Endpoint */
1, /* Clear Feature */
0, /* wValue: 0: Endpoint Halt, 1: Device Remote Wakeup */
0, /* wIndex: 0, Interface or Endpoint */
0 /* wLength */
};
USB_SETUP tx_set_feature =
{
0, /* host-to-device, 0: default, 1: Interface, 2: Endpoint */
3, /* Set Feature */
#ifdef BIG_ENDIAN
0x0300, /* wValue: 0: Endpoint Halt, 1: Device Remote Wakeup,b_hnp_enable */
#else
3, /* wValue: 0: Endpoint Halt, 1: Device Remote Wakeup,b_hnp_enable */
#endif
0, /* wIndex: 0, Interface or Endpoint */
0 /* wLength */
};
USB_SETUP tx_set_address =
{
0, /* host-to-device */
5, /* Set Address */
0, /* wValue: Device address to assign */
0, /* wIndex: 0 */
0 /* wLength */
};
USB_SETUP tx_get_desc =
{
0x80, /* device-to-host */
6, /* Get Descriptor */
#ifdef BIG_ENDIAN
0x0001, /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration,
** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index
*/
0, /* wIndex: 0 (or language ID) */
0x1200 /* wLength: Descriptor Length */
#else
0x0100, /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration,
** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index
*/
0, /* wIndex: 0 (or language ID) */
0x0012 /* wLength: Descriptor Length */
#endif
};
USB_SETUP tx_get_config_desc =
{
0x80, /* device-to-host */
6, /* Get Descriptor */
#ifdef BIG_ENDIAN
0x0002, /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration,
** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index
*/
0, /* wIndex: 0 (or language ID) */
0x4000 /* wLength: Descriptor Length */
#else
0x0200, /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration,
** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index
*/
0, /* wIndex: 0 (or language ID) */
0x0040 /* wLength: Descriptor Length */
#endif
};
USB_SETUP tx_set_desc =
{
0, /* device-to-host */
7, /* Set Descriptor */
#ifdef BIG_ENDIAN
0x0001, /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration,
** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index
*/
0, /* wIndex: 0 (or language ID) */
0x1200 /* wLength: Descriptor Length */
#else
0x0100, /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration,
** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index
*/
0, /* wIndex: 0 (or language ID) */
0x0012 /* wLength: Descriptor Length */
#endif
};
USB_SETUP tx_get_config =
{
0x80, /* device-to-host */
8, /* Get Config */
0, /* wValue: 0: default */
0, /* wIndex: 0 = Default */
#ifdef BIG_ENDIAN
0x0100 /* wLength: 1 byte */
#else
1 /* wLength: 1 byte */
#endif
};
USB_SETUP tx_set_config =
{
0, /* host-to-device */
9, /* Set Config */
#ifdef BIG_ENDIAN
0x0100, /* wValue: Configuration value */
#else
1, /* wValue: Configuration value */
#endif
0, /* wIndex: 0 */
0 /* wLength */
};
USB_SETUP tx_get_interface =
{
0x81, /* device-to-host */
0x0A, /* Get Interface */
0, /* 0: default */
0, /* wIndex: Interface */
#ifdef BIG_ENDIAN
0x0100, /* wLength: 1 byte */
#else
1, /* wLength: 1 byte */
#endif
};
USB_SETUP tx_set_interface =
{
0x21, /* host-to-device, class, other */
0x0B, /* Set Interface */
0, /* wValue: Alternate Setting */
0, /* wIndex: Zero or Interface or Endpoint (1 for port 1) */
0, /* wLength */
};
USB_SETUP tx_synch_frame =
{
0x82, /* device-to-host */
0x0C, /* Synch Frame */
0, /* wValue: 0: Default */
0, /* wIndex: Endpoint */
#ifdef BIG_ENDIAN
0x0200 /* wLength: 2 bytes */
#else
2 /* wLength: 2 bytes */
#endif
};
/* Example of a Vendor Specific Request */
USB_SETUP tx_enable_echo =
{
0x40, /* Vendor Specific request */
0x02,
#ifdef BIG_ENDIAN
0x1d00, /* wValue: */
0x0100, /* wIndex: Endpoint */
#else
0x001d, /* wValue: */
0x0001, /* wIndex: Endpoint */
#endif
0x0000 /* wLength: 0 bytes */
};