Old fashion design for PC-104
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.

80 lines
1.8 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT: Laserguard libraries
  7. // SUBSYSTEM: Devices support library
  8. // FILE: LgDeviceGPIOLPT.h
  9. // AUTHOR: Chizhevskiy Sergey
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of CLgDeviceGPIOLPT
  13. //----------------------------------------------------------------------------
  14. #ifndef __LG__DEVICE__PARALLEL__PORT__GPIO__H__INCLUDED__
  15. #define __LG__DEVICE__PARALLEL__PORT__GPIO__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "LgDeviceGPIO.h"
  20. class CLgDeviceGPIOLPT :
  21. public CLgDeviceGPIO
  22. {
  23. public:
  24. CLgDeviceGPIOLPT();
  25. virtual ~CLgDeviceGPIOLPT();
  26. public:
  27. enum
  28. {
  29. GPIO_LPT_I_ERROR = 0x08,
  30. GPIO_LPT_I_SELECT = 0x10,
  31. GPIO_LPT_I_PAPEREND = 0x20,
  32. GPIO_LPT_I_ASK = 0x40,
  33. GPIO_LPT_I_BUZY = 0x80,
  34. GPIO_LPT_IO_DATA_0 = 0x01 << 8,
  35. GPIO_LPT_IO_DATA_1 = 0x02 << 8,
  36. GPIO_LPT_IO_DATA_2 = 0x04 << 8,
  37. GPIO_LPT_IO_DATA_3 = 0x08 << 8,
  38. GPIO_LPT_IO_DATA_4 = 0x10 << 8,
  39. GPIO_LPT_IO_DATA_5 = 0x20 << 8,
  40. GPIO_LPT_IO_DATA_6 = 0x40 << 8,
  41. GPIO_LPT_IO_DATA_7 = 0x80 << 8,
  42. };
  43. public:
  44. BOOL Create( LPCTSTR pPort, BOOL bDataOutput );
  45. void Destroy();
  46. protected:
  47. virtual BOOL ReadWriteProc();
  48. private:
  49. BOOL m_bDataOutput;
  50. INT m_BaseAddress;
  51. DWORD m_dwInputState;
  52. DWORD m_dwOutputState;
  53. DWORD m_dwSavedState;
  54. private:
  55. typedef struct GISTEREZIS
  56. {
  57. BOOL bCurrentOn;
  58. BOOL bSavedOn;
  59. LARGE_INTEGER liTime;
  60. }GISTEREZIS;
  61. private:
  62. GISTEREZIS m_pGisterezis[13];
  63. private:
  64. static DWORD s_bControlBits[13];
  65. static BOOL s_bInvertBits[13];
  66. };
  67. #endif