IceCube display
LED display to show IceCube event data
std.h File Reference

Definitions of constants as described by the USB 2.0 standard. More...

Include dependency graph for std.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  usb_setup_packet_t
 

Macros

USB request direction
#define REQ_DIR_MASK   (0x1<<7)
 
#define REQ_DIR_OUT   (0<<7)
 
#define REQ_DIR_IN   (1<<7)
 
#define GET_REQUEST_DIRECTION(bmRequestType)   (bmRequestType & REQ_DIR_MASK)
 
USB request type
#define REQ_TYPE_MASK   (0x3<<5)
 
#define REQ_TYPE_STANDARD   (0<<5)
 
#define REQ_TYPE_CLASS   (1<<5)
 
#define REQ_TYPE_VENDOR   (2<<5)
 
#define GET_REQUEST_TYPE(bmRequestType)   (bmRequestType & REQ_TYPE_MASK)
 
USB request recipient
#define REQ_REC_MASK   0x1F
 
#define REQ_REC_DEVICE   0
 
#define REQ_REC_INTERFACE   1
 
#define REQ_REC_ENDPOINT   2
 
#define REQ_REC_OTHER   3
 
#define GET_REQUEST_RECIPIENT(bmRequestType)   (bmRequestType & REQ_REC_MASK)
 
USB device status
#define DEVICE_STATUS_SELF_POWERED   1
 
#define DEVICE_STATUS_REMOTE_WAKEUP   2
 
#define ENDPOINT_STATUS_HALTED   1
 

Enumerations

enum  usb_pid_t {
  PID_OUT = 0x1, PID_IN = 0x9, PID_SOF = 0x5, PID_SETUP = 0xD,
  PID_DATA0 = 0x3, PID_DATA1 = 0xB, PID_DATA2 = 0x7, PID_MDATA = 0xF,
  PID_ACK = 0x2, PID_NAK = 0xA, PID_STALL = 0xE, PIT_NYET = 0x6,
  PID_PRE = 0xC, PID_ERR = 0xC, PID_SPLIT = 0x8, PID_PING = 0x4
}
 USB packet IDs.
 
enum  usb_request_code_t {
  GET_STATUS = 0, CLEAR_FEATURE = 1, SET_FEATURE = 3, SET_ADDRESS = 5,
  GET_DESCRIPTOR = 6, SET_DESCRIPTOR = 7, GET_CONFIGURATION = 8, SET_CONFIGURATION = 9,
  GET_INTERFACE = 10, SET_INTERFACE = 11, SYNCH_FRAME = 12
}
 
enum  usb_feature_t { ENDPOINT_HALT = 0, REMOTE_WAKEUP = 1, TEST_MODE = 2 }
 

Detailed Description

Definitions of constants as described by the USB 2.0 standard.

A few types, constants and macros used by the USB subsystem.

Author
Sander Vanheule (Universiteit Gent)
See also
USB 2.0 specification

Enumeration Type Documentation

◆ usb_feature_t

USB device or endpoint features.

Enumerator
ENDPOINT_HALT 

If the endpoint is/should be stalled.

REMOTE_WAKEUP 

Remote wake-up of host by device.

TEST_MODE 

Switch the device to test mode – a high-speed feature, so not supported.

◆ usb_request_code_t

USB request codes defined in ยง9.4 of the specification. Not all requests are currently supported.

Enumerator
GET_STATUS 

Get device or endpoint status.

CLEAR_FEATURE 

Turn device or endpoint feature off. See usb_feature_t.

SET_FEATURE 

Turn device or endpoint feature on. See usb_feature_t.

SET_ADDRESS 

Set device address.

GET_DESCRIPTOR 

Get USB descriptor.

SET_DESCRIPTOR 

Set USB descriptor, not supported.

GET_CONFIGURATION 

Get currently selected configuration index.

SET_CONFIGURATION 

Set device configuration.

GET_INTERFACE 

Get currently selected interface, not supported.

SET_INTERFACE 

Select interface, not supported.

SYNCH_FRAME 

Device synchronisation for isochronous configurations, not supported.