25 #if !defined(_usb_h_) || defined(_ch9_h_)
26 #error "Never include usb_ch9.h directly; include Usb.h instead"
33 #define DEV_DESCR_LEN 18
34 #define CONF_DESCR_LEN 9
35 #define INTR_DESCR_LEN 9
36 #define EP_DESCR_LEN 7
40 #define USB_REQUEST_GET_STATUS 0
41 #define USB_REQUEST_CLEAR_FEATURE 1
42 #define USB_REQUEST_SET_FEATURE 3
43 #define USB_REQUEST_SET_ADDRESS 5
44 #define USB_REQUEST_GET_DESCRIPTOR 6
45 #define USB_REQUEST_SET_DESCRIPTOR 7
46 #define USB_REQUEST_GET_CONFIGURATION 8
47 #define USB_REQUEST_SET_CONFIGURATION 9
48 #define USB_REQUEST_GET_INTERFACE 10
49 #define USB_REQUEST_SET_INTERFACE 11
50 #define USB_REQUEST_SYNCH_FRAME 12
52 #define USB_FEATURE_ENDPOINT_HALT 0
53 #define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1
54 #define USB_FEATURE_TEST_MODE 2
58 #define USB_SETUP_HOST_TO_DEVICE 0x00
59 #define USB_SETUP_DEVICE_TO_HOST 0x80
60 #define USB_SETUP_TYPE_STANDARD 0x00
61 #define USB_SETUP_TYPE_CLASS 0x20
62 #define USB_SETUP_TYPE_VENDOR 0x40
63 #define USB_SETUP_RECIPIENT_DEVICE 0x00
64 #define USB_SETUP_RECIPIENT_INTERFACE 0x01
65 #define USB_SETUP_RECIPIENT_ENDPOINT 0x02
66 #define USB_SETUP_RECIPIENT_OTHER 0x03
70 #define USB_DESCRIPTOR_DEVICE 0x01
71 #define USB_DESCRIPTOR_CONFIGURATION 0x02
72 #define USB_DESCRIPTOR_STRING 0x03
73 #define USB_DESCRIPTOR_INTERFACE 0x04
74 #define USB_DESCRIPTOR_ENDPOINT 0x05
75 #define USB_DESCRIPTOR_DEVICE_QUALIFIER 0x06
76 #define USB_DESCRIPTOR_OTHER_SPEED 0x07
77 #define USB_DESCRIPTOR_INTERFACE_POWER 0x08
78 #define USB_DESCRIPTOR_OTG 0x09
80 #define HID_DESCRIPTOR_HID 0x21
85 #define OTG_FEATURE_B_HNP_ENABLE 3
86 #define OTG_FEATURE_A_HNP_SUPPORT 4
87 #define OTG_FEATURE_A_ALT_HNP_SUPPORT 5
90 #define USB_TRANSFER_TYPE_CONTROL 0x00
91 #define USB_TRANSFER_TYPE_ISOCHRONOUS 0x01
92 #define USB_TRANSFER_TYPE_BULK 0x02
93 #define USB_TRANSFER_TYPE_INTERRUPT 0x03
94 #define bmUSB_TRANSFER_TYPE 0x03
98 #define USB_FEATURE_ENDPOINT_STALL 0
99 #define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1
100 #define USB_FEATURE_TEST_MODE 2
uint16_t wDescriptorLength
uint8_t bConfigurationValue
uint8_t bNumConfigurations
uint16_t wDescriptorLength
uint8_t bAlternateSetting
uint8_t bInterfaceSubClass
uint8_t bInterfaceProtocol