Kmdf Hid Minidriver For Touch I2c Device Calibration Repack Guide
KMDF HID Minidriver for Touch I2C Device Calibration
VOID MyTouchCalibEvtInternalDeviceControl( WDFQUEUE Queue, WDFREQUEST Request, size_t OutputBufferLength, size_t InputBufferLength, ULONG IoControlCode)
WDF_MEMORY_DESCRIPTOR writeDesc, readDesc; WDF_MEMORY_DESCRIPTOR_INIT_BUFFER(&writeDesc, WriteBuffer, WriteLen); WDF_MEMORY_DESCRIPTOR_INIT_BUFFER(&readDesc, ReadBuffer, ReadLen); // Build I2C request return WdfIoTargetSendI2cWriteReadSynchronously( I2cTarget, NULL, &writeDesc, &readDesc, &transmission, NULL, WDF_WAIT_TIMEOUT_INFINITE); kmdf hid minidriver for touch i2c device calibration
- Affine transform (3x3 homogeneous matrix or 2x2+offset): Handles rotation, uniform/non-uniform scale and translation.
- Higher-order polynomial warp (2D polynomials): For moderate nonlinearity; e.g., bicubic polynomials mapping (x_raw,y_raw) -> (x_disp,y_disp).
- Piecewise lookup tables (LUTs) / grid-based warping: Divide surface into grid cells; each cell stores correction vectors for interpolation (bilinear or bicubic). Good for spatially varying distortions.
- Thin-plate spline or RBF interpolation: Smooth, continuous warps defined by control points for more complex distortions.
- Per-contact calibration parameters: Size- or pressure-dependent offsets to account for centroid bias for fingers vs stylus.
The HID class driver sends IOCTL_HID_READ_REPORT (IRP_MJ_INTERNAL_DEVICE_CONTROL). The minidriver forwards the request to the lower driver (HIDI2C.sys), then modifies the output buffer. bicubic polynomials mapping (x_raw
Exposing HID reports and handling IO
// Send Request to ACPI (via WDF) status = WdfIoTargetSendIoctlSynchronously( WdfDeviceGetIoTarget(Device), NULL, IOCTL_ACPI_EVAL_METHOD_EX, ¶ms, sizeof(params), NULL, &returnLength ); ULONG IoControlCode) WDF_MEMORY_DESCRIPTOR writeDesc