-
Notifications
You must be signed in to change notification settings - Fork 0
/
usb.inc
52 lines (40 loc) · 1.16 KB
/
usb.inc
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
; SPDX-FileCopyrightText: 2023 Andreas Sig Rosvall
;
; SPDX-License-Identifier: GPL-3.0-or-later
USB_VERSION = 0x0110
USB_DT_DEVICE = 0x01
USB_DT_CONFIGURATION = 0x02
USB_DT_STRING = 0x03
USB_DT_INTERFACE = 0x04
USB_DT_ENDPOINT = 0x05
USB_DT_DEVICE_QUALIFIER = 0x06
USB_DT_OTHER_SPEED_CONFIG = 0x07
USB_DT_INTERFACE_POWER = 0x08
USB_DT_DFU_FUNCTIONAL = 0x21
LANGID_ENGLISH_US = 0x0409
bitBusPowered = 1 << 7
USB_DEVICE_CLASS_DEVICE = 0x00
USB_DEVICE_SUBCLASS_NONE = 0x00
USB_DEVICE_PROTOCOL_PER_INTF = 0x00
USB_STRING_DESC_LANGID = 0
VBUS_MAX_CURRENT_MA = 50
; USB bmRequestType bits
USB_RT_DEV = 0 << 0
USB_RT_INTF = 1 << 0
USB_RT_EP = 2 << 0
USB_RT_STD = 0 << 5
USB_RT_CLASS = 1 << 5
USB_RT_VENDOR = 2 << 5
USB_RT_OUT = 0 << 7
USB_RT_IN = 1 << 7
; Standard USB bRequests
USB_REQ_GET_STATUS = 0
USB_REQ_CLEAR_FEATURE = 1
USB_REQ_SET_FEATURE = 3
USB_REQ_SET_ADDRESS = 5
USB_REQ_GET_DESCRIPTOR = 6
USB_REQ_SET_DESCRIPTOR = 7
USB_REQ_GET_CONFIGURATION = 8
USB_REQ_SET_CONFIGURATION = 9
USB_REQ_GET_INTF = 10
USB_REQ_SET_INTF = 11