Leaked source code of windows server 2003
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.

126 lines
2.4 KiB

  1. /***************************************************************************\
  2. *
  3. * ************************
  4. * * MINIPORT SAMPLE CODE *
  5. * ************************
  6. *
  7. * Module Name:
  8. *
  9. * i2c.h
  10. *
  11. * Abstract:
  12. *
  13. * This module contains the code that implements the i2c interface feature
  14. *
  15. *
  16. * Environment:
  17. *
  18. * Kernel mode
  19. *
  20. *
  21. * Copyright (c) 1994-1999 3Dlabs Inc. Ltd. All rights reserved.
  22. * Copyright (c) 1995-2003 Microsoft Corporation. All Rights Reserved.
  23. *
  24. \***************************************************************************/
  25. #define STATUS_SUCCESS 0x00000000
  26. #define STATUS_UNSUCCESSFUL 0xC0000001
  27. #define MAX_CLOCK_RATE 1000000
  28. #define INITGUID
  29. typedef ULONG NTSTATUS;
  30. #include <i2cgpio.h>
  31. BOOLEAN
  32. GetCookie(
  33. PVOID DeviceObject,
  34. PULONG Cookie
  35. );
  36. VP_STATUS
  37. I2CBusOpenCRT(
  38. PVOID DeviceObject,
  39. BOOLEAN bOpen,
  40. PI2CControl I2CControl
  41. );
  42. VP_STATUS
  43. I2CBusOpenDFP(
  44. PVOID DeviceObject,
  45. BOOLEAN bOpen,
  46. PI2CControl I2CControl
  47. );
  48. VP_STATUS
  49. I2CBusAccessCRT(
  50. PVOID DeviceObject,
  51. PI2CControl I2CControl
  52. );
  53. VP_STATUS
  54. I2CBusAccessDFP(
  55. PVOID DeviceObject,
  56. PI2CControl I2CControl
  57. );
  58. VOID
  59. InterfaceReference(
  60. IN PVOID pContext
  61. );
  62. VOID
  63. InterfaceDereference(
  64. IN PVOID pContext
  65. );
  66. ULONG
  67. I2CNull(
  68. PI2CControl I2CControl,
  69. PVIDEO_I2C_CONTROL I2CCallbacks,
  70. PHW_DEVICE_EXTENSION hwDeviceExtension
  71. );
  72. ULONG
  73. I2CRead(
  74. PI2CControl I2CControl,
  75. PVIDEO_I2C_CONTROL I2CCallbacks,
  76. PHW_DEVICE_EXTENSION hwDeviceExtension
  77. );
  78. ULONG
  79. I2CWrite(
  80. PI2CControl I2CControl,
  81. PVIDEO_I2C_CONTROL I2CCallbacks,
  82. PHW_DEVICE_EXTENSION hwDeviceExtension
  83. );
  84. ULONG
  85. I2CStop(
  86. PI2CControl I2CControl,
  87. PVIDEO_I2C_CONTROL I2CCallbacks,
  88. PHW_DEVICE_EXTENSION hwDeviceExtension
  89. );
  90. ULONG
  91. I2CStart(
  92. PI2CControl I2CControl,
  93. PVIDEO_I2C_CONTROL I2CCallbacks,
  94. PHW_DEVICE_EXTENSION hwDeviceExtension
  95. );
  96. VP_STATUS
  97. I2CBusOpen(
  98. PVOID DeviceObject,
  99. BOOLEAN bOpen,
  100. PI2CControl I2CControl,
  101. PVIDEO_I2C_CONTROL I2CCallbacks
  102. );
  103. VP_STATUS
  104. I2CBusAccess(
  105. PVOID DeviceObject,
  106. PI2CControl I2CControl,
  107. PVIDEO_I2C_CONTROL I2CCallbacks
  108. );