当前位置:网站首页>3. Basic constants and macro definitions
3. Basic constants and macro definitions
2022-07-28 15:33:00 【Turing_ three hundred and twenty-one】
\qquad Here is HD-GR GNSS Basic constants and macro definitions of navigation software :
// constants.h: Header file for various SHARED constants and macro definitions.
/* * Copyright (C) 2005 Andrew Greenberg * Distributed under the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 (June 1991). * See the "COPYING" file distributed with this software for more information. */
/* Namuru GPS receiver project * Original : constants.h * Modes : GP4020 HW I/O handling commented/replaced * version : V1.0 * date : 21st/Dec/2006 */
/* * HD-GR GNSS receiver project * Modes : Inherited the code of constants.h in the Namuru GPS receiver project * V1.0 and made necessary adjustments to adapt to the new HW, RTOS and * functions. * version : V1.0 * date : xx/xx/2015 */
#ifndef __CONSTANTS_H__
#define __CONSTANTS_H__
// Language Constants
#define IDLE 0
#define FALSE 0
#define TRUE 1
// Physical Constants
#define SPEED_OF_LIGHT 2.99792458E8 // [m/s]
#define PI 3.141592653589793
#define PI_OVER_2 (PI / 2.0)
#define TWO_PI (PI * 2.0)
#define RADTODEG 180.0/PI // [deg/r]
// GNSS Week Defines
#define SECONDS_IN_WEEK (7 * 24 * 3600) // (604800) seconds per week
#define BITS_IN_WEEK (50 * SECONDS_IN_WEEK) // (30240000) gps 50Hz data rate
#define BITS_IN_WEEK_50HZ BITS_IN_WEEK // (30240000) gps 50Hz data rate
// Clock info
#define SAMPLE_CLOCK 16.368E6 // nominal [Hz], sets correlator timing
#define SYSTEM_CLOCK (16.368E6*6.0) // nominal [Hz]
// sample clock square root value
#define SAMPLE_CLOCK_SQRT 4.04574
#define TIC_PERIOD 0.1
#define TIC_2_ACCUM_DIV 128
#define TIC_2_PPS_DIV 100
#define VALUE_TIC_ADD1 (unsigned long)(SYSTEM_CLOCK*0.1)
#define VALUE_TIC_DIV (VALUE_TIC_ADD1 - 1)
#define VALUE_ACCUM_INT (VALUE_TIC_ADD1/TIC_2_ACCUM_DIV - 1)
#define VALUE_PPS_DIV (VALUE_TIC_ADD1/TIC_2_PPS_DIV - 1)
//#define VALUE_ACCUM_INT (unsigned long)(SYSTEM_CLOCK*(0.8E-3))-1
//#define VALUE_TIC (unsigned long)(SYSTEM_CLOCK*0.1)-1
//#define VALUE_PPS (unsigned long)(SYSTEM_CLOCK*(1.0E-3))-1
// 1MHz sample clock noise level
#define NOISE_LEVEL_1MS_1MHZ 130.384
// noise level: (SAMPLE_CLOCK_SQRT*NOISE_LEVEL_1MS_1MHZ) = 527.4995
#define NOISE_LEVEL 1500
// 3db over noise level: 745.113
#define SIGNAL_LEVEL_3DB (1.412538*NOISE_LEVEL)
// 5db over noise level: 938.041
#define SIGNAL_LEVEL_5DB (1.778279*NOISE_LEVEL)
// 6db over noise level: 1052.500
#define SIGNAL_LEVEL_6DB (1.995262*NOISE_LEVEL)
// ACQ THRESHOLD: this threshold refers to the sum of early, prompt and late
// magnitude (6dB over early, 3dB over prompt, 0db over late
#define ACQ_THRESHOLD (SIGNAL_LEVEL_6DB+SIGNAL_LEVEL_3DB+NOISE_LEVEL)
// LOCK THRESHOLD: this treshold refers to a single correlator branch magnitude
#define LOCK_THRESHOLD SIGNAL_LEVEL_3DB
#define TANG_THRESHOLD SIGNAL_LEVEL_3DB
// GPS RF Timing
#define GPS_REF 10.23E6 // theoretical GPS reference frequency [Hz]
#define GPS_L1 (154*GPS_REF) // nominal civilian GPS satellite
// GPS Code DCO timing
#define GPS_CODE_DCO_LENGTH 1024
#define GPS_CODE_PERIOD 1023 // Gold code period
#define GPS_MAX_CODE_PHASE (2*GPS_CODE_PERIOD) // In half-chips
#define GPS_CHIP_RATE (GPS_REF/10)
#define GPS_CODE_TIME (GPS_CODE_PERIOD/GPS_CHIP_RATE) // 1ms precisely
#define GPS_QUARTER_CHIP_TIME (0.25/GPS_CHIP_RATE) // about 74[m]
// GPS IF frequency
#define GPS_IF_FREQ 4.092E6
// GPS CARR_FREQ_RES
#define GPS_CARR_FREQ_RES (SYSTEM_CLOCK / (1 << 30))
// Find integer setting used to tune the carrier DCO to the nominal frequency
#define GPS_CARRIER_REF (unsigned int)(0.5 + GPS_IF_FREQ / GPS_CARR_FREQ_RES)
// GPS CODE_FREQ_RES
#define GPS_CODE_FREQ_RES (SYSTEM_CLOCK / (1 << 29))
/* Find integer setting used to tune the code DCO to the nominal chip rate * Note, this is twice the expected value since the code generator works * in half-chips. This also means the chip resolution is actually two times * better than the value given in CODE_FREQ_RES. */
#define GPS_CODE_REF (unsigned int)(0.5 + 2 * GPS_CHIP_RATE / GPS_CODE_FREQ_RES)
// BDS B1 RF Timing
#define B1I_REF 1.023E6 // theoretical BDS reference frequency [Hz]
#define B1I_L1 (1526*B1I_REF) // nominal B1I satellite
// BDS B1 Code DCO timing
#define B1I_CODE_DCO_LENGTH 2046
#define B1I_CODE_PERIOD 2046 // Gold code period
#define B1I_MAX_CODE_PHASE (2*B1I_CODE_PERIOD) // In half-chips
#define B1I_CHIP_RATE (2*B1I_REF) // 2.046MHz
#define B1I_CODE_TIME (B1I_CODE_PERIOD/B1I_CHIP_RATE) // 1ms precisely
#define B1I_QUARTER_CHIP_TIME (0.25/B1I_CHIP_RATE)// about ??[m]
// B1I_IF frequency
#define B1I_IF_FREQ 4.092E6
// B1I_CARR_FREQ_RES
#define B1I_CARR_FREQ_RES (SYSTEM_CLOCK / (1 << 30))
// Find integer setting used to tune the carrier DCO to the nominal frequency
#define B1I_CARRIER_REF (unsigned int)(0.5 + B1I_IF_FREQ / B1I_CARR_FREQ_RES)
// CODE_FREQ_RES
#define B1I_CODE_FREQ_RES (SYSTEM_CLOCK / (1 << 29))
/* Find integer setting used to tune the code DCO to the nominal chip rate * Note, this is twice the expected value since the code generator works * in half-chips. This also means the chip resolution is actually two times * better than the value given in CODE_FREQ_RES. */
#define B1I_CODE_REF (unsigned int)(0.5 + 2 * B1I_CHIP_RATE / B1I_CODE_FREQ_RES)
// GPS, BDS and total channels
#define BDMOD_GPS_CHANNELS 10
#define BDMOD_B1I_CHANNELS 10
#define GPS_MAX_CHANNELS 10
#define B1I_MAX_CHANNELS 10
#define TOT_MAX_CHANNELS (GPS_MAX_CHANNELS+B1I_MAX_CHANNELS)
// GPS and BDS satellites
#define GPS_MAX_SATELLITES 32
#define B1I_MAX_SATELLITES 32
// Positioning satellite constellations
#define POS_CONSTELL_GPS 0x01 // Only use GPS satellite constellation
#define POS_CONSTELL_BDS 0x02 // Only use BDS satellite constellation
#define POS_CONSTELL_MIX 0x03 // use GPS and BDS satellite constellations
#define ENABLE_TRACKING_LOG
#define ENABLE_POSITION_LOG
// Task Priority
#define ACCUM_TASK_PRIORITY 1
#define MEAS_TASK_PRIORITY 2
#define MESSA_TASK_PRIORITY 3
#define EPHEM_TASK_PRIORITY 4
#define ALLOC_TASK_PRIORITY 5
#define POSIT_TASK_PRIORITY 6
#define DISP_TASK_PRIORITY 7
#define RS232_TASK_PRIORITY 8
// #define GNSS_ENABLE_CRITICAL
// #define GNSS_ENABLE_MUTEX
#ifdef GNSS_ENABLE_CRITICAL
#define GNSS_ENTER_CRITICAL() OS_ENTER_CRITICAL()
#define GNSS_EXIT_CRITICAL() OS_EXIT_CRITICAL()
#else
#define GNSS_ENTER_CRITICAL()
#define GNSS_EXIT_CRITICAL()
#endif
#endif // __CONSTANTS_H__
边栏推荐
- 树上启发式合并简单题
- Srtt-110vdc-4h-c time relay
- Vs usage skills
- PMP【敏捷教材+全真模拟题】,续6月25日考试之后,敏捷就成为了重中
- 给你一个链表,删除链表的倒数第 n 个结点,并且返回链表的头结点。
- Gfpgan blurred photo repair artifact
- Jy-7ga/1 voltage relay
- [MP error] MP: 'getbasemappe serviceimpl' claims
- MySQL 8.0 common (continuous update)
- Crmeb Standard Edition window+phpstudy8 installation tutorial (II)
猜你喜欢
随机推荐
Self cultivation of programmers
Learn PHP reflection classes from ThinkPHP remote code execution
给你一个链表,删除链表的倒数第 n 个结点,并且返回链表的头结点。
SRTT-110VDC-4H-C时间继电器
.net core 2.2 版本跨域配置
Editor in ArcGIS Pro
Pyinstaller packages py as an EXE file
Pytorch - autograd automatic differentiation
Heuristic merging simple problem on tree
2、开源GPS项目HD-GR GNSS的自叙
Crmeb knowledge paid manual installation tutorial
Srtt-110vdc-4h-c time relay
Jy-7ga/1 voltage relay
MIT指出公开预训练模型不能乱用
2021-06-29
Qt刷新UI界面问题
2022年全球程序员平均薪资发布,中国排名很意外
百度提出动态自蒸馏方法,结合交互模型与双塔模型实现稠密段落检索
PMP【敏捷教材+全真模拟题】,续6月25日考试之后,敏捷就成为了重中
DAY:7/11









