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.

79 lines
2.2 KiB

  1. // $Header: G:/SwDev/WDM/Video/bt848/rcs/Gpio.h 1.2 1998/04/29 22:43:33 tomz Exp $
  2. #ifndef __GPIO_H
  3. #define __GPIO_H
  4. #include "regField.h"
  5. #include "viddefs.h"
  6. #include "gpiotype.h"
  7. #include "retcode.h"
  8. //===========================================================================
  9. // Constants
  10. //===========================================================================
  11. const int MAX_GPDATA_SIZE = 64; // maximum number of DWORDs in GPDATA
  12. const int MAX_GPIO_BIT = 23; // maximum bit number for GPIO registers
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CLASS GPIO
  15. //
  16. // Description:
  17. // This class encapsulates the register fields in the GPIO register of the
  18. // Bt848. A complete set of functions are developed to manipulate all the
  19. // register fields in the GPIO for the Bt848.
  20. //
  21. /////////////////////////////////////////////////////////////////////////////
  22. class GPIO
  23. {
  24. private:
  25. bool initOK;
  26. public:
  27. // Constructor
  28. GPIO( void );
  29. ~GPIO();
  30. // Member functions
  31. bool IsInitOK( void );
  32. void SetGPCLKMODE( State );
  33. int GetGPCLKMODE( void );
  34. void SetGPIOMODE( GPIOMode );
  35. int GetGPIOMODE( void );
  36. void SetGPWEC( State );
  37. int GetGPWEC( void );
  38. void SetGPINTI( State );
  39. int GetGPINTI( void );
  40. void SetGPINTC( State );
  41. int GetGPINTC( void );
  42. ErrorCode SetGPOE( int, State );
  43. void SetGPOE( DWORD );
  44. int GetGPOE( int );
  45. DWORD GetGPOE( void );
  46. ErrorCode SetGPIE( int, State );
  47. void SetGPIE( DWORD );
  48. int GetGPIE( int );
  49. DWORD GetGPIE( void );
  50. ErrorCode SetGPDATA( GPIOReg *, int, int offset = 0 );
  51. ErrorCode GetGPDATA( GPIOReg *, int, int offset = 0 );
  52. ErrorCode SetGPDATA( int, int, DWORD, int offset = 0 );
  53. ErrorCode GetGPDATA( int, int, DWORD *, int offset = 0 );
  54. protected:
  55. RegisterW decRegGPIO;
  56. RegField decFieldGPCLKMODE;
  57. RegField decFieldGPIOMODE;
  58. RegField decFieldGPWEC;
  59. RegField decFieldGPINTI;
  60. RegField decFieldGPINTC;
  61. RegisterDW decRegGPOE;
  62. RegisterDW decRegGPIE;
  63. RegisterDW decRegGPDATA;
  64. };
  65. #endif // __GPIO_H