2018-10-21 19:00:20 +02:00
|
|
|
#ifndef _GPSREAD_H
|
|
|
|
#define _GPSREAD_H
|
2018-07-15 14:28:05 +02:00
|
|
|
|
2018-09-20 17:33:52 +02:00
|
|
|
#include <TinyGPS++.h> // library for parsing NMEA data
|
2019-02-21 23:17:01 +01:00
|
|
|
#include <RtcDateTime.h>
|
2019-02-25 20:22:03 +01:00
|
|
|
#include "timekeeper.h"
|
2018-07-17 13:51:41 +02:00
|
|
|
|
2018-10-20 09:58:53 +02:00
|
|
|
#ifdef GPS_I2C // Needed for reading from I2C Bus
|
2018-09-20 17:33:52 +02:00
|
|
|
#include <Wire.h>
|
|
|
|
#endif
|
|
|
|
|
2019-04-14 14:35:07 +02:00
|
|
|
#define NMEA_FRAME_SIZE 82 // NEMA has a maxium of 82 bytes per record
|
2019-02-27 00:52:27 +01:00
|
|
|
#define NMEA_BUFFERTIME 50 // 50ms safety time regardless
|
|
|
|
|
2018-09-20 17:33:52 +02:00
|
|
|
extern TinyGPSPlus gps; // Make TinyGPS++ instance globally availabe
|
|
|
|
extern gpsStatus_t
|
|
|
|
gps_status; // Make struct for storing gps data globally available
|
2018-10-03 00:25:05 +02:00
|
|
|
extern TaskHandle_t GpsTask;
|
2018-07-17 11:53:43 +02:00
|
|
|
|
2018-11-25 16:05:30 +01:00
|
|
|
int gps_init(void);
|
2019-07-28 23:51:24 +02:00
|
|
|
void IRAM_ATTR gps_storetime(gpsStatus_t *gps_store);
|
|
|
|
void gps_storelocation(gpsStatus_t *gps_store);
|
2018-07-15 14:28:05 +02:00
|
|
|
void gps_loop(void *pvParameters);
|
2019-08-03 14:01:25 +02:00
|
|
|
time_t fetch_gpsTime(gpsStatus_t value, uint16_t *msec);
|
2019-02-09 13:02:38 +01:00
|
|
|
int gps_config();
|
2018-07-15 14:28:05 +02:00
|
|
|
|
|
|
|
#endif
|