Centrum wiedzy o technologiach i pracy w IT

The KMDF HID Minidriver calibration process involves a series of steps that configure the Touch I2C device for optimal performance. Here's an overview of the calibration process:

// Set HID minidriver flag WdfDeviceInitSetDeviceType(DeviceInit, FILE_DEVICE_KEYBOARD); // or MOUSE WDF_HID_DEVICE_CONFIG hidConfig; WDF_HID_DEVICE_CONFIG_INIT(&hidConfig); hidConfig.EvtHidDeviceGetDescriptor = GetHidDescriptor; hidConfig.EvtHidDeviceGetFeatureReport = GetFeatureReport; hidConfig.EvtHidDeviceSetFeatureReport = SetFeatureReport; hidConfig.EvtHidDeviceGetInputReport = GetInputReport; return WdfHidDeviceCreate(Device, &hidConfig, WDF_NO_OBJECT_ATTRIBUTES, &hHidDevice);

+---------------------------------------------+ | User-Space Apps | +---------------------------------------------+ ▲ │ Windows Touch Messages ▼ +---------------------------------------------+ | Input Subsystem | +---------------------------------------------+ ▲ │ HID Reports ▼ +---------------------------------------------+ | HIDClass.sys (Class Driver) | +---------------------------------------------+ ▲ │ Minidriver Interfaces ▼ +---------------------------------------------+ | Custom KMDF HID Minidriver (Your Driver) | +---------------------------------------------+ ▲ │ SPB / I2C Read/Write ▼ +---------------------------------------------+ | HIDI2C.sys / Hw I2C Controller | +---------------------------------------------+ ▲ │ Physical Signals ▼ +---------------------------------------------+ | Touch I2C Hardware | +---------------------------------------------+

The Windows touch subsystem uses a layered driver architecture to process touch inputs.

The preferred method for user-driven calibration is the built-in Windows tool. This generates the necessary registry entries that the OS uses to map HID inputs to screen pixels. Open Control Panel . Select Tablet PC Settings . Click Calibrate under the Display tab.

Starting in Windows 10, Microsoft introduced the , which eliminates the need to write a traditional transport minidriver. Instead, developers can write a HID source driver using KMDF or WDM programming interfaces. VHF consists of a Microsoft-provided static library that handles HID class driver interactions. For new projects targeting Windows 10 and later, VHF represents a cleaner and more maintainable approach than legacy transport minidrivers.

Where ( S_x ) and ( S_y ) are scaling factors, and ( O_x ) and ( O_y ) are offset corrections.