Home |
Function FindUSBControllers |
Function FindUSBControllersAll RTUSB-32 demos are linked with module Usbinit.cpp, which contains function FindUSBControllers. It queries the PCI BIOS using RTTarget-32's PCI BIOS functions for installed USB host controllers and then calls RTURegisterXHCI, RTURegisterEHCI, RTURegisterOHCI, and RTURegisterUHCI to start the RTUSB-32 protocol stack. In addition, function FindUSBControllers switches to APIC mode with function RTMPSetAPICModeACPI and calls RTKernelInit and KBInit to initialize RTKernel-32. All XHCI controllers are operated in MSI interrupt mode through function RTMPSetupMSI. RTUShutDown is installed as an exit function using run-time system function atexit. It is recommended to copy function FindUSBControllers to applications using RTUSB-32 to correctly call the host controller registration functions. FindUSBControllers can be configured to reference only those host controller registration functions that an application intends to support (see Usbinit.cpp for details). Excluding selected host controllers may be advisable if the application always runs on the same hardware platform, and the installed USB host controller type is known. Not registering unused controllers type(s) reduces the application's code size. For programs using RTPEG-32, the call to KBInit should be removed, because RTPEG-32 contains its own keyboard event queue handling. FindUSBControllers is also responsible for PCI configuration changes, if any such changes are required. For example, the PCI latency timers are adjusted if they are too low.
|