|
4 | 4 | #include <stdint.h> |
5 | 5 |
|
6 | 6 | /* USB Request Types */ |
7 | | -#define USB_DIR_OUT 0x00 |
8 | | -#define USB_DIR_IN 0x80 |
| 7 | +#define USB_DIR_OUT 0x00 |
| 8 | +#define USB_DIR_IN 0x80 |
9 | 9 |
|
10 | | -#define USB_TYPE_STANDARD 0x00 |
11 | | -#define USB_TYPE_CLASS 0x20 |
12 | | -#define USB_TYPE_VENDOR 0x40 |
| 10 | +#define USB_TYPE_STANDARD 0x00 |
| 11 | +#define USB_TYPE_CLASS 0x20 |
| 12 | +#define USB_TYPE_VENDOR 0x40 |
13 | 13 |
|
14 | | -#define USB_RECIP_DEVICE 0x00 |
15 | | -#define USB_RECIP_INTERFACE 0x01 |
16 | | -#define USB_RECIP_ENDPOINT 0x02 |
| 14 | +#define USB_RECIP_DEVICE 0x00 |
| 15 | +#define USB_RECIP_INTERFACE 0x01 |
| 16 | +#define USB_RECIP_ENDPOINT 0x02 |
17 | 17 |
|
18 | 18 | /* USB Standard Requests */ |
19 | | -#define USB_REQ_GET_STATUS 0x00 |
20 | | -#define USB_REQ_CLEAR_FEATURE 0x01 |
21 | | -#define USB_REQ_SET_FEATURE 0x03 |
22 | | -#define USB_REQ_SET_ADDRESS 0x05 |
23 | | -#define USB_REQ_GET_DESCRIPTOR 0x06 |
24 | | -#define USB_REQ_SET_DESCRIPTOR 0x07 |
| 19 | +#define USB_REQ_GET_STATUS 0x00 |
| 20 | +#define USB_REQ_CLEAR_FEATURE 0x01 |
| 21 | +#define USB_REQ_SET_FEATURE 0x03 |
| 22 | +#define USB_REQ_SET_ADDRESS 0x05 |
| 23 | +#define USB_REQ_GET_DESCRIPTOR 0x06 |
| 24 | +#define USB_REQ_SET_DESCRIPTOR 0x07 |
25 | 25 | #define USB_REQ_GET_CONFIGURATION 0x08 |
26 | 26 | #define USB_REQ_SET_CONFIGURATION 0x09 |
27 | | -#define USB_REQ_GET_INTERFACE 0x0A |
28 | | -#define USB_REQ_SET_INTERFACE 0x0B |
| 27 | +#define USB_REQ_GET_INTERFACE 0x0A |
| 28 | +#define USB_REQ_SET_INTERFACE 0x0B |
29 | 29 |
|
30 | 30 | /* Descriptor Types */ |
31 | | -#define USB_DT_DEVICE 0x01 |
32 | | -#define USB_DT_CONFIG 0x02 |
33 | | -#define USB_DT_STRING 0x03 |
34 | | -#define USB_DT_INTERFACE 0x04 |
35 | | -#define USB_DT_ENDPOINT 0x05 |
| 31 | +#define USB_DT_DEVICE 0x01 |
| 32 | +#define USB_DT_CONFIG 0x02 |
| 33 | +#define USB_DT_STRING 0x03 |
| 34 | +#define USB_DT_INTERFACE 0x04 |
| 35 | +#define USB_DT_ENDPOINT 0x05 |
36 | 36 |
|
37 | 37 | /* USB Setup Packet */ |
38 | 38 | struct usb_setup_packet { |
@@ -97,30 +97,30 @@ struct usb_endpoint_descriptor { |
97 | 97 | } __attribute__((packed)); |
98 | 98 |
|
99 | 99 | /* USB Device Class Codes */ |
100 | | -#define USB_CLASS_AUDIO 0x01 |
101 | | -#define USB_CLASS_COMM 0x02 |
102 | | -#define USB_CLASS_HID 0x03 |
103 | | -#define USB_CLASS_PRINTER 0x07 |
104 | | -#define USB_CLASS_MASS_STORAGE 0x08 |
105 | | -#define USB_CLASS_HUB 0x09 |
106 | | -#define USB_CLASS_DATA 0x0A |
107 | | -#define USB_CLASS_VENDOR_SPEC 0xFF |
| 100 | +#define USB_CLASS_AUDIO 0x01 |
| 101 | +#define USB_CLASS_COMM 0x02 |
| 102 | +#define USB_CLASS_HID 0x03 |
| 103 | +#define USB_CLASS_PRINTER 0x07 |
| 104 | +#define USB_CLASS_MASS_STORAGE 0x08 |
| 105 | +#define USB_CLASS_HUB 0x09 |
| 106 | +#define USB_CLASS_DATA 0x0A |
| 107 | +#define USB_CLASS_VENDOR_SPEC 0xFF |
108 | 108 |
|
109 | 109 | /* HID Subclass Codes */ |
110 | | -#define HID_SUBCLASS_NONE 0x00 |
111 | | -#define HID_SUBCLASS_BOOT 0x01 |
| 110 | +#define HID_SUBCLASS_NONE 0x00 |
| 111 | +#define HID_SUBCLASS_BOOT 0x01 |
112 | 112 |
|
113 | 113 | /* HID Protocol Codes */ |
114 | | -#define HID_PROTOCOL_NONE 0x00 |
115 | | -#define HID_PROTOCOL_KEYBOARD 0x01 |
116 | | -#define HID_PROTOCOL_MOUSE 0x02 |
| 114 | +#define HID_PROTOCOL_NONE 0x00 |
| 115 | +#define HID_PROTOCOL_KEYBOARD 0x01 |
| 116 | +#define HID_PROTOCOL_MOUSE 0x02 |
117 | 117 |
|
118 | 118 | /* HID Class Requests */ |
119 | | -#define HID_REQ_GET_REPORT 0x01 |
120 | | -#define HID_REQ_GET_IDLE 0x02 |
121 | | -#define HID_REQ_GET_PROTOCOL 0x03 |
122 | | -#define HID_REQ_SET_REPORT 0x09 |
123 | | -#define HID_REQ_SET_IDLE 0x0A |
124 | | -#define HID_REQ_SET_PROTOCOL 0x0B |
| 119 | +#define HID_REQ_GET_REPORT 0x01 |
| 120 | +#define HID_REQ_GET_IDLE 0x02 |
| 121 | +#define HID_REQ_GET_PROTOCOL 0x03 |
| 122 | +#define HID_REQ_SET_REPORT 0x09 |
| 123 | +#define HID_REQ_SET_IDLE 0x0A |
| 124 | +#define HID_REQ_SET_PROTOCOL 0x0B |
125 | 125 |
|
126 | 126 | #endif /* _USB_H */ |
0 commit comments