Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. oempen.h
  5. Abstract: Contains OEM specific definitions.
  6. Environment:
  7. Kernel mode
  8. Author:
  9. Michael Tsang (MikeTs) 13-Mar-2000
  10. Revision History:
  11. --*/
  12. #ifndef _OEMPEN_H
  13. #define _OEMPEN_H
  14. //
  15. // Constants
  16. //
  17. #define OEM_VENDOR_ID 0x3429 //"MAI"
  18. #define STR_TABLET_FEATURES L"TabletFeatures"
  19. // OEM serial communication parameters
  20. #define OEM_SERIAL_BAUDRATE 19200
  21. #define OEM_SERIAL_WORDLEN 8
  22. #define OEM_SERIAL_PARITY NO_PARITY
  23. #define OEM_SERIAL_STOPBITS STOP_BIT_1
  24. #define OEM_PEN_REPORT_ID 1
  25. #define OEM_FEATURE_REPORT_ID 2
  26. #define OEM_MOUSE_REPORT_ID 3
  27. #define OEM_PEN_MAX_X 8600
  28. #define OEM_PEN_MAX_Y 6480
  29. #define OEM_THRESHOLD_DX 500
  30. #define OEM_THRESHOLD_DY 500
  31. #define OEM_MIN_RATE_DIVISOR 0
  32. #define OEM_MAX_RATE_DIVISOR 9
  33. #define NORMALIZE_DATA(w) ((USHORT)((((w) & 0x7f00) >> 1) | \
  34. ((w) & 0x007f)))
  35. #define OemIsValidPacket(p) (((p)->InputReport.bStatus & INSTATUS_SYNC) && \
  36. !((p)->InputReport.bStatus & \
  37. (INSTATUS_RESERVED1 | INSTATUS_RESERVED2 | \
  38. INSTATUS_TEST_DATA)) && \
  39. !((p)->InputReport.wXData & INDATA_SYNC) && \
  40. !((p)->InputReport.wYData & INDATA_SYNC))
  41. typedef struct _OEM_DATA
  42. {
  43. ULONG dwTabletFeatures;
  44. ULONG dwThresholdPeriod;
  45. USHORT wFirmwareDate;
  46. USHORT wFirmwareYear;
  47. USHORT wProductID;
  48. USHORT wFirmwareRev;
  49. USHORT wCorrectionRev;
  50. } OEM_DATA, *POEM_DATA;
  51. //
  52. // This must match with hardware, so make sure it is byte aligned.
  53. //
  54. #include <pshpack1.h>
  55. typedef struct _OEM_INPUT_REPORT
  56. {
  57. union
  58. {
  59. struct
  60. {
  61. UCHAR bStatus;
  62. USHORT wXData;
  63. USHORT wYData;
  64. } InputReport;
  65. UCHAR RawInput[5];
  66. };
  67. } OEM_INPUT_REPORT, *POEM_INPUT_REPORT;
  68. typedef struct _HID_INPUT_REPORT
  69. {
  70. UCHAR ReportID;
  71. OEM_INPUT_REPORT Report;
  72. } HID_INPUT_REPORT, *PHID_INPUT_REPORT;
  73. // bStatus bit values
  74. #define INSTATUS_PEN_TIP_DOWN 0x01
  75. #define INSTATUS_SIDE_SW_ENABLED 0x02
  76. #define INSTATUS_RESERVED1 0x04
  77. #define INSTATUS_TEST_DATA 0x08
  78. #define INSTATUS_RESERVED2 0x10
  79. #define INSTATUS_IN_PROXIMITY 0x20
  80. #define INSTATUS_SW_CHANGED 0x40
  81. #define INSTATUS_SYNC 0x80
  82. #define INDATA_SYNC 0x8080
  83. typedef struct _OEM_FEATURE_REPORT
  84. {
  85. ULONG dwTabletFeatures;
  86. } OEM_FEATURE_REPORT, *POEM_FEATURE_REPORT;
  87. #define OEM_FEATURE_RATE_MASK 0x0000000f
  88. #define OEM_FEATURE_DIGITAL_FILTER_ON 0x00000010
  89. #define OEM_FEATURE_GLITCH_FILTER_ON 0x00000020
  90. #define OEM_FEATURE_UNUSED_BITS 0xffffffc0
  91. typedef struct _HID_FEATURE_REPORT
  92. {
  93. UCHAR ReportID;
  94. OEM_FEATURE_REPORT Report;
  95. } HID_FEATURE_REPORT, *PHID_FEATURE_REPORT;
  96. #include <poppack.h>
  97. //
  98. // Global Data Declarations
  99. //
  100. extern UCHAR gReportDescriptor[130];
  101. extern HID_DESCRIPTOR gHidDescriptor;
  102. extern PWSTR gpwstrManufacturerID;
  103. extern PWSTR gpwstrProductID;
  104. extern PWSTR gpwstrSerialNumber;
  105. extern OEM_INPUT_REPORT gLastReport;
  106. extern USHORT gwDXThreshold;
  107. extern USHORT gwDYThreshold;
  108. #endif //ifndef _OEMPEN_H