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