USB Function Controller Driver PDD (Windows CE 5.0)
The following table shows the requirements of the USB function controller platform dependent driver (PDD).
Requirement | Description |
---|---|
Facilitate the presentation of an abstract USB function controller. | Presents an abstract USB function controller to a mounted function driver to ensure portability across different USB function controllers. |
Support configuration of the USB function controller. | Provides a function driver with the ability to examine the capabilities of a USB function controller, and allows a function driver to configure and allocate an endpoint. |
Present the USB protocol as an event system. | Notifies a mounted function driver of the occurrence of an event related to the USB protocol, and allows a function driver to react to and close an event. |
Interrupts and the Event System
Interrupt handling for USB function controllers is abstracted as USB event handling. An interrupt notifies the mounted function driver when USB events occur. A PDD provider is required to map hardware platform dependent interrupts to a prescribed set of recognized USB events. For information on the recognized USB device events, see the DEVICE_EVENT enumeration.
When an endpoint is configured and allocated, the function driver, through the MDD, specifies a notification function and a notification context. When a USB event related to the endpoint occurs, the notification function executes and supplies the specified notification context. The supplying function driver defines the interpretation of the notification context. If a function driver does not specify a notification function, then a mounted function driver must poll the status of the device.
Note The remainder of this discussion assumes that a notification function is associated with an allocated endpoint.
The USB function controller driver maps a hardware platform dependent interrupt to a recognized USB event. It also notifies the function driver directly when the event occurs. The function driver services the event. A USB function controller driver is an abstract function controller. A USB event generated by a USB function controller driver is an abstract interrupt. A notification function is an abstract interrupt service routine (ISR).
The following steps show the general event handling process:
The PDD creates the interrupt service thread (IST).
The following code example shows, generally, what the IST executes to create the IST.
while (!fTerminate) { ulWaitResult = WaitForSingleObject(hUDCEvent, INFINITE); HandleUSBEvent(); InterruptDone(dwIRQ); }
When the USB function controller generates a hardware interrupt, the USB function controller driver's IST unblocks on WaitForSingleObject.
The PDD determines the cause of the interrupt and maps the interrupt to a corresponding USB event.
If the USB function controller cannot directly map an interrupt to a USB event, the PDD generates an artificial event.
The PDD manipulates the underlying USB function controller to conform to the event system.
The PDD calls the notification function for either the USB function controller or a specific endpoint that is associated with the event.
See Also
USB Function Controller Driver Reference
Send Feedback on this topic to the authors