OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [tools/] [fx2/] [src/] [lib/] [usb_requests.h] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 wfjm
/* -*- c++ -*- */
2
/* $Id: usb_requests.h 395 2011-07-17 22:02:55Z mueller $ */
3
/*-----------------------------------------------------------------------------
4
 * USB request definitions
5
 *-----------------------------------------------------------------------------
6
 * Code taken from USRP2 firmware (GNU Radio Project), version 3.0.2,
7
 * Copyright 2003 Free Software Foundation, Inc.
8
 *-----------------------------------------------------------------------------
9
 * This code is part of usbjtag. usbjtag is free software; you can redistribute
10
 * it and/or modify it under the terms of the GNU General Public License as
11
 * published by the Free Software Foundation; either version 2 of the License,
12
 * or (at your option) any later version. usbjtag is distributed in the hope
13
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.  You should have received a
16
 * copy of the GNU General Public License along with this program in the file
17
 * COPYING; if not, write to the Free Software Foundation, Inc., 51 Franklin
18
 * St, Fifth Floor, Boston, MA  02110-1301  USA
19
 *-----------------------------------------------------------------------------
20
 */
21
 
22
// Standard USB requests.
23
// These are contained in end point 0 setup packets
24
 
25
 
26
#ifndef _USB_REQUESTS_H_
27
#define _USB_REQUESTS_H_
28
 
29
// format of bmRequestType byte
30
 
31
#define bmRT_DIR_MASK           (0x1 << 7)
32
#define bmRT_DIR_IN             (1 << 7)
33
#define bmRT_DIR_OUT            (0 << 7)
34
 
35
#define bmRT_TYPE_MASK          (0x3 << 5)
36
#define bmRT_TYPE_STD           (0 << 5)
37
#define bmRT_TYPE_CLASS         (1 << 5)
38
#define bmRT_TYPE_VENDOR        (2 << 5)
39
#define bmRT_TYPE_RESERVED      (3 << 5)
40
 
41
#define bmRT_RECIP_MASK         (0x1f << 0)
42
#define bmRT_RECIP_DEVICE       (0 << 0)
43
#define bmRT_RECIP_INTERFACE    (1 << 0)
44
#define bmRT_RECIP_ENDPOINT     (2 << 0)
45
#define bmRT_RECIP_OTHER        (3 << 0)
46
 
47
 
48
// standard request codes (bRequest)
49
 
50
#define RQ_GET_STATUS           0
51
#define RQ_CLEAR_FEATURE        1
52
#define RQ_RESERVED_2           2
53
#define RQ_SET_FEATURE          3
54
#define RQ_RESERVED_4           4
55
#define RQ_SET_ADDRESS          5
56
#define RQ_GET_DESCR            6
57
#define RQ_SET_DESCR            7
58
#define RQ_GET_CONFIG           8
59
#define RQ_SET_CONFIG           9
60
#define RQ_GET_INTERFACE       10
61
#define RQ_SET_INTERFACE       11
62
#define RQ_SYNCH_FRAME         12
63
 
64
// standard descriptor types
65
 
66
#define DT_DEVICE               1
67
#define DT_CONFIG               2
68
#define DT_STRING               3
69
#define DT_INTERFACE            4
70
#define DT_ENDPOINT             5
71
#define DT_DEVQUAL              6
72
#define DT_OTHER_SPEED          7
73
#define DT_INTERFACE_POWER      8
74
 
75
// standard feature selectors
76
 
77
#define FS_ENDPOINT_HALT        0        // recip: endpoint
78
#define FS_DEV_REMOTE_WAKEUP    1       // recip: device
79
#define FS_TEST_MODE            2       // recip: device
80
 
81
// Get Status device attributes
82
 
83
#define bmGSDA_SELF_POWERED     0x01
84
#define bmGSDA_REM_WAKEUP       0x02
85
 
86
 
87
#endif /* _USB_REQUESTS_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.