## Input/Output Device Driver Reference

[prev][next][parent][TOC]

### Using the Interface

Defining and implementing an API for OS/2 applications is one of the two primary functions of this device driver. After opening the device, applications communicate with the device driver via the OS/2 device IOCtl interface. Functions are provided for getting and setting device parameters, reading the state of the devices connected, and calibrating those devices.

The device driver samples the game-port adapter inside the realtime clock timer handler. This handler is registered with the operating system at device initialization and is called every 32 milliseconds thereafter. It determines whether or not the game-adapter port requires sampling based on client demand and the current sampling rate. Client demand for the sampling procedure only exists if an OS/2 application has the device open or if a VDM is emulating the port.

The joysticks connected are determined and calibrated as part of the device initialization. These parameters can be modified by an OS/2 application or refreshed through a calibration IOCtl request.

In addition to the standard device-read function, functions are also defined for returning the state of the device connected at the next button press or at the next timed read. These functions block the calling process until the given event occurs when the process is run from inside the timer handler.