/ firmware / src / services / rtc.h
rtc.h
 1  #pragma once
 2  
 3  #include <stdint.h>
 4  
 5  struct RTCSnapshot {
 6    bool valid;
 7    char iso8601[32];
 8    float temperature_celsius;
 9  };
10  
11  namespace services::rtc {
12  bool initialize();
13  bool isValid();
14  bool setEpoch(uint32_t epoch);
15  uint32_t accessEpoch();
16  bool accessSnapshot(RTCSnapshot *snapshot);
17  #ifdef PIO_UNIT_TESTING
18  void test();
19  #endif
20  }