Pseudo-code:
switch(IoControlCode) case IOCTL_TOUCH_CALIBRATE_SET_COEFFS: // Lock mutex, copy coefficients into device context, apply to next touch // Store in registry via WdfRegistry break; case IOCTL_TOUCH_CALIBRATE_GET_RAW: // Temporarily bypass calibration, read raw I2C registers, return break; kmdf hid minidriver for touch i2c device calibration
NTSTATUS DeviceAdd(WDFDRIVER Driver, PWDFDEVICE_INIT DeviceInit) copy coefficients into device context
void EvtIoDeviceControl( WDFQUEUE Queue, WDFREQUEST Request, size_t OutputBufferLength, size_t InputBufferLength, ULONG IoControlCode) read raw I2C registers
During EvtDevicePrepareHardware or EvtDeviceD0Entry , read:
VOID ApplyCalibration(PTOUCH_POINT RawPoint, PTOUCH_POINT CalibratedPoint)