Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
usb.h File Reference
#include "ultibo/globaltypes.h"
#include "ultibo/globalconst.h"
#include "ultibo/system.h"
#include "ultibo/devices.h"

Go to the source code of this file.

Data Structures

struct  _USB_DEVICE_ID
struct  _USB_INTERFACE_ID
struct  _USB_DEVICE_AND_INTERFACE_ID
struct  _USB_DEVICE_AND_INTERFACE_NO
struct  _USB_CONTROL_SETUP_DATA
struct  _USB_DESCRIPTOR_HEADER
struct  _USB_DEVICE_DESCRIPTOR
struct  _USB_CONFIGURATION_DESCRIPTOR
struct  _USB_INTERFACE_DESCRIPTOR
struct  _USB_ENDPOINT_DESCRIPTOR
struct  _USB_STRING_DESCRIPTOR
struct  _USB_DEVICE_STATUS
struct  _USB_DEVICE
struct  _USB_CONFIGURATION
struct  _USB_INTERFACE
struct  _USB_ALTERNATE
struct  _USB_DRIVER
struct  _USB_HOST
struct  _USB_REQUEST
struct  _USB_HUB_DESCRIPTOR
struct  _USB_PORT_STATUS
struct  _USB_HUB_STATUS
struct  _USB_HUB_DATA
struct  _USB_PORT
struct  _USB_HUB

Macros

#define USB_DEVICE_PREFIX   "USB"
 Name prefix for USB Devices.
#define USB_DRIVER_PREFIX   "USB"
 Name prefix for USB Drivers.
#define USB_HOST_PREFIX   "USBHost"
 Name prefix for USB Hosts.
#define USB_TYPE_NONE   0
#define USB_TYPE_MAX   0
#define USB_STATE_DETACHED   0
#define USB_STATE_DETACHING   1
#define USB_STATE_ATTACHING   2
#define USB_STATE_ATTACHED   3
#define USB_STATE_MAX   3
#define USB_STATUS_UNBOUND   0
#define USB_STATUS_BOUND   1
#define USB_STATUS_MAX   1
#define USB_FLAG_NONE   0x00000000
#define USBHOST_TYPE_NONE   0
#define USBHOST_TYPE_EHCI   1
#define USBHOST_TYPE_OHCI   2
#define USBHOST_TYPE_UHCI   3
#define USBHOST_TYPE_XHCI   4
#define USBHOST_TYPE_DWCOTG   5
#define USBHOST_TYPE_MAX   5
#define USBHOST_STATE_DISABLED   0
#define USBHOST_STATE_ENABLED   1
#define USBHOST_STATE_MAX   1
#define USBHOST_FLAG_NONE   0x00000000
#define USBHOST_FLAG_SHARED   0x00000001
#define USBHOST_FLAG_NOCACHE   0x00000002
#define USB_STATUS_SUCCESS   0
 Function successful.
#define USB_STATUS_DEVICE_DETACHED   1
 USB device was detached.
#define USB_STATUS_DEVICE_UNSUPPORTED   2
 USB device is unsupported by the driver.
#define USB_STATUS_HARDWARE_ERROR   3
 Hardware error of some form occurred.
#define USB_STATUS_INVALID_DATA   4
 Invalid data was received.
#define USB_STATUS_INVALID_PARAMETER   5
 An invalid parameter was passed to the function.
#define USB_STATUS_NOT_PROCESSED   6
 The USB request has been submitted but not yet processed.
#define USB_STATUS_OUT_OF_MEMORY   7
 Failed to allocate memory.
#define USB_STATUS_TIMEOUT   8
 The operation timed out.
#define USB_STATUS_UNSUPPORTED_REQUEST   9
 The request is unsupported.
#define USB_STATUS_HARDWARE_STALL   10
 The device reported an endpoint STALL.
#define USB_STATUS_OPERATION_FAILED   11
 The operation was not able to be completed.
#define USB_STATUS_NOT_BOUND   12
 USB device is not bound to a driver.
#define USB_STATUS_ALREADY_BOUND   13
 USB device is already bound to a driver.
#define USB_STATUS_NOT_READY   14
 USB device is not in a ready state.
#define USB_STATUS_NOT_COMPLETED   15
 The USB request has been scheduled but not yet completed.
#define USB_STATUS_CANCELLED   16
 The USB request was cancelled.
#define USB_STATUS_NOT_VALID   17
 The USB request is not valid.
#define USB_REQUEST_FLAG_NONE   0x00000000
#define USB_REQUEST_FLAG_ALLOCATED   0x00000001
 Request data has been allocated by USBBufferAllocate (and can be freed by USBBufferRelease).
#define USB_REQUEST_FLAG_COMPATIBLE   0x00000002
 Request data is compatible with DMA requirements of host configuration (Can be passed directly to DMA).
#define USB_REQUEST_FLAG_ALIGNED   0x00000004
 Request data is aligned according to host configuration.
#define USB_REQUEST_FLAG_SIZED   0x00000008
 Request data is sized according to host configuration.
#define USB_REQUEST_FLAG_SHARED   0x00000010
 Request data has been allocated from Shared memory.
#define USB_REQUEST_FLAG_NOCACHE   0x00000020
 Request data has been allocated from Non Cached memory.
#define USB_CONTROL_PHASE_SETUP   0
 Setup phase of a Control request (Using SetupData).
#define USB_CONTROL_PHASE_DATA   1
 Data phase of a Control request (Using Data buffer).
#define USB_CONTROL_PHASE_STATUS   2
 Status phase of a Control request (Using StatusData).
#define USB_CONTROL_GET_TIMEOUT   5000
#define USB_CONTROL_SET_TIMEOUT   5000
#define USB_DEFAULT_MAX_PACKET_SIZE   8
#define USB_ALTERNATE_MAX_PACKET_SIZE   64
#define USB_MAX_PACKET_SIZE   1024
#define USB_FRAMES_PER_MS   1
#define USB_UFRAMES_PER_MS   8
#define USB_CONFIGURATION_ATTRIBUTE_RESERVED_HIGH   0x80
#define USB_CONFIGURATION_ATTRIBUTE_SELF_POWERED   0x40
#define USB_CONFIGURATION_ATTRIBUTE_REMOTE_WAKEUP   0x20
#define USB_CONFIGURATION_ATTRIBUTE_RESERVED_LOW   0x1f
#define USB_DEVICE_STATUS_SELF_POWERED   (1 << 0)
#define USB_DEVICE_STATUS_REMOTE_WAKEUP   (1 << 1)
#define USB_ENDPOINT_STATUS_HALT   (1 << 0)
#define USB_SPEED_HIGH   0
 480 Mb/s
#define USB_SPEED_FULL   1
 12 Mb/s
#define USB_SPEED_LOW   2
 1.5 Mb/s
#define USB_SPEED_SUPER   3
 5 Gb/s
#define USB_SPEED_SUPERPLUS   4
 10 Gb/s
#define USB_TRANSFER_TYPE_CONTROL   0
#define USB_TRANSFER_TYPE_ISOCHRONOUS   1
#define USB_TRANSFER_TYPE_BULK   2
#define USB_TRANSFER_TYPE_INTERRUPT   3
#define USB_TRANSFER_TYPE_MASK   0x03
#define USB_TRANSFER_SIZE_8_BIT   0
#define USB_TRANSFER_SIZE_16_BIT   1
#define USB_TRANSFER_SIZE_32_BIT   2
#define USB_TRANSFER_SIZE_64_BIT   3
#define USB_DESCRIPTOR_TYPE_DEVICE   1
#define USB_DESCRIPTOR_TYPE_CONFIGURATION   2
#define USB_DESCRIPTOR_TYPE_STRING   3
#define USB_DESCRIPTOR_TYPE_INTERFACE   4
#define USB_DESCRIPTOR_TYPE_ENDPOINT   5
#define USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER   6
#define USB_DESCRIPTOR_TYPE_OTHER_SPEED_CONFIGURATION   7
#define USB_DESCRIPTOR_TYPE_INTERFACE_POWER   8
#define USB_DESCRIPTOR_TYPE_CLASS_DEVICE   0x21
 (USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_DEVICE
#define USB_DESCRIPTOR_TYPE_CLASS_CONFIGURATION   0x22
 (USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_CONFIGURATION
#define USB_DESCRIPTOR_TYPE_CLASS_STRING   0x23
 (USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_STRING
#define USB_DESCRIPTOR_TYPE_CLASS_INTERFACE   0x24
 (USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_INTERFACE
#define USB_DESCRIPTOR_TYPE_CLASS_ENDPOINT   0x25
 (USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_ENDPOINT
#define USB_DESCRIPTOR_TYPE_HUB   0x29
#define USB_DIRECTION_OUT   0
 Host to Device.
#define USB_DIRECTION_IN   1
 Device to Host.
#define USB_REQUEST_TYPE_STANDARD   0
#define USB_REQUEST_TYPE_CLASS   1
#define USB_REQUEST_TYPE_VENDOR   2
#define USB_REQUEST_TYPE_RESERVED   3
#define USB_REQUEST_RECIPIENT_DEVICE   0
#define USB_REQUEST_RECIPIENT_INTERFACE   1
#define USB_REQUEST_RECIPIENT_ENDPOINT   2
#define USB_REQUEST_RECIPIENT_OTHER   3
#define USB_BMREQUESTTYPE_DIR_OUT   (USB_DIRECTION_OUT << 7)
#define USB_BMREQUESTTYPE_DIR_IN   (USB_DIRECTION_IN << 7)
#define USB_BMREQUESTTYPE_DIR_MASK   (0x01 << 7)
#define USB_BMREQUESTTYPE_TYPE_STANDARD   (USB_REQUEST_TYPE_STANDARD << 5)
#define USB_BMREQUESTTYPE_TYPE_CLASS   (USB_REQUEST_TYPE_CLASS << 5)
#define USB_BMREQUESTTYPE_TYPE_VENDOR   (USB_REQUEST_TYPE_VENDOR << 5)
#define USB_BMREQUESTTYPE_TYPE_RESERVED   (USB_REQUEST_TYPE_RESERVED << 5)
#define USB_BMREQUESTTYPE_TYPE_MASK   (0x03 << 5)
#define USB_BMREQUESTTYPE_RECIPIENT_DEVICE   (USB_REQUEST_RECIPIENT_DEVICE << 0)
#define USB_BMREQUESTTYPE_RECIPIENT_INTERFACE   (USB_REQUEST_RECIPIENT_INTERFACE << 0)
#define USB_BMREQUESTTYPE_RECIPIENT_ENDPOINT   (USB_REQUEST_RECIPIENT_ENDPOINT << 0)
#define USB_BMREQUESTTYPE_RECIPIENT_OTHER   (USB_REQUEST_RECIPIENT_OTHER << 0)
#define USB_BMREQUESTTYPE_RECIPIENT_MASK   (0x1f << 0)
#define USB_DEVICE_REQUEST_GET_STATUS   0
#define USB_DEVICE_REQUEST_CLEAR_FEATURE   1
#define USB_DEVICE_REQUEST_SET_FEATURE   3
#define USB_DEVICE_REQUEST_SET_ADDRESS   5
#define USB_DEVICE_REQUEST_GET_DESCRIPTOR   6
#define USB_DEVICE_REQUEST_SET_DESCRIPTOR   7
#define USB_DEVICE_REQUEST_GET_CONFIGURATION   8
#define USB_DEVICE_REQUEST_SET_CONFIGURATION   9
#define USB_DEVICE_REQUEST_GET_INTERFACE   10
#define USB_DEVICE_REQUEST_SET_INTERFACE   11
#define USB_DEVICE_REQUEST_SYNCH_FRAME   12
#define USB_DEVICE_FEATURE_ENDPOINT_HALT   0
 Endpoint Only.
#define USB_DEVICE_FEATURE_REMOTE_WAKEUP   1
 Device Only.
#define USB_DEVICE_FEATURE_TEST_MODE   2
 Device Only.
#define USB_DEVICE_TEST_MODE_J   0x01
#define USB_DEVICE_TEST_MODE_K   0x02
#define USB_DEVICE_TEST_MODE_SE0_NAK   0x03
#define USB_DEVICE_TEST_MODE_PACKET   0x04
#define USB_DEVICE_TEST_MODE_FORCE_ENABLE   0x05
#define USB_PACKETID_UNDEF_0   0xf0
#define USB_PACKETID_OUT   0xe1
#define USB_PACKETID_ACK   0xd2
#define USB_PACKETID_DATA0   0xc3
#define USB_PACKETID_UNDEF_4   0xb4
#define USB_PACKETID_SOF   0xa5
#define USB_PACKETID_UNDEF_6   0x96
#define USB_PACKETID_UNDEF_7   0x87
#define USB_PACKETID_UNDEF_8   0x78
#define USB_PACKETID_IN   0x69
#define USB_PACKETID_NAK   0x5a
#define USB_PACKETID_DATA1   0x4b
#define USB_PACKETID_PREAMBLE   0x3c
#define USB_PACKETID_SETUP   0x2d
#define USB_PACKETID_STALL   0x1e
#define USB_PACKETID_UNDEF_F   0x0f
#define USB_CLASS_CODE_INTERFACE_SPECIFIC   0x00
 Use class code info from Interface Descriptors.
#define USB_CLASS_CODE_AUDIO   0x01
 Audio device.
#define USB_CLASS_CODE_COMMUNICATIONS_AND_CDC_CONTROL   0x02
 Communication device class.
#define USB_CLASS_CODE_COMMS   USB_CLASS_CODE_COMMUNICATIONS_AND_CDC_CONTROL
#define USB_CLASS_CODE_HID   0x03
 HID device class.
#define USB_CLASS_CODE_PHYSICAL   0x05
 Physical device class.
#define USB_CLASS_CODE_IMAGE   0x06
 Still Imaging device.
#define USB_CLASS_CODE_PRINTER   0x07
 Printer device.
#define USB_CLASS_CODE_MASS_STORAGE   0x08
 Mass Storage device.
#define USB_CLASS_CODE_HUB   0x09
 Hub Device.
#define USB_CLASS_CODE_CDC_DATA   0x0a
 CDC data device.
#define USB_CLASS_CODE_SMART_CARD   0x0b
 Smart Card device.
#define USB_CLASS_CODE_CONTENT_SECURITY   0x0d
 Content Security device.
#define USB_CLASS_CODE_VIDEO   0x0e
 Video device.
#define USB_CLASS_CODE_PERSONAL_HEALTHCARE   0x0f
 Personal Healthcare device.
#define USB_CLASS_CODE_AUDIO_VIDEO   0x10
 Audio/Video Devices.
#define USB_CLASS_CODE_BILLBOARD   0x11
 Billboard Device.
#define USB_CLASS_CODE_DIAGNOSTIC   0xDC
 Diagnostic Device.
#define USB_CLASS_CODE_WIRELESS_CONTROLLER   0xe0
 Wireless Controller.
#define USB_CLASS_CODE_MISCELLANEOUS   0xef
 Miscellaneous.
#define USB_CLASS_CODE_APPLICATION_SPECIFIC   0xfe
 Application Specific.
#define USB_CLASS_CODE_VENDOR_SPECIFIC   0xff
 Vendor Specific.
#define USB_SUBCLASS_CDC_DLCM   0x01
 Direct Line Control Model (USBPSTN1.2).
#define USB_SUBCLASS_CDC_ACM   0x02
 Abstract Control Model (USBPSTN1.2).
#define USB_SUBCLASS_CDC_TCM   0x03
 Telephone Control Model (USBPSTN1.2).
#define USB_SUBCLASS_CDC_MCCM   0x04
 Multi-Channel Control Model (USBISDN1.2).
#define USB_SUBCLASS_CDC_CCM   0x05
 CAPI Control Model (USBISDN1.2).
#define USB_SUBCLASS_CDC_ETHERNET   0x06
 Ethernet Networking Control Model (USBECM1.2).
#define USB_SUBCLASS_CDC_WHCM   0x08
 Wireless Handset Control Model (USBWMC1.1).
#define USB_SUBCLASS_CDC_DMM   0x09
 Device Management Model (USBWMC1.1).
#define USB_SUBCLASS_CDC_MDLM   0x0a
 Mobile Direct Line Model (USBWMC1.1).
#define USB_SUBCLASS_CDC_OBEX   0x0b
 OBEX (USBWMC1.1).
#define USB_SUBCLASS_CDC_EEM   0x0c
 Ethernet Emulation Model (USBEEM1.0).
#define USB_SUBCLASS_CDC_NCM   0x0d
 Network Control Model (USBNCM1.0).
#define USB_SUBCLASS_CDC_MBIM   0x0e
#define USB_SUBCLASS_IMAGE_DEFAULT   0x01
#define USB_SUBCLASS_MASS_STORAGE_DEFAULT   0x00
 SCSI command set not reported, De facto use.
#define USB_SUBCLASS_MASS_STORAGE_RBC   0x01
 Reduced Block Commands (RBC), INCITS 330:2000, available at http://www.t10.org.
#define USB_SUBCLASS_MASS_STORAGE_MMC5   0x02
 Multi-Media Command Set 5 (MMC-5), T10/1675-D available at http://www.t10.org.
#define USB_SUBCLASS_MASS_STORAGE_QIC157   0x03
 Obsolete was QIC-157.
#define USB_SUBCLASS_MASS_STORAGE_UFI   0x04
 UFI Specifies how to interface Floppy Disk Drives to USB.
#define USB_SUBCLASS_MASS_STORAGE_SFF8070I   0x05
 Obsolete Was SFF-8070i.
#define USB_SUBCLASS_MASS_STORAGE_SCSI   0x06
 SCSI transparent command set.
#define USB_SUBCLASS_MASS_STORAGE_LSDFS   0x07
 LSD FS.
#define USB_SUBCLASS_MASS_STORAGE_IEEE1667   0x08
 IEEE 1667 Standard Protocol for Authentication in Host Attachments of Transient Storage Devices (IEEE 1667) available at www.ieee1667.com.
#define USB_SUBCLASS_MASS_STORAGE_VENDOR_SPECIFIC   0xff
 Specific to device vendor, De facto use.
#define USB_SUBCLASS_CONTENT_SECURITY_DEFAULT   0x00
#define USB_SUBCLASS_AUDIO_VIDEO_CONTROL   0x01
 Audio/Video Device – AVControl Interface.
#define USB_SUBCLASS_AUDIO_VIDEO_DATA_VIDEO   0x02
 Audio/Video Device – AVData Video Streaming Interface.
#define USB_SUBCLASS_AUDIO_VIDEO_DATA_AUDIO   0x03
 Audio/Video Device – AVData Audio Streaming Interface.
#define USB_SUBCLASS_BILLBOARD_DEFAULT   0x00
#define USB_SUBCLASS_DIAGNOSTIC_DEFAULT   0x01
#define USB_SUBCLASS_WIRELESS_CONTROLLER_BLUETOOTH   0x01
#define USB_SUBCLASS_WIRELESS_CONTROLLER_USB   0x02
#define USB_SUBCLASS_MISCELLANEOUS_SYNC   0x01
#define USB_SUBCLASS_MISCELLANEOUS_IAD_WAMP   0x02
 Interface Association Descriptor / Wire Adapter Multifunction Peripheral.
#define USB_SUBCLASS_MISCELLANEOUS_CBAF   0x03
 Cable Based Association Framework.
#define USB_SUBCLASS_MISCELLANEOUS_RNDIS   0x04
#define USB_SUBCLASS_MISCELLANEOUS_USB3VISION   0x05
#define USB_SUBCLASS_APPLICATION_SPECIFIC_DFU   0x01
#define USB_SUBCLASS_APPLICATION_SPECIFIC_IRDA   0x02
#define USB_SUBCLASS_APPLICATION_SPECIFIC_TMC   0x02
#define USB_SUBCLASS_VENDOR_SPECIFIC   0xff
 Vendor Specific.
#define USB_PROTOCOL_CDC_ACM_NONE   0
 Abstract Control Model - No class specific protocol required.
#define USB_PROTOCOL_CDC_ACM_AT_V25TER   1
 Abstract Control Model - AT Commands: V.250 etc.
#define USB_PROTOCOL_CDC_ACM_AT_PCCA101   2
 Abstract Control Model - AT Commands defined by PCCA-101.
#define USB_PROTOCOL_CDC_ACM_AT_PCCA101_WAKE   3
 Abstract Control Model - AT Commands defined by PCCA-101 & Annex O.
#define USB_PROTOCOL_CDC_ACM_AT_GSM   4
 Abstract Control Model - AT Commands defined by GSM 07.07.
#define USB_PROTOCOL_CDC_ACM_AT_3G   5
 Abstract Control Model - AT Commands defined by 3GPP 27.007.
#define USB_PROTOCOL_CDC_ACM_AT_CDMA   6
 Abstract Control Model - AT Commands defined by TIA for CDMA.
#define USB_PROTOCOL_CDC_ACM_VENDOR   0xff
 Abstract Control Model - Vendor-specific.
#define USB_PROTOCOL_CDC_EEM   7
 Ethernet Emulation Model.
#define USB_PROTOCOL_CDC_NCM_NTB   1
 Network Control Model - Network Transfer Block.
#define USB_PROTOCOL_CDC_MBIM_NTB   2
 Network Transfer Block.
#define USB_PROTOCOL_IMAGE_DEFAULT   0x01
#define USB_PROTOCOL_MASS_STORAGE_CBI   0x00
 CBI (with command completion interrupt) USB Mass Storage Class Control/Bulk/Interrupt Transport.
#define USB_PROTOCOL_MASS_STORAGE_CB   0x01
 CBI (with no command completion interrupt) USB Mass Storage Class Control/Bulk/Interrupt Transport.
#define USB_PROTOCOL_MASS_STORAGE_BBB   0x50
 BBB USB Mass Storage Class Bulk-Only Transport.
#define USB_PROTOCOL_MASS_STORAGE_UAS   0x62
 UAS.
#define USB_PROTOCOL_MASS_STORAGE_VENDOR_SPECIFIC   0xff
 Specific to device vendor, De facto use.
#define USB_PROTOCOL_HUB_FULLSPEED   0x00
 Full speed Hub.
#define USB_PROTOCOL_HUB_HIGHSPEED_SINGLE_TT   0x01
 Hi-speed hub with single Transaction Translator.
#define USB_PROTOCOL_HUB_HIGHSPEED_MULTI_TT   0x02
 Hi-speed hub with multiple Transaction Translators.
#define USB_PROTOCOL_CONTENT_SECURITY_DEFAULT   0x00
#define USB_PROTOCOL_AUDIO_VIDEO_DEFAULT   0x00
#define USB_PROTOCOL_BILLBOARD_DEFAULT   0x00
#define USB_PROTOCOL_DIAGNOSTIC_DEFAULT   0x01
#define USB_PROTOCOL_WIRELESS_CONTROLLER_BLUETOOTH   0x01
 See: http://www.bluetooth.com/.
#define USB_PROTOCOL_WIRELESS_CONTROLLER_UWB   0x02
 See: Wireless USB Specification in Chapter 8.
#define USB_PROTOCOL_WIRELESS_CONTROLLER_NDIS   0x03
 See: http://www.microsoft.com/windowsmobile/mobileoperators/default.mspx.
#define USB_PROTOCOL_WIRELESS_CONTROLLER_BLUETOOTH_AMP   0x04
 See: http://www.bluetooth.com/.
#define USB_PROTOCOL_WIRELESS_CONTROLLER_USB_HOST   0x01
 Host Wire Adapter Control/Data interface. Definition can be found in the Wireless USB Specification in Chapter 8.
#define USB_PROTOCOL_WIRELESS_CONTROLLER_USB_DEVICE   0x02
 Device Wire Adapter Control/Data interface. Definition can be found in the Wireless USB Specification in Chapter 8.
#define USB_PROTOCOL_WIRELESS_CONTROLLER_USB_DEVICE_ISOC   0x03
 Device Wire Adapter Isochronous interface. Definition can be found in the Wireless USB Specification in Chapter 8.
#define USB_PROTOCOL_MISCELLANEOUS_ACTIVESYNC   0x01
 Active Sync device.
#define USB_PROTOCOL_MISCELLANEOUS_PALMSYNC   0x02
 Palm Sync.
#define USB_PROTOCOL_MISCELLANEOUS_IAD   0x01
 Interface Association Descriptor. The usage of this class code triple is defined in the Interface Association Descriptor ECN.
#define USB_PROTOCOL_MISCELLANEOUS_WAMP   0x02
 Wire Adapter Multifunction Peripheral programming interface. Definition can be found in the Wireless USB Specification in Chapter 8.
#define USB_PROTOCOL_MISCELLANEOUS_CBAF   0x01
 Cable Based Association Framework. This is defined in the Association Model addendum to the Wireless USB specification.
#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_ETHERNET   0x01
 RNDIS over Ethernet.
#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_WIFI   0x02
 RNDIS over WiFi.
#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_WIMAX   0x03
 RNDIS over WiMAX.
#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_WWAN   0x04
 RNDIS over WWAN.
#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_IPV4   0x05
 RNDIS for Raw IPv4.
#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_IPV6   0x06
 RNDIS for Raw IPv6.
#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_GPRS   0x07
 RNDIS for GPRS.
#define USB_PROTOCOL_MISCELLANEOUS_USB3VISION_CONTROL   0x00
 USB3 Vision Control Interface.
#define USB_PROTOCOL_MISCELLANEOUS_USB3VISION_EVENT   0x01
 USB3 Vision Event Interface.
#define USB_PROTOCOL_MISCELLANEOUS_USB3VISION_STREAM   0x02
 USB3 Vision Streaming Interface.
#define USB_PROTOCOL_APPLICATION_SPECIFIC_DFU_DEFAULT   0x01
 Device Firmware Upgrade.
#define USB_PROTOCOL_APPLICATION_SPECIFIC_IRDA_DEFAULT   0x00
 IRDA Bridge device.
#define USB_PROTOCOL_APPLICATION_SPECIFIC_TMC_DEFAULT   0x00
 USB Test and Measurement Device.
#define USB_PROTOCOL_APPLICATION_SPECIFIC_TMC_488   0x01
 USB Test and Measurement Device conforming to the USBTMC USB488 Subclass Specification.
#define USB_LANG_ARABIC   0x01
 Arabic.
#define USB_LANG_BULGARIAN   0x02
 Bulgarian.
#define USB_LANG_CATALAN   0x03
 Catalan.
#define USB_LANG_CHINESE   0x04
 Chinese.
#define USB_LANG_CZECH   0x05
 Czech.
#define USB_LANG_DANISH   0x06
 Danish.
#define USB_LANG_GERMAN   0x07
 German.
#define USB_LANG_GREEK   0x08
 Greek.
#define USB_LANG_ENGLISH   0x09
 English.
#define USB_LANG_SPANISH   0x0a
 Spanish.
#define USB_LANG_FINNISH   0x0b
 Finnish.
#define USB_LANG_FRENCH   0x0c
 French.
#define USB_LANG_HEBREW   0x0d
 Hebrew.
#define USB_LANG_HUNGARIAN   0x0e
 Hungarian.
#define USB_LANG_ICELANDIC   0x0f
 Icelandic.
#define USB_LANG_ITALIAN   0x10
 Italian.
#define USB_LANG_JAPANESE   0x11
 Japanese.
#define USB_LANG_KOREAN   0x12
 Korean.
#define USB_LANG_DUTCH   0x13
 Dutch.
#define USB_LANG_NORWEGIAN   0x14
 Norwegian.
#define USB_LANG_POLISH   0x15
 Polish.
#define USB_LANG_PORTUGUESE   0x16
 Portuguese.
#define USB_LANG_ROMANIAN   0x18
 Romanian.
#define USB_LANG_RUSSIAN   0x19
 Russian.
#define USB_LANG_CROATIAN   0x1a
 Croatian.
#define USB_LANG_SERBIAN   0x1a
 Serbian.
#define USB_LANG_SLOVAK   0x1b
 Slovak.
#define USB_LANG_ALBANIAN   0x1c
 Albanian.
#define USB_LANG_SWEDISH   0x1d
 Swedish.
#define USB_LANG_THAI   0x1e
 Thai.
#define USB_LANG_TURKISH   0x1f
 Turkish.
#define USB_LANG_URDU   0x20
 Urdu.
#define USB_LANG_INDONESIAN   0x21
 Indonesian.
#define USB_LANG_UKRANIAN   0x22
 Ukrainian.
#define USB_LANG_BELARUSIAN   0x23
 Belarusian.
#define USB_LANG_SLOVENIAN   0x24
 Slovenian.
#define USB_LANG_ESTONIAN   0x25
 Estonian.
#define USB_LANG_LATVIAN   0x26
 Latvian.
#define USB_LANG_LITHUANIAN   0x27
 Lithuanian.
#define USB_LANG_FARSI   0x29
 Farsi.
#define USB_LANG_VIETNAMESE   0x2a
 Vietnamese.
#define USB_LANG_ARMENIAN   0x2b
 Armenian.
#define USB_LANG_AZERI   0x2c
 Azeri.
#define USB_LANG_BASQUE   0x2d
 Basque.
#define USB_LANG_MACEDONIAN   0x2f
 Macedonian.
#define USB_LANG_AFRIKAANS   0x36
 Afrikaans.
#define USB_LANG_GEORGIAN   0x37
 Georgian.
#define USB_LANG_FAEROESE   0x38
 Faeroese.
#define USB_LANG_HINDI   0x39
 Hindi.
#define USB_LANG_MALAY   0x3e
 Malay.
#define USB_LANG_KAZAK   0x3f
 Kazak.
#define USB_LANG_SWAHILI   0x41
 Swahili.
#define USB_LANG_UZBEK   0x43
 Uzbek.
#define USB_LANG_TATAR   0x44
 Tatar.
#define USB_LANG_BENGALI   0x45
 Bengali.
#define USB_LANG_PUNJABI   0x46
 Punjabi.
#define USB_LANG_GUJARATI   0x47
 Gujarati.
#define USB_LANG_ORIYA   0x48
 Oriya.
#define USB_LANG_TAMIL   0x49
 Tamil.
#define USB_LANG_TELUGU   0x4a
 Telugu.
#define USB_LANG_KANNADA   0x4b
 Kannada.
#define USB_LANG_MALAYALAM   0x4c
 Malayalam.
#define USB_LANG_ASSAMESE   0x4d
 Assamese.
#define USB_LANG_MARATHI   0x4e
 Marathi.
#define USB_LANG_SANSKRIT   0x4f
 Sanskrit.
#define USB_LANG_KONKANI   0x57
 Konkani.
#define USB_LANG_MANIPURI   0x58
 Manipuri.
#define USB_LANG_SINDHI   0x59
 Sindhi.
#define USB_LANG_KASHMIRI   0x60
 Kashmiri.
#define USB_LANG_NEPALI   0x61
 Nepali.
#define USB_LANG_HID   0xff
 Reserved for USB HID Class use.
#define USB_PRIMARY_LANGUAGE_MASK   0x3ff
#define USB_SUBLANG_ARABIC_SAUDI_ARABIA   0x01
 Arabic (Saudi Arabia).
#define USB_SUBLANG_ARABIC_IRAQ   0x02
 Arabic (Iraq).
#define USB_SUBLANG_ARABIC_EGYPT   0x03
 Arabic (Egypt).
#define USB_SUBLANG_ARABIC_LIBYA   0x04
 Arabic (Libya).
#define USB_SUBLANG_ARABIC_ALGERIA   0x05
 Arabic (Algeria).
#define USB_SUBLANG_ARABIC_MOROCCO   0x06
 Arabic (Morocco).
#define USB_SUBLANG_ARABIC_TUNISIA   0x07
 Arabic (Tunisia).
#define USB_SUBLANG_ARABIC_OMAN   0x08
 Arabic (Oman).
#define USB_SUBLANG_ARABIC_YEMEN   0x09
 Arabic (Yemen).
#define USB_SUBLANG_ARABIC_SYRIA   0x10
 Arabic (Syria).
#define USB_SUBLANG_ARABIC_JORDAN   0x11
 Arabic (Jordan).
#define USB_SUBLANG_ARABIC_LEBANON   0x12
 Arabic (Lebanon).
#define USB_SUBLANG_ARABIC_KUWAIT   0x13
 Arabic (Kuwait).
#define USB_SUBLANG_ARABIC_UAE   0x14
 Arabic (U.A.E.).
#define USB_SUBLANG_ARABIC_BAHRAIN   0x15
 Arabic (Bahrain).
#define USB_SUBLANG_ARABIC_QATAR   0x16
 Arabic (Qatar).
#define USB_SUBLANG_AZERI_CYRILLIC   0x01
 Azeri (Cyrillic).
#define USB_SUBLANG_AZERI_LATIN   0x02
 Azeri (Latin).
#define USB_SUBLANG_CHINESE_TRADITIONAL   0x01
 Chinese (Traditional).
#define USB_SUBLANG_CHINESE_SIMPLIFIED   0x02
 Chinese (Simplified).
#define USB_SUBLANG_CHINESE_HONGKONG   0x03
 Chinese (Hong Kong SAR, PRC).
#define USB_SUBLANG_CHINESE_SINGAPORE   0x04
 Chinese (Singapore).
#define USB_SUBLANG_CHINESE_MACAU   0x05
 Chinese (Macau SAR).
#define USB_SUBLANG_DUTCH   0x01
 Dutch.
#define USB_SUBLANG_DUTCH_BELGIAN   0x02
 Dutch (Belgian).
#define USB_SUBLANG_ENGLISH_US   0x01
 English (US).
#define USB_SUBLANG_ENGLISH_UK   0x02
 English (UK).
#define USB_SUBLANG_ENGLISH_AUS   0x03
 English (Australian).
#define USB_SUBLANG_ENGLISH_CAN   0x04
 English (Canadian).
#define USB_SUBLANG_ENGLISH_NZ   0x05
 English (New Zealand).
#define USB_SUBLANG_ENGLISH_EIRE   0x06
 English (Ireland).
#define USB_SUBLANG_ENGLISH_SOUTH_AFRICA   0x07
 English (South Africa).
#define USB_SUBLANG_ENGLISH_JAMAICA   0x08
 English (Jamaica).
#define USB_SUBLANG_ENGLISH_CARIBBEAN   0x09
 English (Caribbean).
#define USB_SUBLANG_ENGLISH_BELIZE   0x0a
 English (Belize).
#define USB_SUBLANG_ENGLISH_TRINIDAD   0x0b
 English (Trinidad).
#define USB_SUBLANG_ENGLISH_PHILIPPINES   0x0c
 English (Zimbabwe).
#define USB_SUBLANG_ENGLISH_ZIMBABWE   0x0d
 English (Philippines).
#define USB_SUBLANG_FRENCH   0x01
 French.
#define USB_SUBLANG_FRENCH_BELGIAN   0x02
 French (Belgian).
#define USB_SUBLANG_FRENCH_CANADIAN   0x03
 French (Canadian).
#define USB_SUBLANG_FRENCH_SWISS   0x04
 French (Swiss).
#define USB_SUBLANG_FRENCH_LUXEMBOURG   0x05
 French (Luxembourg).
#define USB_SUBLANG_FRENCH_MONACO   0x06
 French (Monaco).
#define USB_SUBLANG_GERMAN   0x01
 German.
#define USB_SUBLANG_GERMAN_SWISS   0x02
 German (Swiss).
#define USB_SUBLANG_GERMAN_AUSTRIAN   0x03
 German (Austrian).
#define USB_SUBLANG_GERMAN_LUXEMBOURG   0x04
 German (Luxembourg).
#define USB_SUBLANG_GERMAN_LIECHTENSTEIN   0x05
 German (Liechtenstein).
#define USB_SUBLANG_ITALIAN   0x01
 Italian.
#define USB_SUBLANG_ITALIAN_SWISS   0x02
 Italian (Swiss).
#define USB_SUBLANG_KASHMIRI_INDIA   0x02
 Kashmiri (India).
#define USB_SUBLANG_KOREAN   0x01
 Korean.
#define USB_SUBLANG_LITHUANIAN   0x01
 Lithuanian.
#define USB_SUBLANG_MALAY_MALAYSIA   0x01
 Malay (Malaysia).
#define USB_SUBLANG_MALAY_BRUNEI_DARUSSALAM   0x02
 Malay (Brunei Darassalam).
#define USB_SUBLANG_NEPALI_INDIA   0x02
 Nepali (India).
#define USB_SUBLANG_NORWEGIAN_BOKMAL   0x01
 Norwegian (Bokmal).
#define USB_SUBLANG_NORWEGIAN_NYNORSK   0x02
 Norwegian (Nynorsk).
#define USB_SUBLANG_PORTUGUESE   0x01
 Portuguese (Brazilian).
#define USB_SUBLANG_PORTUGUESE_BRAZILIAN   0x02
 Portuguese.
#define USB_SUBLANG_SERBIAN_LATIN   0x02
 Serbian (Latin).
#define USB_SUBLANG_SERBIAN_CYRILLIC   0x03
 Serbian (Cyrillic).
#define USB_SUBLANG_SPANISH   0x01
 Spanish (Castilian).
#define USB_SUBLANG_SPANISH_MEXICAN   0x02
 Spanish (Mexican).
#define USB_SUBLANG_SPANISH_MODERN   0x03
 Spanish (Modern).
#define USB_SUBLANG_SPANISH_GUATEMALA   0x04
 Spanish (Guatemala).
#define USB_SUBLANG_SPANISH_COSTA_RICA   0x05
 Spanish (Costa Rica).
#define USB_SUBLANG_SPANISH_PANAMA   0x06
 Spanish (Panama).
#define USB_SUBLANG_SPANISH_DOMINICAN_REPUBLIC   0x07
 Spanish (Dominican Republic).
#define USB_SUBLANG_SPANISH_VENEZUELA   0x08
 Spanish (Venezuela).
#define USB_SUBLANG_SPANISH_COLOMBIA   0x09
 Spanish (Colombia).
#define USB_SUBLANG_SPANISH_PERU   0x0a
 Spanish (Peru).
#define USB_SUBLANG_SPANISH_ARGENTINA   0x0b
 Spanish (Argentina).
#define USB_SUBLANG_SPANISH_ECUADOR   0x0c
 Spanish (Ecuador).
#define USB_SUBLANG_SPANISH_CHILE   0x0d
 Spanish (Chile).
#define USB_SUBLANG_SPANISH_URUGUAY   0x0e
 Spanish (Uruguay).
#define USB_SUBLANG_SPANISH_PARAGUAY   0x0f
 Spanish (Paraguay).
#define USB_SUBLANG_SPANISH_BOLIVIA   0x10
 Spanish (Bolivia).
#define USB_SUBLANG_SPANISH_EL_SALVADOR   0x11
 Spanish (El Salvador).
#define USB_SUBLANG_SPANISH_HONDURAS   0x12
 Spanish (Honduras).
#define USB_SUBLANG_SPANISH_NICARAGUA   0x13
 Spanish (Nicaragua).
#define USB_SUBLANG_SPANISH_PUERTO_RICO   0x14
 Spanish (Puerto Rico).
#define USB_SUBLANG_SWEDISH   0x01
 Swedish.
#define USB_SUBLANG_SWEDISH_FINLAND   0x02
 Swedish (Finland).
#define USB_SUBLANG_URDU_PAKISTAN   0x01
 Urdu (Pakistan).
#define USB_SUBLANG_URDU_INDIA   0x02
 Urdu (India).
#define USB_SUBLANG_UZBEK_LATIN   0x01
 Uzbek (Latin).
#define USB_SUBLANG_UZBEK_CYRILLIC   0x02
 Uzbek (Cyrillic).
#define USB_SUBLANG_HID_USAGE_DATA_DESCRIPTOR   0x01
 HID (Usage Data Descriptor).
#define USB_SUBLANG_HID_VENDOR_DEFINED_1   0x3c
 HID (Vendor Defined 1).
#define USB_SUBLANG_HID_VENDOR_DEFINED_2   0x3d
 HID (Vendor Defined 2).
#define USB_SUBLANG_HID_VENDOR_DEFINED_3   0x3e
 HID (Vendor Defined 3).
#define USB_SUBLANG_HID_VENDOR_DEFINED_4   0x3f
 HID (Vendor Defined 4).
#define USB_LANGID_US_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_US << 10))
 English (US).
#define USB_LANGID_UK_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_UK << 10))
 English (UK).
#define USB_LANGID_AUS_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_AUS << 10))
 English (Australian).
#define USB_LANGID_CAN_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_CAN << 10))
 English (Canadian).
#define USB_LANGID_NZ_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_NZ << 10))
 English (New Zealand).
#define USB_LANGID_EIRE_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_EIRE << 10))
 English (Ireland).
#define USB_LANGID_SOUTH_AFRICA_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_SOUTH_AFRICA << 10))
 English (South Africa).
#define USB_LANGID_JAMAICA_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_JAMAICA << 10))
 English (Jamaica).
#define USB_LANGID_CARIBBEAN_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_CARIBBEAN << 10))
 English (Caribbean).
#define USB_LANGID_BELIZE_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_BELIZE << 10))
 English (Belize).
#define USB_LANGID_TRINIDAD_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_TRINIDAD << 10))
 English (Trinidad).
#define USB_LANGID_PHILIPPINES_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_PHILIPPINES << 10))
 English (Philippines).
#define USB_LANGID_ZIMBABWE_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_ZIMBABWE << 10))
 English (Zimbabwe).
#define USB_LANGID_USAGE_HID   (USB_LANG_HID | (USB_SUBLANG_HID_USAGE_DATA_DESCRIPTOR << 10))
#define USB_LANGID_VENDOR1_HID   (USB_LANG_HID | (USB_SUBLANG_HID_VENDOR_DEFINED_1 << 10))
#define USB_LANGID_VENDOR2_HID   (USB_LANG_HID | (USB_SUBLANG_HID_VENDOR_DEFINED_2 << 10))
#define USB_LANGID_VENDOR3_HID   (USB_LANG_HID | (USB_SUBLANG_HID_VENDOR_DEFINED_3 << 10))
#define USB_LANGID_VENDOR4_HID   (USB_LANG_HID | (USB_SUBLANG_HID_VENDOR_DEFINED_4 << 10))
#define USB_VENDORID_REALTEK   0x0BDA
 Realtek.
#define USB_HUB_PREFIX   "USBHub"
 Name prefix for USB Hubs.
#define USBHUB_TYPE_NONE   0
#define USBHUB_TYPE_MAX   0
#define USBHUB_STATE_DETACHED   0
#define USBHUB_STATE_DETACHING   1
#define USBHUB_STATE_ATTACHING   2
#define USBHUB_STATE_ATTACHED   3
#define USBHUB_STATE_MAX   3
#define USBHUB_FLAG_NONE   0x00000000
#define USBHUB_FLAG_COMPOUND   0x00000001
 The Hub is part of a compound device.
#define USBHUB_FLAG_PORT_POWER   0x00000002
 The Hub supports per port power switching.
#define USBHUB_FLAG_PORT_PROTECTION   0x00000004
 The Hub supports per port over current protection.
#define USBHUB_FLAG_MULTI_TRANSLATOR   0x00000008
 The Hub includes multiple transaction translators (1 per port).
#define USBHUB_THREAD_STACK_SIZE   SIZE_32K
 Stack size of USB hub thread.
#define USBHUB_THREAD_PRIORITY   THREAD_PRIORITY_HIGHEST
 Priority of USB hub thread.
#define USBHUB_THREAD_NAME   "USB Hub"
 Name of USB hub thread.
#define USBHUB_DEVICE_DESCRIPTION   "USB Hub"
 Description of USB hub device.
#define USBHUB_DRIVER_NAME   "USB Hub Driver"
 Name of USB hub driver.
#define USB_PORT_RESET_TIMEOUT   500
 Maximum milliseconds to wait for a port to reset (500 is the same value that Linux uses).
#define USB_PORT_RESET_RECOVERY   30
 Milliseconds to wait after port reset to allow the device attached to the port to recover before any data transfers. USB 2.0 spec says 10ms.
#define USB_PORT_SHORT_RESET_DELAY   10
 Milliseconds between each status check on the port while waiting for it to finish being reset (Linux uses 10ms as the default value).
#define USB_PORT_LONG_RESET_DELAY   200
 Milliseconds between each status check on the port while waiting for it to finish being reset (Linux uses 200ms for Low Speed devices).
#define USB_PORT_ROOT_RESET_DELAY   60
 Milliseconds between each status check on the port while waiting for it to finish being reset (Linux uses 60ms for Root hub ports).
#define USB_ATTACH_DEBOUNCE_INTERVAL   100
 Milliseconds to wait after attachment for debounce (TATTDB).
#define USB_ADDRESS_COMPLETION_TIME   50
 Milliseconds to wait for set address completion (TDSETADDR).
#define USB_HUB_CHARACTERISTIC_LPSM   (3 << 0)
 Logical Power Switching Mode.
#define USB_HUB_CHARACTERISTIC_LPSM_GANGED   (0 << 0)
 Ganged power switching (all ports power at once).
#define USB_HUB_CHARACTERISTIC_LPSM_PORT   (1 << 0)
 Individual port power switching.
#define USB_HUB_CHARACTERISTIC_IS_COMPOUND_DEVICE   (1 << 2)
 Identifies a Compound Device (0 = Hub is not part of a compound device / 1 = Hub is part of a compound device).
#define USB_HUB_CHARACTERISTIC_OCPM   (3 << 3)
 Over-current Protection Mode.
#define USB_HUB_CHARACTERISTIC_OCPM_GLOBAL   (0 << 3)
 Global Over-current Protection.
#define USB_HUB_CHARACTERISTIC_OCPM_PORT   (1 << 3)
 Individual Port Over-current Protection.
#define USB_HUB_CHARACTERISTIC_OCPM_NONE   (2 << 3)
 No Over-current Protection.
#define USB_HUB_CHARACTERISTIC_TTTT   (3 << 5)
 TT Think Time.
#define USB_HUB_CHARACTERISTIC_TTTT_8   (0 << 5)
 TT requires at most 8 FS bit times of inter transaction gap.
#define USB_HUB_CHARACTERISTIC_TTTT_16   (1 << 5)
 TT requires at most 16 FS bit times of inter transaction gap.
#define USB_HUB_CHARACTERISTIC_TTTT_24   (2 << 5)
 TT requires at most 24 FS bit times of inter transaction gap.
#define USB_HUB_CHARACTERISTIC_TTTT_32   (3 << 5)
 TT requires at most 32 FS bit times of inter transaction gap.
#define USB_HUB_CHARACTERISTIC_PORT_INDICATOR   (1 << 7)
 Port Indicators Supported (0 = Port Indicators are not supported / 1 = Port Indicators are supported).
#define USB_C_HUB_LOCAL_POWER   0
#define USB_C_HUB_OVER_CURRENT   1
#define USB_PORT_CONNECTION   0
#define USB_PORT_ENABLE   1
#define USB_PORT_SUSPEND   2
#define USB_PORT_OVER_CURRENT   3
#define USB_PORT_RESET   4
#define USB_PORT_POWER   8
#define USB_PORT_LOW_SPEED   9
#define USB_C_PORT_CONNECTION   16
#define USB_C_PORT_ENABLE   17
#define USB_C_PORT_SUSPEND   18
#define USB_C_PORT_OVER_CURRENT   19
#define USB_C_PORT_RESET   20
#define USB_PORT_TEST   21
#define USB_PORT_INDICATOR   22
#define USB_HUB_REQUEST_GET_STATUS   0
#define USB_HUB_REQUEST_CLEAR_FEATURE   1
#define USB_HUB_REQUEST_SET_FEATURE   3
#define USB_HUB_REQUEST_GET_DESCRIPTOR   6
#define USB_HUB_REQUEST_SET_DESCRIPTOR   7
#define USB_HUB_REQUEST_CLEAR_TT_BUFFER   8
#define USB_HUB_REQUEST_RESET_TT   9
#define USB_HUB_REQUEST_GET_TT_STATE   10
#define USB_HUB_REQUEST_STOP_TT   11
#define USB_PORT_STATUS_CONNNECTED   (1 << 0)
#define USB_PORT_STATUS_ENABLED   (1 << 1)
#define USB_PORT_STATUS_SUSPENDED   (1 << 2)
#define USB_PORT_STATUS_OVERCURRENT   (1 << 3)
#define USB_PORT_STATUS_RESET   (1 << 4)
#define USB_PORT_STATUS_POWERED   (1 << 8)
#define USB_PORT_STATUS_LOW_SPEED_ATTACHED   (1 << 9)
#define USB_PORT_STATUS_HIGH_SPEED_ATTACHED   (1 << 10)
#define USB_PORT_STATUS_TEST_MODE   (1 << 11)
#define USB_PORT_STATUS_INDICATOR_CONTROL   (1 << 12)
#define USB_PORT_CHANGE_CONNECTED   (1 << 0)
#define USB_PORT_CHANGE_ENABLED   (1 << 1)
#define USB_PORT_CHANGE_SUSPENDED   (1 << 2)
#define USB_PORT_CHANGE_OVERCURRENT   (1 << 3)
#define USB_PORT_CHANGE_RESET   (1 << 4)
#define USB_HUB_STATUS_LOCAL_POWER   (1 << 0)
#define USB_HUB_STATUS_OVERCURRENT   (1 << 1)
#define USB_HUB_CHANGE_LOCAL_POWER   (1 << 0)
#define USB_HUB_CHANGE_OVERCURRENT   (1 << 1)

Typedefs

typedef struct _USB_DEVICE_ID USB_DEVICE_ID
 USB Device Id record for driver device identification (Not part of USB specification).
typedef struct _USB_INTERFACE_ID USB_INTERFACE_ID
 USB Interface Id record for driver device identification (Not part of USB specification).
typedef struct _USB_DEVICE_AND_INTERFACE_ID USB_DEVICE_AND_INTERFACE_ID
 USB Device and Interface Id record for driver device identification (Not part of USB specification).
typedef struct _USB_DEVICE_AND_INTERFACE_NO USB_DEVICE_AND_INTERFACE_NO
 USB Device and Interface No record for driver device identification (Not part of USB specification).
typedef struct _USB_CONTROL_SETUP_DATA USB_CONTROL_SETUP_DATA
typedef struct _USB_DESCRIPTOR_HEADER USB_DESCRIPTOR_HEADER
typedef struct _USB_DEVICE_DESCRIPTOR USB_DEVICE_DESCRIPTOR
typedef struct _USB_CONFIGURATION_DESCRIPTOR USB_CONFIGURATION_DESCRIPTOR
typedef struct _USB_INTERFACE_DESCRIPTOR USB_INTERFACE_DESCRIPTOR
typedef struct _USB_ENDPOINT_DESCRIPTOR USB_ENDPOINT_DESCRIPTOR
typedef struct _USB_STRING_DESCRIPTOR USB_STRING_DESCRIPTOR
typedef uint16_t USB_STRING_DESCRIPTOR_STRING[126]
 Array type to allow typecasting of bString element in TUSBStringDescriptor (Maximum size of descriptor is 255) (126 x 2 + 2 = 254).
typedef uint16_t USB_STRING_DESCRIPTOR_LANGIDS[126]
 Array type to allow typecasting of bString element in TUSBStringDescriptor (Maximum size of descriptor is 255) (126 x 2 + 2 = 254).
typedef struct _USB_DEVICE_STATUS USB_DEVICE_STATUS
typedef struct _USB_HOST USB_HOST
 Forward declared to satisfy USBDevice.
typedef struct _USB_DRIVER USB_DRIVER
 Forward declared to satisfy USBDevice.
typedef struct _USB_ALTERNATE USB_ALTERNATE
 Forward declared to satisfy USBDevice.
typedef struct _USB_INTERFACE USB_INTERFACE
 Forward declared to satisfy USBDevice.
typedef struct _USB_CONFIGURATION USB_CONFIGURATION
 Forward declared to satisfy USBDevice.
typedef struct _USB_DEVICE USB_DEVICE
typedef uint32_t STDCALL(* usb_device_bind_proc) (USB_DEVICE *device)
typedef uint32_t STDCALL(* usb_device_unbind_proc) (USB_DEVICE *device, USB_DRIVER *driver)
typedef uint32_t STDCALL(* usb_device_enumerate_cb) (USB_DEVICE *device, void *data)
typedef uint32_t STDCALL(* usb_device_notification_cb) (DEVICE *device, void *data, uint32_t notification)
typedef uint32_t STDCALL(* usb_driver_enumerate_cb) (USB_DRIVER *driver, void *data)
typedef uint32_t STDCALL(* usb_driver_bind_proc) (USB_DEVICE *device, USB_INTERFACE *interrface)
typedef uint32_t STDCALL(* usb_driver_unbind_proc) (USB_DEVICE *device, USB_INTERFACE *interrface)
typedef struct _USB_REQUEST USB_REQUEST
 Forward declared to satisfy USBHost.
typedef uint32_t STDCALL(* usb_host_enumerate_cb) (USB_HOST *host, void *data)
typedef uint32_t STDCALL(* usb_host_notification_cb) (DEVICE *device, void *data, uint32_t notification)
typedef uint32_t STDCALL(* usb_host_start_proc) (USB_HOST *host)
typedef uint32_t STDCALL(* usb_host_stop_proc) (USB_HOST *host)
typedef uint32_t STDCALL(* usb_host_reset_proc) (USB_HOST *host)
typedef uint32_t STDCALL(* usb_host_submit_proc) (USB_HOST *host, USB_REQUEST *request)
typedef uint32_t STDCALL(* usb_host_cancel_proc) (USB_HOST *host, USB_REQUEST *request)
typedef void STDCALL(* usb_request_completed_cb) (USB_REQUEST *request)
typedef struct _USB_HUB_DESCRIPTOR USB_HUB_DESCRIPTOR
typedef uint8_t USB_HUB_DESCRIPTOR_DATA[64]
 Array type to allow typecasting of varData element in TUSBHubDescriptor.
typedef struct _USB_PORT_STATUS USB_PORT_STATUS
typedef struct _USB_HUB_STATUS USB_HUB_STATUS
typedef struct _USB_HUB_DATA USB_HUB_DATA
typedef struct _USB_HUB USB_HUB
 Forward declared to satisfy USBPort.
typedef struct _USB_PORT USB_PORT
typedef uint32_t STDCALL(* usb_hub_enumerate_cb) (USB_HUB *hub, void *data)
typedef uint32_t STDCALL(* usb_hub_notification_cb) (DEVICE *device, void *data, uint32_t notification)
typedef void STDCALL(* usb_log_output_proc) (const char *text, void *data)

Functions

uint32_t STDCALL usb_start (void)
 Starts all registered USB hosts, starts the USB hub thread and begins the USB enumeration process. USB enumeration will continue after this function returns as devices are discovered by changes in hub status.
uint32_t STDCALL usb_stop (void)
void STDCALL usb_async_start (USB_HOST *host)
uint8_t STDCALL usb_device_get_address (USB_DEVICE *device)
 Device Methods.
uint32_t STDCALL usb_device_set_address (USB_DEVICE *device, uint8_t address)
 Set the bus address for the specified device.
uint32_t STDCALL usb_device_get_descriptor (USB_DEVICE *device, uint8_t brequest, uint8_t bmrequesttype, uint16_t wvalue, uint16_t windex, void *data, uint16_t length)
 Read any descriptor from the specified device using USBControlRequest.
uint32_t STDCALL usb_device_get_device_descriptor (USB_DEVICE *device, void *data, uint16_t length)
 Read all or part of the device descriptor from the specified device using USBControlRequest.
uint32_t STDCALL usb_device_create_device_descriptor (USB_DEVICE *device, uint16_t length)
 Allocate a device descriptor for the specified device.
uint32_t STDCALL usb_device_read_device_descriptor (USB_DEVICE *device, uint16_t length)
 Read all or part of the device descriptor from the specified device using USBControlRequest.
uint32_t STDCALL usb_device_read_device_descriptor_ex (USB_DEVICE *device, uint16_t length, BOOL allowshort)
 Read all or part of the device descriptor from the specified device using USBControlRequest.
uint32_t STDCALL usb_device_create_configurations (USB_DEVICE *device)
 Allocate the available configurations for this device.
uint32_t STDCALL usb_device_read_configurations (USB_DEVICE *device)
 Read and parse the available configurations for this device.
uint32_t STDCALL usb_device_create_configuration (USB_DEVICE *device, uint8_t index, uint16_t size)
 Allocate the specified configuration for this device.
uint32_t STDCALL usb_device_read_configuration (USB_DEVICE *device, uint8_t index)
 Read and parse the specified configuration for this device.
uint32_t STDCALL usb_device_get_string_descriptor (USB_DEVICE *device, uint8_t index, void *data, uint16_t length)
 Read all or part of the specified string descriptor from the specified device using USBControlRequest.
uint32_t STDCALL usb_device_get_string_descriptor_ex (USB_DEVICE *device, uint8_t index, uint16_t languageid, void *data, uint16_t length)
 Read all or part of the specified string descriptor from the specified device using USBControlRequest.
void STDCALL usb_device_read_string_language_ids (USB_DEVICE *device, USB_STRING_DESCRIPTOR_LANGIDS *languageids)
 Get the list of supported string language identifiers from the specified device.
uint32_t STDCALL usb_device_read_string_descriptor (USB_DEVICE *device, uint8_t index, char *value, uint32_t len)
 Get the content of the specified string descriptor from the specified device.
uint32_t STDCALL usb_device_read_string_descriptor_ex (USB_DEVICE *device, uint8_t index, uint16_t languageid, char *value, uint32_t len)
 Get the content of the specified string descriptor from the specified device.
uint32_t STDCALL usb_device_read_string_descriptor_w (USB_DEVICE *device, uint8_t index, WCHAR *value, uint32_t len)
 Get the content of the specified string descriptor from the specified device.
uint32_t STDCALL usb_device_read_string_descriptor_ex_w (USB_DEVICE *device, uint8_t index, uint16_t languageid, WCHAR *value, uint32_t len)
 Get the content of the specified string descriptor from the specified device.
uint32_t STDCALL usb_device_get_configuration_descriptor (USB_DEVICE *device, uint8_t index, void *data, uint16_t length)
 Read all or part of the specified configuration descriptor from the specified device using USBControlRequest.
uint32_t STDCALL usb_device_get_configuration (USB_DEVICE *device, uint8_t *configurationvalue)
 Get the current configuration for the specified device.
uint32_t STDCALL usb_device_set_configuration (USB_DEVICE *device, uint8_t configurationvalue)
 Set the configuration for the specified device.
USB_CONFIGURATION *STDCALL usb_device_find_configuration_by_value (USB_DEVICE *device, uint8_t configurationvalue)
 Find the configuration represented by configuration value for the specified device.
USB_HUB *STDCALL usb_device_get_hub (USB_DEVICE *device)
 Get the USB Hub that the specified device is connected to.
USB_PORT *STDCALL usb_device_get_port (USB_DEVICE *device)
 Get the USB Port that the specified device is connected to.
uint32_t STDCALL usb_device_get_interface (USB_DEVICE *device, uint8_t index, uint8_t *alternatesetting)
 Get the interface alternate setting for the specified device.
uint32_t STDCALL usb_device_set_interface (USB_DEVICE *device, uint8_t index, uint8_t alternatesetting)
 Set the interface alternate setting for the specified device.
USB_INTERFACE *STDCALL usb_device_find_interface_by_index (USB_DEVICE *device, uint8_t index)
 Find the interface with the specified index on the specified device.
USB_INTERFACE *STDCALL usb_device_find_interface_by_class_only (USB_DEVICE *device, uint8_t interfaceclass)
 Find an interface of the specified class on the specified device.
USB_INTERFACE *STDCALL usb_device_find_interface_by_class (USB_DEVICE *device, uint8_t interfaceclass, uint8_t interfacesubclass, uint8_t interfaceprotocol)
 Find an interface of the specified class on the specified device.
USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_endpoint_by_index (USB_DEVICE *device, USB_INTERFACE *interrface, uint8_t index)
 Find the endpoint with the specified index on the specified interface of the specified device.
USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_endpoint_by_type (USB_DEVICE *device, USB_INTERFACE *interrface, uint8_t direction, uint8_t transfertype)
 Find an endpoint of the specified type and direction on the specified interface of the specified device.
USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_endpoint_by_type_ex (USB_DEVICE *device, USB_INTERFACE *interrface, uint8_t direction, uint8_t transfertype, uint8_t *index)
 Find the next endpoint of the specified type and direction on the specified interface of the specified device.
uint8_t STDCALL usb_device_count_endpoints_by_type (USB_DEVICE *device, USB_INTERFACE *interrface, uint8_t direction, uint8_t transfertype)
 Count the number of endpoints of the specified type and direction on the specified interface of the specified device.
USB_ALTERNATE *STDCALL usb_device_find_alternate_by_index (USB_DEVICE *device, USB_INTERFACE *interrface, uint8_t index)
 Find the alternate setting with the specified index on the specified interface of the specified device.
USB_ALTERNATE *STDCALL usb_device_find_alternate_by_setting (USB_DEVICE *device, USB_INTERFACE *interrface, uint8_t alternatesetting)
 Find the alternate setting with the specified value on the specified interface of the specified device.
USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_alternate_endpoint_by_index (USB_DEVICE *device, USB_INTERFACE *interrface, USB_ALTERNATE *alternate, uint8_t index)
 Find the endpoint with the specified index on the specified alternate setting interface of the specified device.
USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_alternate_endpoint_by_type (USB_DEVICE *device, USB_INTERFACE *interrface, USB_ALTERNATE *alternate, uint8_t direction, uint8_t transfertype)
 Find an endpoint of the specified type and direction on the specified alternate setting interface of the specified device.
uint32_t STDCALL usb_device_set_feature (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *endpoint, uint16_t feature, uint16_t index)
 Enable a feature on the specified endpoint on the specified device.
uint32_t STDCALL usb_device_clear_feature (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *endpoint, uint16_t feature)
 Disable a feature on the specified endpoint on the specified device.
uint32_t STDCALL usb_device_set_state (USB_DEVICE *device, uint32_t state)
 Set the state of the specified device and send a notification.
uint32_t STDCALL usb_device_set_status (USB_DEVICE *device, uint32_t status)
 Set the status of the specified device and send a notification.
uint32_t STDCALL usb_device_bind (USB_DEVICE *device)
 Attempt to bind a device to one of the registered drivers.
uint32_t STDCALL usb_device_unbind (USB_DEVICE *device, USB_DRIVER *driver)
 Unbind a device from a driver.
uint32_t STDCALL usb_device_attach (USB_DEVICE *device)
 Configure and initialize a newly attached USB device.
uint32_t STDCALL usb_device_detach (USB_DEVICE *device)
 Shutdown and detach a USB device.
USB_DEVICE *STDCALL usb_device_allocate (USB_HOST *host, USB_DEVICE *parent)
 Create and Register a new Device entry in the Device table.
uint32_t STDCALL usb_device_release (USB_DEVICE *device)
 Deregister and Destroy a Device from the Device table.
USB_DEVICE *STDCALL usb_device_find (uint32_t usbid)
USB_DEVICE *STDCALL usb_device_find_by_id (uint16_t vendorid, uint16_t productid)
USB_DEVICE *STDCALL usb_device_find_by_name (const char *name)
USB_DEVICE *STDCALL usb_device_find_by_description (const char *description)
uint32_t STDCALL usb_device_enumerate (usb_device_enumerate_cb callback, void *data)
uint32_t STDCALL usb_device_notification (USB_DEVICE *device, usb_device_notification_cb callback, void *data, uint32_t notification, uint32_t flags)
USB_DRIVER *STDCALL usb_driver_create (void)
 Driver Methods.
USB_DRIVER *STDCALL usb_driver_create_ex (uint32_t size)
 Create a new USB Driver entry.
uint32_t STDCALL usb_driver_destroy (USB_DRIVER *driver)
 Destroy an existing USB Driver entry.
uint32_t STDCALL usb_driver_register (USB_DRIVER *driver)
 Register a new Driver in the USB Driver table.
uint32_t STDCALL usb_driver_deregister (USB_DRIVER *driver)
 Deregister a Driver from the USB Driver table.
USB_DRIVER *STDCALL usb_driver_find (uint32_t driverid)
 Find a driver by Id in the USB Driver table.
USB_DRIVER *STDCALL usb_driver_find_by_name (const char *name)
 Find a driver by name in the Driver table.
uint32_t STDCALL usb_driver_enumerate (usb_driver_enumerate_cb callback, void *data)
 Enumerate all drivers in the USB Driver table.
uint32_t STDCALL usb_host_set_state (USB_HOST *host, uint32_t state)
 Host Methods.
USB_HOST *STDCALL usb_host_create (void)
 Create a new Host entry.
USB_HOST *STDCALL usb_host_create_ex (uint32_t size)
 Create a new Host entry.
uint32_t STDCALL usb_host_destroy (USB_HOST *host)
 Destroy an existing Host entry.
uint32_t STDCALL usb_host_register (USB_HOST *host)
 Register a new Host in the Host table.
uint32_t STDCALL usb_host_deregister (USB_HOST *host)
 Deregister a Host from the Host table.
USB_HOST *STDCALL usb_host_find (uint32_t hostid)
USB_HOST *STDCALL usb_host_find_by_name (const char *name)
USB_HOST *STDCALL usb_host_find_by_description (const char *description)
uint32_t STDCALL usb_host_enumerate (usb_host_enumerate_cb callback, void *data)
uint32_t STDCALL usb_host_notification (USB_HOST *host, usb_host_notification_cb callback, void *data, uint32_t notification, uint32_t flags)
void *STDCALL usb_buffer_allocate (USB_DEVICE *device, uint32_t size)
 Buffer Methods.
void *STDCALL usb_buffer_allocate_ex (USB_DEVICE *device, uint32_t size, uint32_t *flags)
 Allocate a data buffer for a USB request.
uint32_t STDCALL usb_buffer_validate (USB_DEVICE *device, void *buffer, uint32_t size, uint32_t *flags)
 Validate a data buffer for a USB request against the USB host requirements.
uint32_t STDCALL usb_buffer_release (void *buffer)
 Release a data buffer from a USB request.
USB_REQUEST *STDCALL usb_request_allocate (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *endpoint, usb_request_completed_cb callback, uint32_t size, void *driverdata)
 Request Methods.
USB_REQUEST *STDCALL usb_request_allocate_ex (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *endpoint, usb_request_completed_cb callback, void *data, uint32_t size, void *driverdata)
 Allocate a new USB request.
uint32_t STDCALL usb_request_release (USB_REQUEST *request)
 Release and destroy a USB request.
uint32_t STDCALL usb_request_initialize (USB_REQUEST *request, usb_request_completed_cb callback, void *data, uint32_t size, void *driverdata)
 Initialize or Reinitialize an existing USB request.
uint32_t STDCALL usb_request_submit (USB_REQUEST *request)
 Submit a USB request to a host controller for execution.
uint32_t STDCALL usb_request_cancel (USB_REQUEST *request)
 Cancel a USB request previously submitted to a host controller.
uint32_t STDCALL usb_control_request (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *endpoint, uint8_t brequest, uint8_t bmrequesttype, uint16_t wvalue, uint16_t windex, void *data, uint16_t wlength)
 Control Methods.
uint32_t STDCALL usb_control_request_ex (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *endpoint, uint8_t brequest, uint8_t bmrequesttype, uint16_t wvalue, uint16_t windex, void *data, uint16_t wlength, uint32_t timeout, BOOL allowshort)
 Send a USB control request to the specified device and wait for the request to complete.
uint32_t STDCALL usb_control_transfer (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *endpoint, uint8_t brequest, uint8_t bmrequesttype, uint16_t wvalue, uint16_t windex, void *data, uint16_t wlength, uint32_t *count, uint32_t timeout)
 Synchronous Transfer Methods.
uint32_t STDCALL usb_bulk_transfer (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *endpoint, void *data, uint32_t size, uint32_t *count, uint32_t timeout)
 Perform a synchronous bulk transfer to a USB device and endpoint.
uint32_t STDCALL usb_interrupt_transfer (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *endpoint, void *data, uint32_t size, uint32_t *count, uint32_t timeout)
 Perform a synchronous interrupt transfer to a USB device and endpoint.
uint32_t STDCALL usb_hub_create_ports (USB_HUB *hub)
 Hub Methods.
uint32_t STDCALL usb_hub_power_on_ports (USB_HUB *hub)
 Power on all ports on a Hub.
uint32_t STDCALL usb_hub_create_hub_descriptor (USB_HUB *hub)
 Allocate the hub descriptor for the specified hub.
uint32_t STDCALL usb_hub_read_hub_descriptor (USB_HUB *hub)
 Read the hub descriptor for the specified hub.
uint32_t STDCALL usb_hub_lock (USB_HUB *hub)
 Lock the specified Hub to prevent changes.
uint32_t STDCALL usb_hub_unlock (USB_HUB *hub)
 Unlock the specified Hub to allow changes.
uint32_t STDCALL usb_hub_set_state (USB_HUB *hub, uint32_t state)
 Set the state of the specified hub and send a notification.
USB_HUB *STDCALL usb_hub_allocate (USB_DEVICE *device)
 Create and Register a new Hub device.
uint32_t STDCALL usb_hub_release (USB_HUB *hub)
 Deregister and Destroy a Hub device.
USB_HUB *STDCALL usb_hub_find (uint32_t hubid)
USB_HUB *STDCALL usb_hub_find_by_name (const char *name)
USB_HUB *STDCALL usb_hub_find_by_description (const char *description)
uint32_t STDCALL usb_hub_enumerate (usb_hub_enumerate_cb callback, void *data)
uint32_t STDCALL usb_hub_notification (USB_HUB *hub, usb_hub_notification_cb callback, void *data, uint32_t notification, uint32_t flags)
void STDCALL usb_hub_bind_devices (USB_DEVICE *device, usb_device_bind_proc callback)
 Enumerate each device in the USB tree and call a bind callback for each one.
void STDCALL usb_hub_unbind_devices (USB_DEVICE *device, USB_DRIVER *driver, usb_device_unbind_proc callback)
 Enumerate each device in the USB tree and call an unbind callback for each one.
void STDCALL usb_hub_enumerate_devices (USB_DEVICE *device, usb_device_enumerate_cb callback, void *data)
 Enumerate each device in the USB tree and call an enumerate callback for each one.
uint32_t STDCALL usb_hub_port_reset (USB_PORT *port, uint32_t delay)
 Hub Port Methods.
uint32_t STDCALL usb_hub_port_disable (USB_PORT *port)
 Disable the specified USB port.
uint32_t STDCALL usb_hub_port_power_on (USB_PORT *port)
 Power on the specified USB port.
uint32_t STDCALL usb_hub_port_power_off (USB_PORT *port)
 Power off the specified USB port.
uint32_t STDCALL usb_hub_port_get_status (USB_PORT *port)
 Read the status of the specified USB port.
uint32_t STDCALL usb_hub_port_set_feature (USB_PORT *port, uint16_t feature)
 Enable a feature on the specified USB port.
uint32_t STDCALL usb_hub_port_clear_feature (USB_PORT *port, uint16_t feature)
 Disable a feature on the specified USB port.
uint32_t STDCALL usb_hub_port_change_feature (USB_PORT *port, uint16_t feature, BOOL enable)
 Enable or disable a feature on the specified USB port.
uint32_t STDCALL usb_hub_port_attach_device (USB_PORT *port)
 Attach a newly connected USB device to the specified USB port.
uint32_t STDCALL usb_hub_port_detach_device (USB_PORT *port)
 Detach a disconnected USB device from the specified USB port.
uint32_t STDCALL usb_hub_port_status_changed (USB_PORT *port)
 Process a status change for the specified USB port.
uint32_t STDCALL usb_device_get_count (void)
 Get the current device count.
USB_DEVICE *STDCALL usb_device_check (USB_DEVICE *device)
 Check if the supplied Device is in the device table.
uint32_t STDCALL usb_driver_get_count (void)
 Get the current USB driver count.
USB_DRIVER *STDCALL usb_driver_check (USB_DRIVER *driver)
 Check if the supplied USB Driver is in the driver table.
uint32_t STDCALL usb_host_get_count (void)
 Get the current host count.
USB_HOST *STDCALL usb_host_check (USB_HOST *host)
 Check if the supplied Host is in the host table.
BOOL STDCALL usb_is_hub (USB_DEVICE *device)
 Returns True if Device is a Hub or False if not.
BOOL STDCALL usb_is_root_hub (USB_DEVICE *device)
 Returns True if Device is a Root Hub or False if not.
BOOL STDCALL usb_is_control_request (USB_REQUEST *request)
 Returns True if Request is a control request or False if not.
BOOL STDCALL usb_is_bulk_request (USB_REQUEST *request)
 Returns True if Request is a bulk request or False if not.
BOOL STDCALL usb_is_interrupt_request (USB_REQUEST *request)
 Returns True if Request is an interrupt request or False if not.
BOOL STDCALL usb_is_isochronous_request (USB_REQUEST *request)
 Returns True if Request is an isochronous request or False if not.
BOOL STDCALL usb_is_in_endpoint (USB_ENDPOINT_DESCRIPTOR *endpoint)
 Returns True if Endpoint is an IN endpoint or False if not.
BOOL STDCALL usb_is_out_endpoint (USB_ENDPOINT_DESCRIPTOR *endpoint)
 Returns True if Endpoint is an OUT endpoint or False if not.
BOOL STDCALL usb_is_bulk_endpoint (USB_ENDPOINT_DESCRIPTOR *endpoint)
 Returns True if Endpoint is a BULK endpoint or False if not.
BOOL STDCALL usb_is_interrupt_endpoint (USB_ENDPOINT_DESCRIPTOR *endpoint)
 Returns True if Endpoint is a INTERRUPT endpoint or False if not.
BOOL STDCALL usb_is_isochronous_endpoint (USB_ENDPOINT_DESCRIPTOR *endpoint)
 Returns True if Endpoint is a ISOCHRONOUS endpoint or False if not.
uint32_t STDCALL usb_status_to_string (uint32_t status, char *string, uint32_t len)
 Translates a USB status code into a string.
uint32_t STDCALL usb_device_type_to_string (uint32_t usbtype, char *string, uint32_t len)
uint32_t STDCALL usb_device_state_to_string (uint32_t usbstate, char *string, uint32_t len)
uint32_t STDCALL usb_device_status_to_string (uint32_t usbstatus, char *string, uint32_t len)
uint32_t STDCALL usb_device_state_to_notification (uint32_t state)
 Convert a Device state value into the notification code for device notifications.
uint32_t STDCALL usb_device_status_to_notification (uint32_t status)
 Convert a Device status value into the notification code for device notifications.
uint32_t STDCALL usb_host_type_to_string (uint32_t hosttype, char *string, uint32_t len)
uint32_t STDCALL usb_host_state_to_string (uint32_t hoststate, char *string, uint32_t len)
uint32_t STDCALL usb_host_state_to_notification (uint32_t state)
 Convert a Host state value into the notification code for device notifications.
void STDCALL usb_log_device_configuration (USB_DEVICE *device, usb_log_output_proc output, void *data)
void STDCALL usb_log_device_descriptor (USB_DEVICE *device, USB_DEVICE_DESCRIPTOR *descriptor, usb_log_output_proc output, void *data)
void STDCALL usb_log_configuration_descriptor (USB_DEVICE *device, USB_CONFIGURATION_DESCRIPTOR *descriptor, usb_log_output_proc output, void *data)
void STDCALL usb_log_interface_descriptor (USB_DEVICE *device, USB_INTERFACE_DESCRIPTOR *descriptor, usb_log_output_proc output, void *data)
void STDCALL usb_log_endpoint_descriptor (USB_DEVICE *device, USB_ENDPOINT_DESCRIPTOR *descriptor, usb_log_output_proc output, void *data)
uint32_t STDCALL usb_log_devices (void)
 Print information about all devices attached to the USB.
uint32_t STDCALL usb_log_devices_ex (USB_DEVICE *device, usb_log_output_proc output, usb_device_enumerate_cb devicecallback, usb_device_enumerate_cb treecallback, void *data)
 Print information about one or all devices attached to the USB with custom output and callbacks.
uint32_t STDCALL usb_log_device_callback (USB_DEVICE *device, void *data)
uint32_t STDCALL usb_log_tree_callback (USB_DEVICE *device, void *data)
uint32_t STDCALL usb_hub_get_count (void)
 Get the current hub count.
USB_HUB *STDCALL usb_hub_check (USB_HUB *hub)
 Check if the supplied Hub is in the hub table.
BOOL STDCALL usb_hub_is_multi_tt (USB_HUB *hub)
 Returns True if Hub has multiple Transaction Translators or False if not.
BOOL STDCALL usb_hub_is_compound (USB_HUB *hub)
 Returns True if Hub is part of a Compound Device or False if not.
BOOL STDCALL usb_hub_has_port_indicator (USB_HUB *hub)
 Returns True if Hub supports Port Indicators or False if not.
BOOL STDCALL usb_hub_has_port_power_switching (USB_HUB *hub)
 Returns True if Hub supports per port Power Switching or False if not.
BOOL STDCALL usb_hub_has_port_current_protection (USB_HUB *hub)
 Returns True if Hub supports per port Over Current Power Protection or False if not.
uint8_t STDCALL usb_hub_get_tt_think_time (USB_HUB *hub)
 Get the TT Think Time from a Hub.
uint32_t STDCALL usb_hub_type_to_string (uint32_t hubtype, char *string, uint32_t len)
 Return a string describing the supplied Hub type value.
uint32_t STDCALL usb_hub_state_to_string (uint32_t hubstate, char *string, uint32_t len)
 Return a string describing the supplied Hub state value.
uint32_t STDCALL usb_hub_state_to_notification (uint32_t state)
 Convert a Hub state value into the notification code for device notifications.

Variables

struct _USB_CONTROL_SETUP_DATA PACKED

Macro Definition Documentation

◆ USB_DEVICE_PREFIX

#define USB_DEVICE_PREFIX   "USB"

Name prefix for USB Devices.

USB Device, Driver and Host specific constants

◆ USB_DRIVER_PREFIX

#define USB_DRIVER_PREFIX   "USB"

Name prefix for USB Drivers.

◆ USB_HOST_PREFIX

#define USB_HOST_PREFIX   "USBHost"

Name prefix for USB Hosts.

◆ USB_TYPE_NONE

#define USB_TYPE_NONE   0

USB Device Types

◆ USB_TYPE_MAX

#define USB_TYPE_MAX   0

◆ USB_STATE_DETACHED

#define USB_STATE_DETACHED   0

USB Device States

◆ USB_STATE_DETACHING

#define USB_STATE_DETACHING   1

◆ USB_STATE_ATTACHING

#define USB_STATE_ATTACHING   2

◆ USB_STATE_ATTACHED

#define USB_STATE_ATTACHED   3

◆ USB_STATE_MAX

#define USB_STATE_MAX   3

◆ USB_STATUS_UNBOUND

#define USB_STATUS_UNBOUND   0

USB Device Status

◆ USB_STATUS_BOUND

#define USB_STATUS_BOUND   1

◆ USB_STATUS_MAX

#define USB_STATUS_MAX   1

◆ USB_FLAG_NONE

#define USB_FLAG_NONE   0x00000000

USB Device Flags

◆ USBHOST_TYPE_NONE

#define USBHOST_TYPE_NONE   0

USB Host Types

◆ USBHOST_TYPE_EHCI

#define USBHOST_TYPE_EHCI   1

◆ USBHOST_TYPE_OHCI

#define USBHOST_TYPE_OHCI   2

◆ USBHOST_TYPE_UHCI

#define USBHOST_TYPE_UHCI   3

◆ USBHOST_TYPE_XHCI

#define USBHOST_TYPE_XHCI   4

◆ USBHOST_TYPE_DWCOTG

#define USBHOST_TYPE_DWCOTG   5

◆ USBHOST_TYPE_MAX

#define USBHOST_TYPE_MAX   5

◆ USBHOST_STATE_DISABLED

#define USBHOST_STATE_DISABLED   0

USB Host States

◆ USBHOST_STATE_ENABLED

#define USBHOST_STATE_ENABLED   1

◆ USBHOST_STATE_MAX

#define USBHOST_STATE_MAX   1

◆ USBHOST_FLAG_NONE

#define USBHOST_FLAG_NONE   0x00000000

USB Host Flags

◆ USBHOST_FLAG_SHARED

#define USBHOST_FLAG_SHARED   0x00000001

◆ USBHOST_FLAG_NOCACHE

#define USBHOST_FLAG_NOCACHE   0x00000002

◆ USB_STATUS_SUCCESS

#define USB_STATUS_SUCCESS   0

Function successful.

USB Status Codes

◆ USB_STATUS_DEVICE_DETACHED

#define USB_STATUS_DEVICE_DETACHED   1

USB device was detached.

◆ USB_STATUS_DEVICE_UNSUPPORTED

#define USB_STATUS_DEVICE_UNSUPPORTED   2

USB device is unsupported by the driver.

◆ USB_STATUS_HARDWARE_ERROR

#define USB_STATUS_HARDWARE_ERROR   3

Hardware error of some form occurred.

◆ USB_STATUS_INVALID_DATA

#define USB_STATUS_INVALID_DATA   4

Invalid data was received.

◆ USB_STATUS_INVALID_PARAMETER

#define USB_STATUS_INVALID_PARAMETER   5

An invalid parameter was passed to the function.

◆ USB_STATUS_NOT_PROCESSED

#define USB_STATUS_NOT_PROCESSED   6

The USB request has been submitted but not yet processed.

◆ USB_STATUS_OUT_OF_MEMORY

#define USB_STATUS_OUT_OF_MEMORY   7

Failed to allocate memory.

◆ USB_STATUS_TIMEOUT

#define USB_STATUS_TIMEOUT   8

The operation timed out.

◆ USB_STATUS_UNSUPPORTED_REQUEST

#define USB_STATUS_UNSUPPORTED_REQUEST   9

The request is unsupported.

◆ USB_STATUS_HARDWARE_STALL

#define USB_STATUS_HARDWARE_STALL   10

The device reported an endpoint STALL.

◆ USB_STATUS_OPERATION_FAILED

#define USB_STATUS_OPERATION_FAILED   11

The operation was not able to be completed.

◆ USB_STATUS_NOT_BOUND

#define USB_STATUS_NOT_BOUND   12

USB device is not bound to a driver.

◆ USB_STATUS_ALREADY_BOUND

#define USB_STATUS_ALREADY_BOUND   13

USB device is already bound to a driver.

◆ USB_STATUS_NOT_READY

#define USB_STATUS_NOT_READY   14

USB device is not in a ready state.

◆ USB_STATUS_NOT_COMPLETED

#define USB_STATUS_NOT_COMPLETED   15

The USB request has been scheduled but not yet completed.

◆ USB_STATUS_CANCELLED

#define USB_STATUS_CANCELLED   16

The USB request was cancelled.

◆ USB_STATUS_NOT_VALID

#define USB_STATUS_NOT_VALID   17

The USB request is not valid.

◆ USB_REQUEST_FLAG_NONE

#define USB_REQUEST_FLAG_NONE   0x00000000

USB Request Flags

◆ USB_REQUEST_FLAG_ALLOCATED

#define USB_REQUEST_FLAG_ALLOCATED   0x00000001

Request data has been allocated by USBBufferAllocate (and can be freed by USBBufferRelease).

◆ USB_REQUEST_FLAG_COMPATIBLE

#define USB_REQUEST_FLAG_COMPATIBLE   0x00000002

Request data is compatible with DMA requirements of host configuration (Can be passed directly to DMA).

◆ USB_REQUEST_FLAG_ALIGNED

#define USB_REQUEST_FLAG_ALIGNED   0x00000004

Request data is aligned according to host configuration.

◆ USB_REQUEST_FLAG_SIZED

#define USB_REQUEST_FLAG_SIZED   0x00000008

Request data is sized according to host configuration.

◆ USB_REQUEST_FLAG_SHARED

#define USB_REQUEST_FLAG_SHARED   0x00000010

Request data has been allocated from Shared memory.

◆ USB_REQUEST_FLAG_NOCACHE

#define USB_REQUEST_FLAG_NOCACHE   0x00000020

Request data has been allocated from Non Cached memory.

◆ USB_CONTROL_PHASE_SETUP

#define USB_CONTROL_PHASE_SETUP   0

Setup phase of a Control request (Using SetupData).

USB Control Phases

◆ USB_CONTROL_PHASE_DATA

#define USB_CONTROL_PHASE_DATA   1

Data phase of a Control request (Using Data buffer).

◆ USB_CONTROL_PHASE_STATUS

#define USB_CONTROL_PHASE_STATUS   2

Status phase of a Control request (Using StatusData).

◆ USB_CONTROL_GET_TIMEOUT

#define USB_CONTROL_GET_TIMEOUT   5000

USB Control Timeouts

◆ USB_CONTROL_SET_TIMEOUT

#define USB_CONTROL_SET_TIMEOUT   5000

◆ USB_DEFAULT_MAX_PACKET_SIZE

#define USB_DEFAULT_MAX_PACKET_SIZE   8

Default maximum packet size for unconfigured Endpoints

◆ USB_ALTERNATE_MAX_PACKET_SIZE

#define USB_ALTERNATE_MAX_PACKET_SIZE   64

◆ USB_MAX_PACKET_SIZE

#define USB_MAX_PACKET_SIZE   1024

Maximum packet size of any USB Endpoint (1024 is the maximum allowed by USB 2.0)

◆ USB_FRAMES_PER_MS

#define USB_FRAMES_PER_MS   1

Number of USB frames per millisecond

◆ USB_UFRAMES_PER_MS

#define USB_UFRAMES_PER_MS   8

Number of USB microframes per millisecond

◆ USB_CONFIGURATION_ATTRIBUTE_RESERVED_HIGH

#define USB_CONFIGURATION_ATTRIBUTE_RESERVED_HIGH   0x80

Values for bmAttributes in type TUSBConfigurationDescriptor

◆ USB_CONFIGURATION_ATTRIBUTE_SELF_POWERED

#define USB_CONFIGURATION_ATTRIBUTE_SELF_POWERED   0x40

◆ USB_CONFIGURATION_ATTRIBUTE_REMOTE_WAKEUP

#define USB_CONFIGURATION_ATTRIBUTE_REMOTE_WAKEUP   0x20

◆ USB_CONFIGURATION_ATTRIBUTE_RESERVED_LOW

#define USB_CONFIGURATION_ATTRIBUTE_RESERVED_LOW   0x1f

◆ USB_DEVICE_STATUS_SELF_POWERED

#define USB_DEVICE_STATUS_SELF_POWERED   (1 << 0)

Values for wStatus in type TUSBDeviceStatus (Device Recipient) (See Figure 9-4 of Section 9.4 of the USB 2.0 specification)

◆ USB_DEVICE_STATUS_REMOTE_WAKEUP

#define USB_DEVICE_STATUS_REMOTE_WAKEUP   (1 << 1)

◆ USB_ENDPOINT_STATUS_HALT

#define USB_ENDPOINT_STATUS_HALT   (1 << 0)

Values for vStatus in type TUSBDeviceStatus (Endpoint Recipient) (See Figure 9-6 of Section 9.4 of the USB 2.0 specification)

◆ USB_SPEED_HIGH

#define USB_SPEED_HIGH   0

480 Mb/s

USB Device Speeds

◆ USB_SPEED_FULL

#define USB_SPEED_FULL   1

12 Mb/s

◆ USB_SPEED_LOW

#define USB_SPEED_LOW   2

1.5 Mb/s

◆ USB_SPEED_SUPER

#define USB_SPEED_SUPER   3

5 Gb/s

◆ USB_SPEED_SUPERPLUS

#define USB_SPEED_SUPERPLUS   4

10 Gb/s

◆ USB_TRANSFER_TYPE_CONTROL

#define USB_TRANSFER_TYPE_CONTROL   0

Values for bmAttributes (bits 1..0) in type TUSBEndpointDescriptor USB Transfer Types

◆ USB_TRANSFER_TYPE_ISOCHRONOUS

#define USB_TRANSFER_TYPE_ISOCHRONOUS   1

◆ USB_TRANSFER_TYPE_BULK

#define USB_TRANSFER_TYPE_BULK   2

◆ USB_TRANSFER_TYPE_INTERRUPT

#define USB_TRANSFER_TYPE_INTERRUPT   3

◆ USB_TRANSFER_TYPE_MASK

#define USB_TRANSFER_TYPE_MASK   0x03

◆ USB_TRANSFER_SIZE_8_BIT

#define USB_TRANSFER_SIZE_8_BIT   0

USB Transfer Sizes

◆ USB_TRANSFER_SIZE_16_BIT

#define USB_TRANSFER_SIZE_16_BIT   1

◆ USB_TRANSFER_SIZE_32_BIT

#define USB_TRANSFER_SIZE_32_BIT   2

◆ USB_TRANSFER_SIZE_64_BIT

#define USB_TRANSFER_SIZE_64_BIT   3

◆ USB_DESCRIPTOR_TYPE_DEVICE

#define USB_DESCRIPTOR_TYPE_DEVICE   1

Values for bDescriptorType in types TUSBDescriptorHeader and TUSBDeviceDescriptor USB Descriptor Types (See Table 9-5 in Section 9.4 of the USB 2.0 specification)

◆ USB_DESCRIPTOR_TYPE_CONFIGURATION

#define USB_DESCRIPTOR_TYPE_CONFIGURATION   2

◆ USB_DESCRIPTOR_TYPE_STRING

#define USB_DESCRIPTOR_TYPE_STRING   3

◆ USB_DESCRIPTOR_TYPE_INTERFACE

#define USB_DESCRIPTOR_TYPE_INTERFACE   4

◆ USB_DESCRIPTOR_TYPE_ENDPOINT

#define USB_DESCRIPTOR_TYPE_ENDPOINT   5

◆ USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER

#define USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER   6

◆ USB_DESCRIPTOR_TYPE_OTHER_SPEED_CONFIGURATION

#define USB_DESCRIPTOR_TYPE_OTHER_SPEED_CONFIGURATION   7

◆ USB_DESCRIPTOR_TYPE_INTERFACE_POWER

#define USB_DESCRIPTOR_TYPE_INTERFACE_POWER   8

◆ USB_DESCRIPTOR_TYPE_CLASS_DEVICE

#define USB_DESCRIPTOR_TYPE_CLASS_DEVICE   0x21

(USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_DEVICE

◆ USB_DESCRIPTOR_TYPE_CLASS_CONFIGURATION

#define USB_DESCRIPTOR_TYPE_CLASS_CONFIGURATION   0x22

(USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_CONFIGURATION

◆ USB_DESCRIPTOR_TYPE_CLASS_STRING

#define USB_DESCRIPTOR_TYPE_CLASS_STRING   0x23

(USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_STRING

◆ USB_DESCRIPTOR_TYPE_CLASS_INTERFACE

#define USB_DESCRIPTOR_TYPE_CLASS_INTERFACE   0x24

(USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_INTERFACE

◆ USB_DESCRIPTOR_TYPE_CLASS_ENDPOINT

#define USB_DESCRIPTOR_TYPE_CLASS_ENDPOINT   0x25

(USB_REQUEST_TYPE_CLASS << 5) | USB_DESCRIPTOR_TYPE_ENDPOINT

◆ USB_DESCRIPTOR_TYPE_HUB

#define USB_DESCRIPTOR_TYPE_HUB   0x29

◆ USB_DIRECTION_OUT

#define USB_DIRECTION_OUT   0

Host to Device.

Values for bmRequestType (bit 7) in type TUSBControlSetupData (See Table 9-2 of Section 9.3 of the USB 2.0 specification) USB Transfer Directions (Relative to the host)

◆ USB_DIRECTION_IN

#define USB_DIRECTION_IN   1

Device to Host.

◆ USB_REQUEST_TYPE_STANDARD

#define USB_REQUEST_TYPE_STANDARD   0

USB Request Types (bits 6..5 of bmRequestType in type TUSBControlSetupData) (See Table 9-2 of Section 9.3 of the USB 2.0 specification)

◆ USB_REQUEST_TYPE_CLASS

#define USB_REQUEST_TYPE_CLASS   1

◆ USB_REQUEST_TYPE_VENDOR

#define USB_REQUEST_TYPE_VENDOR   2

◆ USB_REQUEST_TYPE_RESERVED

#define USB_REQUEST_TYPE_RESERVED   3

◆ USB_REQUEST_RECIPIENT_DEVICE

#define USB_REQUEST_RECIPIENT_DEVICE   0

USB Request Recipients (bits 4..0 of bmRequestType in type TUSBControlSetupData) (See Table 9-2 of Section 9.3 of the USB 2.0 specification)

◆ USB_REQUEST_RECIPIENT_INTERFACE

#define USB_REQUEST_RECIPIENT_INTERFACE   1

◆ USB_REQUEST_RECIPIENT_ENDPOINT

#define USB_REQUEST_RECIPIENT_ENDPOINT   2

◆ USB_REQUEST_RECIPIENT_OTHER

#define USB_REQUEST_RECIPIENT_OTHER   3

◆ USB_BMREQUESTTYPE_DIR_OUT

#define USB_BMREQUESTTYPE_DIR_OUT   (USB_DIRECTION_OUT << 7)

Values of the bitfields within the bmRequestType member of TUSBControlSetupData (See Table 9-2 of Section 9.3 of the USB 2.0 specification)

◆ USB_BMREQUESTTYPE_DIR_IN

#define USB_BMREQUESTTYPE_DIR_IN   (USB_DIRECTION_IN << 7)

◆ USB_BMREQUESTTYPE_DIR_MASK

#define USB_BMREQUESTTYPE_DIR_MASK   (0x01 << 7)

◆ USB_BMREQUESTTYPE_TYPE_STANDARD

#define USB_BMREQUESTTYPE_TYPE_STANDARD   (USB_REQUEST_TYPE_STANDARD << 5)

◆ USB_BMREQUESTTYPE_TYPE_CLASS

#define USB_BMREQUESTTYPE_TYPE_CLASS   (USB_REQUEST_TYPE_CLASS << 5)

◆ USB_BMREQUESTTYPE_TYPE_VENDOR

#define USB_BMREQUESTTYPE_TYPE_VENDOR   (USB_REQUEST_TYPE_VENDOR << 5)

◆ USB_BMREQUESTTYPE_TYPE_RESERVED

#define USB_BMREQUESTTYPE_TYPE_RESERVED   (USB_REQUEST_TYPE_RESERVED << 5)

◆ USB_BMREQUESTTYPE_TYPE_MASK

#define USB_BMREQUESTTYPE_TYPE_MASK   (0x03 << 5)

◆ USB_BMREQUESTTYPE_RECIPIENT_DEVICE

#define USB_BMREQUESTTYPE_RECIPIENT_DEVICE   (USB_REQUEST_RECIPIENT_DEVICE << 0)

◆ USB_BMREQUESTTYPE_RECIPIENT_INTERFACE

#define USB_BMREQUESTTYPE_RECIPIENT_INTERFACE   (USB_REQUEST_RECIPIENT_INTERFACE << 0)

◆ USB_BMREQUESTTYPE_RECIPIENT_ENDPOINT

#define USB_BMREQUESTTYPE_RECIPIENT_ENDPOINT   (USB_REQUEST_RECIPIENT_ENDPOINT << 0)

◆ USB_BMREQUESTTYPE_RECIPIENT_OTHER

#define USB_BMREQUESTTYPE_RECIPIENT_OTHER   (USB_REQUEST_RECIPIENT_OTHER << 0)

◆ USB_BMREQUESTTYPE_RECIPIENT_MASK

#define USB_BMREQUESTTYPE_RECIPIENT_MASK   (0x1f << 0)

◆ USB_DEVICE_REQUEST_GET_STATUS

#define USB_DEVICE_REQUEST_GET_STATUS   0

Values for bRequest in type TUSBControlSetupData USB Device Requests (See Table 9-3 in Section 9.4 of the USB 2.0 specification)

◆ USB_DEVICE_REQUEST_CLEAR_FEATURE

#define USB_DEVICE_REQUEST_CLEAR_FEATURE   1

◆ USB_DEVICE_REQUEST_SET_FEATURE

#define USB_DEVICE_REQUEST_SET_FEATURE   3

◆ USB_DEVICE_REQUEST_SET_ADDRESS

#define USB_DEVICE_REQUEST_SET_ADDRESS   5

◆ USB_DEVICE_REQUEST_GET_DESCRIPTOR

#define USB_DEVICE_REQUEST_GET_DESCRIPTOR   6

◆ USB_DEVICE_REQUEST_SET_DESCRIPTOR

#define USB_DEVICE_REQUEST_SET_DESCRIPTOR   7

◆ USB_DEVICE_REQUEST_GET_CONFIGURATION

#define USB_DEVICE_REQUEST_GET_CONFIGURATION   8

◆ USB_DEVICE_REQUEST_SET_CONFIGURATION

#define USB_DEVICE_REQUEST_SET_CONFIGURATION   9

◆ USB_DEVICE_REQUEST_GET_INTERFACE

#define USB_DEVICE_REQUEST_GET_INTERFACE   10

◆ USB_DEVICE_REQUEST_SET_INTERFACE

#define USB_DEVICE_REQUEST_SET_INTERFACE   11

◆ USB_DEVICE_REQUEST_SYNCH_FRAME

#define USB_DEVICE_REQUEST_SYNCH_FRAME   12

◆ USB_DEVICE_FEATURE_ENDPOINT_HALT

#define USB_DEVICE_FEATURE_ENDPOINT_HALT   0

Endpoint Only.

Values for wValue in type TUSBControlSetupData USB Device Features (See Table 9-6 in Section 9.4 of the USB 2.0 specification)

◆ USB_DEVICE_FEATURE_REMOTE_WAKEUP

#define USB_DEVICE_FEATURE_REMOTE_WAKEUP   1

Device Only.

◆ USB_DEVICE_FEATURE_TEST_MODE

#define USB_DEVICE_FEATURE_TEST_MODE   2

Device Only.

◆ USB_DEVICE_TEST_MODE_J

#define USB_DEVICE_TEST_MODE_J   0x01

Values for wIndex in type TUSBControlSetupData USB Test Modes (See Table 9-7 in Section 9.4 of the USB 2.0 specification)

◆ USB_DEVICE_TEST_MODE_K

#define USB_DEVICE_TEST_MODE_K   0x02

◆ USB_DEVICE_TEST_MODE_SE0_NAK

#define USB_DEVICE_TEST_MODE_SE0_NAK   0x03

◆ USB_DEVICE_TEST_MODE_PACKET

#define USB_DEVICE_TEST_MODE_PACKET   0x04

◆ USB_DEVICE_TEST_MODE_FORCE_ENABLE

#define USB_DEVICE_TEST_MODE_FORCE_ENABLE   0x05

◆ USB_PACKETID_UNDEF_0

#define USB_PACKETID_UNDEF_0   0xf0

USB Packet ID values (See ????????)

◆ USB_PACKETID_OUT

#define USB_PACKETID_OUT   0xe1

◆ USB_PACKETID_ACK

#define USB_PACKETID_ACK   0xd2

◆ USB_PACKETID_DATA0

#define USB_PACKETID_DATA0   0xc3

◆ USB_PACKETID_UNDEF_4

#define USB_PACKETID_UNDEF_4   0xb4

◆ USB_PACKETID_SOF

#define USB_PACKETID_SOF   0xa5

◆ USB_PACKETID_UNDEF_6

#define USB_PACKETID_UNDEF_6   0x96

◆ USB_PACKETID_UNDEF_7

#define USB_PACKETID_UNDEF_7   0x87

◆ USB_PACKETID_UNDEF_8

#define USB_PACKETID_UNDEF_8   0x78

◆ USB_PACKETID_IN

#define USB_PACKETID_IN   0x69

◆ USB_PACKETID_NAK

#define USB_PACKETID_NAK   0x5a

◆ USB_PACKETID_DATA1

#define USB_PACKETID_DATA1   0x4b

◆ USB_PACKETID_PREAMBLE

#define USB_PACKETID_PREAMBLE   0x3c

◆ USB_PACKETID_SETUP

#define USB_PACKETID_SETUP   0x2d

◆ USB_PACKETID_STALL

#define USB_PACKETID_STALL   0x1e

◆ USB_PACKETID_UNDEF_F

#define USB_PACKETID_UNDEF_F   0x0f

◆ USB_CLASS_CODE_INTERFACE_SPECIFIC

#define USB_CLASS_CODE_INTERFACE_SPECIFIC   0x00

Use class code info from Interface Descriptors.

USB Class Codes (bDeviceClass / bInterfaceClass) (See: https://www.usb.org/defined-class-codes) (Note that only the hub class is defined in the USB 2.0 specification itself the other standard class codes are defined in additional specifications)

◆ USB_CLASS_CODE_AUDIO

#define USB_CLASS_CODE_AUDIO   0x01

Audio device.

◆ USB_CLASS_CODE_COMMUNICATIONS_AND_CDC_CONTROL

#define USB_CLASS_CODE_COMMUNICATIONS_AND_CDC_CONTROL   0x02

Communication device class.

◆ USB_CLASS_CODE_COMMS

#define USB_CLASS_CODE_COMMS   USB_CLASS_CODE_COMMUNICATIONS_AND_CDC_CONTROL

◆ USB_CLASS_CODE_HID

#define USB_CLASS_CODE_HID   0x03

HID device class.

◆ USB_CLASS_CODE_PHYSICAL

#define USB_CLASS_CODE_PHYSICAL   0x05

Physical device class.

◆ USB_CLASS_CODE_IMAGE

#define USB_CLASS_CODE_IMAGE   0x06

Still Imaging device.

◆ USB_CLASS_CODE_PRINTER

#define USB_CLASS_CODE_PRINTER   0x07

Printer device.

◆ USB_CLASS_CODE_MASS_STORAGE

#define USB_CLASS_CODE_MASS_STORAGE   0x08

Mass Storage device.

◆ USB_CLASS_CODE_HUB

#define USB_CLASS_CODE_HUB   0x09

Hub Device.

◆ USB_CLASS_CODE_CDC_DATA

#define USB_CLASS_CODE_CDC_DATA   0x0a

CDC data device.

◆ USB_CLASS_CODE_SMART_CARD

#define USB_CLASS_CODE_SMART_CARD   0x0b

Smart Card device.

◆ USB_CLASS_CODE_CONTENT_SECURITY

#define USB_CLASS_CODE_CONTENT_SECURITY   0x0d

Content Security device.

◆ USB_CLASS_CODE_VIDEO

#define USB_CLASS_CODE_VIDEO   0x0e

Video device.

◆ USB_CLASS_CODE_PERSONAL_HEALTHCARE

#define USB_CLASS_CODE_PERSONAL_HEALTHCARE   0x0f

Personal Healthcare device.

◆ USB_CLASS_CODE_AUDIO_VIDEO

#define USB_CLASS_CODE_AUDIO_VIDEO   0x10

Audio/Video Devices.

◆ USB_CLASS_CODE_BILLBOARD

#define USB_CLASS_CODE_BILLBOARD   0x11

Billboard Device.

◆ USB_CLASS_CODE_DIAGNOSTIC

#define USB_CLASS_CODE_DIAGNOSTIC   0xDC

Diagnostic Device.

◆ USB_CLASS_CODE_WIRELESS_CONTROLLER

#define USB_CLASS_CODE_WIRELESS_CONTROLLER   0xe0

Wireless Controller.

◆ USB_CLASS_CODE_MISCELLANEOUS

#define USB_CLASS_CODE_MISCELLANEOUS   0xef

Miscellaneous.

◆ USB_CLASS_CODE_APPLICATION_SPECIFIC

#define USB_CLASS_CODE_APPLICATION_SPECIFIC   0xfe

Application Specific.

◆ USB_CLASS_CODE_VENDOR_SPECIFIC

#define USB_CLASS_CODE_VENDOR_SPECIFIC   0xff

Vendor Specific.

◆ USB_SUBCLASS_CDC_DLCM

#define USB_SUBCLASS_CDC_DLCM   0x01

Direct Line Control Model (USBPSTN1.2).

USB SubClass Codes (bDeviceSubClass/bInterfaceSubClass) (See: https://www.usb.org/defined-class-codes) Communications Devices

◆ USB_SUBCLASS_CDC_ACM

#define USB_SUBCLASS_CDC_ACM   0x02

Abstract Control Model (USBPSTN1.2).

◆ USB_SUBCLASS_CDC_TCM

#define USB_SUBCLASS_CDC_TCM   0x03

Telephone Control Model (USBPSTN1.2).

◆ USB_SUBCLASS_CDC_MCCM

#define USB_SUBCLASS_CDC_MCCM   0x04

Multi-Channel Control Model (USBISDN1.2).

◆ USB_SUBCLASS_CDC_CCM

#define USB_SUBCLASS_CDC_CCM   0x05

CAPI Control Model (USBISDN1.2).

◆ USB_SUBCLASS_CDC_ETHERNET

#define USB_SUBCLASS_CDC_ETHERNET   0x06

Ethernet Networking Control Model (USBECM1.2).

◆ USB_SUBCLASS_CDC_WHCM

#define USB_SUBCLASS_CDC_WHCM   0x08

Wireless Handset Control Model (USBWMC1.1).

◆ USB_SUBCLASS_CDC_DMM

#define USB_SUBCLASS_CDC_DMM   0x09

Device Management Model (USBWMC1.1).

◆ USB_SUBCLASS_CDC_MDLM

#define USB_SUBCLASS_CDC_MDLM   0x0a

Mobile Direct Line Model (USBWMC1.1).

◆ USB_SUBCLASS_CDC_OBEX

#define USB_SUBCLASS_CDC_OBEX   0x0b

OBEX (USBWMC1.1).

◆ USB_SUBCLASS_CDC_EEM

#define USB_SUBCLASS_CDC_EEM   0x0c

Ethernet Emulation Model (USBEEM1.0).

◆ USB_SUBCLASS_CDC_NCM

#define USB_SUBCLASS_CDC_NCM   0x0d

Network Control Model (USBNCM1.0).

◆ USB_SUBCLASS_CDC_MBIM

#define USB_SUBCLASS_CDC_MBIM   0x0e

◆ USB_SUBCLASS_IMAGE_DEFAULT

#define USB_SUBCLASS_IMAGE_DEFAULT   0x01

Still Image Devices

◆ USB_SUBCLASS_MASS_STORAGE_DEFAULT

#define USB_SUBCLASS_MASS_STORAGE_DEFAULT   0x00

SCSI command set not reported, De facto use.

Mass Storage Devices

◆ USB_SUBCLASS_MASS_STORAGE_RBC

#define USB_SUBCLASS_MASS_STORAGE_RBC   0x01

Reduced Block Commands (RBC), INCITS 330:2000, available at http://www.t10.org.

◆ USB_SUBCLASS_MASS_STORAGE_MMC5

#define USB_SUBCLASS_MASS_STORAGE_MMC5   0x02

Multi-Media Command Set 5 (MMC-5), T10/1675-D available at http://www.t10.org.

◆ USB_SUBCLASS_MASS_STORAGE_QIC157

#define USB_SUBCLASS_MASS_STORAGE_QIC157   0x03

Obsolete was QIC-157.

◆ USB_SUBCLASS_MASS_STORAGE_UFI

#define USB_SUBCLASS_MASS_STORAGE_UFI   0x04

UFI Specifies how to interface Floppy Disk Drives to USB.

◆ USB_SUBCLASS_MASS_STORAGE_SFF8070I

#define USB_SUBCLASS_MASS_STORAGE_SFF8070I   0x05

Obsolete Was SFF-8070i.

◆ USB_SUBCLASS_MASS_STORAGE_SCSI

#define USB_SUBCLASS_MASS_STORAGE_SCSI   0x06

SCSI transparent command set.

◆ USB_SUBCLASS_MASS_STORAGE_LSDFS

#define USB_SUBCLASS_MASS_STORAGE_LSDFS   0x07

LSD FS.

◆ USB_SUBCLASS_MASS_STORAGE_IEEE1667

#define USB_SUBCLASS_MASS_STORAGE_IEEE1667   0x08

IEEE 1667 Standard Protocol for Authentication in Host Attachments of Transient Storage Devices (IEEE 1667) available at www.ieee1667.com.

◆ USB_SUBCLASS_MASS_STORAGE_VENDOR_SPECIFIC

#define USB_SUBCLASS_MASS_STORAGE_VENDOR_SPECIFIC   0xff

Specific to device vendor, De facto use.

◆ USB_SUBCLASS_CONTENT_SECURITY_DEFAULT

#define USB_SUBCLASS_CONTENT_SECURITY_DEFAULT   0x00

Content Security Devices

◆ USB_SUBCLASS_AUDIO_VIDEO_CONTROL

#define USB_SUBCLASS_AUDIO_VIDEO_CONTROL   0x01

Audio/Video Device – AVControl Interface.

Audio/Video Devices

◆ USB_SUBCLASS_AUDIO_VIDEO_DATA_VIDEO

#define USB_SUBCLASS_AUDIO_VIDEO_DATA_VIDEO   0x02

Audio/Video Device – AVData Video Streaming Interface.

◆ USB_SUBCLASS_AUDIO_VIDEO_DATA_AUDIO

#define USB_SUBCLASS_AUDIO_VIDEO_DATA_AUDIO   0x03

Audio/Video Device – AVData Audio Streaming Interface.

◆ USB_SUBCLASS_BILLBOARD_DEFAULT

#define USB_SUBCLASS_BILLBOARD_DEFAULT   0x00

Billboard Devices

◆ USB_SUBCLASS_DIAGNOSTIC_DEFAULT

#define USB_SUBCLASS_DIAGNOSTIC_DEFAULT   0x01

Diagnostic Device

◆ USB_SUBCLASS_WIRELESS_CONTROLLER_BLUETOOTH

#define USB_SUBCLASS_WIRELESS_CONTROLLER_BLUETOOTH   0x01

Wireless Controller

◆ USB_SUBCLASS_WIRELESS_CONTROLLER_USB

#define USB_SUBCLASS_WIRELESS_CONTROLLER_USB   0x02

◆ USB_SUBCLASS_MISCELLANEOUS_SYNC

#define USB_SUBCLASS_MISCELLANEOUS_SYNC   0x01

Miscellaneous

◆ USB_SUBCLASS_MISCELLANEOUS_IAD_WAMP

#define USB_SUBCLASS_MISCELLANEOUS_IAD_WAMP   0x02

Interface Association Descriptor / Wire Adapter Multifunction Peripheral.

◆ USB_SUBCLASS_MISCELLANEOUS_CBAF

#define USB_SUBCLASS_MISCELLANEOUS_CBAF   0x03

Cable Based Association Framework.

◆ USB_SUBCLASS_MISCELLANEOUS_RNDIS

#define USB_SUBCLASS_MISCELLANEOUS_RNDIS   0x04

◆ USB_SUBCLASS_MISCELLANEOUS_USB3VISION

#define USB_SUBCLASS_MISCELLANEOUS_USB3VISION   0x05

◆ USB_SUBCLASS_APPLICATION_SPECIFIC_DFU

#define USB_SUBCLASS_APPLICATION_SPECIFIC_DFU   0x01

Application Specific

◆ USB_SUBCLASS_APPLICATION_SPECIFIC_IRDA

#define USB_SUBCLASS_APPLICATION_SPECIFIC_IRDA   0x02

◆ USB_SUBCLASS_APPLICATION_SPECIFIC_TMC

#define USB_SUBCLASS_APPLICATION_SPECIFIC_TMC   0x02

◆ USB_SUBCLASS_VENDOR_SPECIFIC

#define USB_SUBCLASS_VENDOR_SPECIFIC   0xff

Vendor Specific.

Vendor Specific

◆ USB_PROTOCOL_CDC_ACM_NONE

#define USB_PROTOCOL_CDC_ACM_NONE   0

Abstract Control Model - No class specific protocol required.

USB Protocol Codes (bDeviceProtocol/bInterfaceProtocol) (See: https://www.usb.org/defined-class-codes) Communications Devices

◆ USB_PROTOCOL_CDC_ACM_AT_V25TER

#define USB_PROTOCOL_CDC_ACM_AT_V25TER   1

Abstract Control Model - AT Commands: V.250 etc.

◆ USB_PROTOCOL_CDC_ACM_AT_PCCA101

#define USB_PROTOCOL_CDC_ACM_AT_PCCA101   2

Abstract Control Model - AT Commands defined by PCCA-101.

◆ USB_PROTOCOL_CDC_ACM_AT_PCCA101_WAKE

#define USB_PROTOCOL_CDC_ACM_AT_PCCA101_WAKE   3

Abstract Control Model - AT Commands defined by PCCA-101 & Annex O.

◆ USB_PROTOCOL_CDC_ACM_AT_GSM

#define USB_PROTOCOL_CDC_ACM_AT_GSM   4

Abstract Control Model - AT Commands defined by GSM 07.07.

◆ USB_PROTOCOL_CDC_ACM_AT_3G

#define USB_PROTOCOL_CDC_ACM_AT_3G   5

Abstract Control Model - AT Commands defined by 3GPP 27.007.

◆ USB_PROTOCOL_CDC_ACM_AT_CDMA

#define USB_PROTOCOL_CDC_ACM_AT_CDMA   6

Abstract Control Model - AT Commands defined by TIA for CDMA.

◆ USB_PROTOCOL_CDC_ACM_VENDOR

#define USB_PROTOCOL_CDC_ACM_VENDOR   0xff

Abstract Control Model - Vendor-specific.

◆ USB_PROTOCOL_CDC_EEM

#define USB_PROTOCOL_CDC_EEM   7

Ethernet Emulation Model.

◆ USB_PROTOCOL_CDC_NCM_NTB

#define USB_PROTOCOL_CDC_NCM_NTB   1

Network Control Model - Network Transfer Block.

◆ USB_PROTOCOL_CDC_MBIM_NTB

#define USB_PROTOCOL_CDC_MBIM_NTB   2

Network Transfer Block.

◆ USB_PROTOCOL_IMAGE_DEFAULT

#define USB_PROTOCOL_IMAGE_DEFAULT   0x01

Still Image Devices

◆ USB_PROTOCOL_MASS_STORAGE_CBI

#define USB_PROTOCOL_MASS_STORAGE_CBI   0x00

CBI (with command completion interrupt) USB Mass Storage Class Control/Bulk/Interrupt Transport.

Mass Storage Devices

◆ USB_PROTOCOL_MASS_STORAGE_CB

#define USB_PROTOCOL_MASS_STORAGE_CB   0x01

CBI (with no command completion interrupt) USB Mass Storage Class Control/Bulk/Interrupt Transport.

◆ USB_PROTOCOL_MASS_STORAGE_BBB

#define USB_PROTOCOL_MASS_STORAGE_BBB   0x50

BBB USB Mass Storage Class Bulk-Only Transport.

◆ USB_PROTOCOL_MASS_STORAGE_UAS

#define USB_PROTOCOL_MASS_STORAGE_UAS   0x62

UAS.

◆ USB_PROTOCOL_MASS_STORAGE_VENDOR_SPECIFIC

#define USB_PROTOCOL_MASS_STORAGE_VENDOR_SPECIFIC   0xff

Specific to device vendor, De facto use.

◆ USB_PROTOCOL_HUB_FULLSPEED

#define USB_PROTOCOL_HUB_FULLSPEED   0x00

Full speed Hub.

Hub Devices

◆ USB_PROTOCOL_HUB_HIGHSPEED_SINGLE_TT

#define USB_PROTOCOL_HUB_HIGHSPEED_SINGLE_TT   0x01

Hi-speed hub with single Transaction Translator.

◆ USB_PROTOCOL_HUB_HIGHSPEED_MULTI_TT

#define USB_PROTOCOL_HUB_HIGHSPEED_MULTI_TT   0x02

Hi-speed hub with multiple Transaction Translators.

◆ USB_PROTOCOL_CONTENT_SECURITY_DEFAULT

#define USB_PROTOCOL_CONTENT_SECURITY_DEFAULT   0x00

Content Security Devices

◆ USB_PROTOCOL_AUDIO_VIDEO_DEFAULT

#define USB_PROTOCOL_AUDIO_VIDEO_DEFAULT   0x00

Audio/Video Devices

◆ USB_PROTOCOL_BILLBOARD_DEFAULT

#define USB_PROTOCOL_BILLBOARD_DEFAULT   0x00

Billboard Devices

◆ USB_PROTOCOL_DIAGNOSTIC_DEFAULT

#define USB_PROTOCOL_DIAGNOSTIC_DEFAULT   0x01

Diagnostic Device

◆ USB_PROTOCOL_WIRELESS_CONTROLLER_BLUETOOTH

#define USB_PROTOCOL_WIRELESS_CONTROLLER_BLUETOOTH   0x01

See: http://www.bluetooth.com/.

Wireless Controller

◆ USB_PROTOCOL_WIRELESS_CONTROLLER_UWB

#define USB_PROTOCOL_WIRELESS_CONTROLLER_UWB   0x02

See: Wireless USB Specification in Chapter 8.

◆ USB_PROTOCOL_WIRELESS_CONTROLLER_NDIS

#define USB_PROTOCOL_WIRELESS_CONTROLLER_NDIS   0x03

◆ USB_PROTOCOL_WIRELESS_CONTROLLER_BLUETOOTH_AMP

#define USB_PROTOCOL_WIRELESS_CONTROLLER_BLUETOOTH_AMP   0x04

◆ USB_PROTOCOL_WIRELESS_CONTROLLER_USB_HOST

#define USB_PROTOCOL_WIRELESS_CONTROLLER_USB_HOST   0x01

Host Wire Adapter Control/Data interface. Definition can be found in the Wireless USB Specification in Chapter 8.

◆ USB_PROTOCOL_WIRELESS_CONTROLLER_USB_DEVICE

#define USB_PROTOCOL_WIRELESS_CONTROLLER_USB_DEVICE   0x02

Device Wire Adapter Control/Data interface. Definition can be found in the Wireless USB Specification in Chapter 8.

◆ USB_PROTOCOL_WIRELESS_CONTROLLER_USB_DEVICE_ISOC

#define USB_PROTOCOL_WIRELESS_CONTROLLER_USB_DEVICE_ISOC   0x03

Device Wire Adapter Isochronous interface. Definition can be found in the Wireless USB Specification in Chapter 8.

◆ USB_PROTOCOL_MISCELLANEOUS_ACTIVESYNC

#define USB_PROTOCOL_MISCELLANEOUS_ACTIVESYNC   0x01

Active Sync device.

Miscellaneous

◆ USB_PROTOCOL_MISCELLANEOUS_PALMSYNC

#define USB_PROTOCOL_MISCELLANEOUS_PALMSYNC   0x02

Palm Sync.

◆ USB_PROTOCOL_MISCELLANEOUS_IAD

#define USB_PROTOCOL_MISCELLANEOUS_IAD   0x01

Interface Association Descriptor. The usage of this class code triple is defined in the Interface Association Descriptor ECN.

◆ USB_PROTOCOL_MISCELLANEOUS_WAMP

#define USB_PROTOCOL_MISCELLANEOUS_WAMP   0x02

Wire Adapter Multifunction Peripheral programming interface. Definition can be found in the Wireless USB Specification in Chapter 8.

◆ USB_PROTOCOL_MISCELLANEOUS_CBAF

#define USB_PROTOCOL_MISCELLANEOUS_CBAF   0x01

Cable Based Association Framework. This is defined in the Association Model addendum to the Wireless USB specification.

◆ USB_PROTOCOL_MISCELLANEOUS_RNDIS_ETHERNET

#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_ETHERNET   0x01

RNDIS over Ethernet.

◆ USB_PROTOCOL_MISCELLANEOUS_RNDIS_WIFI

#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_WIFI   0x02

RNDIS over WiFi.

◆ USB_PROTOCOL_MISCELLANEOUS_RNDIS_WIMAX

#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_WIMAX   0x03

RNDIS over WiMAX.

◆ USB_PROTOCOL_MISCELLANEOUS_RNDIS_WWAN

#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_WWAN   0x04

RNDIS over WWAN.

◆ USB_PROTOCOL_MISCELLANEOUS_RNDIS_IPV4

#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_IPV4   0x05

RNDIS for Raw IPv4.

◆ USB_PROTOCOL_MISCELLANEOUS_RNDIS_IPV6

#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_IPV6   0x06

RNDIS for Raw IPv6.

◆ USB_PROTOCOL_MISCELLANEOUS_RNDIS_GPRS

#define USB_PROTOCOL_MISCELLANEOUS_RNDIS_GPRS   0x07

RNDIS for GPRS.

◆ USB_PROTOCOL_MISCELLANEOUS_USB3VISION_CONTROL

#define USB_PROTOCOL_MISCELLANEOUS_USB3VISION_CONTROL   0x00

USB3 Vision Control Interface.

◆ USB_PROTOCOL_MISCELLANEOUS_USB3VISION_EVENT

#define USB_PROTOCOL_MISCELLANEOUS_USB3VISION_EVENT   0x01

USB3 Vision Event Interface.

◆ USB_PROTOCOL_MISCELLANEOUS_USB3VISION_STREAM

#define USB_PROTOCOL_MISCELLANEOUS_USB3VISION_STREAM   0x02

USB3 Vision Streaming Interface.

◆ USB_PROTOCOL_APPLICATION_SPECIFIC_DFU_DEFAULT

#define USB_PROTOCOL_APPLICATION_SPECIFIC_DFU_DEFAULT   0x01

Device Firmware Upgrade.

Application Specific

◆ USB_PROTOCOL_APPLICATION_SPECIFIC_IRDA_DEFAULT

#define USB_PROTOCOL_APPLICATION_SPECIFIC_IRDA_DEFAULT   0x00

IRDA Bridge device.

◆ USB_PROTOCOL_APPLICATION_SPECIFIC_TMC_DEFAULT

#define USB_PROTOCOL_APPLICATION_SPECIFIC_TMC_DEFAULT   0x00

USB Test and Measurement Device.

◆ USB_PROTOCOL_APPLICATION_SPECIFIC_TMC_488

#define USB_PROTOCOL_APPLICATION_SPECIFIC_TMC_488   0x01

USB Test and Measurement Device conforming to the USBTMC USB488 Subclass Specification.

◆ USB_LANG_ARABIC

#define USB_LANG_ARABIC   0x01

Arabic.

USB Primary Language IDs (See Language Identifiers supplement to the USB 2.0 specification) (These are the first 10 bits of the 16-bit language identifier) Reserved 0x00

◆ USB_LANG_BULGARIAN

#define USB_LANG_BULGARIAN   0x02

Bulgarian.

◆ USB_LANG_CATALAN

#define USB_LANG_CATALAN   0x03

Catalan.

◆ USB_LANG_CHINESE

#define USB_LANG_CHINESE   0x04

Chinese.

◆ USB_LANG_CZECH

#define USB_LANG_CZECH   0x05

Czech.

◆ USB_LANG_DANISH

#define USB_LANG_DANISH   0x06

Danish.

◆ USB_LANG_GERMAN

#define USB_LANG_GERMAN   0x07

German.

◆ USB_LANG_GREEK

#define USB_LANG_GREEK   0x08

Greek.

◆ USB_LANG_ENGLISH

#define USB_LANG_ENGLISH   0x09

English.

◆ USB_LANG_SPANISH

#define USB_LANG_SPANISH   0x0a

Spanish.

◆ USB_LANG_FINNISH

#define USB_LANG_FINNISH   0x0b

Finnish.

◆ USB_LANG_FRENCH

#define USB_LANG_FRENCH   0x0c

French.

◆ USB_LANG_HEBREW

#define USB_LANG_HEBREW   0x0d

Hebrew.

◆ USB_LANG_HUNGARIAN

#define USB_LANG_HUNGARIAN   0x0e

Hungarian.

◆ USB_LANG_ICELANDIC

#define USB_LANG_ICELANDIC   0x0f

Icelandic.

◆ USB_LANG_ITALIAN

#define USB_LANG_ITALIAN   0x10

Italian.

◆ USB_LANG_JAPANESE

#define USB_LANG_JAPANESE   0x11

Japanese.

◆ USB_LANG_KOREAN

#define USB_LANG_KOREAN   0x12

Korean.

◆ USB_LANG_DUTCH

#define USB_LANG_DUTCH   0x13

Dutch.

◆ USB_LANG_NORWEGIAN

#define USB_LANG_NORWEGIAN   0x14

Norwegian.

◆ USB_LANG_POLISH

#define USB_LANG_POLISH   0x15

Polish.

◆ USB_LANG_PORTUGUESE

#define USB_LANG_PORTUGUESE   0x16

Portuguese.

◆ USB_LANG_ROMANIAN

#define USB_LANG_ROMANIAN   0x18

Romanian.

◆ USB_LANG_RUSSIAN

#define USB_LANG_RUSSIAN   0x19

Russian.

◆ USB_LANG_CROATIAN

#define USB_LANG_CROATIAN   0x1a

Croatian.

◆ USB_LANG_SERBIAN

#define USB_LANG_SERBIAN   0x1a

Serbian.

◆ USB_LANG_SLOVAK

#define USB_LANG_SLOVAK   0x1b

Slovak.

◆ USB_LANG_ALBANIAN

#define USB_LANG_ALBANIAN   0x1c

Albanian.

◆ USB_LANG_SWEDISH

#define USB_LANG_SWEDISH   0x1d

Swedish.

◆ USB_LANG_THAI

#define USB_LANG_THAI   0x1e

Thai.

◆ USB_LANG_TURKISH

#define USB_LANG_TURKISH   0x1f

Turkish.

◆ USB_LANG_URDU

#define USB_LANG_URDU   0x20

Urdu.

◆ USB_LANG_INDONESIAN

#define USB_LANG_INDONESIAN   0x21

Indonesian.

◆ USB_LANG_UKRANIAN

#define USB_LANG_UKRANIAN   0x22

Ukrainian.

◆ USB_LANG_BELARUSIAN

#define USB_LANG_BELARUSIAN   0x23

Belarusian.

◆ USB_LANG_SLOVENIAN

#define USB_LANG_SLOVENIAN   0x24

Slovenian.

◆ USB_LANG_ESTONIAN

#define USB_LANG_ESTONIAN   0x25

Estonian.

◆ USB_LANG_LATVIAN

#define USB_LANG_LATVIAN   0x26

Latvian.

◆ USB_LANG_LITHUANIAN

#define USB_LANG_LITHUANIAN   0x27

Lithuanian.

◆ USB_LANG_FARSI

#define USB_LANG_FARSI   0x29

Farsi.

◆ USB_LANG_VIETNAMESE

#define USB_LANG_VIETNAMESE   0x2a

Vietnamese.

◆ USB_LANG_ARMENIAN

#define USB_LANG_ARMENIAN   0x2b

Armenian.

◆ USB_LANG_AZERI

#define USB_LANG_AZERI   0x2c

Azeri.

◆ USB_LANG_BASQUE

#define USB_LANG_BASQUE   0x2d

Basque.

◆ USB_LANG_MACEDONIAN

#define USB_LANG_MACEDONIAN   0x2f

Macedonian.

◆ USB_LANG_AFRIKAANS

#define USB_LANG_AFRIKAANS   0x36

Afrikaans.

◆ USB_LANG_GEORGIAN

#define USB_LANG_GEORGIAN   0x37

Georgian.

◆ USB_LANG_FAEROESE

#define USB_LANG_FAEROESE   0x38

Faeroese.

◆ USB_LANG_HINDI

#define USB_LANG_HINDI   0x39

Hindi.

◆ USB_LANG_MALAY

#define USB_LANG_MALAY   0x3e

Malay.

◆ USB_LANG_KAZAK

#define USB_LANG_KAZAK   0x3f

Kazak.

◆ USB_LANG_SWAHILI

#define USB_LANG_SWAHILI   0x41

Swahili.

◆ USB_LANG_UZBEK

#define USB_LANG_UZBEK   0x43

Uzbek.

◆ USB_LANG_TATAR

#define USB_LANG_TATAR   0x44

Tatar.

◆ USB_LANG_BENGALI

#define USB_LANG_BENGALI   0x45

Bengali.

◆ USB_LANG_PUNJABI

#define USB_LANG_PUNJABI   0x46

Punjabi.

◆ USB_LANG_GUJARATI

#define USB_LANG_GUJARATI   0x47

Gujarati.

◆ USB_LANG_ORIYA

#define USB_LANG_ORIYA   0x48

Oriya.

◆ USB_LANG_TAMIL

#define USB_LANG_TAMIL   0x49

Tamil.

◆ USB_LANG_TELUGU

#define USB_LANG_TELUGU   0x4a

Telugu.

◆ USB_LANG_KANNADA

#define USB_LANG_KANNADA   0x4b

Kannada.

◆ USB_LANG_MALAYALAM

#define USB_LANG_MALAYALAM   0x4c

Malayalam.

◆ USB_LANG_ASSAMESE

#define USB_LANG_ASSAMESE   0x4d

Assamese.

◆ USB_LANG_MARATHI

#define USB_LANG_MARATHI   0x4e

Marathi.

◆ USB_LANG_SANSKRIT

#define USB_LANG_SANSKRIT   0x4f

Sanskrit.

◆ USB_LANG_KONKANI

#define USB_LANG_KONKANI   0x57

Konkani.

◆ USB_LANG_MANIPURI

#define USB_LANG_MANIPURI   0x58

Manipuri.

◆ USB_LANG_SINDHI

#define USB_LANG_SINDHI   0x59

Sindhi.

◆ USB_LANG_KASHMIRI

#define USB_LANG_KASHMIRI   0x60

Kashmiri.

◆ USB_LANG_NEPALI

#define USB_LANG_NEPALI   0x61

Nepali.

◆ USB_LANG_HID

#define USB_LANG_HID   0xff

Reserved for USB HID Class use.

Reserved 0x62-0xfe

◆ USB_PRIMARY_LANGUAGE_MASK

#define USB_PRIMARY_LANGUAGE_MASK   0x3ff

Reserved 0x100-0x3ff

◆ USB_SUBLANG_ARABIC_SAUDI_ARABIA

#define USB_SUBLANG_ARABIC_SAUDI_ARABIA   0x01

Arabic (Saudi Arabia).

USB SubLanguage IDs (See Language Identifiers supplement to the USB 2.0 specification) (These are the upper 6 bits of the 16-bit language identifier) Reserved 0x00-0x02

◆ USB_SUBLANG_ARABIC_IRAQ

#define USB_SUBLANG_ARABIC_IRAQ   0x02

Arabic (Iraq).

◆ USB_SUBLANG_ARABIC_EGYPT

#define USB_SUBLANG_ARABIC_EGYPT   0x03

Arabic (Egypt).

◆ USB_SUBLANG_ARABIC_LIBYA

#define USB_SUBLANG_ARABIC_LIBYA   0x04

Arabic (Libya).

◆ USB_SUBLANG_ARABIC_ALGERIA

#define USB_SUBLANG_ARABIC_ALGERIA   0x05

Arabic (Algeria).

◆ USB_SUBLANG_ARABIC_MOROCCO

#define USB_SUBLANG_ARABIC_MOROCCO   0x06

Arabic (Morocco).

◆ USB_SUBLANG_ARABIC_TUNISIA

#define USB_SUBLANG_ARABIC_TUNISIA   0x07

Arabic (Tunisia).

◆ USB_SUBLANG_ARABIC_OMAN

#define USB_SUBLANG_ARABIC_OMAN   0x08

Arabic (Oman).

◆ USB_SUBLANG_ARABIC_YEMEN

#define USB_SUBLANG_ARABIC_YEMEN   0x09

Arabic (Yemen).

◆ USB_SUBLANG_ARABIC_SYRIA

#define USB_SUBLANG_ARABIC_SYRIA   0x10

Arabic (Syria).

◆ USB_SUBLANG_ARABIC_JORDAN

#define USB_SUBLANG_ARABIC_JORDAN   0x11

Arabic (Jordan).

◆ USB_SUBLANG_ARABIC_LEBANON

#define USB_SUBLANG_ARABIC_LEBANON   0x12

Arabic (Lebanon).

◆ USB_SUBLANG_ARABIC_KUWAIT

#define USB_SUBLANG_ARABIC_KUWAIT   0x13

Arabic (Kuwait).

◆ USB_SUBLANG_ARABIC_UAE

#define USB_SUBLANG_ARABIC_UAE   0x14

Arabic (U.A.E.).

◆ USB_SUBLANG_ARABIC_BAHRAIN

#define USB_SUBLANG_ARABIC_BAHRAIN   0x15

Arabic (Bahrain).

◆ USB_SUBLANG_ARABIC_QATAR

#define USB_SUBLANG_ARABIC_QATAR   0x16

Arabic (Qatar).

◆ USB_SUBLANG_AZERI_CYRILLIC

#define USB_SUBLANG_AZERI_CYRILLIC   0x01

Azeri (Cyrillic).

◆ USB_SUBLANG_AZERI_LATIN

#define USB_SUBLANG_AZERI_LATIN   0x02

Azeri (Latin).

◆ USB_SUBLANG_CHINESE_TRADITIONAL

#define USB_SUBLANG_CHINESE_TRADITIONAL   0x01

Chinese (Traditional).

◆ USB_SUBLANG_CHINESE_SIMPLIFIED

#define USB_SUBLANG_CHINESE_SIMPLIFIED   0x02

Chinese (Simplified).

◆ USB_SUBLANG_CHINESE_HONGKONG

#define USB_SUBLANG_CHINESE_HONGKONG   0x03

Chinese (Hong Kong SAR, PRC).

◆ USB_SUBLANG_CHINESE_SINGAPORE

#define USB_SUBLANG_CHINESE_SINGAPORE   0x04

Chinese (Singapore).

◆ USB_SUBLANG_CHINESE_MACAU

#define USB_SUBLANG_CHINESE_MACAU   0x05

Chinese (Macau SAR).

◆ USB_SUBLANG_DUTCH

#define USB_SUBLANG_DUTCH   0x01

Dutch.

◆ USB_SUBLANG_DUTCH_BELGIAN

#define USB_SUBLANG_DUTCH_BELGIAN   0x02

Dutch (Belgian).

◆ USB_SUBLANG_ENGLISH_US

#define USB_SUBLANG_ENGLISH_US   0x01

English (US).

◆ USB_SUBLANG_ENGLISH_UK

#define USB_SUBLANG_ENGLISH_UK   0x02

English (UK).

◆ USB_SUBLANG_ENGLISH_AUS

#define USB_SUBLANG_ENGLISH_AUS   0x03

English (Australian).

◆ USB_SUBLANG_ENGLISH_CAN

#define USB_SUBLANG_ENGLISH_CAN   0x04

English (Canadian).

◆ USB_SUBLANG_ENGLISH_NZ

#define USB_SUBLANG_ENGLISH_NZ   0x05

English (New Zealand).

◆ USB_SUBLANG_ENGLISH_EIRE

#define USB_SUBLANG_ENGLISH_EIRE   0x06

English (Ireland).

◆ USB_SUBLANG_ENGLISH_SOUTH_AFRICA

#define USB_SUBLANG_ENGLISH_SOUTH_AFRICA   0x07

English (South Africa).

◆ USB_SUBLANG_ENGLISH_JAMAICA

#define USB_SUBLANG_ENGLISH_JAMAICA   0x08

English (Jamaica).

◆ USB_SUBLANG_ENGLISH_CARIBBEAN

#define USB_SUBLANG_ENGLISH_CARIBBEAN   0x09

English (Caribbean).

◆ USB_SUBLANG_ENGLISH_BELIZE

#define USB_SUBLANG_ENGLISH_BELIZE   0x0a

English (Belize).

◆ USB_SUBLANG_ENGLISH_TRINIDAD

#define USB_SUBLANG_ENGLISH_TRINIDAD   0x0b

English (Trinidad).

◆ USB_SUBLANG_ENGLISH_PHILIPPINES

#define USB_SUBLANG_ENGLISH_PHILIPPINES   0x0c

English (Zimbabwe).

◆ USB_SUBLANG_ENGLISH_ZIMBABWE

#define USB_SUBLANG_ENGLISH_ZIMBABWE   0x0d

English (Philippines).

◆ USB_SUBLANG_FRENCH

#define USB_SUBLANG_FRENCH   0x01

French.

◆ USB_SUBLANG_FRENCH_BELGIAN

#define USB_SUBLANG_FRENCH_BELGIAN   0x02

French (Belgian).

◆ USB_SUBLANG_FRENCH_CANADIAN

#define USB_SUBLANG_FRENCH_CANADIAN   0x03

French (Canadian).

◆ USB_SUBLANG_FRENCH_SWISS

#define USB_SUBLANG_FRENCH_SWISS   0x04

French (Swiss).

◆ USB_SUBLANG_FRENCH_LUXEMBOURG

#define USB_SUBLANG_FRENCH_LUXEMBOURG   0x05

French (Luxembourg).

◆ USB_SUBLANG_FRENCH_MONACO

#define USB_SUBLANG_FRENCH_MONACO   0x06

French (Monaco).

◆ USB_SUBLANG_GERMAN

#define USB_SUBLANG_GERMAN   0x01

German.

◆ USB_SUBLANG_GERMAN_SWISS

#define USB_SUBLANG_GERMAN_SWISS   0x02

German (Swiss).

◆ USB_SUBLANG_GERMAN_AUSTRIAN

#define USB_SUBLANG_GERMAN_AUSTRIAN   0x03

German (Austrian).

◆ USB_SUBLANG_GERMAN_LUXEMBOURG

#define USB_SUBLANG_GERMAN_LUXEMBOURG   0x04

German (Luxembourg).

◆ USB_SUBLANG_GERMAN_LIECHTENSTEIN

#define USB_SUBLANG_GERMAN_LIECHTENSTEIN   0x05

German (Liechtenstein).

◆ USB_SUBLANG_ITALIAN

#define USB_SUBLANG_ITALIAN   0x01

Italian.

◆ USB_SUBLANG_ITALIAN_SWISS

#define USB_SUBLANG_ITALIAN_SWISS   0x02

Italian (Swiss).

◆ USB_SUBLANG_KASHMIRI_INDIA

#define USB_SUBLANG_KASHMIRI_INDIA   0x02

Kashmiri (India).

◆ USB_SUBLANG_KOREAN

#define USB_SUBLANG_KOREAN   0x01

Korean.

◆ USB_SUBLANG_LITHUANIAN

#define USB_SUBLANG_LITHUANIAN   0x01

Lithuanian.

◆ USB_SUBLANG_MALAY_MALAYSIA

#define USB_SUBLANG_MALAY_MALAYSIA   0x01

Malay (Malaysia).

◆ USB_SUBLANG_MALAY_BRUNEI_DARUSSALAM

#define USB_SUBLANG_MALAY_BRUNEI_DARUSSALAM   0x02

Malay (Brunei Darassalam).

◆ USB_SUBLANG_NEPALI_INDIA

#define USB_SUBLANG_NEPALI_INDIA   0x02

Nepali (India).

◆ USB_SUBLANG_NORWEGIAN_BOKMAL

#define USB_SUBLANG_NORWEGIAN_BOKMAL   0x01

Norwegian (Bokmal).

◆ USB_SUBLANG_NORWEGIAN_NYNORSK

#define USB_SUBLANG_NORWEGIAN_NYNORSK   0x02

Norwegian (Nynorsk).

◆ USB_SUBLANG_PORTUGUESE

#define USB_SUBLANG_PORTUGUESE   0x01

Portuguese (Brazilian).

◆ USB_SUBLANG_PORTUGUESE_BRAZILIAN

#define USB_SUBLANG_PORTUGUESE_BRAZILIAN   0x02

Portuguese.

◆ USB_SUBLANG_SERBIAN_LATIN

#define USB_SUBLANG_SERBIAN_LATIN   0x02

Serbian (Latin).

◆ USB_SUBLANG_SERBIAN_CYRILLIC

#define USB_SUBLANG_SERBIAN_CYRILLIC   0x03

Serbian (Cyrillic).

◆ USB_SUBLANG_SPANISH

#define USB_SUBLANG_SPANISH   0x01

Spanish (Castilian).

◆ USB_SUBLANG_SPANISH_MEXICAN

#define USB_SUBLANG_SPANISH_MEXICAN   0x02

Spanish (Mexican).

◆ USB_SUBLANG_SPANISH_MODERN

#define USB_SUBLANG_SPANISH_MODERN   0x03

Spanish (Modern).

◆ USB_SUBLANG_SPANISH_GUATEMALA

#define USB_SUBLANG_SPANISH_GUATEMALA   0x04

Spanish (Guatemala).

◆ USB_SUBLANG_SPANISH_COSTA_RICA

#define USB_SUBLANG_SPANISH_COSTA_RICA   0x05

Spanish (Costa Rica).

◆ USB_SUBLANG_SPANISH_PANAMA

#define USB_SUBLANG_SPANISH_PANAMA   0x06

Spanish (Panama).

◆ USB_SUBLANG_SPANISH_DOMINICAN_REPUBLIC

#define USB_SUBLANG_SPANISH_DOMINICAN_REPUBLIC   0x07

Spanish (Dominican Republic).

◆ USB_SUBLANG_SPANISH_VENEZUELA

#define USB_SUBLANG_SPANISH_VENEZUELA   0x08

Spanish (Venezuela).

◆ USB_SUBLANG_SPANISH_COLOMBIA

#define USB_SUBLANG_SPANISH_COLOMBIA   0x09

Spanish (Colombia).

◆ USB_SUBLANG_SPANISH_PERU

#define USB_SUBLANG_SPANISH_PERU   0x0a

Spanish (Peru).

◆ USB_SUBLANG_SPANISH_ARGENTINA

#define USB_SUBLANG_SPANISH_ARGENTINA   0x0b

Spanish (Argentina).

◆ USB_SUBLANG_SPANISH_ECUADOR

#define USB_SUBLANG_SPANISH_ECUADOR   0x0c

Spanish (Ecuador).

◆ USB_SUBLANG_SPANISH_CHILE

#define USB_SUBLANG_SPANISH_CHILE   0x0d

Spanish (Chile).

◆ USB_SUBLANG_SPANISH_URUGUAY

#define USB_SUBLANG_SPANISH_URUGUAY   0x0e

Spanish (Uruguay).

◆ USB_SUBLANG_SPANISH_PARAGUAY

#define USB_SUBLANG_SPANISH_PARAGUAY   0x0f

Spanish (Paraguay).

◆ USB_SUBLANG_SPANISH_BOLIVIA

#define USB_SUBLANG_SPANISH_BOLIVIA   0x10

Spanish (Bolivia).

◆ USB_SUBLANG_SPANISH_EL_SALVADOR

#define USB_SUBLANG_SPANISH_EL_SALVADOR   0x11

Spanish (El Salvador).

◆ USB_SUBLANG_SPANISH_HONDURAS

#define USB_SUBLANG_SPANISH_HONDURAS   0x12

Spanish (Honduras).

◆ USB_SUBLANG_SPANISH_NICARAGUA

#define USB_SUBLANG_SPANISH_NICARAGUA   0x13

Spanish (Nicaragua).

◆ USB_SUBLANG_SPANISH_PUERTO_RICO

#define USB_SUBLANG_SPANISH_PUERTO_RICO   0x14

Spanish (Puerto Rico).

◆ USB_SUBLANG_SWEDISH

#define USB_SUBLANG_SWEDISH   0x01

Swedish.

◆ USB_SUBLANG_SWEDISH_FINLAND

#define USB_SUBLANG_SWEDISH_FINLAND   0x02

Swedish (Finland).

◆ USB_SUBLANG_URDU_PAKISTAN

#define USB_SUBLANG_URDU_PAKISTAN   0x01

Urdu (Pakistan).

◆ USB_SUBLANG_URDU_INDIA

#define USB_SUBLANG_URDU_INDIA   0x02

Urdu (India).

◆ USB_SUBLANG_UZBEK_LATIN

#define USB_SUBLANG_UZBEK_LATIN   0x01

Uzbek (Latin).

◆ USB_SUBLANG_UZBEK_CYRILLIC

#define USB_SUBLANG_UZBEK_CYRILLIC   0x02

Uzbek (Cyrillic).

◆ USB_SUBLANG_HID_USAGE_DATA_DESCRIPTOR

#define USB_SUBLANG_HID_USAGE_DATA_DESCRIPTOR   0x01

HID (Usage Data Descriptor).

◆ USB_SUBLANG_HID_VENDOR_DEFINED_1

#define USB_SUBLANG_HID_VENDOR_DEFINED_1   0x3c

HID (Vendor Defined 1).

◆ USB_SUBLANG_HID_VENDOR_DEFINED_2

#define USB_SUBLANG_HID_VENDOR_DEFINED_2   0x3d

HID (Vendor Defined 2).

◆ USB_SUBLANG_HID_VENDOR_DEFINED_3

#define USB_SUBLANG_HID_VENDOR_DEFINED_3   0x3e

HID (Vendor Defined 3).

◆ USB_SUBLANG_HID_VENDOR_DEFINED_4

#define USB_SUBLANG_HID_VENDOR_DEFINED_4   0x3f

HID (Vendor Defined 4).

◆ USB_LANGID_US_ENGLISH

#define USB_LANGID_US_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_US << 10))

English (US).

USB Primary Language Identifiers (See Language Identifiers supplement to the USB 2.0 specification)

◆ USB_LANGID_UK_ENGLISH

#define USB_LANGID_UK_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_UK << 10))

English (UK).

◆ USB_LANGID_AUS_ENGLISH

#define USB_LANGID_AUS_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_AUS << 10))

English (Australian).

◆ USB_LANGID_CAN_ENGLISH

#define USB_LANGID_CAN_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_CAN << 10))

English (Canadian).

◆ USB_LANGID_NZ_ENGLISH

#define USB_LANGID_NZ_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_NZ << 10))

English (New Zealand).

◆ USB_LANGID_EIRE_ENGLISH

#define USB_LANGID_EIRE_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_EIRE << 10))

English (Ireland).

◆ USB_LANGID_SOUTH_AFRICA_ENGLISH

#define USB_LANGID_SOUTH_AFRICA_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_SOUTH_AFRICA << 10))

English (South Africa).

◆ USB_LANGID_JAMAICA_ENGLISH

#define USB_LANGID_JAMAICA_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_JAMAICA << 10))

English (Jamaica).

◆ USB_LANGID_CARIBBEAN_ENGLISH

#define USB_LANGID_CARIBBEAN_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_CARIBBEAN << 10))

English (Caribbean).

◆ USB_LANGID_BELIZE_ENGLISH

#define USB_LANGID_BELIZE_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_BELIZE << 10))

English (Belize).

◆ USB_LANGID_TRINIDAD_ENGLISH

#define USB_LANGID_TRINIDAD_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_TRINIDAD << 10))

English (Trinidad).

◆ USB_LANGID_PHILIPPINES_ENGLISH

#define USB_LANGID_PHILIPPINES_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_PHILIPPINES << 10))

English (Philippines).

◆ USB_LANGID_ZIMBABWE_ENGLISH

#define USB_LANGID_ZIMBABWE_ENGLISH   (USB_LANG_ENGLISH | (USB_SUBLANG_ENGLISH_ZIMBABWE << 10))

English (Zimbabwe).

◆ USB_LANGID_USAGE_HID

#define USB_LANGID_USAGE_HID   (USB_LANG_HID | (USB_SUBLANG_HID_USAGE_DATA_DESCRIPTOR << 10))

◆ USB_LANGID_VENDOR1_HID

#define USB_LANGID_VENDOR1_HID   (USB_LANG_HID | (USB_SUBLANG_HID_VENDOR_DEFINED_1 << 10))

◆ USB_LANGID_VENDOR2_HID

#define USB_LANGID_VENDOR2_HID   (USB_LANG_HID | (USB_SUBLANG_HID_VENDOR_DEFINED_2 << 10))

◆ USB_LANGID_VENDOR3_HID

#define USB_LANGID_VENDOR3_HID   (USB_LANG_HID | (USB_SUBLANG_HID_VENDOR_DEFINED_3 << 10))

◆ USB_LANGID_VENDOR4_HID

#define USB_LANGID_VENDOR4_HID   (USB_LANG_HID | (USB_SUBLANG_HID_VENDOR_DEFINED_4 << 10))

◆ USB_VENDORID_REALTEK

#define USB_VENDORID_REALTEK   0x0BDA

Realtek.

USB Vendor IDs

◆ USB_HUB_PREFIX

#define USB_HUB_PREFIX   "USBHub"

Name prefix for USB Hubs.

USB Hub specific constants

◆ USBHUB_TYPE_NONE

#define USBHUB_TYPE_NONE   0

USB Hub Types

◆ USBHUB_TYPE_MAX

#define USBHUB_TYPE_MAX   0

◆ USBHUB_STATE_DETACHED

#define USBHUB_STATE_DETACHED   0

USB Hub States

◆ USBHUB_STATE_DETACHING

#define USBHUB_STATE_DETACHING   1

◆ USBHUB_STATE_ATTACHING

#define USBHUB_STATE_ATTACHING   2

◆ USBHUB_STATE_ATTACHED

#define USBHUB_STATE_ATTACHED   3

◆ USBHUB_STATE_MAX

#define USBHUB_STATE_MAX   3

◆ USBHUB_FLAG_NONE

#define USBHUB_FLAG_NONE   0x00000000

USB Hub Flags

◆ USBHUB_FLAG_COMPOUND

#define USBHUB_FLAG_COMPOUND   0x00000001

The Hub is part of a compound device.

◆ USBHUB_FLAG_PORT_POWER

#define USBHUB_FLAG_PORT_POWER   0x00000002

The Hub supports per port power switching.

◆ USBHUB_FLAG_PORT_PROTECTION

#define USBHUB_FLAG_PORT_PROTECTION   0x00000004

The Hub supports per port over current protection.

◆ USBHUB_FLAG_MULTI_TRANSLATOR

#define USBHUB_FLAG_MULTI_TRANSLATOR   0x00000008

The Hub includes multiple transaction translators (1 per port).

◆ USBHUB_THREAD_STACK_SIZE

#define USBHUB_THREAD_STACK_SIZE   SIZE_32K

Stack size of USB hub thread.

◆ USBHUB_THREAD_PRIORITY

#define USBHUB_THREAD_PRIORITY   THREAD_PRIORITY_HIGHEST

Priority of USB hub thread.

◆ USBHUB_THREAD_NAME

#define USBHUB_THREAD_NAME   "USB Hub"

Name of USB hub thread.

◆ USBHUB_DEVICE_DESCRIPTION

#define USBHUB_DEVICE_DESCRIPTION   "USB Hub"

Description of USB hub device.

◆ USBHUB_DRIVER_NAME

#define USBHUB_DRIVER_NAME   "USB Hub Driver"

Name of USB hub driver.

◆ USB_PORT_RESET_TIMEOUT

#define USB_PORT_RESET_TIMEOUT   500

Maximum milliseconds to wait for a port to reset (500 is the same value that Linux uses).

USB_HUB_MAX_PORTS = 255;

◆ USB_PORT_RESET_RECOVERY

#define USB_PORT_RESET_RECOVERY   30

Milliseconds to wait after port reset to allow the device attached to the port to recover before any data transfers. USB 2.0 spec says 10ms.

◆ USB_PORT_SHORT_RESET_DELAY

#define USB_PORT_SHORT_RESET_DELAY   10

Milliseconds between each status check on the port while waiting for it to finish being reset (Linux uses 10ms as the default value).

◆ USB_PORT_LONG_RESET_DELAY

#define USB_PORT_LONG_RESET_DELAY   200

Milliseconds between each status check on the port while waiting for it to finish being reset (Linux uses 200ms for Low Speed devices).

◆ USB_PORT_ROOT_RESET_DELAY

#define USB_PORT_ROOT_RESET_DELAY   60

Milliseconds between each status check on the port while waiting for it to finish being reset (Linux uses 60ms for Root hub ports).

◆ USB_ATTACH_DEBOUNCE_INTERVAL

#define USB_ATTACH_DEBOUNCE_INTERVAL   100

Milliseconds to wait after attachment for debounce (TATTDB).

◆ USB_ADDRESS_COMPLETION_TIME

#define USB_ADDRESS_COMPLETION_TIME   50

Milliseconds to wait for set address completion (TDSETADDR).

◆ USB_HUB_CHARACTERISTIC_LPSM

#define USB_HUB_CHARACTERISTIC_LPSM   (3 << 0)

Logical Power Switching Mode.

Values for wHubCharacteristics in type TUSBHubDescriptor (See Table 11-13 in Section 11.23.2.1 of the USB 2.0 specification)

◆ USB_HUB_CHARACTERISTIC_LPSM_GANGED

#define USB_HUB_CHARACTERISTIC_LPSM_GANGED   (0 << 0)

Ganged power switching (all ports power at once).

◆ USB_HUB_CHARACTERISTIC_LPSM_PORT

#define USB_HUB_CHARACTERISTIC_LPSM_PORT   (1 << 0)

Individual port power switching.

◆ USB_HUB_CHARACTERISTIC_IS_COMPOUND_DEVICE

#define USB_HUB_CHARACTERISTIC_IS_COMPOUND_DEVICE   (1 << 2)

Identifies a Compound Device (0 = Hub is not part of a compound device / 1 = Hub is part of a compound device).

◆ USB_HUB_CHARACTERISTIC_OCPM

#define USB_HUB_CHARACTERISTIC_OCPM   (3 << 3)

Over-current Protection Mode.

◆ USB_HUB_CHARACTERISTIC_OCPM_GLOBAL

#define USB_HUB_CHARACTERISTIC_OCPM_GLOBAL   (0 << 3)

Global Over-current Protection.

◆ USB_HUB_CHARACTERISTIC_OCPM_PORT

#define USB_HUB_CHARACTERISTIC_OCPM_PORT   (1 << 3)

Individual Port Over-current Protection.

◆ USB_HUB_CHARACTERISTIC_OCPM_NONE

#define USB_HUB_CHARACTERISTIC_OCPM_NONE   (2 << 3)

No Over-current Protection.

◆ USB_HUB_CHARACTERISTIC_TTTT

#define USB_HUB_CHARACTERISTIC_TTTT   (3 << 5)

TT Think Time.

◆ USB_HUB_CHARACTERISTIC_TTTT_8

#define USB_HUB_CHARACTERISTIC_TTTT_8   (0 << 5)

TT requires at most 8 FS bit times of inter transaction gap.

◆ USB_HUB_CHARACTERISTIC_TTTT_16

#define USB_HUB_CHARACTERISTIC_TTTT_16   (1 << 5)

TT requires at most 16 FS bit times of inter transaction gap.

◆ USB_HUB_CHARACTERISTIC_TTTT_24

#define USB_HUB_CHARACTERISTIC_TTTT_24   (2 << 5)

TT requires at most 24 FS bit times of inter transaction gap.

◆ USB_HUB_CHARACTERISTIC_TTTT_32

#define USB_HUB_CHARACTERISTIC_TTTT_32   (3 << 5)

TT requires at most 32 FS bit times of inter transaction gap.

◆ USB_HUB_CHARACTERISTIC_PORT_INDICATOR

#define USB_HUB_CHARACTERISTIC_PORT_INDICATOR   (1 << 7)

Port Indicators Supported (0 = Port Indicators are not supported / 1 = Port Indicators are supported).

◆ USB_C_HUB_LOCAL_POWER

#define USB_C_HUB_LOCAL_POWER   0

USB Hub Features (See Table 11-17 in Section 11.24.2 of the USB 2.0 specification)

◆ USB_C_HUB_OVER_CURRENT

#define USB_C_HUB_OVER_CURRENT   1

◆ USB_PORT_CONNECTION

#define USB_PORT_CONNECTION   0

USB Port Features (See Table 11-17 in Section 11.24.2 of the USB 2.0 specification)

◆ USB_PORT_ENABLE

#define USB_PORT_ENABLE   1

◆ USB_PORT_SUSPEND

#define USB_PORT_SUSPEND   2

◆ USB_PORT_OVER_CURRENT

#define USB_PORT_OVER_CURRENT   3

◆ USB_PORT_RESET

#define USB_PORT_RESET   4

◆ USB_PORT_POWER

#define USB_PORT_POWER   8

◆ USB_PORT_LOW_SPEED

#define USB_PORT_LOW_SPEED   9

◆ USB_C_PORT_CONNECTION

#define USB_C_PORT_CONNECTION   16

◆ USB_C_PORT_ENABLE

#define USB_C_PORT_ENABLE   17

◆ USB_C_PORT_SUSPEND

#define USB_C_PORT_SUSPEND   18

◆ USB_C_PORT_OVER_CURRENT

#define USB_C_PORT_OVER_CURRENT   19

◆ USB_C_PORT_RESET

#define USB_C_PORT_RESET   20

◆ USB_PORT_TEST

#define USB_PORT_TEST   21

◆ USB_PORT_INDICATOR

#define USB_PORT_INDICATOR   22

◆ USB_HUB_REQUEST_GET_STATUS

#define USB_HUB_REQUEST_GET_STATUS   0

USB Hub Class Requests (See Table 11-16 in Section 11.24.2 of the USB 2.0 specification)

◆ USB_HUB_REQUEST_CLEAR_FEATURE

#define USB_HUB_REQUEST_CLEAR_FEATURE   1

◆ USB_HUB_REQUEST_SET_FEATURE

#define USB_HUB_REQUEST_SET_FEATURE   3

◆ USB_HUB_REQUEST_GET_DESCRIPTOR

#define USB_HUB_REQUEST_GET_DESCRIPTOR   6

◆ USB_HUB_REQUEST_SET_DESCRIPTOR

#define USB_HUB_REQUEST_SET_DESCRIPTOR   7

◆ USB_HUB_REQUEST_CLEAR_TT_BUFFER

#define USB_HUB_REQUEST_CLEAR_TT_BUFFER   8

◆ USB_HUB_REQUEST_RESET_TT

#define USB_HUB_REQUEST_RESET_TT   9

◆ USB_HUB_REQUEST_GET_TT_STATE

#define USB_HUB_REQUEST_GET_TT_STATE   10

◆ USB_HUB_REQUEST_STOP_TT

#define USB_HUB_REQUEST_STOP_TT   11

◆ USB_PORT_STATUS_CONNNECTED

#define USB_PORT_STATUS_CONNNECTED   (1 << 0)

Values for wPortStatus in type TUSBPortStatus (See Table 11-21 in Section 11.24.2.7.1 of the USB 2.0 specification)

◆ USB_PORT_STATUS_ENABLED

#define USB_PORT_STATUS_ENABLED   (1 << 1)

◆ USB_PORT_STATUS_SUSPENDED

#define USB_PORT_STATUS_SUSPENDED   (1 << 2)

◆ USB_PORT_STATUS_OVERCURRENT

#define USB_PORT_STATUS_OVERCURRENT   (1 << 3)

◆ USB_PORT_STATUS_RESET

#define USB_PORT_STATUS_RESET   (1 << 4)

◆ USB_PORT_STATUS_POWERED

#define USB_PORT_STATUS_POWERED   (1 << 8)

◆ USB_PORT_STATUS_LOW_SPEED_ATTACHED

#define USB_PORT_STATUS_LOW_SPEED_ATTACHED   (1 << 9)

◆ USB_PORT_STATUS_HIGH_SPEED_ATTACHED

#define USB_PORT_STATUS_HIGH_SPEED_ATTACHED   (1 << 10)

◆ USB_PORT_STATUS_TEST_MODE

#define USB_PORT_STATUS_TEST_MODE   (1 << 11)

◆ USB_PORT_STATUS_INDICATOR_CONTROL

#define USB_PORT_STATUS_INDICATOR_CONTROL   (1 << 12)

◆ USB_PORT_CHANGE_CONNECTED

#define USB_PORT_CHANGE_CONNECTED   (1 << 0)

Values for wPortChange in type TUSBPortStatus (See Table 11-20 in Section 11.24.2.6 of the USB 2.0 specification)

◆ USB_PORT_CHANGE_ENABLED

#define USB_PORT_CHANGE_ENABLED   (1 << 1)

◆ USB_PORT_CHANGE_SUSPENDED

#define USB_PORT_CHANGE_SUSPENDED   (1 << 2)

◆ USB_PORT_CHANGE_OVERCURRENT

#define USB_PORT_CHANGE_OVERCURRENT   (1 << 3)

◆ USB_PORT_CHANGE_RESET

#define USB_PORT_CHANGE_RESET   (1 << 4)

◆ USB_HUB_STATUS_LOCAL_POWER

#define USB_HUB_STATUS_LOCAL_POWER   (1 << 0)

Values for wHubStatus in type TUSBHubStatus (See Table 11-19 in Section 11.24.2.6 of the USB 2.0 specification)

◆ USB_HUB_STATUS_OVERCURRENT

#define USB_HUB_STATUS_OVERCURRENT   (1 << 1)

◆ USB_HUB_CHANGE_LOCAL_POWER

#define USB_HUB_CHANGE_LOCAL_POWER   (1 << 0)

Values for wHubChange in type TUSBHubStatus (See Table 11-20 in Section 11.24.2.6 of the USB 2.0 specification)

◆ USB_HUB_CHANGE_OVERCURRENT

#define USB_HUB_CHANGE_OVERCURRENT   (1 << 1)

Typedef Documentation

◆ USB_DEVICE_ID

typedef struct _USB_DEVICE_ID USB_DEVICE_ID

USB Device Id record for driver device identification (Not part of USB specification).

USB Device, Driver and Host specific types

◆ USB_INTERFACE_ID

USB Interface Id record for driver device identification (Not part of USB specification).

◆ USB_DEVICE_AND_INTERFACE_ID

USB Device and Interface Id record for driver device identification (Not part of USB specification).

◆ USB_DEVICE_AND_INTERFACE_NO

USB Device and Interface No record for driver device identification (Not part of USB specification).

◆ USB_CONTROL_SETUP_DATA

USB Control Request SETUP data (See Table 9-2 in Section 9.3 of the USB 2.0 specification)

◆ USB_DESCRIPTOR_HEADER

USB Device Descriptor Header (See Table 9-8 in 9.6.1 of the USB 2.0 specification)

◆ USB_DEVICE_DESCRIPTOR

USB Device Descriptor (See Table 9-8 in 9.6.1 of the USB 2.0 specification)

◆ USB_CONFIGURATION_DESCRIPTOR

USB Configuration Descriptor (See Table 9-10 in Section 9.6.3 of the USB 2.0 specification)

◆ USB_INTERFACE_DESCRIPTOR

USB Interface Descriptor (See Table 9-12 in Section 9.6.6 of the USB 2.0 specification)

◆ USB_ENDPOINT_DESCRIPTOR

USB Endpoint Descriptor (See Table 9-13 in Section 9.6.6 of the USB 2.0 specification)

◆ USB_STRING_DESCRIPTOR

USB String Descriptor (See Table 9-16 in Section 9.7 of the USB 2.0 specification)

◆ USB_STRING_DESCRIPTOR_STRING

typedef uint16_t USB_STRING_DESCRIPTOR_STRING[126]

Array type to allow typecasting of bString element in TUSBStringDescriptor (Maximum size of descriptor is 255) (126 x 2 + 2 = 254).

◆ USB_STRING_DESCRIPTOR_LANGIDS

typedef uint16_t USB_STRING_DESCRIPTOR_LANGIDS[126]

Array type to allow typecasting of bString element in TUSBStringDescriptor (Maximum size of descriptor is 255) (126 x 2 + 2 = 254).

◆ USB_DEVICE_STATUS

Device status information returned by a USB_DEVICE_REQUEST_GET_STATUS control message (See Section 9.4.6 of the USB 2.0 specification)

◆ USB_HOST

typedef struct _USB_HOST USB_HOST

Forward declared to satisfy USBDevice.

USB Device

◆ USB_DRIVER

typedef struct _USB_DRIVER USB_DRIVER

Forward declared to satisfy USBDevice.

◆ USB_ALTERNATE

typedef struct _USB_ALTERNATE USB_ALTERNATE

Forward declared to satisfy USBDevice.

◆ USB_INTERFACE

typedef struct _USB_INTERFACE USB_INTERFACE

Forward declared to satisfy USBDevice.

◆ USB_CONFIGURATION

Forward declared to satisfy USBDevice.

◆ USB_DEVICE

typedef struct _USB_DEVICE USB_DEVICE

◆ usb_device_bind_proc

typedef uint32_t STDCALL(* usb_device_bind_proc) (USB_DEVICE *device)

USB Device Bind Callback

◆ usb_device_unbind_proc

typedef uint32_t STDCALL(* usb_device_unbind_proc) (USB_DEVICE *device, USB_DRIVER *driver)

USB Device Unbind Callback

◆ usb_device_enumerate_cb

typedef uint32_t STDCALL(* usb_device_enumerate_cb) (USB_DEVICE *device, void *data)

USB Device Enumeration Callback

◆ usb_device_notification_cb

typedef uint32_t STDCALL(* usb_device_notification_cb) (DEVICE *device, void *data, uint32_t notification)

USB Device Notification Callback

◆ usb_driver_enumerate_cb

typedef uint32_t STDCALL(* usb_driver_enumerate_cb) (USB_DRIVER *driver, void *data)

USB Driver PUSBDriver = ^TUSBDriver; USB Driver Enumeration Callback

◆ usb_driver_bind_proc

typedef uint32_t STDCALL(* usb_driver_bind_proc) (USB_DEVICE *device, USB_INTERFACE *interrface)

USB Driver Methods

◆ usb_driver_unbind_proc

typedef uint32_t STDCALL(* usb_driver_unbind_proc) (USB_DEVICE *device, USB_INTERFACE *interrface)

◆ USB_REQUEST

typedef struct _USB_REQUEST USB_REQUEST

Forward declared to satisfy USBHost.

USB Host

◆ usb_host_enumerate_cb

typedef uint32_t STDCALL(* usb_host_enumerate_cb) (USB_HOST *host, void *data)

USB Host Enumeration Callback

◆ usb_host_notification_cb

typedef uint32_t STDCALL(* usb_host_notification_cb) (DEVICE *device, void *data, uint32_t notification)

USB Host Notification Callback

◆ usb_host_start_proc

typedef uint32_t STDCALL(* usb_host_start_proc) (USB_HOST *host)

USB Host Methods

◆ usb_host_stop_proc

typedef uint32_t STDCALL(* usb_host_stop_proc) (USB_HOST *host)

◆ usb_host_reset_proc

typedef uint32_t STDCALL(* usb_host_reset_proc) (USB_HOST *host)

◆ usb_host_submit_proc

typedef uint32_t STDCALL(* usb_host_submit_proc) (USB_HOST *host, USB_REQUEST *request)

◆ usb_host_cancel_proc

typedef uint32_t STDCALL(* usb_host_cancel_proc) (USB_HOST *host, USB_REQUEST *request)

◆ usb_request_completed_cb

typedef void STDCALL(* usb_request_completed_cb) (USB_REQUEST *request)

USB Request USB Request Methods

◆ USB_HUB_DESCRIPTOR

USB Hub specific types USB Hub Descriptor (See Table 11-13 in Section 11.23 of the USB 2.0 specification)

◆ USB_HUB_DESCRIPTOR_DATA

typedef uint8_t USB_HUB_DESCRIPTOR_DATA[64]

Array type to allow typecasting of varData element in TUSBHubDescriptor.

◆ USB_PORT_STATUS

USB Port Status (See Section 11.24.2.7 of the USB 2.0 specification)

◆ USB_HUB_STATUS

USB Hub Status (See Section 11.24.2.6 of the USB 2.0 specification)

◆ USB_HUB_DATA

typedef struct _USB_HUB_DATA USB_HUB_DATA

USB Hub Status Change Data

◆ USB_HUB

typedef struct _USB_HUB USB_HUB

Forward declared to satisfy USBPort.

USB Port

◆ USB_PORT

typedef struct _USB_PORT USB_PORT

◆ usb_hub_enumerate_cb

typedef uint32_t STDCALL(* usb_hub_enumerate_cb) (USB_HUB *hub, void *data)

USB Hub USB Hub Enumeration Callback

◆ usb_hub_notification_cb

typedef uint32_t STDCALL(* usb_hub_notification_cb) (DEVICE *device, void *data, uint32_t notification)

USB Hub Notification Callback

◆ usb_log_output_proc

typedef void STDCALL(* usb_log_output_proc) (const char *text, void *data)

USB Logging specific types

Function Documentation

◆ usb_start()

uint32_t STDCALL usb_start ( void )

Starts all registered USB hosts, starts the USB hub thread and begins the USB enumeration process. USB enumeration will continue after this function returns as devices are discovered by changes in hub status.

Initialization Functions

◆ usb_stop()

uint32_t STDCALL usb_stop ( void )

◆ usb_async_start()

void STDCALL usb_async_start ( USB_HOST * host)

◆ usb_device_get_address()

uint8_t STDCALL usb_device_get_address ( USB_DEVICE * device)

Device Methods.

USB Device, Driver and Host Functions

Get the bus address for the specified device

Parameters
DeviceThe USB device to get the address for
Returns
Device address or 0 on failure

◆ usb_device_set_address()

uint32_t STDCALL usb_device_set_address ( USB_DEVICE * device,
uint8_t address )

Set the bus address for the specified device.

Parameters
DeviceThe USB device to set the address for
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_get_descriptor()

uint32_t STDCALL usb_device_get_descriptor ( USB_DEVICE * device,
uint8_t brequest,
uint8_t bmrequesttype,
uint16_t wvalue,
uint16_t windex,
void * data,
uint16_t length )

Read any descriptor from the specified device using USBControlRequest.

Parameters
DeviceThe USB device to read the descriptor from
bRequestSee USBControlRequest
bmRequestTypeSee USBControlRequest
wValueSee USBControlRequest
wIndexSee USBControlRequest
DataSee USBControlRequest
LengthSee USBControlRequest
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_get_device_descriptor()

uint32_t STDCALL usb_device_get_device_descriptor ( USB_DEVICE * device,
void * data,
uint16_t length )

Read all or part of the device descriptor from the specified device using USBControlRequest.

Parameters
DeviceThe USB device to read the device descriptor from
DataSee USBControlRequest
LengthSee USBControlRequest
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_create_device_descriptor()

uint32_t STDCALL usb_device_create_device_descriptor ( USB_DEVICE * device,
uint16_t length )

Allocate a device descriptor for the specified device.

Parameters
DeviceThe USB device to create the device descriptor for
LengthThe length of the descriptor to create
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_read_device_descriptor()

uint32_t STDCALL usb_device_read_device_descriptor ( USB_DEVICE * device,
uint16_t length )

Read all or part of the device descriptor from the specified device using USBControlRequest.

Parameters
DeviceThe USB device to read the device descriptor from
LengthThe amount of the descriptor to read which may be less than the full size
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_read_device_descriptor_ex()

uint32_t STDCALL usb_device_read_device_descriptor_ex ( USB_DEVICE * device,
uint16_t length,
BOOL allowshort )

Read all or part of the device descriptor from the specified device using USBControlRequest.

Parameters
DeviceThe USB device to read the device descriptor from
LengthThe amount of the descriptor to read which may be less than the full size
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_create_configurations()

uint32_t STDCALL usb_device_create_configurations ( USB_DEVICE * device)

Allocate the available configurations for this device.

Parameters
DeviceThe USB device to create the configurations for
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_read_configurations()

uint32_t STDCALL usb_device_read_configurations ( USB_DEVICE * device)

Read and parse the available configurations for this device.

Parameters
DeviceThe USB device to read the configurations for
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_create_configuration()

uint32_t STDCALL usb_device_create_configuration ( USB_DEVICE * device,
uint8_t index,
uint16_t size )

Allocate the specified configuration for this device.

Parameters
DeviceThe USB device to create the configuration for
IndexThe index of the configuration to create
SizeThe size of the configuration descriptor to create
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_read_configuration()

uint32_t STDCALL usb_device_read_configuration ( USB_DEVICE * device,
uint8_t index )

Read and parse the specified configuration for this device.

Parameters
DeviceThe USB device to read the configuration for
IndexThe index of the configuration to read
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_get_string_descriptor()

uint32_t STDCALL usb_device_get_string_descriptor ( USB_DEVICE * device,
uint8_t index,
void * data,
uint16_t length )

Read all or part of the specified string descriptor from the specified device using USBControlRequest.

Parameters
DeviceThe USB device to read the string descriptor from
IndexThe index of the string descriptor to read
DataSee USBControlRequest
LengthSee USBControlRequest
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_get_string_descriptor_ex()

uint32_t STDCALL usb_device_get_string_descriptor_ex ( USB_DEVICE * device,
uint8_t index,
uint16_t languageid,
void * data,
uint16_t length )

Read all or part of the specified string descriptor from the specified device using USBControlRequest.

Parameters
DeviceThe USB device to read the string descriptor from
IndexThe index of the string descriptor to read
LanguageIdThe language identifier of the string descriptor to read (eg USB_LANGID_US_ENGLISH)
DataSee USBControlRequest
LengthSee USBControlRequest
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_read_string_language_ids()

void STDCALL usb_device_read_string_language_ids ( USB_DEVICE * device,
USB_STRING_DESCRIPTOR_LANGIDS * languageids )

Get the list of supported string language identifiers from the specified device.

Parameters
DeviceThe USB device to read the language identifiers from
Returns
An array of supported language identifiers (Unused values are returned as zero)

◆ usb_device_read_string_descriptor()

uint32_t STDCALL usb_device_read_string_descriptor ( USB_DEVICE * device,
uint8_t index,
char * value,
uint32_t len )

Get the content of the specified string descriptor from the specified device.

Parameters
DeviceThe USB device to read the string descriptor from
IndexThe index of the string descriptor to read
Returns
The ANSI string content of the string descriptor or an empty string on failure

◆ usb_device_read_string_descriptor_ex()

uint32_t STDCALL usb_device_read_string_descriptor_ex ( USB_DEVICE * device,
uint8_t index,
uint16_t languageid,
char * value,
uint32_t len )

Get the content of the specified string descriptor from the specified device.

Parameters
DeviceThe USB device to read the string descriptor from
IndexThe index of the string descriptor to read
LanguageIdThe language identifier of the string descriptor to read (eg USB_LANGID_US_ENGLISH)
Returns
The ANSI string content of the string descriptor or an empty string on failure

◆ usb_device_read_string_descriptor_w()

uint32_t STDCALL usb_device_read_string_descriptor_w ( USB_DEVICE * device,
uint8_t index,
WCHAR * value,
uint32_t len )

Get the content of the specified string descriptor from the specified device.

Parameters
DeviceThe USB device to read the string descriptor from
IndexThe index of the string descriptor to read
Returns
The Unicode string content of the string descriptor or an empty string on failure

◆ usb_device_read_string_descriptor_ex_w()

uint32_t STDCALL usb_device_read_string_descriptor_ex_w ( USB_DEVICE * device,
uint8_t index,
uint16_t languageid,
WCHAR * value,
uint32_t len )

Get the content of the specified string descriptor from the specified device.

Parameters
DeviceThe USB device to read the string descriptor from
IndexThe index of the string descriptor to read
LanguageIdThe language identifier of the string descriptor to read (eg USB_LANGID_US_ENGLISH)
Returns
The Unicode string content of the string descriptor or an empty string on failure

◆ usb_device_get_configuration_descriptor()

uint32_t STDCALL usb_device_get_configuration_descriptor ( USB_DEVICE * device,
uint8_t index,
void * data,
uint16_t length )

Read all or part of the specified configuration descriptor from the specified device using USBControlRequest.

Parameters
DeviceThe USB device to read the configuration descriptor from
IndexThe index of the configuration descriptor to read
DataSee USBControlRequest
LengthSee USBControlRequest
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_get_configuration()

uint32_t STDCALL usb_device_get_configuration ( USB_DEVICE * device,
uint8_t * configurationvalue )

Get the current configuration for the specified device.

Parameters
DeviceThe USB device to get the current configuration for
ConfigurationValueThe current configuration (As per bConfigurationValue in the configuration descriptor)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_set_configuration()

uint32_t STDCALL usb_device_set_configuration ( USB_DEVICE * device,
uint8_t configurationvalue )

Set the configuration for the specified device.

Parameters
DeviceThe USB device to set the configuration for
ConfigurationValueThe configuration to set (As per bConfigurationValue in the configuration descriptor)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_find_configuration_by_value()

USB_CONFIGURATION *STDCALL usb_device_find_configuration_by_value ( USB_DEVICE * device,
uint8_t configurationvalue )

Find the configuration represented by configuration value for the specified device.

Parameters
DeviceThe USB device to find the configuration for
ConfigurationValueThe configuration value to find (As per bConfigurationValue in the configuration descriptor)
Returns
USB Configuration if completed or nil on failure

◆ usb_device_get_hub()

USB_HUB *STDCALL usb_device_get_hub ( USB_DEVICE * device)

Get the USB Hub that the specified device is connected to.

Parameters
DeviceThe USB device to get the hub for
Returns
USB Hub if successful or nil on failure

◆ usb_device_get_port()

USB_PORT *STDCALL usb_device_get_port ( USB_DEVICE * device)

Get the USB Port that the specified device is connected to.

Parameters
DeviceThe USB device to get the port for
Returns
USB Port if successful or nil on failure

◆ usb_device_get_interface()

uint32_t STDCALL usb_device_get_interface ( USB_DEVICE * device,
uint8_t index,
uint8_t * alternatesetting )

Get the interface alternate setting for the specified device.

Parameters
DeviceThe USB device to get the interface alternate setting for
IndexThe index of the interface to get (As per bInterfaceNumber in the interface descriptor)
AlternateSettingThe current alternate setting of the specified interface (As per bAlternateSetting in the interface descriptor)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_set_interface()

uint32_t STDCALL usb_device_set_interface ( USB_DEVICE * device,
uint8_t index,
uint8_t alternatesetting )

Set the interface alternate setting for the specified device.

Parameters
DeviceThe USB device to set the interface alternate setting for
IndexThe index of the interface to set (As per bInterfaceNumber in the interface descriptor)
AlternateSettingThe alternate setting to set on the specified interface (As per bAlternateSetting in the interface descriptor)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_find_interface_by_index()

USB_INTERFACE *STDCALL usb_device_find_interface_by_index ( USB_DEVICE * device,
uint8_t index )

Find the interface with the specified index on the specified device.

Parameters
DeviceThe USB device to find the interface from
IndexThe index of the interface to find (As per bInterfaceNumber in the interface descriptor)
Returns
The interface for the matching interface of nil if no interface matched

◆ usb_device_find_interface_by_class_only()

USB_INTERFACE *STDCALL usb_device_find_interface_by_class_only ( USB_DEVICE * device,
uint8_t interfaceclass )

Find an interface of the specified class on the specified device.

Parameters
DeviceThe USB device to find the interface from
InterfaceClassThe interface class to match
Returns
The matching interface or nil if no interface matched Find an interface of the specified class, subclass and protocol on the specified device
Parameters
DeviceThe USB device to find the interface from
InterfaceClassThe interface class to match
InterfaceSubClassThe interface subclass to match
InterfaceProtocolThe interface protocol to match
Returns
The matching interface or nil if no interface matched

◆ usb_device_find_interface_by_class()

USB_INTERFACE *STDCALL usb_device_find_interface_by_class ( USB_DEVICE * device,
uint8_t interfaceclass,
uint8_t interfacesubclass,
uint8_t interfaceprotocol )

Find an interface of the specified class on the specified device.

Parameters
DeviceThe USB device to find the interface from
InterfaceClassThe interface class to match
Returns
The matching interface or nil if no interface matched Find an interface of the specified class, subclass and protocol on the specified device
Parameters
DeviceThe USB device to find the interface from
InterfaceClassThe interface class to match
InterfaceSubClassThe interface subclass to match
InterfaceProtocolThe interface protocol to match
Returns
The matching interface or nil if no interface matched

◆ usb_device_find_endpoint_by_index()

USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_endpoint_by_index ( USB_DEVICE * device,
USB_INTERFACE * interrface,
uint8_t index )

Find the endpoint with the specified index on the specified interface of the specified device.

Parameters
DeviceThe USB device to find the endpoint from
InterrfaceThe interface to find the endpoint from
IndexThe index of the endpoint to find (First endpoint is zero)
Returns
The endpoint for the matching endpoint of nil if no endpoint matched

◆ usb_device_find_endpoint_by_type()

USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_endpoint_by_type ( USB_DEVICE * device,
USB_INTERFACE * interrface,
uint8_t direction,
uint8_t transfertype )

Find an endpoint of the specified type and direction on the specified interface of the specified device.

Parameters
DeviceThe USB device to find the endpoint from
InterrfaceThe interface to find the endpoint from
DirectionThe direction of the endpoint to find (eg USB_DIRECTION_OUT)
TransferTypeThe transfer type of the endpoint to find (eg USB_TRANSFER_TYPE_BULK)
Returns
The endpoint for the matching endpoint of nil if no endpoint matched

◆ usb_device_find_endpoint_by_type_ex()

USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_endpoint_by_type_ex ( USB_DEVICE * device,
USB_INTERFACE * interrface,
uint8_t direction,
uint8_t transfertype,
uint8_t * index )

Find the next endpoint of the specified type and direction on the specified interface of the specified device.

Parameters
DeviceThe USB device to find the endpoint from
InterrfaceThe interface to find the endpoint from
DirectionThe direction of the endpoint to find (eg USB_DIRECTION_OUT)
TransferTypeThe transfer type of the endpoint to find (eg USB_TRANSFER_TYPE_BULK)
IndexThe index returned from the last call, pass 0 on the first call]
{ReturnThe endpoint for the matching endpoint of nil if no endpoint matched

◆ usb_device_count_endpoints_by_type()

uint8_t STDCALL usb_device_count_endpoints_by_type ( USB_DEVICE * device,
USB_INTERFACE * interrface,
uint8_t direction,
uint8_t transfertype )

Count the number of endpoints of the specified type and direction on the specified interface of the specified device.

Parameters
DeviceThe USB device to find the endpoint from
InterrfaceThe interface to find the endpoint from
DirectionThe direction of the endpoint to find (eg USB_DIRECTION_OUT)
TransferTypeThe transfer type of the endpoint to find (eg USB_TRANSFER_TYPE_BULK)
Returns
The number of matching endpoints on the specified interface

◆ usb_device_find_alternate_by_index()

USB_ALTERNATE *STDCALL usb_device_find_alternate_by_index ( USB_DEVICE * device,
USB_INTERFACE * interrface,
uint8_t index )

Find the alternate setting with the specified index on the specified interface of the specified device.

Parameters
DeviceThe USB device to find the alternate setting from
InterrfaceThe interface to find the alternate setting from
IndexThe index of the alternate setting to find (First alternate setting is zero)
Returns
The alternate setting for the matching alternate setting of nil if no alternate setting matched

◆ usb_device_find_alternate_by_setting()

USB_ALTERNATE *STDCALL usb_device_find_alternate_by_setting ( USB_DEVICE * device,
USB_INTERFACE * interrface,
uint8_t alternatesetting )

Find the alternate setting with the specified value on the specified interface of the specified device.

Parameters
DeviceThe USB device to find the alternate setting from
InterrfaceThe interface to find the alternate setting from
AlternateSettingThe value of the alternate setting to find
Returns
The alternate setting for the matching alternate setting of nil if no alternate setting matched

◆ usb_device_find_alternate_endpoint_by_index()

USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_alternate_endpoint_by_index ( USB_DEVICE * device,
USB_INTERFACE * interrface,
USB_ALTERNATE * alternate,
uint8_t index )

Find the endpoint with the specified index on the specified alternate setting interface of the specified device.

Parameters
DeviceThe USB device to find the endpoint from
InterrfaceThe interface to find the endpoint from
AlternateThe alternate setting to find the endpoint from
IndexThe index of the endpoint to find (First endpoint is zero)
Returns
The endpoint for the matching endpoint of nil if no endpoint matched

◆ usb_device_find_alternate_endpoint_by_type()

USB_ENDPOINT_DESCRIPTOR *STDCALL usb_device_find_alternate_endpoint_by_type ( USB_DEVICE * device,
USB_INTERFACE * interrface,
USB_ALTERNATE * alternate,
uint8_t direction,
uint8_t transfertype )

Find an endpoint of the specified type and direction on the specified alternate setting interface of the specified device.

Parameters
DeviceThe USB device to find the endpoint from
InterrfaceThe interface to find the endpoint from
AlternateThe alternate setting to find the endpoint from
DirectionThe direction of the endpoint to find (eg USB_DIRECTION_OUT)
TransferTypeThe transfer type of the endpoint to find (eg USB_TRANSFER_TYPE_BULK)
Returns
The endpoint for the matching endpoint of nil if no endpoint matched

◆ usb_device_set_feature()

uint32_t STDCALL usb_device_set_feature ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * endpoint,
uint16_t feature,
uint16_t index )

Enable a feature on the specified endpoint on the specified device.

Parameters
DeviceThe USB device to enable the feature for
EndpointThe endpoint to enable the feature on
FeatureThe feature to enable
Index??????
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_clear_feature()

uint32_t STDCALL usb_device_clear_feature ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * endpoint,
uint16_t feature )

Disable a feature on the specified endpoint on the specified device.

Parameters
DeviceThe USB device to disable the feature for
EndpointThe endpoint to disable the feature on
FeatureThe feature to disable
Index??????
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_set_state()

uint32_t STDCALL usb_device_set_state ( USB_DEVICE * device,
uint32_t state )

Set the state of the specified device and send a notification.

Parameters
DeviceThe USB device to set the state for
StateThe new state to set and notify (eg USB_STATE_ATTACHED)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_set_status()

uint32_t STDCALL usb_device_set_status ( USB_DEVICE * device,
uint32_t status )

Set the status of the specified device and send a notification.

Parameters
DeviceThe USB device to set the status for
StatusThe new status to set and notify (eg USB_STATUS_BOUND)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_bind()

uint32_t STDCALL usb_device_bind ( USB_DEVICE * device)

Attempt to bind a device to one of the registered drivers.

Parameters
DeviceThe device to attempt to bind a driver to
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_unbind()

uint32_t STDCALL usb_device_unbind ( USB_DEVICE * device,
USB_DRIVER * driver )

Unbind a device from a driver.

Parameters
DeviceThe device to unbind a driver from
DriverThe driver to unbind the device from (nil to unbind from current driver)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_attach()

uint32_t STDCALL usb_device_attach ( USB_DEVICE * device)

Configure and initialize a newly attached USB device.

Parameters
DeviceNew USB device to configure and initialize
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_detach()

uint32_t STDCALL usb_device_detach ( USB_DEVICE * device)

Shutdown and detach a USB device.

Parameters
DeviceThe USB device to shutdown and detach
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_device_allocate()

USB_DEVICE *STDCALL usb_device_allocate ( USB_HOST * host,
USB_DEVICE * parent )

Create and Register a new Device entry in the Device table.

Parameters
HostThe Host this device is attached to
ParentThe Parent device (Hub) this device is attached to (nil if this device is a root hub)
Returns
Pointer to new Device entry or nil if device could not be created

◆ usb_device_release()

uint32_t STDCALL usb_device_release ( USB_DEVICE * device)

Deregister and Destroy a Device from the Device table.

Parameters
DeviceThe device to deregister and destroy
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ usb_device_find()

USB_DEVICE *STDCALL usb_device_find ( uint32_t usbid)

◆ usb_device_find_by_id()

USB_DEVICE *STDCALL usb_device_find_by_id ( uint16_t vendorid,
uint16_t productid )

◆ usb_device_find_by_name()

USB_DEVICE *STDCALL usb_device_find_by_name ( const char * name)

◆ usb_device_find_by_description()

USB_DEVICE *STDCALL usb_device_find_by_description ( const char * description)

◆ usb_device_enumerate()

uint32_t STDCALL usb_device_enumerate ( usb_device_enumerate_cb callback,
void * data )

◆ usb_device_notification()

uint32_t STDCALL usb_device_notification ( USB_DEVICE * device,
usb_device_notification_cb callback,
void * data,
uint32_t notification,
uint32_t flags )

◆ usb_driver_create()

USB_DRIVER *STDCALL usb_driver_create ( void )

Driver Methods.

Create a new USB Driver entry

Returns
Pointer to new Driver entry or nil if driver could not be created

◆ usb_driver_create_ex()

USB_DRIVER *STDCALL usb_driver_create_ex ( uint32_t size)

Create a new USB Driver entry.

Parameters
SizeSize in bytes to allocate for new driver (Including the driver entry)
Returns
Pointer to new Driver entry or nil if driver could not be created

◆ usb_driver_destroy()

uint32_t STDCALL usb_driver_destroy ( USB_DRIVER * driver)

Destroy an existing USB Driver entry.

◆ usb_driver_register()

uint32_t STDCALL usb_driver_register ( USB_DRIVER * driver)

Register a new Driver in the USB Driver table.

◆ usb_driver_deregister()

uint32_t STDCALL usb_driver_deregister ( USB_DRIVER * driver)

Deregister a Driver from the USB Driver table.

◆ usb_driver_find()

USB_DRIVER *STDCALL usb_driver_find ( uint32_t driverid)

Find a driver by Id in the USB Driver table.

◆ usb_driver_find_by_name()

USB_DRIVER *STDCALL usb_driver_find_by_name ( const char * name)

Find a driver by name in the Driver table.

◆ usb_driver_enumerate()

uint32_t STDCALL usb_driver_enumerate ( usb_driver_enumerate_cb callback,
void * data )

Enumerate all drivers in the USB Driver table.

◆ usb_host_set_state()

uint32_t STDCALL usb_host_set_state ( USB_HOST * host,
uint32_t state )

Host Methods.

Set the state of the specified host and send a notification

Parameters
HostThe USB host to set the state for
StateThe new state to set and notify (eg USBHOST_STATE_ENABLED)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_host_create()

USB_HOST *STDCALL usb_host_create ( void )

Create a new Host entry.

Returns
Pointer to new Host entry or nil if host could not be created

◆ usb_host_create_ex()

USB_HOST *STDCALL usb_host_create_ex ( uint32_t size)

Create a new Host entry.

Parameters
SizeSize in bytes to allocate for new host (Including the host entry)
Returns
Pointer to new Host entry or nil if host could not be created

◆ usb_host_destroy()

uint32_t STDCALL usb_host_destroy ( USB_HOST * host)

Destroy an existing Host entry.

◆ usb_host_register()

uint32_t STDCALL usb_host_register ( USB_HOST * host)

Register a new Host in the Host table.

◆ usb_host_deregister()

uint32_t STDCALL usb_host_deregister ( USB_HOST * host)

Deregister a Host from the Host table.

◆ usb_host_find()

USB_HOST *STDCALL usb_host_find ( uint32_t hostid)

◆ usb_host_find_by_name()

USB_HOST *STDCALL usb_host_find_by_name ( const char * name)

◆ usb_host_find_by_description()

USB_HOST *STDCALL usb_host_find_by_description ( const char * description)

◆ usb_host_enumerate()

uint32_t STDCALL usb_host_enumerate ( usb_host_enumerate_cb callback,
void * data )

◆ usb_host_notification()

uint32_t STDCALL usb_host_notification ( USB_HOST * host,
usb_host_notification_cb callback,
void * data,
uint32_t notification,
uint32_t flags )

◆ usb_buffer_allocate()

void *STDCALL usb_buffer_allocate ( USB_DEVICE * device,
uint32_t size )

Buffer Methods.

Allocate a data buffer for a USB request

Parameters
DeviceThe device that the request will be sent to
SizeThe size of the data buffer to allocate
Returns
The newly allocated buffer or nil on failure

◆ usb_buffer_allocate_ex()

void *STDCALL usb_buffer_allocate_ex ( USB_DEVICE * device,
uint32_t size,
uint32_t * flags )

Allocate a data buffer for a USB request.

Parameters
DeviceThe device that the request will be sent to
SizeThe size of the data buffer to allocate
FlagsThe returned flags for the allocated buffer (eg USB_REQUEST_FLAG_SHARED)
Returns
The newly allocated buffer or nil on failure

◆ usb_buffer_validate()

uint32_t STDCALL usb_buffer_validate ( USB_DEVICE * device,
void * buffer,
uint32_t size,
uint32_t * flags )

Validate a data buffer for a USB request against the USB host requirements.

Parameters
DeviceThe device that the request will be sent to
BufferThe data buffer to validate
SizeThe size of the data buffer
FlagsThe returned flags for the validated buffer (eg USB_REQUEST_FLAG_SHARED)
Returns
USB_STATUS_SUCCESS on success or another error code on failure

◆ usb_buffer_release()

uint32_t STDCALL usb_buffer_release ( void * buffer)

Release a data buffer from a USB request.

Parameters
DataThe buffer to be released
Returns
USB_STATUS_SUCCESS on success or another error code on failure

◆ usb_request_allocate()

USB_REQUEST *STDCALL usb_request_allocate ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * endpoint,
usb_request_completed_cb callback,
uint32_t size,
void * driverdata )

Request Methods.

Allocate a new USB request

Parameters
DeviceThe USB device this request will be sent to
EndpointThe Endpoint descriptor this request will be sent to (Or nil for the default control endpoint)
CallbackThe callback function to be called on completion of the request
SizeThe size of the data buffer for the request
DriverDataDevice driver private data for the callback (Optional)
Returns
The newly allocated request or nil on failure

◆ usb_request_allocate_ex()

USB_REQUEST *STDCALL usb_request_allocate_ex ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * endpoint,
usb_request_completed_cb callback,
void * data,
uint32_t size,
void * driverdata )

Allocate a new USB request.

Parameters
DeviceThe USB device this request will be sent to
EndpointThe Endpoint descriptor this request will be sent to (Or nil for the default control endpoint)
CallbackThe callback function to be called on completion of the request
DataThe returned data buffer allocated for the request (Or nil if size is zero)(Pass an existing buffer to prevent allocation)
SizeThe size of the data buffer for the request
DriverDataDevice driver private data for the callback (Optional)
Returns
The newly allocated request or nil on failure

◆ usb_request_release()

uint32_t STDCALL usb_request_release ( USB_REQUEST * request)

Release and destroy a USB request.

Parameters
RequestThe request to be released
Returns
USB_STATUS_SUCCESS on success or another error code on failure

◆ usb_request_initialize()

uint32_t STDCALL usb_request_initialize ( USB_REQUEST * request,
usb_request_completed_cb callback,
void * data,
uint32_t size,
void * driverdata )

Initialize or Reinitialize an existing USB request.

Parameters
RequestThe request to be initialized
CallbackThe callback function to be called on completion of the request
DataThe returned data buffer allocated for the request (Or nil if size is zero)
SizeThe size of the data buffer for the request
DriverDataDevice driver private data for the callback (Optional)
Returns
USB_STATUS_SUCCESS on success or another error code on failure

◆ usb_request_submit()

uint32_t STDCALL usb_request_submit ( USB_REQUEST * request)

Submit a USB request to a host controller for execution.

Parameters
RequestThe request to be submitted
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
The request will be completed asynchronously by the host controller and the completion callback will be called when the request has either succeeded or failed

◆ usb_request_cancel()

uint32_t STDCALL usb_request_cancel ( USB_REQUEST * request)

Cancel a USB request previously submitted to a host controller.

Parameters
RequestThe request to be cancelled
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_control_request()

uint32_t STDCALL usb_control_request ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * endpoint,
uint8_t brequest,
uint8_t bmrequesttype,
uint16_t wvalue,
uint16_t windex,
void * data,
uint16_t wlength )

Control Methods.

Send a USB control request to the specified device and wait for the request to complete

Parameters
DeviceThe USB device to send the control request to
EndpointThe Endpoint to use for the control request (or nil for the default control endpoint)
bRequestThe request to send (See Section 9.4 of the USB 2.0 specification for Standard requests)
bmRequestTypeType of request to send (See Section 9.3.1 of the USB 2.0 specification for Standard request types)
wValueRequest specific data
wIndexRequest specific data
DataBuffer for the data to be sent or received from the request (Ignored if wLength is 0)
wLengthLength of the Data buffer in bytes
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_control_request_ex()

uint32_t STDCALL usb_control_request_ex ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * endpoint,
uint8_t brequest,
uint8_t bmrequesttype,
uint16_t wvalue,
uint16_t windex,
void * data,
uint16_t wlength,
uint32_t timeout,
BOOL allowshort )

Send a USB control request to the specified device and wait for the request to complete.

Parameters
DeviceThe USB device to send the control request to
EndpointThe Endpoint to use for the control request (or nil for the default control endpoint)
bRequestThe request to send (See Section 9.4 of the USB 2.0 specification for Standard requests)
bmRequestTypeType of request to send (See Section 9.3.1 of the USB 2.0 specification for Standard request types)
wValueRequest specific data
wIndexRequest specific data
DataBuffer for the data to be sent or received from the request (Ignored if wLength is 0)
wLengthLength of the Data buffer in bytes
TimeoutMilliseconds to wait for request to complete (INFINITE to wait forever)
AllowShortAllow the return size to be less than the requested size
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_control_transfer()

uint32_t STDCALL usb_control_transfer ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * endpoint,
uint8_t brequest,
uint8_t bmrequesttype,
uint16_t wvalue,
uint16_t windex,
void * data,
uint16_t wlength,
uint32_t * count,
uint32_t timeout )

Synchronous Transfer Methods.

Perform a synchronous control transfer to a USB device and endpoint

Parameters
DeviceThe USB device to send the control request to
EndpointThe Endpoint to use for the control request (or nil for the default control endpoint)
bRequestThe request to send (See Section 9.4 of the USB 2.0 specification for Standard requests)
bmRequestTypeType of request to send (See Section 9.3.1 of the USB 2.0 specification for Standard request types)
wValueRequest specific data
wIndexRequest specific data
DataBuffer for the data to be sent or received from the request (Ignored if wLength is 0)
wLengthLength of the Data buffer in bytes
CountThe actual number of bytes transferred on completion (May apply even on failure or timeout)
TimeoutMilliseconds to wait for request to complete (INFINITE to wait forever)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
This function is very similar to USBControlRequest(Ex) but also returns the actual number of bytes transferred

◆ usb_bulk_transfer()

uint32_t STDCALL usb_bulk_transfer ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * endpoint,
void * data,
uint32_t size,
uint32_t * count,
uint32_t timeout )

Perform a synchronous bulk transfer to a USB device and endpoint.

Parameters
DeviceThe USB device to send the bulk request to
EndpointThe Endpoint to use for the bulk request
DataBuffer for the data to be sent or received from the request (Ignored if Size is 0)
SizeSize of the Data buffer in bytes
CountThe actual number of bytes transferred on completion (May apply even on failure or timeout)
TimeoutMilliseconds to wait for request to complete (INFINITE to wait forever)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
The type and direction of the transfer is determined from the type and direction of the endpoint

◆ usb_interrupt_transfer()

uint32_t STDCALL usb_interrupt_transfer ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * endpoint,
void * data,
uint32_t size,
uint32_t * count,
uint32_t timeout )

Perform a synchronous interrupt transfer to a USB device and endpoint.

Parameters
DeviceThe USB device to send the interrupt request to
EndpointThe Endpoint to use for the interrupt request
DataBuffer for the data to be sent or received from the request (Ignored if Size is 0)
SizeSize of the Data buffer in bytes
CountThe actual number of bytes transferred on completion (May apply even on failure or timeout)
TimeoutMilliseconds to wait for request to complete (INFINITE to wait forever)
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
The type and direction of the transfer is determined from the type and direction of the endpoint

◆ usb_hub_create_ports()

uint32_t STDCALL usb_hub_create_ports ( USB_HUB * hub)

Hub Methods.

USB Hub Functions

Create and initialize the ports for a Hub

Parameters
HubThe hub to initialize ports for
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_hub_power_on_ports()

uint32_t STDCALL usb_hub_power_on_ports ( USB_HUB * hub)

Power on all ports on a Hub.

Parameters
HubThe hub to power on ports for
Returns
USB_STATUS_SUCCESS if completed or another error code on failure

◆ usb_hub_create_hub_descriptor()

uint32_t STDCALL usb_hub_create_hub_descriptor ( USB_HUB * hub)

Allocate the hub descriptor for the specified hub.

Parameters
HubThe hub to create the descriptor for
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
The class specific hub descriptor is not the same as the device descriptor

◆ usb_hub_read_hub_descriptor()

uint32_t STDCALL usb_hub_read_hub_descriptor ( USB_HUB * hub)

Read the hub descriptor for the specified hub.

Parameters
HubThe hub to read the descriptor for
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
The class specific hub descriptor is not the same as the device descriptor

◆ usb_hub_lock()

uint32_t STDCALL usb_hub_lock ( USB_HUB * hub)

Lock the specified Hub to prevent changes.

Parameters
HubThe hub to lock
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ usb_hub_unlock()

uint32_t STDCALL usb_hub_unlock ( USB_HUB * hub)

Unlock the specified Hub to allow changes.

Parameters
HubThe hub to unlock
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ usb_hub_set_state()

uint32_t STDCALL usb_hub_set_state ( USB_HUB * hub,
uint32_t state )

Set the state of the specified hub and send a notification.

Parameters
HubThe hub to set the state for
StateThe new state to set and notify
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ usb_hub_allocate()

USB_HUB *STDCALL usb_hub_allocate ( USB_DEVICE * device)

Create and Register a new Hub device.

Parameters
DeviceThe USB device that represents this hub
Returns
Pointer to new Hub entry or nil if hub could not be created

◆ usb_hub_release()

uint32_t STDCALL usb_hub_release ( USB_HUB * hub)

Deregister and Destroy a Hub device.

Parameters
HubThe hub to deregister and destroy
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ usb_hub_find()

USB_HUB *STDCALL usb_hub_find ( uint32_t hubid)

◆ usb_hub_find_by_name()

USB_HUB *STDCALL usb_hub_find_by_name ( const char * name)

◆ usb_hub_find_by_description()

USB_HUB *STDCALL usb_hub_find_by_description ( const char * description)

◆ usb_hub_enumerate()

uint32_t STDCALL usb_hub_enumerate ( usb_hub_enumerate_cb callback,
void * data )

◆ usb_hub_notification()

uint32_t STDCALL usb_hub_notification ( USB_HUB * hub,
usb_hub_notification_cb callback,
void * data,
uint32_t notification,
uint32_t flags )

◆ usb_hub_bind_devices()

void STDCALL usb_hub_bind_devices ( USB_DEVICE * device,
usb_device_bind_proc callback )

Enumerate each device in the USB tree and call a bind callback for each one.

Parameters
DeviceUSB device at which to start the enumeration (Must be a hub device)
CallbackBind callback function to execute for each device

◆ usb_hub_unbind_devices()

void STDCALL usb_hub_unbind_devices ( USB_DEVICE * device,
USB_DRIVER * driver,
usb_device_unbind_proc callback )

Enumerate each device in the USB tree and call an unbind callback for each one.

Parameters
DeviceUSB device at which to start the enumeration
DriverThe driver to unbind the device from (nil to unbind from current driver)
CallbackUnbind callback function to execute for each device

◆ usb_hub_enumerate_devices()

void STDCALL usb_hub_enumerate_devices ( USB_DEVICE * device,
usb_device_enumerate_cb callback,
void * data )

Enumerate each device in the USB tree and call an enumerate callback for each one.

Parameters
DeviceUSB device at which to start the enumeration
CallbackEnumerate callback function to execute for each device

◆ usb_hub_port_reset()

uint32_t STDCALL usb_hub_port_reset ( USB_PORT * port,
uint32_t delay )

Hub Port Methods.

Reset the specified USB port

Parameters
PortUSB port to reset
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock

◆ usb_hub_port_disable()

uint32_t STDCALL usb_hub_port_disable ( USB_PORT * port)

Disable the specified USB port.

Parameters
PortUSB port to disable
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock
A port cannot be enabled in software, only disabled

◆ usb_hub_port_power_on()

uint32_t STDCALL usb_hub_port_power_on ( USB_PORT * port)

Power on the specified USB port.

Parameters
PortUSB port to power on
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock
Not all hubs support powering on and off individual ports, you must check if the hub includes the USB_HUB_CHARACTERISTIC_LPSM_PORT in its descriptor

◆ usb_hub_port_power_off()

uint32_t STDCALL usb_hub_port_power_off ( USB_PORT * port)

Power off the specified USB port.

Parameters
PortUSB port to power off
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock
Not all hubs support powering on and off individual ports, you must check if the hub includes the USB_HUB_CHARACTERISTIC_LPSM_PORT in its descriptor

◆ usb_hub_port_get_status()

uint32_t STDCALL usb_hub_port_get_status ( USB_PORT * port)

Read the status of the specified USB port.

Parameters
PortUSB port to read status for
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock

◆ usb_hub_port_set_feature()

uint32_t STDCALL usb_hub_port_set_feature ( USB_PORT * port,
uint16_t feature )

Enable a feature on the specified USB port.

Parameters
PortUSB port to enable the feature on
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock

◆ usb_hub_port_clear_feature()

uint32_t STDCALL usb_hub_port_clear_feature ( USB_PORT * port,
uint16_t feature )

Disable a feature on the specified USB port.

Parameters
PortUSB port to disable the feature on
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock

◆ usb_hub_port_change_feature()

uint32_t STDCALL usb_hub_port_change_feature ( USB_PORT * port,
uint16_t feature,
BOOL enable )

Enable or disable a feature on the specified USB port.

Parameters
PortUSB port to enable or disable the feature on
FeatureThe feature to enable or disable
EnableTrue to enable the feature or False to disable the feature
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock

◆ usb_hub_port_attach_device()

uint32_t STDCALL usb_hub_port_attach_device ( USB_PORT * port)

Attach a newly connected USB device to the specified USB port.

Parameters
PortUSB port to attach the new device to
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock
Only called in response to a status change on the hub

◆ usb_hub_port_detach_device()

uint32_t STDCALL usb_hub_port_detach_device ( USB_PORT * port)

Detach a disconnected USB device from the specified USB port.

Parameters
PortUSB port to detach the device from
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock
Only called in response to a status change on the hub

◆ usb_hub_port_status_changed()

uint32_t STDCALL usb_hub_port_status_changed ( USB_PORT * port)

Process a status change for the specified USB port.

Parameters
PortUSB port to process the status change for
Returns
USB_STATUS_SUCCESS if completed or another error code on failure
Note
Caller must hold the hub lock
Only called in response to a status change on the hub

◆ usb_device_get_count()

uint32_t STDCALL usb_device_get_count ( void )

Get the current device count.

USB Device, Driver and Host Helper Functions

◆ usb_device_check()

USB_DEVICE *STDCALL usb_device_check ( USB_DEVICE * device)

Check if the supplied Device is in the device table.

◆ usb_driver_get_count()

uint32_t STDCALL usb_driver_get_count ( void )

Get the current USB driver count.

◆ usb_driver_check()

USB_DRIVER *STDCALL usb_driver_check ( USB_DRIVER * driver)

Check if the supplied USB Driver is in the driver table.

◆ usb_host_get_count()

uint32_t STDCALL usb_host_get_count ( void )

Get the current host count.

◆ usb_host_check()

USB_HOST *STDCALL usb_host_check ( USB_HOST * host)

Check if the supplied Host is in the host table.

◆ usb_is_hub()

BOOL STDCALL usb_is_hub ( USB_DEVICE * device)

Returns True if Device is a Hub or False if not.

◆ usb_is_root_hub()

BOOL STDCALL usb_is_root_hub ( USB_DEVICE * device)

Returns True if Device is a Root Hub or False if not.

◆ usb_is_control_request()

BOOL STDCALL usb_is_control_request ( USB_REQUEST * request)

Returns True if Request is a control request or False if not.

◆ usb_is_bulk_request()

BOOL STDCALL usb_is_bulk_request ( USB_REQUEST * request)

Returns True if Request is a bulk request or False if not.

◆ usb_is_interrupt_request()

BOOL STDCALL usb_is_interrupt_request ( USB_REQUEST * request)

Returns True if Request is an interrupt request or False if not.

◆ usb_is_isochronous_request()

BOOL STDCALL usb_is_isochronous_request ( USB_REQUEST * request)

Returns True if Request is an isochronous request or False if not.

◆ usb_is_in_endpoint()

BOOL STDCALL usb_is_in_endpoint ( USB_ENDPOINT_DESCRIPTOR * endpoint)

Returns True if Endpoint is an IN endpoint or False if not.

◆ usb_is_out_endpoint()

BOOL STDCALL usb_is_out_endpoint ( USB_ENDPOINT_DESCRIPTOR * endpoint)

Returns True if Endpoint is an OUT endpoint or False if not.

◆ usb_is_bulk_endpoint()

BOOL STDCALL usb_is_bulk_endpoint ( USB_ENDPOINT_DESCRIPTOR * endpoint)

Returns True if Endpoint is a BULK endpoint or False if not.

◆ usb_is_interrupt_endpoint()

BOOL STDCALL usb_is_interrupt_endpoint ( USB_ENDPOINT_DESCRIPTOR * endpoint)

Returns True if Endpoint is a INTERRUPT endpoint or False if not.

◆ usb_is_isochronous_endpoint()

BOOL STDCALL usb_is_isochronous_endpoint ( USB_ENDPOINT_DESCRIPTOR * endpoint)

Returns True if Endpoint is a ISOCHRONOUS endpoint or False if not.

◆ usb_status_to_string()

uint32_t STDCALL usb_status_to_string ( uint32_t status,
char * string,
uint32_t len )

Translates a USB status code into a string.

◆ usb_device_type_to_string()

uint32_t STDCALL usb_device_type_to_string ( uint32_t usbtype,
char * string,
uint32_t len )

◆ usb_device_state_to_string()

uint32_t STDCALL usb_device_state_to_string ( uint32_t usbstate,
char * string,
uint32_t len )

◆ usb_device_status_to_string()

uint32_t STDCALL usb_device_status_to_string ( uint32_t usbstatus,
char * string,
uint32_t len )

◆ usb_device_state_to_notification()

uint32_t STDCALL usb_device_state_to_notification ( uint32_t state)

Convert a Device state value into the notification code for device notifications.

◆ usb_device_status_to_notification()

uint32_t STDCALL usb_device_status_to_notification ( uint32_t status)

Convert a Device status value into the notification code for device notifications.

◆ usb_host_type_to_string()

uint32_t STDCALL usb_host_type_to_string ( uint32_t hosttype,
char * string,
uint32_t len )

◆ usb_host_state_to_string()

uint32_t STDCALL usb_host_state_to_string ( uint32_t hoststate,
char * string,
uint32_t len )

◆ usb_host_state_to_notification()

uint32_t STDCALL usb_host_state_to_notification ( uint32_t state)

Convert a Host state value into the notification code for device notifications.

◆ usb_log_device_configuration()

void STDCALL usb_log_device_configuration ( USB_DEVICE * device,
usb_log_output_proc output,
void * data )

◆ usb_log_device_descriptor()

void STDCALL usb_log_device_descriptor ( USB_DEVICE * device,
USB_DEVICE_DESCRIPTOR * descriptor,
usb_log_output_proc output,
void * data )

◆ usb_log_configuration_descriptor()

void STDCALL usb_log_configuration_descriptor ( USB_DEVICE * device,
USB_CONFIGURATION_DESCRIPTOR * descriptor,
usb_log_output_proc output,
void * data )

◆ usb_log_interface_descriptor()

void STDCALL usb_log_interface_descriptor ( USB_DEVICE * device,
USB_INTERFACE_DESCRIPTOR * descriptor,
usb_log_output_proc output,
void * data )

◆ usb_log_endpoint_descriptor()

void STDCALL usb_log_endpoint_descriptor ( USB_DEVICE * device,
USB_ENDPOINT_DESCRIPTOR * descriptor,
usb_log_output_proc output,
void * data )

◆ usb_log_devices()

uint32_t STDCALL usb_log_devices ( void )

Print information about all devices attached to the USB.

Returns
ERROR_SUCCESS if completed or another error code on failure

◆ usb_log_devices_ex()

uint32_t STDCALL usb_log_devices_ex ( USB_DEVICE * device,
usb_log_output_proc output,
usb_device_enumerate_cb devicecallback,
usb_device_enumerate_cb treecallback,
void * data )

Print information about one or all devices attached to the USB with custom output and callbacks.

Parameters
DeviceThe device to print information about (nil for all devices)
OutputThe log output callback to print information to (nil to use the default output)
DeviceCallback The callback to print device information (nil if no device information should be printed)
TreeCallback The callback to print tree information (nil if no tree information should be printed)
DataA pointer to caller specific data which should be passed to the callbacks (Optional)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ usb_log_device_callback()

uint32_t STDCALL usb_log_device_callback ( USB_DEVICE * device,
void * data )

◆ usb_log_tree_callback()

uint32_t STDCALL usb_log_tree_callback ( USB_DEVICE * device,
void * data )

◆ usb_hub_get_count()

uint32_t STDCALL usb_hub_get_count ( void )

Get the current hub count.

USB Hub Helper Functions

◆ usb_hub_check()

USB_HUB *STDCALL usb_hub_check ( USB_HUB * hub)

Check if the supplied Hub is in the hub table.

◆ usb_hub_is_multi_tt()

BOOL STDCALL usb_hub_is_multi_tt ( USB_HUB * hub)

Returns True if Hub has multiple Transaction Translators or False if not.

◆ usb_hub_is_compound()

BOOL STDCALL usb_hub_is_compound ( USB_HUB * hub)

Returns True if Hub is part of a Compound Device or False if not.

◆ usb_hub_has_port_indicator()

BOOL STDCALL usb_hub_has_port_indicator ( USB_HUB * hub)

Returns True if Hub supports Port Indicators or False if not.

◆ usb_hub_has_port_power_switching()

BOOL STDCALL usb_hub_has_port_power_switching ( USB_HUB * hub)

Returns True if Hub supports per port Power Switching or False if not.

◆ usb_hub_has_port_current_protection()

BOOL STDCALL usb_hub_has_port_current_protection ( USB_HUB * hub)

Returns True if Hub supports per port Over Current Power Protection or False if not.

◆ usb_hub_get_tt_think_time()

uint8_t STDCALL usb_hub_get_tt_think_time ( USB_HUB * hub)

Get the TT Think Time from a Hub.

◆ usb_hub_type_to_string()

uint32_t STDCALL usb_hub_type_to_string ( uint32_t hubtype,
char * string,
uint32_t len )

Return a string describing the supplied Hub type value.

◆ usb_hub_state_to_string()

uint32_t STDCALL usb_hub_state_to_string ( uint32_t hubstate,
char * string,
uint32_t len )

Return a string describing the supplied Hub state value.

◆ usb_hub_state_to_notification()

uint32_t STDCALL usb_hub_state_to_notification ( uint32_t state)

Convert a Hub state value into the notification code for device notifications.

Variable Documentation

◆ PACKED

struct _USB_HUB_STATUS PACKED