机构地区: 华南理工大学自动化科学与工程学院
出 处: 《兵工自动化》 2003年第3期49-51,共3页
摘 要: Windows 2000环境下,使用WinDriver,通过用户态API函数,可开发基于ISA/EISA/PCI/USB等总线的用户驱动程序,实现对硬件的操作。WinDriver安装后,利用开发向导选择设备和驱动程序类型,定义I/O等资源和地址范围,即能完成对I/O的直接读写。以ISA K812A卡驱动程序为例,其开发步骤是:调用WD_Open() 函数以返回WinDriver设备句柄,调用WD_CardRegister() 以注册硬件,调用WD_Transfer()进行数据读写操作,如有中断则调用WD_IntEnable()、WD_IntWait()、WD_IntDisable() 函数来处理。 On Win2000 platform, hardware driver for ISA/EISA/PCI/USB can be developed with WinDriver, through API interface functions. After installation WinDriver, WinDriver wizard can help users select drive types, define I/O resources and address range, write/read I/O port directly, and then, hardware operation is realized. Taken the driver of ISA k812 card as an example, its main procedure is as below: first the driver handle can be obtained by means of WD_Open, then hardware information can be registered by means of WD_CardRegister(), at last data read-write operation is realized by means of WD_Transfer(). If signal is interrupted, it is disposed by the functions of WD_IntEnable(), WD_IntWait(), WD_IntDisable().