+------------------------------------------+ | Windows Input Subsystem | +------------------------------------------+ | +------------------------------------------+ | HID Class Driver (hidclass.sys) | +------------------------------------------+ | +------------------------------------------+ | Your KMDF HID Minidriver (Custom) | +------------------------------------------+ | +------------------------------------------+ | SPB Framework Extension (SPBCx) | +------------------------------------------+ | +------------------------------------------+ | I2C Controller Driver | +------------------------------------------+ | +------------------------------------------+ | Physical Touch Hardware | +------------------------------------------+ 2. Setting Up a KMDF HID Minidriver for I2C
NTSTATUS EvtDevicePrepareHardware(WDFDEVICE Device, WDFCMRESLIST ResourcesRaw, WDFCMRESLIST ResourcesTranslated) PDEVICE_CONTEXT pDevCtx = GetDeviceContext(Device); NTSTATUS status = STATUS_SUCCESS;
Use the Windows Driver Kit (WDK) utility HIDView or third-party tools like Wireshark (with USBPcap) to verify that output calibration reports conform exactly to your HID report descriptors. kmdf hid minidriver for touch i2c device calibration
+------------------+ +--------------------------+ +--------------------------+ | Raw I2C Read | --> | Affine Matrix Transform | --> | Clipping & Dead-zone | | (0 to MaxSensor) | | (Translation & Scaling) | | (0 to Logical Maximum) | +------------------+ +--------------------------+ +--------------------------+ Mathematical Model: The Affine Transformation Matrix
However, factors such as:
+-----------------------------------+ | Windows Touch Input Stack | +-----------------------------------+ | +-----------------------------------+ | HIDCLASS.sys | (Class Driver) +-----------------------------------+ | +-----------------------------------+ | Your KMDF Minidriver | (Custom HID Minidriver) +-----------------------------------+ | +-----------------------------------+ | SpbCx.sys | (Simple Peripheral Bus Framework) +-----------------------------------+ | +-----------------------------------+ | I2C Controller Driver | +-----------------------------------+ | [ I2C Hardware Bus ] | +-----------------------------------+ | Touch I2C Device | (Hardware) +-----------------------------------+ Key Framework Components
KMDF HID Minidriver for Touch I2C Device is a kernel-mode driver framework (KMDF) solution used by Windows to enable communication between a touch screen and the system via the KMDF offers the registry as a persistent store
Calibration must survive reboots. KMDF offers the registry as a persistent store.
Before writing a single line of code, one must understand the Windows Input Stack. For touch devices, the preferred pathway is: NTSTATUS status = STATUS_SUCCESS
// Example: I²C read operation (conceptual) NTSTATUS I2CRead( WDFIOTARGET I2CTarget, UCHAR Register, PVOID Buffer, ULONG Length)
Use WdfRequestSend down to the HID class driver via a touch collection.