USBArchitecture A USB system consists of a host computer, one or more USB devices, and a physical bus. The host consists of two layers: an upper software layer, which includes USB device drivers, and a host controller hardware layer, also known as an adapter layer. The main responsibility of the host computer is to control data transfers to and from USB devices. USB devices are peripherals that use the USB electrical and data format specifications to communicate with the host computer. The physical bus is the set of USB cables that links the controller with the peripherals. Bus-powered and Self-powered USB Devices Windows CE 2.10 and later provide full support for bus-powered and self-powered USB devices. When a user connects a self-powered or bus-powered device to a Windows CE–based platform, the USB system software automatically accepts or rejects the device, based on the power requirements of the device. The power model is the same for both bus-powered and self-powered devices. When a USB device is attached to a Windows CE–based platform, the HCD module sets the initial power configuration. During the device attachment processing phase, the HCD module reads the power requirements of the USB device configurations from the device configuration descriptor structures. In this way, the HCD module can choose an appropriate power configuration for the device. Some devices may provide several configurations with different power requirements. OEMs who port an HCD module to their hardware can implement policies to choose the appropriate power configurations from those provided by the USB devices. For example, Windows CE–based platforms have a registry setting that specifies the maximum total current draw allowable for USB devices connected to the host computer. If enabling a device would exceed this power threshold, the device is not configured unless the device has an alternate configuration with acceptable power requirements. OEMs can customize the platform-specific portions of the HCD module to choose dynamically whether to configure devices based on the current system power level. OEMs can implement a power model suitable for their platforms because the HCD module calls platform-specific code in its PDD layer for all USB devices connected to the bus. Therefore, an OEM can implement a power model that can selectively grant or deny power to individual USB devices according to whatever criteria the OEM chooses. Because an HCD module cannot know which configuration might be appropriate for different uses of a USB device, a USB device driver can change its device configuration after the device driver is loaded, to the extent that the new configuration meets overall system power requirements. A USB device driver uses the SetConfiguration function to change a USB device configuration. In the unconfigured state, USB devices may not draw more than 100 mA. Built on Wednesday, October 04, 2000 USB Components Supplied by Microsoft Microsoft supplies the following USB software components: • The USB driver (USBD) module, which loads USB device drivers and manages resources in the USB subsystem. • The complete set of USBD interface functions listed in the Universal Serial Bus Specification, Revision 1.1, implemented by the USBD module. The API set includes transfer functions, pipe functions, device configuration functions, and miscellaneous functions. This API enables developers to write USB device drivers to support any USB devices. • A sample HCD module that works with open host controller interface (OHCI)–compliant USB host controllers. OEMs must port the PDD portion of this driver to their hardware if their platform contains an OHCI host controller. • A sample HCD module that works with universal host controller driver (UHCI)–compliant USB host controllers. OEMs must port the PDD portion of this driver to their hardware if their platform contains a UHCI host controller. Note that the sample UHCI implementation for the CEPC reference platform does not support suspend and resume functionality. To add this support, the sample PDD layer would have to be modified to use the suspend and resume support present in the MDD layer. • A sample USB class driver for human interface devices (HID). Source code for these components is available in \Wince\Public\Common\Oak\Drivers\USB located in the Windows CE Platform Builder. Header files are in \Wince\Public\Oak\Inc and \Wince\Public\Ddk\Inc. Platform sample code is in Platform\Cepc\Drivers\Usb. Built on Wednesday, October 04, 2000 . 04, 2000 USB Components Supplied by Microsoft Microsoft supplies the following USB software components: • The USB driver (USBD) module, which loads USB device. USB Architecture A USB system consists of a host computer, one or more USB devices, and a physical bus. The host