2019-01-20 22:38:53 +01:00
|
|
|
#ifndef _RTCTIME_H
|
|
|
|
#define _RTCTIME_H
|
2019-01-19 17:53:21 +01:00
|
|
|
|
|
|
|
#include "globals.h"
|
|
|
|
#include <Wire.h> // must be included here so that Arduino library object file references work
|
|
|
|
#include <RtcDS3231.h>
|
|
|
|
|
2019-01-21 16:16:39 +01:00
|
|
|
#ifdef HAS_GPS
|
|
|
|
#include "gpsread.h"
|
|
|
|
#endif
|
|
|
|
|
2019-01-25 22:49:26 +01:00
|
|
|
extern RtcDS3231<TwoWire> Rtc; // make RTC instance globally available
|
|
|
|
|
2019-02-07 23:05:26 +01:00
|
|
|
extern TaskHandle_t ClockTask;
|
|
|
|
extern hw_timer_t *clockCycle;
|
2019-02-14 23:01:20 +01:00
|
|
|
extern bool volatile TimePulseTick;
|
2019-02-07 23:05:26 +01:00
|
|
|
|
2019-01-19 17:53:21 +01:00
|
|
|
int rtc_init(void);
|
2019-01-29 22:54:16 +01:00
|
|
|
int set_rtctime(uint32_t t);
|
2019-02-02 09:15:31 +01:00
|
|
|
int set_rtctime(time_t t);
|
2019-01-20 22:38:53 +01:00
|
|
|
void sync_rtctime(void);
|
|
|
|
time_t get_rtctime(void);
|
|
|
|
float get_rtctemp(void);
|
2019-02-07 23:05:26 +01:00
|
|
|
void IRAM_ATTR CLOCKIRQ();
|
2019-02-09 14:21:09 +01:00
|
|
|
int timepulse_init(uint32_t pps_freq);
|
|
|
|
void timepulse_start();
|
2019-02-14 23:01:20 +01:00
|
|
|
void sync_clock(void);
|
2019-01-19 17:53:21 +01:00
|
|
|
|
2019-01-20 22:38:53 +01:00
|
|
|
#endif // _RTCTIME_H
|