📄 ogr_defines.h
字号:
/* ************************************************************************ * * * OpenGPS Receiver * * * * -------------------------------------------------------------------- * * * * Module: ogr_defines.h * * * * Version: 0.1 * * * * Date: 04.07.02 * * * * Author: G. Beyerle * * * * -------------------------------------------------------------------- * * * * Copyright (C) 2002-2003 G. Beyerle * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * * -------------------------------------------------------------------- * * * * The files 'ogr_user.c', 'ogr_navdecode.c', 'ogr_navsolve.c', * * 'ogr_rtproc.c' are modified versions of the files 'gpsfuncs.cpp', * * 'gpsrcvr.cpp' from Clifford Kelley's OpenSourceGPS distribution. * * The unmodified files can be obtained from * * http://www.home.earthlink.net/~cwkelley * * * * -------------------------------------------------------------------- * * * * Defines * * * ************************************************************************ *//* ******************************* changes ******************************** 26.01.03 - add SQRTGM, PROGRAMVERSION; rename C to LIGHTVEL, add FREQRES, L1FRQMHZ ************************************************************************ *//* ----------------------------- defines ---------------------------------- */#define PROGRAMVERSION "0.2.3 (031215)"#undef USE_OPENSRCGPS_NAVFIX//#define USE_OPENSRCGPS_NAVFIX/* * constants defined for GPS, WGS-84 * speed of light in m/sec * earth rotation rate in rad/sec */#define RAD2DEG (180.0/M_PI)#define DEG2RAD (M_PI/180.0)#define PI 3.1415926535898e0#define LIGHTVEL 2.99792458e8#define OMEGAE 7.2921151467e-5#define MAJAXIS 6378137.0#define MINAXIS 6356752.3142// first and second numerical eccentricity#define E1SQR ((MAJAXIS*MAJAXIS-MINAXIS*MINAXIS)/(MAJAXIS*MAJAXIS)) #define E2SQR ((MAJAXIS*MAJAXIS-MINAXIS*MINAXIS)/(MINAXIS*MINAXIS))#define GRAVCONST 3.986005e14#define SQRTGM (sqrt(GRAVCONST))#define FCONST (-2.0*SQRTGM/(LIGHTVEL*LIGHTVEL))#define ESC 0x1b// Zarlink GP2021 correlator specifics#define CARRIER_REF 0x1f7b1b9L#define CODE_REF 0x16ea4a8L#define CARFRQRES 42.574746268e-3 // GP2021 car. frq. resolution #define CODFRQRES 85.149495e-3 // GP2021 code frq. resolution#define LAMBDA 0.1902936728 // L1 wavelength in meters#define L1FRQMHZ 1575.42 // L1 frequency in MHz#define BSIGN(x) (((x)>0)?1:0)// number of 1 ms chips corresponding to 1 nav bit#define CHIPSPERBIT 20// GP2021 register map (document DS4077, p28-29, available at www.zarlink.com)#define IO_COMMAND (PCIBASE+0x0)#define IO_DATA (PCIBASE+0x4)#define CHx_CNTL_BASE 0x0/* * GP2021 correlator registers */// write#define SATCNTL 0x0#define CODE_PHASE_COUNTER 0x1#define CARRIER_CYCLE_COUNTER 0x2#define CARRIER_DCO_INCR_HIGH 0x3#define CARRIER_DCO_INCR_LOW 0x4#define CODE_DCO_INCR_HIGH 0x5#define CODE_DCO_INCR_LOW 0x6#define EPOCH_COUNT_LOAD 0x7// read#define CODE_SLEW 0x0#define CODE_PHASE 0x1#define CARRIER_CYCLE_LOW 0x2#define CARRIER_DCO_PHASE 0x3#define EPOCH 0x4#define CODE_DCO_PHASE 0x5#define CARRIER_CYCLE_HIGH 0x6#define EPOCH_CHECK 0x7#define MULTI_CONTROL 0x60#define PROC_TIC_HIGH 0x6d#define PROC_TIC_LOW 0x6f#define ALL_CONTROL 0x70#define TEST_CONTROL 0x7c#define MULTI_CHANNEL_SELECT 0x7d#define SYSTEM_SETUP 0x7e#define RESET_CONTROL 0x7f// read#define ACCUM_STATUS_C 0x80#define MEAS_STATUS_A 0x81#define ACCUM_STATUS_A 0x82#define ACCUM_STATUS_B 0x83// write#define STATUS 0x80#define CHx_ACCUM_BASE 0x84// accumulator read#define I_TRACK 0x0#define Q_TRACK 0x1#define I_PROMPT 0x2#define Q_PROMPT 0x3// accumulator write#define CODE_SLEW_COUNTER 0x0#define ACCUM_RESET 0x1// 0x2 : not used#define CODE_DCO_PRESET_PHASE 0x3#define MULTI_ACCUM 0xb4#define ALL_ACCUM 0xb8#define DATA_RETENT 0xe4#define IO_CONFIG 0xf0#define DATABUSTEST 0xf2// Linux vs. DOS naming convention ...#define inpb(p) inb(p)#define inpw(p) inw(p)#define outpb(p,v) outb(v,p)#define outpw(p,v) outw(v,p)#define PCIBOARD#ifdef PCIBOARD//#define PCIBASE 0xe800//#define PCIBASE 0xe000 // champ77 : cat /proc/pci - Shuttle XPC/* * Note: we can't set base address from user space since RT module * is loaded before user prg becomes active */# define PCIBASE 0xb800 // kg96 : cat /proc/pci# define PCI_NR_PORTS 0x1F // Zarlink doc, p.24 register map# define PCI_BOARDNAME "Kolter Electronic PROTO-3 PCI Prototyping board (rev 3)."#endif//#define ISABOARD#ifdef ISABOARD# define ISABASE 0x300 # define ISA_NR_PORTS 0x1F # define ISA_BOARDNAME "GPSBuilder-2(PCI)"#endif// names of shared memory areas#define SHM_CHANNEL "OGRChn"#define SHM_RT_CTRL "OGRRTC"#define SHM_CHN_RBUF "OGRRBf"// number of channels in GP2021#define NOFCHN 12 // size of ring buffer#define CHN_RBUF_LEN (100*NOFCHN)// step 0.5 halfchips (1024 = halfchip) in monosat mode#define MONOSAT_COD_OFS_STEP 512// FIFOs#define FIFO_NAVBIT 1#define FIFO_IQDUMP 0// messages from RT process to user process#define MSG_NAVBIT 1 // navigation bits#define MSG_NAVBIT_LEN 2 // message length#define MSG_PSIRANGE 2 // pseudo range, carrier phase#define MSG_PSIRANGE_LEN 22 // message length#define MSG_HEADERSIZE 46 // header length of corr data (version 6)#define MSG_DATASIZE 32 // data record length of corr data#define MSG_MAX_LEN 128 // must be larger than max( MSG_*_LEN) + 2 !#ifndef TRUE# define TRUE 1#endif#ifndef FALSE# define FALSE 0#endif#define FIXPT_BASE 14#define MAGIC_NUMBER 0x4711/* ----------------------------- end of file ------------------------------ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -