摘要
针对Windows操作系统提供的通用驱动程序不能很好满足具有特殊功能的设备的要求这一缺点,通过为自行设计的USB HID硬件设备开发USB HID小驱动程序,探讨在C语言平台上采用DDK开发基于WDM的HID小驱动程序的一般方法。介绍了USB HID设备的特点及其在Windows XP环境下的驱动层次结构;结合实际开发经验,详细阐述了USB HID小驱动程序的入口例程、即插即用例程、分发例程、电源管理例程和卸载例程的功能、特点及其编写方法,重点分析了在HID类驱动程序轮询设备条件下,处理读写I/O请求的一般方法;简单地介绍了WDM驱动程序的加载和安装方法;最后总结了开发USBHID小驱动程序的重点和难点。实验结果表明,自行开发的驱动程序运行稳定,可移植性强,针对具体设备开发小驱动程序简单可行。
To the problem that the ordinary drivers provided by Windows Operating System can not meet the needs of some devices with special function perfectly,the methods to develop USB HID minidrivers are discussed based on WDM using DDK on C language platform.The features of USB HID devices and the device driver architecture under Windows XP are introduced.According to successful experience,the function,characteristics,and programming methods of driver entry,plug and play routine,dispatch routine,power management routine and unload routine are represented in detail.The emphases are paid on the methods to handle read/write requests when the HID class driver polls the devices.The loading and installing procedure is also included.The keys to develop USB HID minidriver are summarized.The experiment result shows that the driver runs stably with good transportability and is easy and feasible to develop minidriver for particular devices.
出处
《控制工程》
CSCD
北大核心
2010年第6期815-819,共5页
Control Engineering of China
基金
国家863计划资助项目(2006AA09Z232)
作者简介
王恒升(1963-),男,陕西合阳人,教授,博士生导师,主要从事机电系统控制理论及控制工程、机器人控制、动态系统理论、机电系统动态检测与数据处理等方面的教学与科研工作。