OSDN Git Service

Logger/Logger.h: __linux__ changed to __unix__ to support build on cygwin
[stock/stock.osdn.git] / FX2 / usb_const.h
1 // USB constants
2 // Copyright (C) 2014 Pawel Jewstafjew
3
4 enum { // Endpoint Dir & Request Dir
5    DIR_OUT = 0<<7,
6    DIR_IN  = 1<<7,
7 };
8
9 enum {
10    USB_VER_2 = 0x200 // bcdUSB: USB version 2.00
11 };
12
13 enum { // Class, bDeviceClass
14    USB_CLASS_UNDEFINED = 0,   // Device defined at Interface level
15    USB_CLASS_AUDIO     = 1,   // Audio
16    USB_CLASS_MISCELLANEOUS = 0xef, // Miscellaneous Device Class (Interface Association)
17    USB_CLASS_VENDOR    = 0xff // Vendor Specific
18 };
19
20 enum { // SubClass
21    USB_SC_UNDEFINED       = 0,   // Device defined at Interface level
22    USB_SC_AUDIO_CONTROL   = 1,   // Audio Control
23    USB_SC_AUDIO_STREAMING = 2,   // Audio Streaming
24    USB_SC_MIDI_STREAMING  = 3,   // MIDI Streaming
25    USB_SC_VENDOR          = 0xff // Vendor Specific
26 };
27
28 enum { // Protocol
29    USB_PR_UNDEFINED       = 0,   // Device defined at Interface level.
30 };
31
32 enum { // Setup, bmRequestType
33   USB_RT_STANDARD = 0<<5,
34   USB_RT_CLASS    = 1<<5,
35   USB_RT_VENDOR   = 2<<5,
36   USB_RT_DEVICE    = 0<<0,
37   USB_RT_INTERFACE = 1<<0,
38   USB_RT_ENDPOINT  = 2<<0,
39   USB_RT_OTHER     = 3<<0,
40 };
41
42 enum { // Setup, bRequest
43   USB_REQ_GET_STATUS        = 0x00,
44   USB_REQ_CLEAR_FEATURE     = 0x01,
45   USB_REQ_SET_FEATURE       = 0x03,
46   USB_REQ_SET_ADDRESS       = 0x05,
47   USB_REQ_GET_DESCRIPTOR    = 0x06,
48   USB_REQ_SET_DESCRIPTOR    = 0x07,
49   USB_REQ_GET_CONFIGURATION = 0x08,
50   USB_REQ_SET_CONFIGURATION = 0x09,
51   USB_REQ_GET_INTERFACE     = 0x0A,
52   USB_REQ_SET_INTERFACE     = 0x0B,
53 };
54