Loom_DS3231 class

DS3231 RTC module.

Base classes

class LoomRTC
Abstract base class of RTC modules.

Protected variables

RTC_DS3231 rtc_inst
Underlying DS3231 manager instance.

CONSTRUCTORS / DESTRUCTOR

Loom_DS3231(LoomManager* manager, TimeZone timezone = TimeZone::PST, const bool use_local_time = false, const bool custom_time = false)
Constructor.
Loom_DS3231(LoomManager* manager, JsonArrayConst p)
Constructor that takes Json Array, extracts args and delegates to regular constructor.
~Loom_DS3231() defaulted
Destructor.

OPERATION

auto now() const -> DateTime override
Get DateTime of current time.
void set_alarm(DateTime time) override
Set an alarm to go off at the specified time.
void clear_alarms() override
Clear alarms.

Function documentation

Loom_DS3231::Loom_DS3231(LoomManager* manager, TimeZone timezone = TimeZone::PST, const bool use_local_time = false, const bool custom_time = false)

Constructor.

Parameters
manager
timezone in Set(TimeZone) | <11> | { 0("WAT"), 1("AT"), 2("ADT"), 3("AST"), 4("EDT"), 5("EST"), 6("CDT"), 7("CST"), 8("MDT"), 9("MST"), 10("PDT"), 11("PST"), 12("AKDT"), 13("AKST"), 14("HST"), 15("SST"), 16("GMT"), 17("BST"), 18("CET"), 19("EET"), 20("EEST"), 21("BRT"), 22("ZP4"), 23("ZP5"), 24("ZP6"), 25("ZP7"), 26("AWST"), 27("ACST"), 28("AEST")} | Which timezone device is in
use_local_time in Bool | <false> | {true, false} | True for local time, false for UTC time
custom_time in Bool | <false> | {true, false} | True for user input local time, false otherwise

Loom_DS3231::Loom_DS3231(LoomManager* manager, JsonArrayConst p)

Constructor that takes Json Array, extracts args and delegates to regular constructor.

Parameters
manager
in The array of constuctor args to expand

DateTime Loom_DS3231::now() const override

Get DateTime of current time.

Returns DateTime

void Loom_DS3231::set_alarm(DateTime time) override

Set an alarm to go off at the specified time.

Parameters
time in DateTime of time alarm should go off

bool Loom_DS3231::_begin() override protected

Begin auxiliary function that subclasses need to implement.

Returns True if begin worked without issue, false otherwise

bool Loom_DS3231::_initialized() override protected

Initialization auxiliary function that subclasses need to implement.

Returns True if RTC is initialized / did not lose power