GONEC_ARTERY_Gnss/Inc/Gnss.h

65 lines
1.5 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.

//
// Created by cfif on 27.09.22.
//
#ifndef GNSSPRO04THREAD_H
#define GNSSPRO04THREAD_H
#include <Nmea0183Parser.h>
#include <GnssPro04Nmea.h>
#include <cmsis_os.h>
#include "ModemGnss.h"
#include "RtcIO.h"
#include "LoggerInterface.h"
typedef struct {
struct {
char data[256];
size_t len;
} rxBuffer;
tGnssPro04Nmea nmea;
tNmeaRmc currentRmc;
tNmeaRmc lastGoodRmc;
uint32_t GMTcorr_v;
tRtcIO *rtcIo;
bool flagSetOneGnss;
uint32_t lastRmcUpdate;
tLoggerInterface *logger;
osMutexId_t rmcAccess;
struct {
osThreadId_t id;
uint32_t stack[512];
StaticTask_t controlBlock;
osThreadAttr_t attr;
} thread;
} tGnss;
// Получение данных с GNSS о местоположении и времени
void Gnss_GetNavDataTracert (tGnss *env, tTracertNavData *location);
void Gnss_Init(tGnss *env, tSerialPortIO *gnssIo);
void Gnss_InitDevice(tGnss *env);
void Gnss_StartThread(tGnss *env);
void Gnss_GetTime(tGnss *env, uint32_t *timestamp);
// Получение данных с GNSS о местоположении
void Gnss_GetNavDataNmeaRmc (tGnss *env, tModemNavData *location);
// latitude and longitude are in degrees, minutes and fraction of minutes
char cConvertDecToMilliArcSecFromDegMin(int32_t deg, int32_t min, int32_t *mArcs, double *gradus);
uint32_t cConvertFrDeg(double frDeg, uint8_t latLonFlag);
void Gnss_GetNavDataMsdNmeaRmc(tGnss *env, tNavDataMsd *location);
#endif //GNSSPRO04THREAD_H