14 #define USB_DT_INTERFACE_SIZE 9
15 #define USB_DT_ENDPOINT_SIZE 7
16 #define USB_DT_DEVICE_SIZE 0x12
17 #define USB_DT_SS_ENDPOINT_COMPANION_SIZE 6
19 #define USB_ENDPOINT_ADDRESS_MASK 0x0f
20 #define USB_ENDPOINT_DIR_MASK 0x80
22 #define USB_TRANSFER_TYPE_MASK 0x03
30 uint16_t wMaxPacketSize;
40 uint8_t bNumEndpoints;
41 uint8_t bInterfaceClass;
42 uint8_t bInterfaceSubClass;
43 uint8_t bInterfaceProtocol;
53 uint8_t bDeviceSubClass;
54 uint8_t bDeviceProtocol;
55 uint8_t bMaxPacketSize0;
59 uint8_t iManufacturer;
61 uint8_t iSerialNumber;
62 uint8_t bNumConfigurations;
68 uint8_t bDescriptorType;
69 uint16_t wTotalLength;
70 uint8_t bNumInterfaces;
71 uint8_t bConfigurationValue;
72 uint8_t iConfiguration;
83 uint16_t wBytesPerInterval;
95 USB_CLASS_PER_INTERFACE = 0,
99 USB_CLASS_PHYSICAL = 5,
100 USB_CLASS_PRINTER = 7,
103 USB_CLASS_MASS_STORAGE = 8,
106 USB_CLASS_SMART_CARD = 0x0b,
107 USB_CLASS_CONTENT_SECURITY = 0x0d,
108 USB_CLASS_VIDEO = 0x0e,
109 USB_CLASS_PERSONAL_HEALTHCARE = 0x0f,
110 USB_CLASS_DIAGNOSTIC_DEVICE = 0xdc,
111 USB_CLASS_WIRELESS = 0xe0,
112 USB_CLASS_APPLICATION = 0xfe,
113 USB_CLASS_VENDOR_SPEC = 0xff
118 USB_DT_DEVICE = 0x01,
119 USB_DT_CONFIG = 0x02,
120 USB_DT_STRING = 0x03,
121 USB_DT_INTERFACE = 0x04,
122 USB_DT_ENDPOINT = 0x05,
124 USB_DT_DEVICE_CAPABILITY = 0x10,
126 USB_DT_REPORT = 0x22,
127 USB_DT_PHYSICAL = 0x23,
129 USB_DT_SUPERSPEED_HUB = 0x2a,
130 USB_DT_SS_ENDPOINT_COMPANION = 0x30
135 USB_ENDPOINT_IN = 0x80,
136 USB_ENDPOINT_OUT = 0x00
141 USB_TRANSFER_TYPE_CONTROL = 0,
142 USB_TRANSFER_TYPE_ISOCHRONOUS = 1,
143 USB_TRANSFER_TYPE_BULK = 2,
144 USB_TRANSFER_TYPE_INTERRUPT = 3,
145 USB_TRANSFER_TYPE_BULK_STREAM = 4,
197 USB_ISO_SYNC_TYPE_NONE = 0,
198 USB_ISO_SYNC_TYPE_ASYNC = 1,
199 USB_ISO_SYNC_TYPE_ADAPTIVE = 2,
200 USB_ISO_SYNC_TYPE_SYNC = 3
205 USB_ISO_USAGE_TYPE_DATA = 0,
206 USB_ISO_USAGE_TYPE_FEEDBACK = 1,
207 USB_ISO_USAGE_TYPE_IMPLICIT = 2,
Imported from libusb, with some adjustments.
Definition: usb.h:66
Imported from libusb, with some adjustments.
Definition: usb.h:48
uint8_t bDescriptorType
Must match USB_DT_Device.
Definition: usb.h:50
Imported from libusb, with some adjustments.
Definition: usb.h:25
uint8_t bEndpointAddress
Should be one of the usb_endpoint_direction values, the endpoint-number is automatically allocated.
Definition: usb.h:28
uint8_t bDescriptorType
Must match USB_DT_ENDPOINT.
Definition: usb.h:27
Imported from libusb, with some adjustments.
Definition: usb.h:35
uint8_t iInterface
Ignored.
Definition: usb.h:44
uint8_t bDescriptorType
Must match USB_DT_INTERFACE.
Definition: usb.h:37
uint8_t bAlternateSetting
Must match 0.
Definition: usb.h:39
uint8_t bInterfaceNumber
See also USBDS_DEFAULT_InterfaceNumber.
Definition: usb.h:38
Imported from libusb, with some adjustments.
Definition: usb.h:78
uint8_t bDescriptorType
Must match USB_DT_SS_ENDPOINT_COMPANION.
Definition: usb.h:80
Imported from libusb, with some adjustments.
Definition: usb.h:87
uint8_t bDescriptorType
Must match USB_DT_STRING.
Definition: usb.h:89
#define NX_PACKED
Packs a struct so that it won't include padding bytes.
Definition: types.h:63
usb_class_code
Imported from libusb, with changed names.
Definition: usb.h:94
usb_standard_request
Imported from libusb, with changed names.
Definition: usb.h:149
@ USB_REQUEST_SET_CONFIGURATION
Set device configuration.
Definition: usb.h:176
@ USB_REQUEST_SET_ADDRESS
Set device address for all future accesses.
Definition: usb.h:164
@ USB_REQUEST_SYNCH_FRAME
Set then report an endpoint's synchronization frame.
Definition: usb.h:185
@ USB_REQUEST_CLEAR_FEATURE
Clear or disable a specific feature.
Definition: usb.h:154
@ USB_SET_ISOCH_DELAY
Delay from the time a host transmits a packet to the time it is received by the device.
Definition: usb.h:192
@ USB_REQUEST_GET_INTERFACE
Return the selected alternate setting for the specified interface.
Definition: usb.h:179
@ USB_REQUEST_SET_DESCRIPTOR
Used to update existing descriptors or add new descriptors.
Definition: usb.h:170
@ USB_REQUEST_SET_SEL
Sets both the U1 and U2 Exit Latency.
Definition: usb.h:188
@ USB_REQUEST_GET_STATUS
Request status of the specific recipient.
Definition: usb.h:151
@ USB_REQUEST_SET_FEATURE
Set or enable a specific feature.
Definition: usb.h:159
@ USB_REQUEST_SET_INTERFACE
Select an alternate interface for the specified interface.
Definition: usb.h:182
@ USB_REQUEST_GET_DESCRIPTOR
Get the specified descriptor.
Definition: usb.h:167
@ USB_REQUEST_GET_CONFIGURATION
Get the current device configuration value.
Definition: usb.h:173
UsbState
USB Device States, per USB 2.0 spec.
Definition: usb.h:211
@ UsbState_Default
Device is attached, powered, and has been reset, but does not have an address.
Definition: usb.h:215
@ UsbState_Detached
Device is not attached to USB.
Definition: usb.h:212
@ UsbState_Address
Device is attached, powered, has been reset, has an address, but is not configured.
Definition: usb.h:216
@ UsbState_Powered
Device is attached and powered, but has not been reset.
Definition: usb.h:214
@ UsbState_Suspended
Device is attached and powered, but has not seen bus activity for 3ms. Device is suspended and cannot...
Definition: usb.h:218
@ UsbState_Configured
Device is attached, powered, has been reset, has an address, configured, and may be used.
Definition: usb.h:217
@ UsbState_Attached
Device is attached, but is not powered.
Definition: usb.h:213
usb_descriptor_type
Imported from libusb, with changed names.
Definition: usb.h:117
usb_endpoint_direction
Imported from libusb, with changed names.
Definition: usb.h:134
usb_iso_usage_type
Imported from libusb, with changed names.
Definition: usb.h:204
usb_iso_sync_type
Imported from libusb, with changed names.
Definition: usb.h:196
usb_transfer_type
Imported from libusb, with changed names.
Definition: usb.h:140