📄 gps.h
字号:
/****************************************Copyright (c)**************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: GPS_HANDLE.h
** Last modified Date: 2005-06-17
** Last Version: 1.0
** Descriptions: header file of GPS
**
**------------------------------------------------------------------------------------------------------
** Created by: Yehaoben
** Created date: 2005-06-17
** Version: 1.0
** Descriptions: The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#ifndef __GPS_H_
#define __GPS_H_ /* __GPS_H_ */
#include "config.h"
#define GPS_CMDMaxSize 80 /*revice Command Line length*/
#define GPS_CMDNUM 7 /*How many command it can process at the same time*/
#define MAXSATELLITE 12
#define MAXMSG 4
extern OS_EVENT *GPSRcv; //GPS接收到一帧数据
typedef struct{
char Data[GPS_CMDMaxSize];
uint8 State; //0:initializtion ; 1: recive $ ; 2: send to handle ;
}GPSRawDataQ;
typedef struct{
uint8 Indicator;
uint8 dd;
uint8 mm;
uint16 mmmm;
}Lat_TYPE;
typedef struct{
char Indicator;
uint16 ddd;
uint8 mm;
uint16 mmmm;
}Long_TYPE;
typedef struct{
uint8 ID;
uint16 AZnEL; //118 degrees and 79 degrees to 11879;
uint8 SNR; //satellite signal dBHz
}Stl_TYPE;
typedef struct{
char UTC_Time[15];//世界调整时间
char UTC_Date[9];//世界日期
char Latitude[16];//纬度
char Longtitude[16];//经度
char Altitude[8];//120 to 12.0 meter//海拔高度
char PDOP[8];//
char HDOP[8];//18 to 1.8//水平精度系数
char VDOP[8];//18 to 1.8//垂直精度系数
char SatelliteUsed[8];//卫星个数
Stl_TYPE Satellite[MAXSATELLITE];//卫星状态;
char Speed[16];//速度18 to 1.8 Km/hr
char Heading[16];
uint8 Status;//HIGH 4bit is for FIX;LOW 4bit is for 3D/2D;
}GPS_DATA_TYPE;
extern GPS_DATA_TYPE GPS_DATA;
extern char GGA_DATA_L[];
extern char GLL_DATA_L[];
extern char GSA_DATA_L[];
extern char GSV_DATA_L[];
extern char RMC_DATA_L[];
extern char VTG_DATA_L[];
extern char STOP_COMMAND[];
extern char START_COMMAND[];
extern char ADD_ALL_COMMAND[];
extern GPSRawDataQ GPSDataQ[GPS_CMDNUM]; //接收数据的队列缓存
extern uint8 GPSDataQNUM; //当前的队列
extern uint8 GPSDataQWPTR; //当前队列中接收到的字符位置
/*********************************************************************************************************
** Function name: ZLG_GPS_Initial
**
** Descriptions: Initial GPS
**
** input parameters: None
** Returned value: None
**
** Used global variables: None
** Calling modules: None
**
** Created by: Yehaoben
** Created Date: 2005/06/02
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void GPSInit(void);
/*********************************************************************************************************
** Function name: GPS_RVC_HANDLE
**
** Descriptions: Revice data and save into GPSDataQ
**
** input parameters: uint8 :one data
**
** Returned value: None
**
** Used global variables: None
** Calling modules: None
**
** Created by: Yehaoben
** Created Date: 2005/06/02
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void GPS_RVC_HANDLE(uint8 i);
/*********************************************************************************************************
** Function name: StrTOUINT
**
** Descriptions: change string to 16 bits integer
**
** input parameters: * str :string pointer
** DBits :string length
** Returned value: uint16 :changed result
**
** Used global variables: None
** Calling modules: None
**
** Created by: Yehaoben
** Created Date: 2005/06/02
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern uint16 StrTOUINT(char * str,uint8 DBits);
/*********************************************************************************************************
** Function name: GPS_RVC_HANDLE
**
** Descriptions: Revice data and save into GPSDataQ
**
** input parameters: uint8 :one data
**
** Returned value: None
**
** Used global variables: None
** Calling modules: None
**
** Created by: Yehaoben
** Created Date: 2005/06/02
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void GPS_RVC_HANDLE(uint8);
/*********************************************************************************************************
** Function name: startchar
**
** Descriptions: check the string from head to end
**
** input parameters: * str :string pointer
** endch :end char
** Returned value: char * :return the string
**
** Used global variables: None
** Calling modules: None
**
** Created by: Yehaoben
** Created Date: 2005/06/02
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern char * startchar(char * str,char endch );
/*********************************************************************************************************
** Function name: GPSAnalyse
** Descriptions: 分析GPS接收到的数据,并且存储到全局变量里面
** input parameters: 无
** Returned value: None
** Used global variables: None
** Calling modules: None
** Created by: XieLuWei
** Created Date: 2007/07/24
**-------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
void GPSAnalyse( void );
#endif /* __GPS_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -