stm32_ota/ABM开发板(DTU透传APP源码)/YcOS版本/APPV4.0/HARDWARE/LTE/EC20/ec20gnss.h
2024-12-17 20:03:43 +08:00

65 lines
2.0 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _EC20GNSS_H
#define _EC20GNSS_H
#include "ec20module.h"
#include "sysport.h"
#include "rtc.h"
#define IS_Number_PERIPH(PERIPH) (((PERIPH) >= 0x30) && \
((PERIPH) <= 0x39) )
/*****************************************
*自定义变量类型
****************************************/
typedef enum
{
ALREADY = 'A', //GNSS已经完成定位
UNALREADY = 'V' //GNSS未完成定位
}GNSSSTATUS_e ; //GNSS就绪状态
typedef enum
{
EAST = 'E', //东
SOUTH = 'S', //南
WEST = 'W', //西
NORTH = 'N' //北
}GNSSDIRECT_e ; //GNSS方向东南西北
typedef struct
{
char utcTime[10] ; //RMC语句中的UTC时间例“031347.00”表示03:13:47
GNSSSTATUS_e eGnssStatus ; //GNSS定位就绪状态
char latitude[12] ; //纬度值
GNSSDIRECT_e eLatitudeDirect ; //南纬/北纬
char longitude[13] ; //经度值
GNSSDIRECT_e eLongitudeDirect ; //西经/东经
char speed[6]; //速度
char angDirect[6] ; //角方向
char utcDate[7] ; //UTC日期。例如"090121"表示2021年1月9日
}NMEARMC_s ; //定义NMEA语句中RMC语句的数据结构体变量类型
/*****************************************
*ec20 GNSS 驱动内部使用常变量
****************************************/
extern NMEARMC_s sRMCData ; //NMEARMC_s结构体全局 用于存放NMEA语句中RMC语句的数据
/*****************************************
*内部函数声明
****************************************/
RunResult EC20_SendPDPCmd( uint8_t cmdNum, char *format,... ) ; // EC20通过串口发送net相关命令
/*****************************************
*对外接口函数声明
****************************************/
extern RunResult EC20GnssConfig(void) ;
extern RunResult EC20SelfOpenGnss(void) ;
extern RunResult EC20OpenGnss(void) ;
extern RunResult EC20CloseGnss(void) ;
extern RunResult EC20GnssQueryRMC(NMEARMC_s *psNmeaRMC ) ;
extern void RMCUtcToBJT(Calendar_u *puSetRTC, NMEARMC_s *psRMCData ) ; //将GNSS返回的RMC语句中的日期和时间转化为 Calendar_u共用体数据格式
#endif