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

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

Issue 409883008: [usb_gadget p00] Classes for encoding USB descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
(Empty)
1 """USB constant definitions.
2 """
3
4
5 class DescriptorType(object):
6 DEVICE = 1
7 CONFIGURATION = 2
8 STRING = 3
9 INTERFACE = 4
10 ENDPOINT = 5
11 QUALIFIER = 6
12 OTHER_SPEED_CONFIGURATION = 7
13
14
15 class DeviceClass(object):
16 """USB device classes."""
17 PER_INTERFACE = 0
18 AUDIO = 1
19 COMM = 2
20 HID = 3
21 PHYSICAL = 5
22 STILL_IMAGE = 6
23 PRINTER = 7
24 MASS_STORAGE = 8
25 HUB = 9
26 CDC_DATA = 10
27 CSCID = 11
28 CONTENT_SEC = 13
29 VIDEO = 14
30 VENDOR = 0xFF
31
32
33 class DeviceSubClass(object):
34 PER_INTERFACE = 0
35 VENDOR = 0xFF
36
37
38 class DeviceProtocol(object):
39 PER_INTERFACE = 0
40 VENDOR = 0xFF
41
42
43 class InterfaceClass(object):
44 VENDOR = 0xFF
45
46
47 class InterfaceSubClass(object):
48 VENDOR = 0xFF
49
50
51 class InterfaceProtocol(object):
52 VENDOR = 0xFF
53
54
55 class TransferType(object):
56 MASK = 3
57 CONTROL = 0
58 ISOCHRONOUS = 1
59 BULK = 2
60 INTERRUPT = 3
61
62
63 class Dir(object):
64 OUT = 0
65 IN = 0x80
66
67
68 class Type(object):
69 MASK = 0x60
70 STANDARD = 0x00
71 CLASS = 0x20
72 VENDOR = 0x40
73 RESERVED = 0x60
74
75
76 class Recipient(object):
77 MASK = 0x1f
78 DEVICE = 0
79 INTERFACE = 1
80 ENDPOINT = 2
81 OTHER = 3
82
83
84 class Request(object):
85 """Standard USB control request types."""
86 GET_STATUS = 0x00
87 CLEAR_FEATURE = 0x01
88 SET_FEATURE = 0x03
89 SET_ADDRESS = 0x05
90 GET_DESCRIPTOR = 0x06
91 SET_DESCRIPTOR = 0x07
92 GET_CONFIGURATION = 0x08
93 SET_CONFIGURATION = 0x09
94 GET_INTERFACE = 0x0A
95 SET_INTERFACE = 0x0B
96 SYNCH_FRAME = 0x0C
97 SET_SEL = 0x30
98 SET_ISOCH_DELAY = 0x31
99
100
101 class Speed(object):
102 UNKNOWN = 0
103 LOW = 1
104 FULL = 2
105 HIGH = 3
106 WIRELESS = 4
107 SUPER = 5
108
109
110 class VendorID(object):
111 GOOGLE = 0x18D1
OLDNEW
« tools/usb_gadget/descriptor.py ('K') | « tools/usb_gadget/descriptor_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698