1 #ifndef USB_H_6PFTDPIMZM__ 2 #define USB_H_6PFTDPIMZM__ 11 #define BYTE_ALIGNED __attribute__ ((__packed__)) 16 #define LOW_BYTE(x) ((unsigned char)x) 17 #define HIGH_BYTE(x) ((unsigned char)(x>>8)) 19 typedef uint8_t Uchar;
20 typedef uint16_t Uint16;
21 typedef uint32_t Uint32;
25 #define GET_STATUS 0x00 26 #define GET_DEVICE 0x01 27 #define CLEAR_FEATURE 0x01 28 #define GET_STRING 0x03 29 #define SET_FEATURE 0x03 30 #define SET_ADDRESS 0x05 31 #define GET_DESCRIPTOR 0x06 32 #define SET_DESCRIPTOR 0x07 33 #define GET_CONFIGURATION 0x08 34 #define SET_CONFIGURATION 0x09 35 #define GET_INTERFACE 0x0A 36 #define SET_INTERFACE 0x0B 37 #define SYNCH_FRAME 0x0C 39 #define GET_DEVICE_DESCRIPTOR 1 40 #define GET_CONFIGURATION_DESCRIPTOR 4 42 #define REQUEST_DEVICE_STATUS 0x80 43 #define REQUEST_INTERFACE_STATUS 0x81 44 #define REQUEST_ENDPOINT_STATUS 0x82 45 #define ZERO_TYPE 0x00 46 #define INTERFACE_TYPE 0x01 47 #define ENDPOINT_TYPE 0x02 52 #define CONFIGURATION 0x02 54 #define INTERFACE 0x04 64 #define DEVICE_REMOTE_WAKEUP_FEATURE 0x01 65 #define ENDPOINT_HALT_FEATURE 0x00 69 #define SELF_POWERED 1 80 #define USB_CONFIG_BUSPOWERED 0x80 81 #define USB_CONFIG_SELFPOWERED 0x40 82 #define USB_CONFIG_REMOTEWAKEUP 0x20 85 #define CS_INTERFACE 0x24 86 #define CS_ENDPOINT 0x25 103 struct usb_st_device_descriptor
106 Uchar bDescriptorType;
109 Uchar bDeviceSubClass;
110 Uchar bDeviceProtocol;
111 Uchar bMaxPacketSize0;
118 Uchar bNumConfigurations;
124 struct usb_st_configuration_descriptor
127 Uchar bDescriptorType;
129 Uchar bNumInterfaces;
130 Uchar bConfigurationValue;
131 Uchar iConfiguration;
139 struct usb_st_interface_descriptor
142 Uchar bDescriptorType;
143 Uchar bInterfaceNumber;
144 Uchar bAlternateSetting;
146 Uchar bInterfaceClass;
147 Uchar bInterfaceSubClass;
148 Uchar bInterfaceProtocol;
155 struct usb_st_endpoint_descriptor
158 Uchar bDescriptorType;
159 Uchar bEndpointAddress;
161 Uint16 wMaxPacketSize;
170 struct usb_st_string_descriptor
173 Uchar bDescriptorType;
178 struct usb_st_language_descriptor
181 Uchar bDescriptorType;