Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: tools/usb_gadget/usb_constants.py

Issue 409883008: [usb_gadget p00] Classes for encoding USB descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove "(c)" from copyright text. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/usb_gadget/OWNERS ('k') | tools/usb_gadget/usb_descriptors.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """USB constant definitions.
6 """
7
8
9 class DescriptorType(object):
10 """Descriptor Types.
11
12 See Universal Serial Bus Specification Revision 2.0 Table 9-5.
13 """
14 DEVICE = 1
15 CONFIGURATION = 2
16 STRING = 3
17 INTERFACE = 4
18 ENDPOINT = 5
19 QUALIFIER = 6
20 OTHER_SPEED_CONFIGURATION = 7
21
22
23 class DeviceClass(object):
24 """Class code.
25
26 See http://www.usb.org/developers/defined_class.
27 """
28 PER_INTERFACE = 0
29 AUDIO = 1
30 COMM = 2
31 HID = 3
32 PHYSICAL = 5
33 STILL_IMAGE = 6
34 PRINTER = 7
35 MASS_STORAGE = 8
36 HUB = 9
37 CDC_DATA = 10
38 CSCID = 11
39 CONTENT_SEC = 13
40 VIDEO = 14
41 VENDOR = 0xFF
42
43
44 class DeviceSubClass(object):
45 """Subclass code.
46
47 See http://www.usb.org/developers/defined_class.
48 """
49 PER_INTERFACE = 0
50 VENDOR = 0xFF
51
52
53 class DeviceProtocol(object):
54 """Protocol code.
55
56 See http://www.usb.org/developers/defined_class.
57 """
58 PER_INTERFACE = 0
59 VENDOR = 0xFF
60
61
62 class InterfaceClass(object):
63 """Class code.
64
65 See http://www.usb.org/developers/defined_class.
66 """
67 VENDOR = 0xFF
68
69
70 class InterfaceSubClass(object):
71 """Subclass code.
72
73 See http://www.usb.org/developers/defined_class.
74 """
75 VENDOR = 0xFF
76
77
78 class InterfaceProtocol(object):
79 """Protocol code.
80
81 See http://www.usb.org/developers/defined_class.
82 """
83 VENDOR = 0xFF
84
85
86 class TransferType(object):
87 """Transfer Type.
88
89 See http://www.usb.org/developers/defined_class.
90 """
91 MASK = 3
92 CONTROL = 0
93 ISOCHRONOUS = 1
94 BULK = 2
95 INTERRUPT = 3
96
97
98 class Dir(object):
99 """Data transfer direction.
100
101 See Universal Serial Bus Specification Revision 2.0 Table 9-2.
102 """
103 OUT = 0
104 IN = 0x80
105
106
107 class Type(object):
108 """Request Type.
109
110 See Universal Serial Bus Specification Revision 2.0 Table 9-2.
111 """
112 MASK = 0x60
113 STANDARD = 0x00
114 CLASS = 0x20
115 VENDOR = 0x40
116 RESERVED = 0x60
117
118
119 class Recipient(object):
120 """Request Recipient.
121
122 See Universal Serial Bus Specification Revision 2.0 Table 9-2.
123 """
124 MASK = 0x1f
125 DEVICE = 0
126 INTERFACE = 1
127 ENDPOINT = 2
128 OTHER = 3
129
130
131 class Request(object):
132 """Standard Request Codes.
133
134 See Universal Serial Bus Specification Revision 2.0 Table 9-4.
135 """
136 GET_STATUS = 0x00
137 CLEAR_FEATURE = 0x01
138 SET_FEATURE = 0x03
139 SET_ADDRESS = 0x05
140 GET_DESCRIPTOR = 0x06
141 SET_DESCRIPTOR = 0x07
142 GET_CONFIGURATION = 0x08
143 SET_CONFIGURATION = 0x09
144 GET_INTERFACE = 0x0A
145 SET_INTERFACE = 0x0B
146 SYNCH_FRAME = 0x0C
147 SET_SEL = 0x30
148 SET_ISOCH_DELAY = 0x31
149
150
151 class Speed(object):
152 UNKNOWN = 0
153 LOW = 1
154 FULL = 2
155 HIGH = 3
156 WIRELESS = 4
157 SUPER = 5
158
159
160 class VendorID(object):
161 GOOGLE = 0x18D1
OLDNEW
« no previous file with comments | « tools/usb_gadget/OWNERS ('k') | tools/usb_gadget/usb_descriptors.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698