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.

70 lines
2.6 KiB

  1. //==========================================================================;
  2. //
  3. // Gpio.H
  4. // Gpio Class declaration
  5. // Based on code from ATI Technologies Inc. Copyright (c) 1996 - 1998
  6. //
  7. //
  8. //==========================================================================;
  9. #ifndef _GPIO_H_
  10. #define _GPIO_H_
  11. #include "i2cgpio.h"
  12. #define GPIO_TIMELIMIT_OPENPROVIDER 50000000 // 5 seconds in 100 nsec.
  13. #define GPIO_TUNER_MODE_SELECT_PIN 0x8
  14. #define GPIO_VSB_RESET_PIN 0x1
  15. #define GPIO_TUNER_PINS (GPIO_TUNER_MODE_SELECT_PIN | GPIO_VSB_RESET_PIN)
  16. #define GPIO_TUNER_MODE_ATSC GPIO_TUNER_MODE_SELECT_PIN
  17. #define GPIO_TUNER_MODE_NTSC 0
  18. #define GPIO_VSB_ON GPIO_VSB_RESET_PIN
  19. #define GPIO_VSB_OFF 0
  20. #define GPIO_VSB_RESET 0x0
  21. #define GPIO_VSB_SET 0x1
  22. // GPIO class object .
  23. // Provides functionality to obtain a GPIO interface, Lock GPIO for
  24. // exclusive use, querying the GPIO provider, write/read GPIO and
  25. // general access to GPIO
  26. class CGpio
  27. {
  28. public:
  29. // constructor
  30. CGpio ( PDEVICE_OBJECT pDeviceObject, NTSTATUS * pStatus);
  31. // PVOID operator new ( UINT size_t, PVOID pAllocation);
  32. // Attributes
  33. private:
  34. // GPIO Provider related
  35. GPIOINTERFACE m_gpioProviderInterface;
  36. PDEVICE_OBJECT m_pdoDriver;
  37. DWORD m_dwGPIOAccessKey;
  38. // Implementation
  39. public:
  40. BOOL InitializeAttachGPIOProvider( GPIOINTERFACE * pGPIOInterface, PDEVICE_OBJECT pDeviceObject);
  41. BOOL LocateAttachGPIOProvider ( GPIOINTERFACE * pGPIOInterface, PDEVICE_OBJECT pDeviceObject, int nIrpMajorFunction);
  42. BOOL QueryGPIOProvider ( PGPIOControl pgpioAccessBlock);
  43. BOOL LockGPIOProviderEx ( PGPIOControl pgpioAccessBlock);
  44. BOOL ReleaseGPIOProvider ( PGPIOControl pgpioAccessBlock);
  45. BOOL AccessGPIOProvider ( PGPIOControl pgpioAccessBlock);
  46. BOOL WriteGPIO ( PGPIOControl pgpioAccessBlock);
  47. BOOL ReadGPIO ( PGPIOControl pgpioAccessBlock);
  48. //BOOL AccessGPIOProvider ( PDEVICE_OBJECT pdoClient, PGPIOControl pgpioAccessBlock);
  49. //BOOL WriteGPIO ( PDEVICE_OBJECT pdoClient, PGPIOControl pgpioAccessBlock);
  50. //BOOL ReadGPIO ( PDEVICE_OBJECT pdoClient, PGPIOControl pgpioAccessBlock);
  51. BOOL WriteGPIO ( UCHAR *p_uchPin, UCHAR *p_uchValue);
  52. BOOL ReadGPIO ( UCHAR *p_uchPin, UCHAR *p_uchValue);
  53. };
  54. #endif // _GPIO_H_