IceCube display
LED display to show IceCube event data
All Data Structures Files Functions Variables Enumerations Enumerator Macros Modules Pages
std.h
Go to the documentation of this file.
1 #ifndef USB_STD_H
2 #define USB_STD_H
3 
11 #include <stdint.h>
12 
14 enum usb_pid_t {
15  PID_OUT = 0x1
16  , PID_IN = 0x9
17  , PID_SOF = 0x5
18  , PID_SETUP = 0xD
19  , PID_DATA0 = 0x3
20  , PID_DATA1 = 0xB
21  , PID_DATA2 = 0x7
22  , PID_MDATA = 0xF
23  , PID_ACK = 0x2
24  , PID_NAK = 0xA
25  , PID_STALL = 0xE
26  , PIT_NYET = 0x6
27  , PID_PRE = 0xC
28  , PID_ERR = 0xC
29  , PID_SPLIT = 0x8
30  , PID_PING = 0x4
31 };
32 
39  , SET_FEATURE = 3
40  , SET_ADDRESS = 5
45  , GET_INTERFACE = 10
46  , SET_INTERFACE = 11
47  , SYNCH_FRAME = 12
48 };
49 
53 #define REQ_DIR_MASK (0x1<<7)
54 #define REQ_DIR_OUT (0<<7)
55 #define REQ_DIR_IN (1<<7)
56 #define GET_REQUEST_DIRECTION(bmRequestType) (bmRequestType & REQ_DIR_MASK)
57 
62 #define REQ_TYPE_MASK (0x3<<5)
63 #define REQ_TYPE_STANDARD (0<<5)
64 #define REQ_TYPE_CLASS (1<<5)
65 #define REQ_TYPE_VENDOR (2<<5)
66 #define GET_REQUEST_TYPE(bmRequestType) (bmRequestType & REQ_TYPE_MASK)
67 
72 #define REQ_REC_MASK 0x1F
73 #define REQ_REC_DEVICE 0
74 #define REQ_REC_INTERFACE 1
75 #define REQ_REC_ENDPOINT 2
76 #define REQ_REC_OTHER 3
77 #define GET_REQUEST_RECIPIENT(bmRequestType) (bmRequestType & REQ_REC_MASK)
78 
83 #define DEVICE_STATUS_SELF_POWERED 1
84 #define DEVICE_STATUS_REMOTE_WAKEUP 2
85 #define ENDPOINT_STATUS_HALTED 1
86 
97 };
98 
99 
104  uint8_t bmRequestType;
105  uint8_t bRequest;
106  uint16_t wValue;
107  uint16_t wIndex;
108  uint16_t wLength;
109 } __attribute__((packed));
110 
111 #endif // USB_STD_H
Device synchronisation for isochronous configurations, not supported.
Definition: std.h:47
Turn device or endpoint feature off. See usb_feature_t.
Definition: std.h:38
Set device configuration.
Definition: std.h:44
Get currently selected configuration index.
Definition: std.h:43
uint16_t wValue
Request value, interpretation is specific to bRequest&#39;s value.
Definition: std.h:106
Switch the device to test mode – a high-speed feature, so not supported.
Definition: std.h:96
uint8_t bmRequestType
bitwise OR of a REQ_DIR_*, a REQ_TYPE_*, and a REQ_REC_* constant. See std.h.
Definition: std.h:104
usb_pid_t
USB packet IDs.
Definition: std.h:14
uint8_t bRequest
Request code, interpretation depends on value of bmRequestType.
Definition: std.h:105
Get device or endpoint status.
Definition: std.h:37
uint16_t wLength
Data length of the request.
Definition: std.h:108
If the endpoint is/should be stalled.
Definition: std.h:92
Turn device or endpoint feature on. See usb_feature_t.
Definition: std.h:39
Set device address.
Definition: std.h:40
Remote wake-up of host by device.
Definition: std.h:94
Get currently selected interface, not supported.
Definition: std.h:45
Set USB descriptor, not supported.
Definition: std.h:42
usb_request_code_t
Definition: std.h:36
Get USB descriptor.
Definition: std.h:41
Definition: std.h:102
usb_feature_t
Definition: std.h:90
uint16_t wIndex
Request index, interpretation is specific to bRequest&#39;s value.
Definition: std.h:107
Select interface, not supported.
Definition: std.h:46