diff options
author | Martin Burnicki <martin.burnicki@meinberg.de> | 2006-06-01 13:00:00 +0200 |
---|---|---|
committer | Martin Burnicki <martin.burnicki@meinberg.de> | 2006-06-01 13:00:00 +0200 |
commit | f19dc46d78cb2a9f19668ba1adf66534dce46dd3 (patch) | |
tree | 4e8acebf641ac28a594695d43fc886fe4a80e376 | |
parent | c00d27f76ce87c266c044688d57c19417621f201 (diff) | |
download | gpsxmple-f19dc46d78cb2a9f19668ba1adf66534dce46dd3.tar.gz gpsxmple-f19dc46d78cb2a9f19668ba1adf66534dce46dd3.zip |
Modify MSG_BUFF structuregpsxmple-1.5-dosgpsprog-1.5-dos
Rename MSG_BUFF field 'data' to 'msg_data' because 'data' is
a reserved word in some environments.
Update source code accordingly.
Update some mbglib header files.
-rw-r--r-- | gpsdefs.h | 178 | ||||
-rw-r--r-- | gpsserio.c | 10 | ||||
-rw-r--r-- | gpsserio.h | 163 | ||||
-rw-r--r-- | gpsxmple.c | 90 | ||||
-rw-r--r-- | gpsxmple.exe | bin | 71302 -> 50944 bytes | |||
-rw-r--r-- | mbg_tgt.h | 14 |
6 files changed, 320 insertions, 135 deletions
@@ -1,7 +1,7 @@ /************************************************************************** * - * $Id: gpsdefs.h 1.39 2005/09/08 14:06:00Z martin REL_M $ + * $Id: gpsdefs.h 1.44 2006/05/18 09:34:41Z martin REL_M $ * * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany * @@ -10,6 +10,23 @@ * * ----------------------------------------------------------------------- * $Log: gpsdefs.h $ + * Revision 1.44 2006/05/18 09:34:41Z martin + * Added definitions for POUT max. pulse_len and max timeout. + * Changed comment for POUT_SETTINGS::timeout: + * Units are minutes, not seconds. + * Added definition for MAX_POUT_TIME_STR_PORTS. + * Added definitions for POUT mode 10MHz. + * Added hint strings for POUT modes. + * Added definitions for PZF511. + * Revision 1.43 2006/01/24 07:53:29Z martin + * New TM_GPS status flag TM_HOLDOVER. + * Revision 1.42 2005/11/24 14:53:22Z martin + * Added definitions for manchester encoded DC IRIG frames. + * Added POUT_TIMESTR and related definitions. + * Revision 1.41 2005/11/03 15:06:59Z martin + * Added definitions to support GPS170PCI. + * Revision 1.40 2005/10/28 08:58:29Z martin + * Added definitions for OCXO_DHQ. * Revision 1.39 2005/09/08 14:06:00Z martin * Added definition SYNTH_PHASE_SYNC_LIMIT. * Revision 1.38 2005/08/18 10:27:35 andre @@ -278,6 +295,8 @@ enum GPS_MODEL_GPS169PCI, GPS_MODEL_TCR167PCI, GPS_MODEL_GPS164, + GPS_MODEL_GPS170PCI, + GPS_MODEL_PZF511, N_GPS_MODEL }; @@ -298,6 +317,8 @@ enum #define GPS_MODEL_NAME_GPS169PCI "GPS169PCI" #define GPS_MODEL_NAME_TCR167PCI "TCR167PCI" #define GPS_MODEL_NAME_GPS164 "GPS164" +#define GPS_MODEL_NAME_GPS170PCI "GPS170PCI" +#define GPS_MODEL_NAME_PZF511 "PZF511" /* @@ -319,7 +340,9 @@ enum GPS_MODEL_NAME_GPS161, \ GPS_MODEL_NAME_GPS169PCI, \ GPS_MODEL_NAME_TCR167PCI, \ - GPS_MODEL_NAME_GPS164 \ + GPS_MODEL_NAME_GPS164, \ + GPS_MODEL_NAME_GPS170PCI, \ + GPS_MODEL_NAME_PZF511 \ } @@ -340,6 +363,7 @@ enum GPS_OSC_OCXO_XHQ, GPS_OSC_RUBIDIUM, GPS_OSC_TCXO_MQ, + GPS_OSC_OCXO_DHQ, N_GPS_OSC }; @@ -359,7 +383,8 @@ enum "OCXO HQ", \ "OCXO XHQ", \ "RUBIDIUM", \ - "TCXO MQ" \ + "TCXO MQ", \ + "OCXO DHQ" \ } @@ -378,6 +403,7 @@ enum GPS_OSC_OCXO_LQ, \ GPS_OSC_OCXO_MQ, \ GPS_OSC_OCXO_HQ, \ + GPS_OSC_OCXO_DHQ, \ GPS_OSC_OCXO_XHQ, \ GPS_OSC_RUBIDIUM \ } @@ -508,16 +534,15 @@ enum TM_BIT_LS_ANN, /* leap second will be inserted */ TM_BIT_LS_ENB, /* current second is leap second */ TM_BIT_LS_ANN_NEG, /* set in addition to TM_LS_ANN if leap sec negative */ - /* Bits 7 through 9 are reserved and not used, yet. */ + /* Bits 7 and 8 are reserved and not used, yet. */ - /* the status flags below were defined starting with GPS166 v1.32 */ - TM_BIT_ANT_SHORT = 10, /* antenna cable short circuited */ + TM_BIT_HOLDOVER = 9, /* holdover mode after previous sync. */ + TM_BIT_ANT_SHORT, /* antenna cable short circuited */ TM_BIT_NO_WARM, /* OCXO has not warmed up */ TM_BIT_ANT_DISCONN, /* antenna currently disconnected */ TM_BIT_SYN_FLAG, /* TIME_SYN output is low */ - TM_BIT_NO_SYNC, /* not sync'ed after reset */ - TM_BIT_NO_POS /* position not computed after reset, */ - /* LOCK LED off */ + TM_BIT_NO_SYNC, /* time sync actually not verified */ + TM_BIT_NO_POS /* position actually not verified, LOCK LED off */ }; @@ -531,6 +556,7 @@ enum #define TM_LS_ENB ( 1U << TM_BIT_LS_ENB ) #define TM_LS_ANN_NEG ( 1U << TM_BIT_LS_ANN_NEG ) +#define TM_HOLDOVER ( 1U << TM_BIT_HOLDOVER ) #define TM_ANT_SHORT ( 1U << TM_BIT_ANT_SHORT ) #define TM_NO_WARM ( 1U << TM_BIT_NO_WARM ) #define TM_ANT_DISCONN ( 1U << TM_BIT_ANT_DISCONN ) @@ -1195,11 +1221,15 @@ enum * B123 100 bps, 1 kHz carrier, time-of-year, SBS * AFNOR 100 bps, 1 kHz carrier, SBS, complete date * AFNOR DC 100 bps, DC shift, SBS, complete date - * IEEE1344 100 bps, 1 kHz carrier, time-of-year, SBS, time zone info - * IEEE1344 DC 100 bps, DC shift, time-of-year, SBS, time zone info + * IEEE1344 100 bps, 1 kHz carrier, time-of-year, SBS, IEEE1344 extensions (B120) + * IEEE1344 DC 100 bps, DC shift, time-of-year, SBS, IEEE1344 extensions (B000) + * B220/1344 100 bps, DC shift, manchester encoded, IEEE1344 extensions + * B222 100 bps, DC shift, manchester encoded, time-of-year + * B223 100 bps, DC shift, manchester encoded, time-of-year, SBS * * time-of-year: day-of-year, hours, minutes, seconds * SBS: straight binary seconds, second-of-day + * IEEE1344 extensions: time zone info * AFNOR: french standard AFNOR NFS-87500 */ @@ -1216,6 +1246,9 @@ enum ICODE_TX_A003_A133, ICODE_TX_AFNOR, ICODE_TX_IEEE1344, + ICODE_TX_B220_1344, + ICODE_TX_B222, + ICODE_TX_B223, N_ICODE_TX /* number of code types */ }; @@ -1230,20 +1263,26 @@ enum "A002+A132", \ "A003+A133", \ "AFNOR NFS-87500", \ - "IEEE1344" \ + "IEEE1344", \ + "B220/1344+IEEE1344", \ + "B222+B122", \ + "B223+B123" \ } /* * Initializers for English format description strings. */ -#define DEFAULT_ICODE_TX_DESCRIPTIONS_ENG \ -{ \ - "100 bps, DC or 1 kHz carrier", \ - "100 bps, DC or 1 kHz carrier, SBS", \ - "1000 bps, DC or 10 kHz carrier", \ - "1000 bps, DC or 10 kHz carrier, SBS", \ - "100 bps, DC or 1 kHz carrier, SBS, complete date", \ - "100 bps, DC or 1 kHz carrier, SBS, time zone info" \ +#define DEFAULT_ICODE_TX_DESCRIPTIONS_ENG \ +{ \ + "100 bps, DC or 1 kHz carrier", \ + "100 bps, DC or 1 kHz carrier, SBS", \ + "1000 bps, DC or 10 kHz carrier", \ + "1000 bps, DC or 10 kHz carrier, SBS", \ + "100 bps, DC or 1 kHz carrier, SBS, complete date", \ + "100 bps, DC or 1 kHz carrier, SBS, time zone info", \ + "100 bps, DC manchester enc. or 1kHz carrier, SBS, time zone info", \ + "100 bps, DC manchester enc. or 1kHz carrier, time-of-year", \ + "100 bps, DC manchester enc. or 1kHz carrier, time-of-year, SBS" \ } /* @@ -1257,6 +1296,19 @@ enum #define MSK_ICODE_TX_A003_A133 ( 1UL << ICODE_TX_A003_A133 ) #define MSK_ICODE_TX_AFNOR ( 1UL << ICODE_TX_AFNOR ) #define MSK_ICODE_TX_IEEE1344 ( 1UL << ICODE_TX_IEEE1344 ) +#define MSK_ICODE_TX_B220_1344 ( 1UL << ICODE_TX_B220_1344 ) +#define MSK_ICODE_TX_B222 ( 1UL << ICODE_TX_B222 ) +#define MSK_ICODE_TX_B223 ( 1UL << ICODE_TX_B223 ) + +/* + * A mask of IRIG formats with manchester encoded DC output: + */ +#define MSK_ICODE_TX_DC_MANCH \ +( \ + MSK_ICODE_TX_B220_1344 | \ + MSK_ICODE_TX_B222 | \ + MSK_ICODE_TX_B223 \ +) /* * A mask of IRIG formats with 1 kHz carrier: @@ -1266,7 +1318,10 @@ enum MSK_ICODE_TX_B002_B122 | \ MSK_ICODE_TX_B003_B123 | \ MSK_ICODE_TX_AFNOR | \ - MSK_ICODE_TX_IEEE1344 \ + MSK_ICODE_TX_IEEE1344 | \ + MSK_ICODE_TX_B220_1344 | \ + MSK_ICODE_TX_B222 | \ + MSK_ICODE_TX_B223 \ ) /* @@ -1581,12 +1636,15 @@ typedef struct typedef struct { uint16_t mode; /* mode of operation, codes defined below */ - uint16_t pulse_len; /* 10 msec units */ - uint16_t timeout; /* [sec], for dcf_mode */ + uint16_t pulse_len; /* 10 msec units, or COM port number */ + uint16_t timeout; /* [min], for dcf_mode */ uint16_t flags; /* see below */ POUT_TIME tm[N_POUT_TIMES]; /* switching times */ } POUT_SETTINGS; +#define MAX_POUT_PULSE_LEN 1000 // 10 secs, in 10 msec units +#define MAX_POUT_DCF_TIMOUT ( 48 * 60 ) // 48 hours, in minutes + /* * The codes below are defined for POUT_SETTINGS.mode to setup @@ -1607,6 +1665,8 @@ enum POUT_TIME_SYNC, /* on if time sync (time_syn) */ POUT_ALL_SYNC, /* on if pos. OK and time sync */ POUT_TIMECODE, /* IRIG/AFNOR DCLS output */ + POUT_TIMESTR, /* COM port number in pulse_len field */ + POUT_10MHZ, /* 10 MHz fixed frequency */ N_POUT_MODES }; @@ -1615,18 +1675,20 @@ enum * Default initializers for English pulse mode names. Initializers * for multi-language strings can be found in pcpslstr.h. */ -#define ENG_POUT_NAME_IDLE "idle" -#define ENG_POUT_NAME_TIMER "timer" -#define ENG_POUT_NAME_SINGLE_SHOT "single shot" -#define ENG_POUT_NAME_CYCLIC_PULSE "cyclic pulse" -#define ENG_POUT_NAME_PER_SEC "per sec" -#define ENG_POUT_NAME_PER_MIN "per min" -#define ENG_POUT_NAME_PER_HOUR "per hour" -#define ENG_POUT_NAME_DCF77 "DCF77 marks" -#define ENG_POUT_NAME_POS_OK "position OK" -#define ENG_POUT_NAME_TIME_SYNC "time sync" -#define ENG_POUT_NAME_ALL_SYNC "all sync" -#define ENG_POUT_NAME_TIMECODE "time code" +#define ENG_POUT_NAME_IDLE "Idle" +#define ENG_POUT_NAME_TIMER "Timer" +#define ENG_POUT_NAME_SINGLE_SHOT "Single Shot" +#define ENG_POUT_NAME_CYCLIC_PULSE "Cyclic Pulse" +#define ENG_POUT_NAME_PER_SEC "Pulse Per Second" +#define ENG_POUT_NAME_PER_MIN "Pulse Per Min" +#define ENG_POUT_NAME_PER_HOUR "Pulse Per Hour" +#define ENG_POUT_NAME_DCF77 "DCF77 Marks" +#define ENG_POUT_NAME_POS_OK "Position OK" +#define ENG_POUT_NAME_TIME_SYNC "Time Sync" +#define ENG_POUT_NAME_ALL_SYNC "All Sync" +#define ENG_POUT_NAME_TIMECODE "DCLS Time Code" +#define ENG_POUT_NAME_TIMESTR "COM Time String" +#define ENG_POUT_NAME_10MHZ "10 MHz Frequency" #define DEFAULT_ENG_POUT_NAMES \ { \ @@ -1641,7 +1703,43 @@ enum ENG_POUT_NAME_POS_OK, \ ENG_POUT_NAME_TIME_SYNC, \ ENG_POUT_NAME_ALL_SYNC, \ - ENG_POUT_NAME_TIMECODE \ + ENG_POUT_NAME_TIMECODE, \ + ENG_POUT_NAME_TIMESTR, \ + ENG_POUT_NAME_10MHZ \ +} + + +#define ENG_POUT_HINT_IDLE "Constant output level" +#define ENG_POUT_HINT_TIMER "Switch based on configured on/off times" +#define ENG_POUT_HINT_SINGLE_SHOT "Generate a single pulse of determined length" +#define ENG_POUT_HINT_CYCLIC_PULSE "Generate cyclic pulses of determined length" +#define ENG_POUT_HINT_PER_SEC "Generate pulse at beginning of new second" +#define ENG_POUT_HINT_PER_MIN "Generate pulse at beginning of new minute" +#define ENG_POUT_HINT_PER_HOUR "Generate pulse at beginning of new hour" +#define ENG_POUT_HINT_DCF77 "DCF77 compatible time marks" +#define ENG_POUT_HINT_POS_OK "Switch if receiver position has been verified" +#define ENG_POUT_HINT_TIME_SYNC "Switch if time is synchronized" +#define ENG_POUT_HINT_ALL_SYNC "Switch if full sync" +#define ENG_POUT_HINT_TIMECODE "Duplicate IRIG time code signal" +#define ENG_POUT_HINT_TIMESTR "Duplicate serial time string of specified port" +#define ENG_POUT_HINT_10MHZ "10 MHz fixed output frequency" + +#define DEFAULT_ENG_POUT_HINTS \ +{ \ + ENG_POUT_HINT_IDLE, \ + ENG_POUT_HINT_TIMER, \ + ENG_POUT_HINT_SINGLE_SHOT, \ + ENG_POUT_HINT_CYCLIC_PULSE, \ + ENG_POUT_HINT_PER_SEC, \ + ENG_POUT_HINT_PER_MIN, \ + ENG_POUT_HINT_PER_HOUR, \ + ENG_POUT_HINT_DCF77, \ + ENG_POUT_HINT_POS_OK, \ + ENG_POUT_HINT_TIME_SYNC, \ + ENG_POUT_HINT_ALL_SYNC, \ + ENG_POUT_HINT_TIMECODE, \ + ENG_POUT_HINT_TIMESTR, \ + ENG_POUT_HINT_10MHZ \ } @@ -1662,6 +1760,8 @@ enum #define MSK_POUT_TIME_SYNC ( 1UL << POUT_TIME_SYNC ) #define MSK_POUT_ALL_SYNC ( 1UL << POUT_ALL_SYNC ) #define MSK_POUT_TIMECODE ( 1UL << POUT_TIMECODE ) +#define MSK_POUT_TIMESTR ( 1UL << POUT_TIMESTR ) +#define MSK_POUT_10MHZ ( 1UL << POUT_10MHZ ) /* @@ -1695,10 +1795,14 @@ typedef struct { POUT_SETTINGS pout_settings; uint32_t supp_modes; /* bit mask of modes supp. by this output */ - uint32_t reserved; /* reserved for future use, currently 0 */ + uint8_t timestr_ports; /* bit mask of COM ports supported for POUT_TIMESTR */ + uint8_t reserved_0; /* reserved for future use, currently 0 */ + uint16_t reserved_1; /* reserved for future use, currently 0 */ uint32_t flags; /* reserved for future use, currently 0 */ } POUT_INFO; +/* The max number of COM ports that can be handled by POUT_INFO::timestr_ports */ +#define MAX_POUT_TIMESTR_PORTS 8 /* * The structure below adds an index number to the structure @@ -1,7 +1,7 @@ /************************************************************************** * - * $Id: gpsserio.c 1.3 2005/04/26 11:00:30Z martin TEST $ + * $Id: gpsserio.c 1.4 2006/05/17 10:19:39Z martin REL_M $ * * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany * @@ -11,7 +11,9 @@ * * ----------------------------------------------------------------------- * $Log: gpsserio.c $ - * Revision 1.3 2005/04/26 11:00:30Z martin + * Revision 1.4 2006/05/17 10:19:39Z martin + * Account for renamed structure. + * Revision 1.3 2005/04/26 11:00:30 martin * Added standard file header. * Source code cleanup. * check_transfer() now expects a control structure which keeps @@ -151,8 +153,8 @@ void xmt_cmd( MSG_BUFF *p, GPS_CMD cmd ) /*HDR*/ void xmt_cmd_us( MSG_BUFF *p, GPS_CMD cmd, uint16_t us ) { - p->u.data.us = us; - p->hdr.len = sizeof( p->u.data.us ); + p->u.msg_data.us = us; + p->hdr.len = sizeof( p->u.msg_data.us ); p->hdr.cmd = cmd; xmt_tbuff( p ); @@ -1,7 +1,7 @@ /************************************************************************** * - * $Id: gpsserio.h 1.17 2005/09/08 14:47:05Z martin TEST $ + * $Id: gpsserio.h 1.18 2006/05/18 09:43:35Z martin REL_M $ * * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany * @@ -31,6 +31,18 @@ * * ----------------------------------------------------------------------- * $Log: gpsserio.h $ + * Revision 1.18 2006/05/18 09:43:35Z martin + * New cmd code GPS_IGNORE_LOCK. + * Added command codes for PZF receivers. + * Renamed IRIG_... symbols to IRIG_TX_... in order to distinguish + * from IRIG input configuration which might be available in the future. + * Added some fields to the MSG_DATA union. + * Renamed MSG_BUFF field "data" to "msg_data" in order to avoid + * conflict with reserved word in some environments. + * Rewrote inclusion control macros. + * Replace control of inclusion of function prototypes by new symbol + * _USE_GPSSERIO_FNC which can be fully overridden. + * Updated lots of comments. * Revision 1.17 2005/09/08 14:47:05Z martin * Changed type of MSG_RCV_CTL::flags from int to ulong * to avoid compiler warnings. @@ -42,7 +54,7 @@ * Defined flag bits and corresponding bit masks. * Updated function prototypes. * Revision 1.14 2004/07/08 08:28:30 martin - * New cmd code GPS_RCV_TIMEOUT which is only supported if + * New cmd code GPS_RCV_TIMEOUT which is only supported if * feature mask GPS_HAS_RCV_TIMEOUT is set. * Revision 1.13 2004/06/16 14:13:50 martin * Changed name of symbol which controls inclusion of function prototypes. @@ -93,18 +105,56 @@ #include <gpsdefs.h> #include <use_pack.h> + +/* + * The following macros control parts of the build process. + * The default values are suitable for most cases but can be + * overridden by global definitions, if required. + */ + +/* control inclusion of function prototypes */ +#ifndef _USE_GPSSERIO_FNC + /* by default don't include if building a firmware */ + #define _USE_GPSSERIO_FNC \ + ( \ + !defined( _C166 ) && \ + !defined( _CC51 ) && \ + !defined( __ARM ) && \ + !defined( _USE_GPS163 ) \ + ) +#endif + +/* control inclusion of non-public GPS declarations */ #ifndef _USE_GPSPRIV - #define _USE_GPSPRIV ( defined( _C166 ) \ - || defined( __ARM ) \ - || defined( _USE_GPS163 ) ) + /* by default do include if building a GPS firmware */ + #define _USE_GPSPRIV \ + ( \ + defined( _C166 ) || \ + defined( _CC51 ) || \ + defined( __ARM ) || \ + defined( _USE_GPS163 ) \ + ) +#endif + +/* control inclusion of pcpsdefs.h */ +#ifndef _USE_PCPSDEFS + #define _USE_PCPSDEFS \ + ( \ + defined( _CC51 ) \ + ) #endif + #if _USE_GPSPRIV #include <gpspriv.h> #else #define _mbg_gps_types_priv #endif +#if _USE_PCPSDEFS + #include <pcpsdefs.h> +#endif + #ifdef __cplusplus extern "C" { @@ -161,55 +211,62 @@ extern "C" { /* | | | */ enum /* | | | */ { /* system data */ - GPS_AUTO_ON = 0x000, /* | | | X | enable auto-msgs from GPS rcvr */ - GPS_AUTO_OFF, /* | | | X | disable auto-msgs from GPS rcvr */ - GPS_SW_REV, /* | | X | | request software revision */ - GPS_BVAR_STAT, /* | | X | | request status of buffered variables */ - GPS_TIME, /* | X | | X | current time or capture or init board time */ - GPS_POS_XYZ, /* | | X | X | current position in ECEF coords */ - GPS_POS_LLA, /* | | X | X | current position in geographic coords */ - GPS_TZDL, /* | | X | X | time zone / daylight saving */ - GPS_PORT_PARM, /* | | X | X | parameters of the serial ports */ - GPS_SYNTH, /* | | X | X | synthesizer's frequency and phase */ - GPS_ANT_INFO, /* | X | X | | time diff after antenna disconnect */ - GPS_UCAP, /* | X | X | | user capture */ - GPS_ENABLE_FLAGS, /* | | X | X | controls when to enable serial, pulses, and synth */ - GPS_STAT_INFO, /* | | X | | request SV, mode and DAC info */ + GPS_AUTO_ON = 0x000, /* | | | X | no param, enable auto-msgs from GPS rcvr */ + GPS_AUTO_OFF, /* | | | X | no param, disable auto-msgs from GPS rcvr */ + GPS_SW_REV, /* | | X | | SW_REV, software revision */ + GPS_BVAR_STAT, /* | | X | | BVAR_STAT, status of buffered variables */ + GPS_TIME, /* | X | | X | TTM, current time or capture, or init board time */ + GPS_POS_XYZ, /* | | X | X | XYZ, current position in ECEF coords */ + GPS_POS_LLA, /* | | X | X | LLA, current position in geographic coords */ + GPS_TZDL, /* | | X | X | TZDL, time zone / daylight saving */ + GPS_PORT_PARM, /* | | X | X | PORT_PARM, (obsolete, use PORT_SETTINGS etc. ) */ + GPS_SYNTH, /* | | X | X | SYNTH synthesizer's frequency and phase */ + GPS_ANT_INFO, /* | X | X | | ANT_INFO, time diff after antenna disconnect */ + GPS_UCAP, /* | X | X | | TTM, user capture events */ + GPS_ENABLE_FLAGS, /* | | X | X | ENABLE_FLAGS, when to enable serial, pulses, and synth */ + GPS_STAT_INFO, /* | | X | | STAT_INFO, request SV, mode and DAC info */ GPS_SWITCH_PARMS, /* | | X | X | (obsolete, use GPS_POUT_PROG_IDX) */ GPS_STRING_PARMS, /* | | X | X | (obsolete, use GPS_PORT_INFO/GPS_PORT_SETTINGS */ - GPS_ANT_CABLE_LENGTH, /* | | X | X | length of antenna cable */ + GPS_ANT_CABLE_LENGTH, /* | | X | X | ANT_CABLE_LEN, length of antenna cable */ GPS_SYNC_OUTAGE_DELAY, /* | | X | X | (customized firmware only) */ GPS_PULSE_INFO, /* | | X | X | (customized firmware only) */ GPS_OPT_FEATURES, /* | | X | | (obsolete, use GPS_RECEIVER_INFO) */ - GPS_IRIG_SETTINGS, /* | | X | X | (only if GPS_HAS_IRIG) */ - GPS_RECEIVER_INFO, /* | | X | | receiver model specific info */ - GPS_STR_TYPE_INFO_IDX, /* | | X | | names and modes of the string types */ - GPS_PORT_INFO_IDX, /* | | X | | port settings + additional info */ - GPS_PORT_SETTINGS_IDX, /* | | X | X | port settings only */ - GPS_POUT_INFO_IDX, /* | | X | | pout settings + additional info */ - GPS_POUT_SETTINGS_IDX, /* | | X | X | programmable pulse output cfg */ - GPS_IRIG_INFO, /* | | X | | (only if GPS_HAS_IRIG) */ - GPS_MULTI_REF_SETTINGS,/* | | X | X | (only if HAS_MULTI_REF) */ - GPS_MULTI_REF_INFO, /* | | X | | (only if HAS_MULTI_REF) */ - GPS_ROM_CSUM, /* | | X | | (only if HAS_MULTI_REF) */ - GPS_MULTI_REF_STATUS, /* | | X | | (only if HAS_MULTI_REF) */ - GPS_RCV_TIMEOUT, /* | | X | X | ushort [min] (only if HAS_RCV_TIMEOUT) */ - + GPS_IRIG_TX_SETTINGS, /* | | X | X | IRIG_SETTINGS, (only if GPS_HAS_IRIG_TX) */ + GPS_RECEIVER_INFO, /* | | X | | RECEIVER_INFO, model specific info */ + GPS_STR_TYPE_INFO_IDX, /* | | X | | STR_TYPE_INFO_IDX, names and modes of supp. string types */ + GPS_PORT_INFO_IDX, /* | | X | | PORT_INFO_IDX, port settings + additional info */ + GPS_PORT_SETTINGS_IDX, /* | | X | X | PORT_SETTINGS_IDX, settings for specified port */ + GPS_POUT_INFO_IDX, /* | | X | | POUT_INFO_IDX, pout settings + additional info */ + GPS_POUT_SETTINGS_IDX, /* | | X | X | POUT_SETTINGS_IDX, programmable pulse output cfg */ + GPS_IRIG_TX_INFO, /* | | X | | IRIG_INFO, (only if GPS_HAS_IRIG_TX) */ + GPS_MULTI_REF_SETTINGS,/* | | X | X | MULTI_REF_SETTINGS, (only if HAS_MULTI_REF) */ + GPS_MULTI_REF_INFO, /* | | X | | MULTI_REF_INFO, (only if HAS_MULTI_REF) */ + GPS_ROM_CSUM, /* | | X | | uint16_t, (not supported by all devices) */ + GPS_MULTI_REF_STATUS, /* | | X | | uint16_t, (only if HAS_MULTI_REF) */ + GPS_RCV_TIMEOUT, /* | | X | X | uint16_t, [min] (only if HAS_RCV_TIMEOUT) */ + GPS_IGNORE_LOCK, /* | | X | X | uint16_t, if != 0 always claim to be sync */ + /* GPS data */ - GPS_CFGH = 0x100, /* | | X | X | SVs' configuration and health codes */ - GPS_ALM, /* | | X | X | one SV's almanac */ - GPS_EPH, /* | | X | X | one SV's ephemeris */ - GPS_UTC, /* | | X | X | UTC correction parameters */ - GPS_IONO, /* | | X | X | ionospheric correction parameters */ - GPS_ASCII_MSG, /* | | X | | the GPS ASCII message */ + GPS_CFGH = 0x100, /* | | X | X | CFGH, SVs' configuration and health codes */ + GPS_ALM, /* | | X | X | SV_ALM, one SV's almanac */ + GPS_EPH, /* | | X | X | SV_EPH, one SV's ephemeris */ + GPS_UTC, /* | | X | X | UTC, GPS UTC correction parameters */ + GPS_IONO, /* | | X | X | IONO, GPS ionospheric correction parameters */ + GPS_ASCII_MSG, /* | | X | | ASCII_MSG, the GPS ASCII message */ /* Misc data */ - GPS_IP4_SETTINGS = 0x800 /* | X | X | cfg of optional LAN interface */ + GPS_IP4_SETTINGS = 0x800, /* | X | X | IP4_SETTINGS, cfg of optional LAN interface */ + + /* PZF data */ + PZF_PCPS_TIME = 0xA00, /* | | X | | PCPS_TIME, date/time/status */ + PZF_TR_DISTANCE, /* | | X | X | TR_DISTANCE, dist. from transmitter [km] */ + PZF_TZCODE, /* | | X | X | TZCODE, time zone code */ + PZF_CORR_INFO /* | | X | | CORR_INFO, correlation info */ }; /* Caution: If almanac or ephemeris data are requested from the GPS rcvr */ -/* an ushort parameter must be supplied specifying the number of the SV */ +/* an uint16_t parameter must be supplied specifying the number of the SV */ /* whose data is to be returned. The SV number may be 0 or MIN_SVNO to */ /* MAX_SVNO, if the number is 0, ALL almanacs (32) are sent. */ @@ -311,21 +368,24 @@ typedef union PORT_PARM port_parm; SYNTH synth; ANT_INFO ant_info; + TTM ucap; ENABLE_FLAGS enable_flags; STAT_INFO stat_info; ANT_CABLE_LEN ant_cable_len; - IRIG_SETTINGS irig_settings; + IRIG_SETTINGS irig_tx_settings; RECEIVER_INFO receiver_info; STR_TYPE_INFO_IDX str_type_info_idx; PORT_INFO_IDX port_info_idx; PORT_SETTINGS_IDX port_settings_idx; POUT_INFO_IDX pout_info_idx; POUT_SETTINGS_IDX pout_settings_idx; - IRIG_INFO irig_info; + IRIG_INFO irig_tx_info; MULTI_REF_SETTINGS multi_ref_settings; MULTI_REF_INFO multi_ref_info; MBG_OPT_SETTINGS opt_settings; MBG_OPT_INFO opt_info; + uint16_t rcv_timeout; + uint16_t ignore_lock; /* GPS system data */ CFGH cfgh; @@ -338,6 +398,13 @@ typedef union /* Misc data */ IP4_SETTINGS ip4_settings; +#if _USE_PCPSDEFS + PCPS_TIME pcps_time; + TR_DISTANCE tr_distance; + PCPS_TZCODE tzcode; + CORR_INFO corr_info; +#endif + _mbg_gps_types_priv } MSG_DATA; @@ -361,7 +428,7 @@ typedef struct union { uint8_t bytes[MAX_MSG_DATA_SIZE]; - MSG_DATA data; + MSG_DATA msg_data; } u; } MSG_BUFF; @@ -398,9 +465,7 @@ enum /* function prototypes: */ -#if ( !defined( _IGN_GPSSERIO_FNC ) \ - && !defined( _C166 ) \ - && !defined( __ARM ) ) +#if _USE_GPSSERIO_FNC /* ----- function prototypes begin ----- */ @@ -415,7 +480,7 @@ enum /* ----- function prototypes end ----- */ -#endif // !defined( _IGN_GPSSERIO_FNC ) +#endif // _USE_GPSSERIO_FNC /* End of header body */ @@ -1,8 +1,8 @@ /************************************************************************** * - * $Id: gpsxmple.c 1.3 2005/09/08 14:28:34Z martin TEST $ - * $Name: GPSPROG_1_4 $ + * $Id: gpsxmple.c 1.4 2006/05/17 10:20:29Z martin REL_M $ + * $Name: GPSPROG_1_5 $ * * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany * @@ -20,7 +20,9 @@ * * ----------------------------------------------------------------------- * $Log: gpsxmple.c $ - * Revision 1.3 2005/09/08 14:28:34Z martin + * Revision 1.4 2006/05/17 10:20:29Z martin + * Account for renamed structure. + * Revision 1.3 2005/09/08 14:28:34 martin * Cleaned up display of synth settings. * Revision 1.2 2005/04/26 11:29:16 martin * Initial revision under RCS. @@ -418,7 +420,7 @@ void sprint_lla( char *s, LLA lla ) /*HDR*/ void print_stat_info( void ) { - STAT_INFO *p = &rbuff.u.data.stat_info; + STAT_INFO *p = &rbuff.u.msg_data.stat_info; const char *cp; switch ( p->mode ) @@ -457,13 +459,13 @@ void print_time( void ) "(capture 1)" }; - sprint_tm( ws, &rbuff.u.data.ttm.tm, 1 ); + sprint_tm( ws, &rbuff.u.msg_data.ttm.tm, 1 ); printf( "\rCh: %2i %-14s %s Status: %04X\n", - rbuff.u.data.ttm.channel, - s[rbuff.u.data.ttm.channel + 1], + rbuff.u.msg_data.ttm.channel, + s[rbuff.u.msg_data.ttm.channel + 1], ws, - rbuff.u.data.ttm.tm.status + rbuff.u.msg_data.ttm.tm.status ); } /* print_time */ @@ -577,9 +579,9 @@ int req_data( int cmd, clock_t timeout ) /*HDR*/ void set_synth( SYNTH *synthp ) { - tbuff.u.data.synth = *synthp; + tbuff.u.msg_data.synth = *synthp; - tbuff.hdr.len = sizeof( tbuff.u.data.synth ); + tbuff.hdr.len = sizeof( tbuff.u.msg_data.synth ); tbuff.hdr.cmd = GPS_REQACK | GPS_SYNTH; xmt_tbuff( &tbuff ); @@ -604,9 +606,9 @@ void show_sw_rev( void ) req_data( GPS_SW_REV, timeout ); printf( "%X.%02X %s\n", - rbuff.u.data.sw_rev.code >> 8, - rbuff.u.data.sw_rev.code & 0xFF, - rbuff.u.data.sw_rev.name + rbuff.u.msg_data.sw_rev.code >> 8, + rbuff.u.msg_data.sw_rev.code & 0xFF, + rbuff.u.msg_data.sw_rev.name ); } /* show_sw_rev */ @@ -620,7 +622,7 @@ void show_stat( void ) req_data( GPS_BVAR_STAT, timeout ); - printf( "%04X\n", rbuff.u.data.bvar_stat ); + printf( "%04X\n", rbuff.u.msg_data.bvar_stat ); } /* show_stat */ @@ -636,9 +638,9 @@ void show_pos( void ) req_data( GPS_POS_LLA, timeout ); for ( i = 0; i < N_LLA; i++ ) - swap_double( &rbuff.u.data.lla[i] ); + swap_double( &rbuff.u.msg_data.lla[i] ); - sprint_lla( ws, rbuff.u.data.lla ); + sprint_lla( ws, rbuff.u.msg_data.lla ); printf( "%s\n", ws ); } /* show_pos */ @@ -653,36 +655,36 @@ void show_tzdl( void ) req_data( GPS_TZDL, timeout ); printf( "%-5s = UTC%+lisec\n", - rbuff.u.data.tzdl.name[0], - (long) rbuff.u.data.tzdl.offs + rbuff.u.msg_data.tzdl.name[0], + (long) rbuff.u.msg_data.tzdl.offs ); printf( fmt, " " ); printf( "%-5s = UTC%+lisec\n", - rbuff.u.data.tzdl.name[1], - (long) rbuff.u.data.tzdl.offs + rbuff.u.data.tzdl.offs_dl + rbuff.u.msg_data.tzdl.name[1], + (long) rbuff.u.msg_data.tzdl.offs + rbuff.u.msg_data.tzdl.offs_dl ); printf( fmt, "Daylight Saving" ); printf( "starts: " ); - if ( rbuff.u.data.tzdl.tm_on.year & DL_AUTO_FLAG ) + if ( rbuff.u.msg_data.tzdl.tm_on.year & DL_AUTO_FLAG ) { printf( "%s after ", - dow_str[(int) rbuff.u.data.tzdl.tm_on.wday] + dow_str[(int) rbuff.u.msg_data.tzdl.tm_on.wday] ); } - sprint_tm( ws, &rbuff.u.data.tzdl.tm_on, 0 ); + sprint_tm( ws, &rbuff.u.msg_data.tzdl.tm_on, 0 ); printf( "%sh\n", ws ); printf( fmt, " " ); printf( "ends: " ); - if ( rbuff.u.data.tzdl.tm_off.year & DL_AUTO_FLAG ) + if ( rbuff.u.msg_data.tzdl.tm_off.year & DL_AUTO_FLAG ) { printf( "%s after ", - dow_str[(int) rbuff.u.data.tzdl.tm_off.wday] + dow_str[(int) rbuff.u.msg_data.tzdl.tm_off.wday] ); } - sprint_tm( ws, &rbuff.u.data.tzdl.tm_off, 0 ); + sprint_tm( ws, &rbuff.u.msg_data.tzdl.tm_off, 0 ); printf( "%sh\n", ws ); } /* show_tzdl */ @@ -699,34 +701,34 @@ void show_synth( void ) req_data( GPS_SYNTH, timeout ); - if ( rbuff.u.data.synth.freq == 0 ) + if ( rbuff.u.msg_data.synth.freq == 0 ) { printf( "disabled\n" ); return; } - if ( rbuff.u.data.synth.range == 0 ) + if ( rbuff.u.msg_data.synth.range == 0 ) { // freq field is in 0.1 Hz units, so if // the range is 0 we must divide by 10 // to yield the correct result - f = (double) rbuff.u.data.synth.freq / 10.0; + f = (double) rbuff.u.msg_data.synth.freq / 10.0; } else { ulong scale = 1; int i; - for ( i = 1; i < rbuff.u.data.synth.range; i++ ) + for ( i = 1; i < rbuff.u.msg_data.synth.range; i++ ) scale *= 10L; - f = rbuff.u.data.synth.freq * (double) scale; + f = rbuff.u.msg_data.synth.freq * (double) scale; } printf( "%.1f Hz, Phase: %+.1f deg", (double) f, - (double) rbuff.u.data.synth.phase / 10.0 + (double) rbuff.u.msg_data.synth.phase / 10.0 ); printf( ( f < SYNTH_PHASE_SYNC_LIMIT ) ? "\n" : " (phase ignored)\n" ); @@ -750,11 +752,11 @@ void show_port_parm( void ) { printf( "COM%i: %5lu Baud, %s, ", i, - (ulong) rbuff.u.data.port_parm.com[i].baud_rate, - rbuff.u.data.port_parm.com[i].framing + (ulong) rbuff.u.msg_data.port_parm.com[i].baud_rate, + rbuff.u.msg_data.port_parm.com[i].framing ); - switch ( rbuff.u.data.port_parm.mode[i] ) + switch ( rbuff.u.msg_data.port_parm.mode[i] ) { case 0: printf( "Time string on request only\n" ); break; case 1: printf( "Time string once per second\n" ); break; @@ -809,7 +811,7 @@ void save_bvars( const char *fn ) printf( fmt, "Reading bvars..." ); req_data( GPS_CFGH, timeout ); - bvars.cfgh = rbuff.u.data.cfgh; + bvars.cfgh = rbuff.u.msg_data.cfgh; for ( i = 0; i < N_SVNO; i++ ) { @@ -819,17 +821,17 @@ void save_bvars( const char *fn ) get_data( GPS_ALM, timeout ); xmt_cmd( &tbuff, GPS_AUTO_OFF ); - swap_alm_doubles( &rbuff.u.data.sv_alm.alm ); - bvars.alm[i] = rbuff.u.data.sv_alm.alm; + swap_alm_doubles( &rbuff.u.msg_data.sv_alm.alm ); + bvars.alm[i] = rbuff.u.msg_data.sv_alm.alm; } req_data( GPS_UTC, timeout ); - swap_utc_doubles( &rbuff.u.data.utc ); - bvars.utc = rbuff.u.data.utc; + swap_utc_doubles( &rbuff.u.msg_data.utc ); + bvars.utc = rbuff.u.msg_data.utc; req_data( GPS_IONO, timeout ); - swap_iono_doubles( &rbuff.u.data.iono ); - bvars.iono = rbuff.u.data.iono; + swap_iono_doubles( &rbuff.u.msg_data.iono ); + bvars.iono = rbuff.u.msg_data.iono; printf( "done.\n" ); @@ -898,7 +900,7 @@ int main( void ) show_tzdl(); show_port_parm(); - str_mode_0 = rbuff.u.data.port_parm.mode[0]; + str_mode_0 = rbuff.u.msg_data.port_parm.mode[0]; show_synth(); @@ -931,7 +933,7 @@ int main( void ) case GPS_TIME: print_time(); - if ( rbuff.u.data.ttm.channel == -1 ) + if ( rbuff.u.msg_data.ttm.channel == -1 ) { xmt_cmd( &tbuff, GPS_AUTO_ON ); xmt_cmd( &tbuff, GPS_STAT_INFO ); diff --git a/gpsxmple.exe b/gpsxmple.exe Binary files differindex 1ab6ab7..cc1a6cf 100644 --- a/gpsxmple.exe +++ b/gpsxmple.exe @@ -1,7 +1,7 @@ /************************************************************************** * - * $Id: mbg_tgt.h 1.5 2003/12/17 16:11:41Z martin REL_M $ + * $Id: mbg_tgt.h 1.6 2006/01/25 14:37:06Z martin REL_M $ * * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany * @@ -11,6 +11,8 @@ * * ----------------------------------------------------------------------- * $Log: mbg_tgt.h $ + * Revision 1.6 2006/01/25 14:37:06Z martin + * Added definitions for 64 bit Windows environments. * Revision 1.5 2003/12/17 16:11:41Z martin * Split API modifiers into _MBG_API and _MBG_API_ATTR. * Revision 1.4 2003/06/19 08:20:22Z martin @@ -110,6 +112,16 @@ #if defined MBG_TGT_WIN32 + #if defined( _AMD64_ ) + // This is used for AMD64 architecture and for + // Intel XEON CPUs with 64 bit extension. + #define MBG_TGT_WIN32_PNP_X64 + #define WIN32_FLAVOR "x64" + #elif defined( _IA64_ ) + #define MBG_TGT_WIN32_PNP_IA64 + #define WIN32_FLAVOR "ia64" + #endif + #define _MBG_API WINAPI #if defined MBG_LIB_EXPORT |