Guidance on handling report descriptors specifically? Creating WDF HID Minidrivers - Windows drivers
Mastering KMDF HID Minidriver Calibration for Touch I2C Devices
Mechanical misalignment can cause a constant shift in coordinates. Calculated_X = (Raw_X - X_Offset)
Store a small cache of active touch points. Calibration must apply to each point individually, and the HID report must track touch IDs across frames. kmdf hid minidriver for touch i2c device calibration
The driver parses the HID report bytes according to the device's HID report descriptor to locate the X and Y coordinate fields.
0x05, 0x0D, // Usage Page (Digitizer) 0x09, 0x04, // Usage (Touch Screen) 0xA1, 0x01, // Collection (Application) 0x85, 0x01, // Report ID 1 0x09, 0x22, // Usage (Finger) 0xA1, 0x00, // Collection (Physical) 0x09, 0x42, // Usage (Tip Switch) 0x15, 0x00, // Logical Minimum (0) 0x25, 0x01, // Logical Maximum (1) 0x75, 0x01, // Report Size (1) 0x95, 0x01, // Report Count (1) 0x81, 0x02, // Input (Data,Var,Abs) 0x09, 0x30, // Usage (X) 0x27, 0xFF, 0xFF, 0x00, 0x00, // Logical Maximum (65535) 0x75, 0x10, // Report Size (16) 0x95, 0x01, // Report Count (1) 0x81, 0x02, // Input (Data,Var,Abs) ... etc ... 0xC0, 0xC0
[HID Class Driver (hidclass.sys)] ↑ [TouchCalibMini.sys – our KMDF minidriver] ↑ [SPB I2C Controller Driver (SpbCx)] ↑ [I2C Hardware] Guidance on handling report descriptors specifically
The driver updates the data buffer inside the IRP with the new calibrated values and passes it up to HIDClass.sys . 4. Storing and Managing Calibration Data
WDF_INTERRUPT_CONFIG interruptConfig; WDF_INTERRUPT_CONFIG_INIT(&interruptConfig, TouchCalibEvtInterruptIsr, TouchCalibEvtInterruptDpc); interruptConfig.PassiveHandling = TRUE; // Allows I2C calls WdfInterruptCreate(Device, &interruptConfig, WDF_NO_OBJECT_ATTRIBUTES, &Interrupt);
The Advanced Configuration and Power Interface (ACPI) table must explicitly map the I2C resources and interrupts to your device. Calibration must apply to each point individually, and
NTSTATUS I2CRead(WDFIOTARGET I2cTarget, UCHAR Register, PVOID Buffer, ULONG Length)
Achieving pinpoint accuracy for an I²C touch device within the Windows operating system is a complex endeavor, requiring a deep dive into kernel-mode driver frameworks (KMDF), Human Interface Device (HID) protocols, and hardware-level configuration. This comprehensive guide explores the intricate world of developing a Kernel-Mode Driver Framework HID minidriver specifically for touch I2C devices, with a focused lens on the calibration and coordinate mapping challenges that define the user experience.