feat: DS3231 RTC read/set with lost-power detection

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 19:55:47 +07:00
co-authored by Claude Opus 4.8
parent d042a94378
commit 2d52fcd851
3 changed files with 43 additions and 3 deletions
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include <Arduino.h>
struct RtcTime {
uint16_t year;
uint8_t month, day, hour, minute, second;
};
bool rtcBegin();
bool rtcLostPower();
RtcTime rtcNow();
void rtcSet(const RtcTime& t);
uint32_t rtcEpoch();