6 #ifndef ACE_TIME_DS3231_CLOCK_H
7 #define ACE_TIME_DS3231_CLOCK_H
11 #include "../hw/DS3231.h"
12 #include "../hw/HardwareDateTime.h"
23 template<
typename T_WIREI>
28 mDS3231(wireInterface)
36 mDS3231.readDateTime(&hardwareDateTime);
37 return toDateTime(hardwareDateTime).toEpochSeconds();
40 void setNow(acetime_t epochSeconds)
override {
43 LocalDateTime now = LocalDateTime::forEpochSeconds(epochSeconds);
44 mDS3231.setDateTime(toHardwareDateTime(now));
53 return LocalDateTime::forComponents(
66 dt.day(), dt.hour(), dt.minute(), dt.second(), dt.dayOfWeek()};
70 const hw::DS3231<T_WIREI> mDS3231;