/contrib/ntp/include/hopf6039.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 144 lines · 99 code · 29 blank · 16 comment · 0 complexity · d297e5200458ea606c13cd7f41c84a33 MD5 · raw file

  1. /****************************************************************************/
  2. /* hopf6039.h */
  3. /* hopf Elektronik 6039 PCI radio clock header */
  4. /* (c) 1999, 2000 Bernd Altmeier <altmeier@ATLSoft.de> */
  5. /* Rev. 1.00 Date 25.03.2000 */
  6. /* History: */
  7. /****************************************************************************/
  8. #ifndef _hopf6039_H_
  9. #define _hopf6039_H_
  10. #define HOPF_MAXVERSION 8
  11. #define HOPF_CNTR_MEM_LEN 0x7f
  12. #define HOPF_DATA_MEM_LEN 0x3ff /* this is our memory size */
  13. /* macros and definition for 32 to 16 to 8 bit conversion */
  14. typedef unsigned long DWORD;
  15. typedef unsigned char BYTE;
  16. typedef unsigned short WORD;
  17. #define LOWORD(l) ((WORD)(l))
  18. #define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
  19. #define LOBYTE(w) ((BYTE)(w))
  20. #define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
  21. /* iocntl codes for driver access */
  22. #define HOPF_CLOCK_CMD_MASK 0xff000
  23. #define HOPF_CLOCK_GET_LOCAL 0x10000
  24. #define HOPF_CLOCK_GET_UTC 0x20000
  25. #define HOPF_CLOCK_GET_ANTENNA 0x30000
  26. #define HOPF_CLOCK_GET_DIFFERENCE 0x40000
  27. #define HOPF_CLOCK_GET_VERSION 0x50000
  28. #define HOPF_CLOCK_GET_POSITION 0x60000
  29. #define HOPF_CLOCK_GET_SATDATA 0x70000
  30. #define HOPF_CLOCK_GET_SYSTEMBYTE 0x80000
  31. #define HOPF_CLOCK_GET_IRIG 0x90000
  32. #define HOPF_CLOCK_SET_DIFFERENCE 0x01000
  33. #define HOPF_CLOCK_SET_ANTENNA 0x02000
  34. #define HOPF_CLOCK_SET_TIME 0x03000
  35. #define HOPF_CLOCK_SET_POSITION 0x04000
  36. #define HOPF_CLOCK_SET_SATMODE 0x05000
  37. #define HOPF_CLOCK_SET_SYSTEMBYTE 0x06000
  38. #define HOPF_CLOCK_SET_RESET 0x07000
  39. #define HOPF_CLOCK_SET_IRIG 0x08000
  40. /* clock command codes */
  41. #define HOPF_CLOCK_HARDRESET 0x00008000
  42. #define HOPF_CLOCK_SOFTRESET 0x00004000
  43. /* sat-information */
  44. typedef struct SatStat{
  45. BYTE wVisible;
  46. BYTE wMode;
  47. BYTE wSat0;
  48. BYTE wRat0;
  49. BYTE wSat1;
  50. BYTE wRat1;
  51. BYTE wSat2;
  52. BYTE wRat2;
  53. BYTE wSat3;
  54. BYTE wRat3;
  55. BYTE wSat4;
  56. BYTE wRat4;
  57. BYTE wSat5;
  58. BYTE wRat5;
  59. BYTE wSat6;
  60. BYTE wRat6;
  61. BYTE wSat7;
  62. BYTE wRat7;
  63. } SatStat;
  64. /* GPS position */
  65. typedef struct GPSPos { /* Position */
  66. long wAltitude;
  67. long wLongitude;
  68. long wLatitude;
  69. } GPSPos;
  70. /* clock hardware version */
  71. typedef struct ClockVersion {
  72. char cVersion[255]; /* Hardware Version like " DCF-RECEIVER, VERSION 01.01, DAT: 23.NOV.1999" */
  73. char dVersion[255]; /* Driver Version */
  74. } ClockVersion;
  75. /* hopftime what you think */
  76. typedef struct HOPFTIME {
  77. unsigned int wYear;
  78. unsigned int wMonth;
  79. unsigned int wDayOfWeek;
  80. unsigned int wDay;
  81. unsigned int wHour;
  82. unsigned int wMinute;
  83. unsigned int wSecond;
  84. unsigned int wMilliseconds;
  85. unsigned int wStatus;
  86. } HOPFTIME;
  87. /* DCF77 antenna alignment */
  88. typedef struct DcfAntenne {
  89. BYTE bStatus;
  90. BYTE bStatus1;
  91. WORD wAntValue;
  92. } DcfAntenne;
  93. /* hopf PCI clock */
  94. typedef struct hopfCard {
  95. char name[32];
  96. unsigned irq;
  97. unsigned long membase; /* without mmap */
  98. unsigned int port;
  99. int versionlen;
  100. char versionbuf[1024];
  101. char *version[HOPF_MAXVERSION];
  102. char cardname[32];
  103. int interrupt;
  104. void *mbase; /* this will be our memory base address */
  105. } hopfCard;
  106. typedef struct cardparams {
  107. unsigned int port;
  108. unsigned irq;
  109. int cardtype;
  110. int cardnr;
  111. unsigned int membase;
  112. } cardparams;
  113. #define WRITE_REGISTER 0x00
  114. #define READ_REGISTER 0x01
  115. #endif /* _hopf6039_H_ */