Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / tools / usb_gadget / usb_constants.py
blob442674be163c1eef590f0e0576409adad82a7be2
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.
5 """USB constant definitions.
6 """
9 class DescriptorType(object):
10 """Descriptor Types.
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
23 class DeviceClass(object):
24 """Class code.
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
44 class DeviceSubClass(object):
45 """Subclass code.
47 See http://www.usb.org/developers/defined_class.
48 """
49 PER_INTERFACE = 0
50 VENDOR = 0xFF
53 class DeviceProtocol(object):
54 """Protocol code.
56 See http://www.usb.org/developers/defined_class.
57 """
58 PER_INTERFACE = 0
59 VENDOR = 0xFF
62 class InterfaceClass(object):
63 """Class code.
65 See http://www.usb.org/developers/defined_class.
66 """
67 VENDOR = 0xFF
70 class InterfaceSubClass(object):
71 """Subclass code.
73 See http://www.usb.org/developers/defined_class.
74 """
75 VENDOR = 0xFF
78 class InterfaceProtocol(object):
79 """Protocol code.
81 See http://www.usb.org/developers/defined_class.
82 """
83 VENDOR = 0xFF
86 class TransferType(object):
87 """Transfer Type.
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
98 class Dir(object):
99 """Data transfer direction.
101 See Universal Serial Bus Specification Revision 2.0 Table 9-2.
103 OUT = 0
104 IN = 0x80
107 class Type(object):
108 """Request Type.
110 See Universal Serial Bus Specification Revision 2.0 Table 9-2.
112 MASK = 0x60
113 STANDARD = 0x00
114 CLASS = 0x20
115 VENDOR = 0x40
116 RESERVED = 0x60
119 class Recipient(object):
120 """Request Recipient.
122 See Universal Serial Bus Specification Revision 2.0 Table 9-2.
124 MASK = 0x1f
125 DEVICE = 0
126 INTERFACE = 1
127 ENDPOINT = 2
128 OTHER = 3
131 class Request(object):
132 """Standard Request Codes.
134 See Universal Serial Bus Specification Revision 2.0 Table 9-4.
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
151 class Speed(object):
152 UNKNOWN = 0
153 LOW = 1
154 FULL = 2
155 HIGH = 3
156 WIRELESS = 4
157 SUPER = 5
160 class VendorID(object):
161 GOOGLE = 0x18D1
164 class ProductID(object):
165 GOOGLE_TEST_GADGET = 0x58F0
166 GOOGLE_KEYBOARD_GADGET = 0x58F1
167 GOOGLE_MOUSE_GADGET = 0x58F2
168 GOOGLE_HID_ECHO_GADGET = 0x58F3
169 GOOGLE_ECHO_GADGET = 0x58F4