devreqst.c
4.46 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
/*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.1 $
*** $Date: 2003/02/17 20:49:00 $
***
*** Description:
*** This file contains the Device Framework Requests
***
**************************************************************************
*END*********************************************************************/
#include "types.h"
#include "hostapi.h"
#include "test_h.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 */
2 /* wLength: 2 bytes */
};
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 */
3, /* wValue: 0: Endpoint Halt, 1: Device Remote Wakeup,b_hnp_enable */
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 */
0x0100, /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration,
** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index
*/
0, /* wIndex: 0 (or language ID) */
0x12 /* wLength: Descriptor Length */
};
USB_SETUP tx_get_config_desc =
{
0x80, /* device-to-host */
6, /* Get Descriptor */
0x0200, /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration,
** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index
*/
0, /* wIndex: 0 (or language ID) */
0x40 /* wLength: Descriptor Length */
};
USB_SETUP tx_set_desc =
{
0, /* device-to-host */
7, /* Set Descriptor */
0x0100, /* wValue: HiByte: Descriptor Type (1: Device, 2: Configuration,
** 3: String, 4: Interface, 5: Endpoint), LoByte: Descriptor Index
*/
0, /* wIndex: 0 (or language ID) */
0x12 /* wLength: Descriptor Length */
};
USB_SETUP tx_get_config =
{
0x80, /* device-to-host */
8, /* Get Config */
0, /* wValue: 0: default */
0, /* wIndex: 0 = Default */
1 /* wLength: 1 byte */
};
USB_SETUP tx_set_config =
{
0, /* host-to-device */
9, /* Set Config */
1, /* wValue: Configuration value */
0, /* wIndex: 0 */
0 /* wLength */
};
USB_SETUP tx_get_interface =
{
0x81, /* device-to-host */
0x0A, /* Get Interface */
0, /* 0: default */
0, /* wIndex: Interface */
1, /* wLength: 1 byte */
};
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 */
2 /* wLength: 2 bytes */
};
/* Example of a Vendor Specific Request */
USB_SETUP tx_enable_echo =
{
0x40, /* Vendor Specific request */
0x02,
0x001d, /* wValue: */
0x0001, /* wIndex: Endpoint */
0x0000 /* wLength: 0 bytes */
};