A core feature for a KMDF HID minidriver on I2C touch devices is . This feature corrects physical misalignment (e.g., inverted axes or "small box" scaling) by applying a transformation matrix to raw I2C touch coordinates before they are wrapped into a HID report. Coordinate Remapping Feature This feature intercepts raw
| Operation | Cost | Mitigation | |-----------|------|-------------| | Report modification | ~50-100ns | Inline calculation, no memory allocation | | Registry read | ~2-5ms | Cache calibration data in device context | | I²C command | ~200µs | Only during D0 entry, not per report |
Capture logs via TraceView.exe and correlate with HID class driver traces.
For every raw coordinate point collected P'(x', y') , the system expects an ideal, corrected point P(x, y) . The relationship can be represented by these equations: kmdf hid minidriver for touch i2c device calibration
// Example snippet of a Vendor-Defined Calibration Collection 0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00) 0x09, 0x01, // Usage (Vendor Usage 1) 0xA1, 0x01, // Collection (Application) 0x85, 0x02, // Report ID (2) - Calibration Command 0x09, 0x02, // Usage (Calibration Data) 0x15, 0x00, // Logical Minimum (0) 0x26, 0xFF, 0x00, // Logical Maximum (255) 0x75, 0x08, // Report Size (8 bits) 0x95, 0x40, // Report Count (64 bytes of matrix data) 0x91, 0x02, // Output (Data, Variable, Absolute) 0xC0 // End Collection Use code with caution. Step 2: Processing IOCTLs for Calibration
Driver architecture overview
KMDF HID Minidriver for Touch I2C Device (often associated with SileadTouch drivers) is a kernel-mode driver that enables Windows to communicate with touchscreens via the I2C protocol. Calibration issues, such as inverted axes or offset touch points, are common when the driver or its configuration file (like SileadTouch.sys or firmware) is incorrect for the specific hardware. 1. Standard Windows Calibration A core feature for a KMDF HID minidriver
switch (IoControlCode) case IOCTL_SET_CALIBRATION: CALIBRATION_DATA newCal; WdfRequestRetrieveInputBuffer(Request, sizeof(newCal), &newCal, NULL); // Apply and persist g_Calibration = newCal; SaveToRegistry(Device, &g_Calibration); WdfRequestComplete(Request, STATUS_SUCCESS); break; default: WdfRequestComplete(Request, STATUS_INVALID_DEVICE_REQUEST);
UX tips for calibration
To allow a user-mode calibration tool to interact with your driver, you must provide a private IOCTL. This is how the calibration GUI collects raw points and sends back coefficients. For every raw coordinate point collected P'(x', y')
A HID minidriver is a specialized driver that enables a HID device to communicate with the Windows operating system. HID devices, such as touchscreens, mice, and keyboards, are designed to provide an intuitive interface for users to interact with their computers. The HID minidriver acts as a bridge between the device and the operating system, facilitating data exchange and device control.
Windows relies on the Kernel-Mode Driver Framework (KMDF) and the Human Interface Device (HID) protocol to communicate with Touch I2C devices like tablets, trackpads, and interactive screens. Over time, or due to manufacturing variances, touch screens experience drift, offset issues, or dead zones.