阅读:886回复:0
关于usb翻译的问题。。。
下面是关于怎样配置usb设备的英文:由于翻译水平是有限的。有些东西不知怎样理解,麻繁帮帮看看。说说大概也好。
How to Configure a USB Device Here are the keys to building a driver to control a USB device: USB drivers must be WDM drivers. This means you need to usb 设备必需是一个wdm驱动器。你需要从kdriver类中派生 have an AddDevice member in the class you derive from 一个类并在这个类中要有一个adddevice函数。你的function.h文件 KDriver. Your function.h file must #define 中加入 DRIVER_FUNCTION_ADD_DEVICE, DRIVER_FUNCTION_PNP, and DRIVER_FUNCTION_POWER. USB devices are always Plug and Play. Derive a class from USB设备总是plug and play的,从kpnpdevice中派生一个类。 KPnpDevice. The class must have a data member of type 这个类中必需要有个kusblowerdevice类型的数据成员。此外, KUsbLowerDevice. Furthermore, for each interface of each c 其它接口的其它配置,从kusbinterface类型中声明一个数据成员。 onfiguration, declare a data member of type KUsbInterface. 其它usb endpoint 从kusbpipe类型中声明数据成员 For each USB endpoint, declare a data member of type KUsbPipe Your device class must override, at a minimum, 你的设备类必需要重载,在最小时要有onstartdevice和onstopdevice函数。 OnStartDevice and OnStopDevice. There may be additional member functions that your driver needs to override, but much of the PnP and Power functionality required by the system is implemented by the base class policy options. In the device constructor, you must first initialize the instance of KUsbLowerDevice by calling its member function Initialize. Then initialize each KUsbInterface by calling its Initialize member. Then initialize each KUsbPipe by calling its Initialize member. Be sure to call the new forms of these methods. Legacy forms exist for compatibility with legacy device drivers. Then call SetLowerDevice, SetPnpPolicy and SetPowerPolicy. In member function OnStartDevice of your device class, call function KUsbLowerDevice::ActivateConfiguration to configure the device. This function will establish the binding between KUsbPipe and KUsbInterface objects and the active USB pipes and interfaces. In member function OnStopDevice, call member KUsbLowerDevice::DeActivateConfiguration. Refer to examples USBTHERM for more information, or use DriverWizard to generate a customized USB client driver. See Also USB Overview |
|