For Kernel-Mode Driver Framework (KMDF) HID minidrivers on Windows, the HID over I2C driver
The following example code illustrates a basic calibration implementation in a KMDF HID minidriver:
- Show targets on screen.
- Read raw coordinates via
IOCTL_TOUCH_GET_RAW (another private IOCTL that bypasses calibration).
- Compute transform.
- Write back via
IOCTL_TOUCH_SET_CALIBRATION.
- Byte 0: command (0=start,1=cancel,2=status)
- Byte 1: status (0=idle,1=running,2=success,3=error)
- Byte 2-3: last_error_rms (uint16)
- Remaining: reserved
// Set the gain and offset values
i2cInterface->WriteRegister(I2C_ADDRESS, REG_GAIN_X, CalibrationData->gainX);
i2cInterface->WriteRegister(I2C_ADDRESS, REG_OFFSET_Y, CalibrationData->offsetY);
Testing and Validation
- Store calibration in registry.
- Apply transform inside the report processing path with minimal overhead.
- Protect parameters with a lock.
- Never alter the HID descriptor.
- Validate thoroughly with HLK tools.
KMDF HID Minidriver for Touch I2C Device — Calibration Guide
Overview
This document describes how to implement calibration support in a KMDF-based HID minidriver for a touch controller connected over I²C. It covers design goals, data flow, required HID usages and reports, driver components, calibration algorithms, persistent storage, and testing/validation steps.
Questo sito web utilizza i cookie al fine di migliorarne la fruibilità. Continuando a navigare o accedendo a un qualunque elemento del sito, senza cambiare le impostazioni dei cookie, accetterai implicitamente di ricevere cookie dal nostro sito. Per maggiori informazioni consulta la nostra informativa Maggiori Info Accetta Privacy & Cookies Policy