Difference between revisions of "Unit USB"
Line 1,825: | Line 1,825: | ||
<pre style="border: 0; padding-bottom:0px;">function USBHostStateToNotification(State:LongWord):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function USBHostStateToNotification(State:LongWord):LongWord;</pre> | ||
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Host state value into the notification code for device notifications</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Host state value into the notification code for device notifications</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | To be documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure USBLog(Level:LongWord; Device:PUSBDevice; const AText:String);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | To be documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure USBLogInfo(Device:PUSBDevice;const AText:String);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | To be documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure USBLogError(Device:PUSBDevice;const AText:String);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | To be documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure USBLogDebug(Device:PUSBDevice;const AText:String);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" |
Revision as of 06:38, 15 September 2016
Return to Unit Reference
Description
USB
This unit implements the USB core software that does not depend on the specific host controller hardware and is not specific to any single USB device or platform.
Features and limitations:
- This driver is written to be compatible with USB 2.0. USB 3.0 devices work correctly when operating in USB 2.0 compatible mode, actual support for USB 3.0 host controllers and native super speed modes will require some modification to this driver.
- Not all USB transfer types and speeds are supported yet. This depends on the Host Controller Driver, see USBRequestSubmit.
- This driver does not attempt to do any intelligent power management, bandwidth allocation, or transfer scheduling. Devices are always set to their first listed configuration regardless of power requirements. Requests are simply passed to the Host Controller Driver in the order submitted, the Host Controller Driver is responsible for doing any more intelligent scheduling if desired.
- This driver does not support multiple configurations per USB device. If a device happens to have multiple configurations, the first one will be assigned (see devices below for more information).
- By design, it is possible to implement a host controller driver for different host controller hardware without changing any of this code, as long as the host controller driver provides the functions declared in TUSBHost (Start, Stop, Reset, Submit and Cancel).
- By design, this driver has a hard-coded dependency on the USB hub driver because USB is useless without hubs.
To initialize this core USB driver, USBInit must be called by the system startup code. See that function for details.
If the flag USB_AUTOSTART is not set then USBStart must be called to start the USB core. See that function for details.
The other functions exported by this core USB driver are mostly intended to be used by USB device drivers.
Debugging messages in this driver can be enabled by changing the value of USB_DEFAULT_LOG_LEVEL and by enabling the USB_DEBUG define in GlobalDefines.
Be careful when enabling USB debugging as the USB core can generate a lot of messages due to constant polling of interrupt endpoints on devices such as hubs, keyboards and mice.
USB Device
USB devices are the generic implementation of anything that can be connected to the USB bus. All USB devices require a driver to implement the specific behaviour of the device but at the generic level each device will have:
- One or more configurations available. The USB core will first offer the device to drivers without a configuration being selected, the driver may choose a specific configuration if required otherwise the core will simply select the first available configuration.
- One or more interfaces available. On devices with multiple interfaces, the USB core supports different drivers binding to different interfaces. This way combination devices are supported.
- One or more endpoints available. All devices must have a control endpoint and most devices will have one or more bulk, interrupt or isochronous endpoints as well. The USB core will only communicate with the control endpoint to perform generic operations like reading the desriptors and assigning a device addresss.
Drivers are expected to understand which endpoints they need to communicate with to provide the device specific functionality.
Devices are considered dynamic by the USB core and can be connected or disconnected at any time. The hub driver is responsible for attaching and detaching devices in response to hub status change events and for binding or unbinding drivers as devices are added or removed.
USB Host
USB hosts implement the hardware level interface that supports sending USB requests to the hardware and receiving responses. All handling of interrupts, DMA, transaction sequence, errors and resubmitting/retrying requests is done by the USB host driver. All host drivers must implement the functions defined in TUSBHost (Start, Stop, Reset, Submit and Cancel) and must register themselves with the USB core by calling USBHostRegister. When the USB core is started each registered host driver will be called via the Start function so it can initialize itself and allocate locks, buffers and other resources required to interact with the hardware.
A host driver can also be registered after the USB core has been started and it will be given the opportunity to start itself immediately. In this way USB hosts can potentially be hot pluggable.
Each host driver must also implement a root hub which respresents the port or ports that are directly connected to the controller hardware. In many cases this will not be a real hub but will be simulated in the host driver so that the hub driver can interact with it as though it was a standard hub device.
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure USBInit;
Note | To be documented |
---|
function USBStart:LongWord;
Note | To be documented |
---|
function USBStop:LongWord;
Note | To be documented |
---|
procedure USBAsyncStart(Host:PUSBHost);
Note | To be documented |
---|
USB device, driver and host functions
function USBDeviceGetAddress(Device:PUSBDevice):Byte;
Device | The USB device to get the address for |
---|---|
Return | Device address or 0 on failure |
function USBDeviceSetAddress(Device:PUSBDevice; Address:Byte):LongWord;
Device | The USB device to set the address for |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceCreateDeviceDescriptor(Device:PUSBDevice; Length:Word):LongWord;
Device | The USB device to create the device descriptor for |
---|---|
Length | The length of the descriptor to create |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceCreateConfigurations(Device:PUSBDevice):LongWord;
Device | The USB device to create the configurations for |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceReadConfigurations(Device:PUSBDevice):LongWord;
Device | The USB device to read the configurations for |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceCreateConfiguration(Device:PUSBDevice; Index:Byte; Size:Word):LongWord;
Device | The USB device to create the configuration for |
---|---|
Index | The index of the configuration to create |
Size | The size of the configuration descriptor to create |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceReadConfiguration(Device:PUSBDevice; Index:Byte):LongWord;
Device | The USB device to read the configuration for |
---|---|
Index | The index of the configuration to read |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceReadStringDescriptor(Device:PUSBDevice; Index:Byte):String;
Note | To be documented |
---|
function USBDeviceReadStringDescriptorW(Device:PUSBDevice; Index:Byte):UnicodeString;
Note | To be documented |
---|
function USBDeviceGetConfiguration(Device:PUSBDevice; var ConfigurationValue:Byte):LongWord;
Device | The USB device to get the current configuration for |
---|---|
ConfigurationValue | The current configuration (As per bConfigurationValue in the configuration descriptor) |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceSetConfiguration(Device:PUSBDevice; ConfigurationValue:Byte):LongWord;
Device | The USB device to set the configuration for |
---|---|
ConfigurationValue | The configuration to set (As per bConfigurationValue in the configuration descriptor) |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceFindConfigurationByValue(Device:PUSBDevice; ConfigurationValue:Byte):PUSBConfiguration;
Device | The USB device to find the configuration for |
---|---|
ConfigurationValue | The configuration value to find (As per bConfigurationValue in the configuration descriptor) |
Return | USB Configuration if completed or nil on failure |
function USBDeviceGetInterface(Device:PUSBDevice; Index:Byte; var AlternateSetting:Byte):LongWord;
Device | The USB device to get the interface alternate setting for |
---|---|
Index | The index of the interface to get (As per bInterfaceNumber in the interface descriptor) |
AlternateSetting | The current alternate setting of the specified interface (As per bAlternateSetting in the interface descriptor) |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceSetInterface(Device:PUSBDevice; Index,AlternateSetting:Byte):LongWord;
Device | The USB device to set the interface alternate setting for |
---|---|
Index | The index of the interface to set (As per bInterfaceNumber in the interface descriptor) |
AlternateSetting | The alternate setting to set on the specified interface (As per bAlternateSetting in the interface descriptor) |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceSetFeature(Device:PUSBDevice; Endpoint:PUSBEndpointDescriptor; Feature,Index:Word):LongWord;
Device | The USB device to enable the feature for |
---|---|
Endpoint | The endpoint to enable the feature on |
Feature | The feature to enable |
Index | To be documented |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceClearFeature(Device:PUSBDevice; Endpoint:PUSBEndpointDescriptor; Feature:Word):LongWord;
Device | The USB device to disable the feature for |
---|---|
Endpoint | The endpoint to disable the feature on |
Feature | The feature to disable |
Index | To be documented |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceSetState(Device:PUSBDevice; State:LongWord):LongWord;
Device | The USB device to set the state for |
---|---|
Status | The new state to set and notify |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceSetStatus(Device:PUSBDevice; Status:LongWord):LongWord;
Device | The USB device to set the status for |
---|---|
Status | The new status to set and notify |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceBind(Device:PUSBDevice):LongWord;
Device | The device to attempt to bind a driver to |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceAttach(Device:PUSBDevice):LongWord;
Device | New USB device to configure and initialize |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceDetach(Device:PUSBDevice):LongWord;
Device | The USB device to shutdown and detach |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBDeviceAllocate(Host:PUSBHost; Parent:PUSBDevice):PUSBDevice;
Host | The Host this device is attached to |
---|---|
Parent | The Parent device (Hub) this device is attached to (nil if this device is a root hub) |
Return | Pointer to new Device entry or nil if device could not be created |
function USBDeviceFind(USBId:LongWord):PUSBDevice;
Note | To be documented |
---|
function USBDeviceFindByName(const Name:String):PUSBDevice; inline;
Note | To be documented |
---|
function USBDeviceFindByDescription(const Description:String):PUSBDevice; inline;
Note | To be documented |
---|
function USBDeviceEnumerate(Callback:TUSBDeviceEnumerate; Data:Pointer):LongWord;
Note | To be documented |
---|
function USBDeviceNotification(Device:PUSBDevice; Callback:TUSBDeviceNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Note | To be documented |
---|
function USBDriverCreate:PUSBDriver;
Return | Pointer to new Driver entry or nil if driver could not be created |
---|
function USBDriverCreateEx(Size:LongWord):PUSBDriver;
Size | Size in bytes to allocate for new driver (Including the driver entry) |
---|---|
Return | Pointer to new Driver entry or nil if driver could not be created |
function USBDriverDestroy(Driver:PUSBDriver):LongWord;
Note | To be documented |
---|
function USBDriverRegister(Driver:PUSBDriver):LongWord;
Note | To be documented |
---|
function USBDriverFind(DriverId:LongWord):PUSBDriver;
Note | To be documented |
---|
function USBDriverFindByName(const Name:String):PUSBDriver; inline;
Note | To be documented |
---|
function USBDriverEnumerate(Callback:TUSBDriverEnumerate; Data:Pointer):LongWord;
Note | To be documented |
---|
function USBHostSetState(Host:PUSBHost; State:LongWord):LongWord;
Host | The USB host to set the state for |
---|---|
State | The new state to set and notify |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBHostCreate:PUSBHost;
Return | Pointer to new Host entry or nil if host could not be created |
---|
function USBHostCreateEx(Size:LongWord):PUSBHost;
Size | Size in bytes to allocate for new host (Including the host entry) |
---|---|
Return | Pointer to new Host entry or nil if host could not be created |
function USBHostDestroy(Host:PUSBHost):LongWord;
Note | To be documented |
---|
function USBHostRegister(Host:PUSBHost):LongWord;
Note | To be documented |
---|
function USBHostFind(HostId:LongWord):PUSBHost;
Note | To be documented |
---|
function USBHostFindByName(const Name:String):PUSBHost; inline;
Note | To be documented |
---|
function USBHostFindByDescription(const Description:String):PUSBHost; inline;
Note | To be documented |
---|
function USBHostEnumerate(Callback:TUSBHostEnumerate; Data:Pointer):LongWord;
Note | To be documented |
---|
function USBHostNotification(Host:PUSBHost; Callback:TUSBHostNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Note | To be documented |
---|
function USBBufferAllocate(Device:PUSBDevice; Size:LongWord):Pointer; inline;
Device | The device that the request will be sent to |
---|---|
Size | The size of the data buffer to allocate |
Return | The newly allocated buffer or nil on failure |
function USBBufferAllocateEx(Device:PUSBDevice; Size:LongWord; var Flags:LongWord):Pointer;
Device | The device that the request will be sent to |
---|---|
Size | The size of the data buffer to allocate |
Flags | The returned flags for the allocated buffer (eg USB_REQUEST_FLAG_SHARED) |
Return | The newly allocated buffer or nil on failure |
function USBBufferValidate(Device:PUSBDevice; Buffer:Pointer; Size:LongWord; var Flags:LongWord):LongWord;
Device | The device that the request will be sent to |
---|---|
Buffer | The data buffer to validate |
Size | The size of the data buffer |
Flags | The returned flags for the validated buffer (eg USB_REQUEST_FLAG_SHARED) |
Return | USB_STATUS_SUCCESS on success or another error code on failure |
function USBRequestAllocate(Device:PUSBDevice; Endpoint:PUSBEndpointDescriptor; Callback:TUSBRequestCompleted; Size:LongWord; DriverData:Pointer):PUSBRequest; inline;
Device | The USB device this request will be sent to |
---|---|
Endpoint | The Endpoint descriptor this request will be sent to (Or nil for the default control endpoint) |
Callback | The callback function to be called on completion of the request |
Size | The size of the data buffer for the request |
DriverData | Device driver private data for the callback (Optional) |
Return | The newly allocated request or nil on failure |
function USBRequestAllocateEx(Device:PUSBDevice; Endpoint:PUSBEndpointDescriptor; Callback:TUSBRequestCompleted; var Data:Pointer; Size:LongWord; DriverData:Pointer):PUSBRequest;
Device | The USB device this request will be sent to |
---|---|
Endpoint | The Endpoint descriptor this request will be sent to (Or nil for the default control endpoint) |
Callback | The callback function to be called on completion of the request |
Data | The returned data buffer allocated for the request (Or nil if size is zero)(Pass an existing buffer to prevent allocation) |
Size | The size of the data buffer for the request |
DriverData | Device driver private data for the callback (Optional) |
Return | The newly allocated request or nil on failure |
function USBRequestRelease(Request:PUSBRequest):LongWord;
Request | The request to be released |
---|---|
Return | USB_STATUS_SUCCESS on success or another error code on failure |
function USBRequestInitialize(Request:PUSBRequest; Callback:TUSBRequestCompleted; Data:Pointer; Size:LongWord; DriverData:Pointer):LongWord;
Request | The request to be initialized |
---|---|
Callback | The callback function to be called on completion of the request |
Data | The returned data buffer allocated for the request (Or nil if size is zero) |
Size | The size of the data buffer for the request |
DriverData | Device driver private data for the callback (Optional) |
Return | USB_STATUS_SUCCESS on success or another error code on failure |
function USBRequestSubmit(Request:PUSBRequest):LongWord;
Request | The request to be submitted |
---|---|
Return | 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 |
function USBRequestCancel(Request:PUSBRequest):LongWord;
Request | The request to be cancelled |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
procedure USBRequestComplete(Request:PUSBRequest);
Request | The USB request which has completed |
---|
USB hub functions
function USBHubCreatePorts(Hub:PUSBHub):LongWord;
Hub | The hub to initialize ports for |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBHubPowerOnPorts(Hub:PUSBHub):LongWord;
Hub | The hub to power on ports for |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function USBHubCreateHubDescriptor(Hub:PUSBHub):LongWord;
Hub | The hub to create the descriptor for |
---|---|
Return | 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 |
function USBHubReadHubDescriptor(Hub:PUSBHub):LongWord;
Hub | The hub to read the descriptor for |
---|---|
Return | 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 |
function USBHubLock(Hub:PUSBHub):LongWord;
Hub | The hub to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function USBHubUnlock(Hub:PUSBHub):LongWord;
Hub | The hub to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function USBHubSetState(Hub:PUSBHub; State:LongWord):LongWord;
Hub | The hub to set the state for |
---|---|
State | The new state to set and notify |
Return | ERROR_SUCCESS if completed or another error code on failure |
function USBHubAllocate(Device:PUSBDevice):PUSBHub;
Device | The USB device that represents this hub |
---|---|
Return | Pointer to new Hub entry or nil if hub could not be created |
function USBHubRelease(Hub:PUSBHub):LongWord;
Hub | The hub to deregister and destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function USBHubFind(HubId:LongWord):PUSBHub;
Note | To be documented |
---|
function USBHubFindByName(const Name:String):PUSBHub; inline;
Note | To be documented |
---|
function USBHubFindByDescription(const Description:String):PUSBHub; inline;
Note | To be documented |
---|
function USBHubEnumerate(Callback:TUSBHubEnumerate; Data:Pointer):LongWord;
Note | To be documented |
---|
function USBHubNotification(Hub:PUSBHub; Callback:TUSBHubNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Note | To be documented |
---|
procedure USBHubBindDevices(Device:PUSBDevice; Callback:TUSBDeviceBind);
Device | USB device at which to start the enueration |
---|---|
Callback | Bind callback function to execute for each device |
procedure USBHubUnbindDevices(Device:PUSBDevice; Driver:PUSBDriver; Callback:TUSBDeviceUnbind);
Device | USB device at which to start the enumeration |
---|---|
Callback | Unbind callback function to execute for each device |
procedure USBHubEnumerateDevices(Device:PUSBDevice; Callback:TUSBDeviceEnumerate; Data:Pointer);
Device | USB device at which to start the enumeration |
---|---|
Callback | Enumerate callback function to execute for each device |
function USBHubPortReset(Port:PUSBPort):LongWord;
Port | USB port to reset |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
Note | Caller must hold the hub lock |
function USBHubPortGetStatus(Port:PUSBPort):LongWord;
Port | USB port to read status for |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
Note | Caller must hold the hub lock |
function USBHubPortSetFeature(Port:PUSBPort; Feature:Word):LongWord;
Port | USB port to enable the feature on |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
Note | Caller must hold the hub lock |
function USBHubPortClearFeature(Port:PUSBPort; Feature:Word):LongWord;
Port | USB port to disable the feature on |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
Note | Caller must hold the hub lock |
function USBHubPortChangeFeature(Port:PUSBPort; Feature:Word; Enable:Boolean):LongWord;
Port | USB port to enable or disable the feature on |
---|---|
Feature | The feature to enable or disable |
Enable | True to enable the feature or False to disable the feature |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
Note | Caller must hold the hub lock |
function USBHubPortAttachDevice(Port:PUSBPort):LongWord;
Port | USB port to attach the new device to |
---|---|
Return | 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. |
function USBHubPortStatusChanged(Port:PUSBPort):LongWord;
Port | USB port to process the status change for |
---|---|
Return | 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. |
function USBHubExecute(Parameter:Pointer):PtrInt;
Note | One status change request exists for each hub currently connected and is created and submitted by the hub driver when it binds to a new hub device. When a hub is disconnected the hub driver will remove the request when the hub is detached and destroyed. |
---|
function USBHubDriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Device | The USB device to attempt to bind to |
---|---|
Interrface | The USB interface to attempt to bind to (or nil for whole device) |
Return | USB_STATUS_SUCCESS if completed, USB_STATUS_DEVICE_UNSUPPORTED if unsupported or another error code on failure |
USB device, driver and host helper functions
function USBDeviceGetCount:LongWord; inline;
Note | To be documented |
---|
function USBDeviceCheck(Device:PUSBDevice):PUSBDevice;
Note | To be documented |
---|
function USBDriverGetCount:LongWord; inline;
Note | To be documented |
---|
function USBDriverCheck(Driver:PUSBDriver):PUSBDriver;
Note | To be documented |
---|
function USBHostGetCount:LongWord; inline;
Note | To be documented |
---|
function USBHostCheck(Host:PUSBHost):PUSBHost;
Note | To be documented |
---|
function USBIsHub(Device:PUSBDevice):Boolean;
Note | To be documented |
---|
function USBIsRootHub(Device:PUSBDevice):Boolean;
Note | To be documented |
---|
function USBIsControlRequest(Request:PUSBRequest):Boolean;
Note | To be documented |
---|
function USBIsBulkRequest(Request:PUSBRequest):Boolean;
Note | To be documented |
---|
function USBIsInterruptRequest(Request:PUSBRequest):Boolean;
Note | To be documented |
---|
function USBIsIsochronousRequest(Request:PUSBRequest):Boolean;
Note | To be documented |
---|
function USBIsInEndpoint(Endpoint:PUSBEndpointDescriptor):Boolean;
Note | To be documented |
---|
function USBIsOutEndpoint(Endpoint:PUSBEndpointDescriptor):Boolean;
Note | To be documented |
---|
function USBIsBulkEndpoint(Endpoint:PUSBEndpointDescriptor):Boolean;
Note | To be documented |
---|
function USBIsInterruptEndpoint(Endpoint:PUSBEndpointDescriptor):Boolean;
Note | To be documented |
---|
function USBIsIsochronousEndpoint(Endpoint:PUSBEndpointDescriptor):Boolean;
Note | To be documented |
---|
function USBDeviceToString(Device:PUSBDevice):String;
Device | USB device to get a description of |
---|---|
Return | A string describing the device |
function USBStatusToString(Status:LongWord):String;
Note | To be documented |
---|
function USBClassCodeToString(ClassCode:Integer):String;
Note | To be documented |
---|
function USBSubClassCodeToString(ClassCode,SubClassCode:Integer):String;
Note | To be documented |
---|
function USBProtocolCodeToString(ClassCode,ProtocolCode:Integer):String;
Note | To be documented |
---|
function USBSpeedToString(Speed:Integer):String;
Note | To be documented |
---|
function USBTransferTypeToString(TransferType:Integer):String;
Note | To be documented |
---|
function USBDirectionToString(Direction:Integer):String;
Note | To be documented |
---|
function USBPortStatusConnectedToString(Status:Word):String;
Note | To be documented |
---|
function USBHubCharacteristicsToString(HubCharacteristics:Word):String;
Note | To be documented |
---|
function USBDeviceTypeToString(USBType:LongWord):String;
Note | To be documented |
---|
function USBDeviceStateToString(USBState:LongWord):String;
Note | To be documented |
---|
function USBDeviceStatusToString(USBStatus:LongWord):String;
Note | To be documented |
---|
function USBDeviceStateToNotification(State:LongWord):LongWord;
Note | To be documented |
---|
function USBDeviceStatusToNotification(Status:LongWord):LongWord;
Note | To be documented |
---|
function USBHostTypeToString(HostType:LongWord):String;
Note | To be documented |
---|
function USBHostStateToString(HostState:LongWord):String;
Note | To be documented |
---|
function USBHostStateToNotification(State:LongWord):LongWord;
Note | To be documented |
---|
procedure USBLog(Level:LongWord; Device:PUSBDevice; const AText:String);
Note | To be documented |
---|
procedure USBLogInfo(Device:PUSBDevice;const AText:String);
Note | To be documented |
---|
procedure USBLogError(Device:PUSBDevice;const AText:String);
Note | To be documented |
---|
procedure USBLogDebug(Device:PUSBDevice;const AText:String);
Note | To be documented |
---|
Return to Unit Reference