ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
esphome::ds3231::DS3231Component Class Referencefinal

Hub for a single DS3231 real-time clock. More...

#include <ds3231.h>

Inheritance diagram for esphome::ds3231::DS3231Component:
esphome::Component esphome::i2c::I2CDevice

Public Member Functions

void setup () override
 
void loop () override
 
void dump_config () override
 
void set_interrupt_pin (InternalGPIOPin *pin)
 
void set_square_wave_frequency (SquareWaveFrequency frequency)
 
void set_battery_backed_square_wave (bool enabled)
 
void set_output_32khz_config (bool enabled)
 
void set_aging_offset_config (int8_t offset)
 
void set_auto_clear_alarms (bool auto_clear)
 
void set_alarm_check_interval (uint32_t interval)
 
void set_monitor_alarms (bool monitor)
 
template<typename F >
void add_on_alarm_callback (F &&callback)
 Register a void(uint8_t alarm) callback that runs when an enabled alarm (1 or 2) matches.
 
 SUB_BINARY_SENSOR (alarm_1) SUB_BINARY_SENSOR(alarm_2) SUB_BINARY_SENSOR(oscillator_stopped) bool read_calendar(uint8_t *raw)
 Read the calendar registers into raw. Fails if the oscillator was stopped since the time was last set.
 
bool write_calendar (const uint8_t *raw)
 Write the calendar registers from raw and clear the oscillator-stop flag.
 
bool read_temperature (float &out)
 
void force_temperature_conversion ()
 
void set_alarm_1 (AlarmMode mode, uint8_t second, uint8_t minute, uint8_t hour, uint8_t day_of_month, uint8_t day_of_week, bool enabled)
 Program alarm 1. day_of_month is used in MONTHLY mode, day_of_week (1 = Sunday) in WEEKLY mode.
 
void set_alarm_2 (AlarmMode mode, uint8_t minute, uint8_t hour, uint8_t day_of_month, uint8_t day_of_week, bool enabled)
 Program alarm 2 (minute resolution, fires at second 00).
 
void enable_alarm (uint8_t alarm)
 Enable alarm. A match from while it was disabled is cleared first, so only the next one fires.
 
void disable_alarm (uint8_t alarm)
 
void clear_alarm (uint8_t alarm)
 Clear the alarm flag, which also releases the INT/SQW line.
 
bool is_alarm_triggered (uint8_t alarm)
 True while the alarm flag of alarm (1 or 2) is set on the chip.
 
void enable_square_wave (SquareWaveFrequency frequency)
 Switch INT/SQW to a square-wave output at frequency. Alarms then no longer drive the pin.
 
void disable_square_wave ()
 Switch INT/SQW back to the (active-low) alarm interrupt output.
 
void set_output_32khz (bool enabled)
 
void set_aging_offset (int8_t offset)
 Aging offset in LSB (about 0.1 ppm each at 25 degC); positive values slow the clock down.
 
- Public Member Functions inherited from esphome::Component
virtual float get_setup_priority () const
 priority of setup().
 
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
void call ()
 
virtual void on_shutdown ()
 
virtual void on_safe_shutdown ()
 
virtual bool teardown ()
 Called during teardown to allow component to gracefully finish operations.
 
virtual void on_powerdown ()
 Called last before a reboot or deep sleep to power down hardware.
 
uint8_t get_component_state () const
 
void reset_to_construction_state ()
 Reset this component back to the construction state to allow setup to run again.
 
bool is_in_loop_state () const
 Check if this component has completed setup and is in the loop state.
 
bool is_idle () const
 Check if this component is idle.
 
void mark_failed ()
 Mark this component as failed.
 
void mark_failed (const LogString *message)
 
bool ESPHOME_ALWAYS_INLINE setup_check (bool ok)
 Marks the component failed with message (default "Communication failed") unless ok; returns ok.
 
bool ESPHOME_ALWAYS_INLINE setup_check (bool ok, const LogString *message)
 
void disable_loop ()
 Disable this component's loop.
 
void enable_loop ()
 Enable this component's loop.
 
void enable_loop_soon_any_context ()
 Thread and ISR-safe version of enable_loop() that can be called from any context.
 
bool is_failed () const
 
bool is_ready () const
 
virtual bool can_proceed ()
 
bool status_has_warning () const
 
bool status_has_error () const
 
void status_set_warning ()
 
void status_set_warning (const char *message)
 
void status_set_warning (const LogString *message)
 
bool status_comm_result (bool ok)
 Clears the warning when ok, else sets it with message (default "Communication failed"); returns ok.
 
bool status_comm_result (bool ok, const LogString *message)
 
void status_set_error ()
 
void status_set_error (const LogString *message)
 
void status_clear_warning ()
 
void status_clear_error ()
 
 ESPDEPRECATED ("Use status_momentary_warning() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_warning(const char *name
 
void status_momentary_warning (uint32_t length=5000)
 Set warning status flag and clear it after length ms.
 
void status_momentary_warning (const LogString *message, uint32_t length=5000)
 
 ESPDEPRECATED ("Use status_momentary_error() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_error(const char *name
 
void status_momentary_error (uint32_t length=5000)
 Set error status flag and clear it after length ms.
 
void status_momentary_error (const LogString *message, uint32_t length=5000)
 
bool has_overridden_loop () const
 
const LogString * get_component_log_str () const ESPHOME_ALWAYS_INLINE
 Get the integration where this component was declared as a LogString for logging.
 
bool should_warn_of_blocking (uint32_t blocking_time, uint32_t &threshold_ms_out)
 
- Public Member Functions inherited from esphome::i2c::I2CDevice
 I2CDevice ()=default
 we use the C++ default constructor
 
void set_i2c_address (uint8_t address)
 We store the address of the device on the bus.
 
uint8_t get_i2c_address () const
 Returns the I2C address of the object.
 
void set_i2c_bus (I2CBus *bus)
 we store the pointer to the I2CBus to use
 
I2CRegister reg (uint8_t a_register)
 calls the I2CRegister constructor
 
I2CRegister16 reg16 (uint16_t a_register)
 calls the I2CRegister16 constructor
 
ErrorCode read (uint8_t *data, size_t len) const
 reads an array of bytes from the device using an I2CBus
 
ErrorCode read_register (uint8_t a_register, uint8_t *data, size_t len)
 reads an array of bytes from a specific register in the I²C device
 
ErrorCode read_register16 (uint16_t a_register, uint8_t *data, size_t len)
 reads an array of bytes from a specific register in the I²C device
 
ErrorCode write (const uint8_t *data, size_t len) const
 writes an array of bytes to a device using an I2CBus
 
ErrorCode write_read (const uint8_t *write_data, size_t write_len, uint8_t *read_data, size_t read_len) const
 writes an array of bytes to a device, then reads an array, as a single transaction
 
ErrorCode write_register (uint8_t a_register, const uint8_t *data, size_t len) const
 writes an array of bytes to a specific register in the I²C device
 
ErrorCode write_register16 (uint16_t a_register, const uint8_t *data, size_t len) const
 write an array of bytes to a specific register in the I²C device
 
bool write_registers (const I2CRegValue *table, size_t count) const
 Write each register and value of table in order, stopping at the first failure.
 
template<size_t N>
bool write_registers (const I2CRegValue(&table)[N]) const
 
bool check_chip_id (Component *component, uint8_t a_register, uint8_t expected, uint8_t mask=0xFF)
 Read the 8-bit ID at a_register and accept it when it matches expected in the bits set in mask.
 
bool read_bytes (uint8_t a_register, uint8_t *data, uint8_t len)
 Compat APIs All methods below have been added for compatibility reasons.
 
bool read_bytes_raw (uint8_t *data, uint8_t len) const
 
template<size_t N>
optional< std::array< uint8_t, N > > read_bytes (uint8_t a_register)
 
template<size_t N>
optional< std::array< uint8_t, N > > read_bytes_raw ()
 
bool read_bytes_16 (uint8_t a_register, uint16_t *data, uint8_t len)
 
bool read_byte (uint8_t a_register, uint8_t *data)
 
optional< uint8_t > read_byte (uint8_t a_register)
 
bool read_byte_16 (uint8_t a_register, uint16_t *data)
 
bool read_bytes_16_le (uint8_t a_register, uint16_t *data, uint8_t len)
 Read len 16-bit values stored least significant byte first; no conversion is compiled on little-endian hosts.
 
bool read_bytes_16_le (uint8_t a_register, int16_t *data, uint8_t len)
 
bool read_byte_16_le (uint8_t a_register, uint16_t *data)
 Read a 16-bit value stored least significant byte first.
 
bool write_bytes (uint8_t a_register, const uint8_t *data, uint8_t len) const
 
bool write_bytes (uint8_t a_register, const std::vector< uint8_t > &data) const
 
template<size_t N>
bool write_bytes (uint8_t a_register, const std::array< uint8_t, N > &data)
 
bool write_bytes_16 (uint8_t a_register, const uint16_t *data, uint8_t len) const
 
bool write_byte (uint8_t a_register, uint8_t data) const
 
bool write_byte_16 (uint8_t a_register, uint16_t data) const
 
bool write_byte_16_le (uint8_t a_register, uint16_t data) const
 Write a 16-bit value least significant byte first.
 
bool update_register (uint8_t a_register, uint8_t mask, uint8_t value)
 Read a register, replace the bits in mask with those of value and write it back.
 

Static Public Attributes

static constexpr size_t CALENDAR_LEN = 7
 Seconds through year, the 7-byte BCD calendar the time platform decodes with time::DS_BCD_CALENDAR.
 

Protected Member Functions

bool read_control_status_ ()
 Read the control and status registers into the cached copies. Sets the warning flag on failure.
 
bool update_control_ (uint8_t mask, uint8_t value)
 Replace the bits in mask of the control register with value, on the chip and in the cache.
 
bool write_status_ (uint8_t clear)
 Write the status register, clearing the flags in clear (writing 1 to a flag leaves it unchanged).
 
bool write_aging_offset_ (int8_t offset)
 
bool clear_alarm_flag_ (uint8_t alarm)
 Clear the flag of alarm and report it off. Returns false (state unchanged) if that fails.
 
void set_alarm_enabled_ (uint8_t alarm, bool enabled)
 
void write_alarm_ (uint8_t alarm, const uint8_t *regs, size_t len, bool enabled)
 Write the alarm registers, clear the stale flag and set the interrupt enable.
 
void check_alarms_ ()
 Read the flags, fire triggers and update the binary sensors.
 
void publish_alarm_state_ (uint8_t alarm, bool state)
 
void publish_oscillator_stopped_ ()
 
- Protected Member Functions inherited from esphome::Component
friend void::setup ()
 
friend void::original_setup ()
 
void set_component_source_ (uint8_t index)
 Set where this component was loaded from for some debug messages.
 
virtual void call_setup ()
 
void call_dump_config_ ()
 
void enable_loop_slow_path_ ()
 
void set_component_state_ (uint8_t state)
 Helper to set component state (clears state bits and sets new state)
 
bool set_status_flag_ (uint8_t flag)
 Helper to set a status LED flag on both this component and the app.
 
bool set_error_flag_ (const LogString *message)
 Set the error flag and log it; true when it was not set before.
 
void set_interval (const char *name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a const char* name.
 
void set_interval (uint32_t id, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a numeric ID (zero heap allocation).
 
void set_interval (InternalSchedulerID id, uint32_t interval, std::function< void()> &&f)
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const char *name)
 Cancel an interval function.
 
bool cancel_interval (uint32_t id)
 
bool cancel_interval (InternalSchedulerID id)
 
void set_timeout (const char *name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a const char* name.
 
void set_timeout (uint32_t id, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a numeric ID (zero heap allocation).
 
void set_timeout (InternalSchedulerID id, uint32_t timeout, std::function< void()> &&f)
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const char *name)
 Cancel a timeout function.
 
bool cancel_timeout (uint32_t id)
 
bool cancel_timeout (InternalSchedulerID id)
 
void defer (const char *name, std::function< void()> &&f)
 Defer a callback to the next loop() call with a const char* name.
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call.
 
void defer (uint32_t id, std::function< void()> &&f)
 Defer a callback with a numeric ID (zero heap allocation)
 
bool cancel_defer (const char *name)
 Cancel a defer callback using the specified name, name must not be empty.
 
bool cancel_defer (uint32_t id)
 
void status_clear_warning_slow_path_ ()
 
void status_clear_error_slow_path_ ()
 

Static Protected Member Functions

static void interrupt_handler (DS3231Component *arg)
 

Protected Attributes

InternalGPIOPin * interrupt_pin_ {nullptr}
 
LazyCallbackManager< void(uint8_t)> alarm_callback_
 
uint32_t alarm_check_interval_ {1000}
 
uint8_t control_reg_ {0}
 
uint8_t status_reg_ {0}
 
int8_t aging_offset_ {0}
 
SquareWaveFrequency square_wave_frequency_ {SQUARE_WAVE_1HZ}
 
int8_t battery_backed_square_wave_ {-1}
 -1: leave the chip as it is, 0: off, 1: on.
 
int8_t output_32khz_ {-1}
 
bool square_wave_configured_ {false}
 
bool aging_offset_configured_ {false}
 
bool auto_clear_alarms_ {true}
 
bool monitor_alarms_ {false}
 
bool alarm_active_ [2] {false, false}
 Set while an alarm flag has been reported, so a latched flag fires its trigger only once.
 
- Protected Attributes inherited from esphome::Component
uint8_t component_source_index_ {0}
 Index into component source PROGMEM lookup table (0 = not set)
 
uint8_t warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_CS}
 Warn threshold in centiseconds (max 2550ms)
 
uint8_t component_state_ {0x00}
 State of this component - each bit has a purpose: Bits 0-2: Component state (0x00=CONSTRUCTION, 0x01=SETUP, 0x02=LOOP, 0x03=FAILED, 0x04=LOOP_DONE) Bit 3: STATUS_LED_WARNING Bit 4: STATUS_LED_ERROR Bit 5: Has overridden loop() (set at registration time) Bits 6-7: Unused - reserved for future expansion.
 
volatile bool pending_enable_loop_ {false}
 ISR-safe flag for enable_loop_soon_any_context.
 
ComponentRuntimeStats runtime_stats_
 
- Protected Attributes inherited from esphome::i2c::I2CDevice
I2CBus * bus_ {nullptr}
 pointer to I2CBus instance
 
uint8_t address_ {0x00}
 store the address of the device on the bus
 

Static Protected Attributes

static constexpr uint8_t CONTROL_A1IE = 0x01
 
static constexpr uint8_t CONTROL_A2IE = 0x02
 
static constexpr uint8_t CONTROL_INTCN = 0x04
 
static constexpr uint8_t CONTROL_RS_MASK = 0x18
 
static constexpr uint8_t CONTROL_RS_SHIFT = 3
 
static constexpr uint8_t CONTROL_CONV = 0x20
 
static constexpr uint8_t CONTROL_BBSQW = 0x40
 
static constexpr uint8_t CONTROL_EOSC = 0x80
 
static constexpr uint8_t STATUS_A1F = 0x01
 
static constexpr uint8_t STATUS_A2F = 0x02
 
static constexpr uint8_t STATUS_BSY = 0x04
 
static constexpr uint8_t STATUS_EN32KHZ = 0x08
 
static constexpr uint8_t STATUS_OSF = 0x80
 
static constexpr uint8_t STATUS_FLAGS = STATUS_A1F | STATUS_A2F | STATUS_OSF
 
static constexpr uint32_t ALARM_PULSE_TIMEOUT_ID = 0
 Scheduler ids: one pulse timer per alarm (id + alarm - 1).
 

Additional Inherited Members

- Data Fields inherited from esphome::Component
uint32_t length = 5000)
 

Detailed Description

Hub for a single DS3231 real-time clock.

Owns all register access; the platforms talk to the chip through this class.

Definition at line 35 of file ds3231.h.

Member Function Documentation

◆ add_on_alarm_callback()

template<typename F >
void esphome::ds3231::DS3231Component::add_on_alarm_callback ( F && callback)
inline

Register a void(uint8_t alarm) callback that runs when an enabled alarm (1 or 2) matches.

Definition at line 61 of file ds3231.h.

◆ check_alarms_()

void esphome::ds3231::DS3231Component::check_alarms_ ( )
protected

Read the flags, fire triggers and update the binary sensors.

Definition at line 349 of file ds3231.cpp.

◆ clear_alarm()

void esphome::ds3231::DS3231Component::clear_alarm ( uint8_t alarm)

Clear the alarm flag, which also releases the INT/SQW line.

Definition at line 322 of file ds3231.cpp.

◆ clear_alarm_flag_()

bool esphome::ds3231::DS3231Component::clear_alarm_flag_ ( uint8_t alarm)
protected

Clear the flag of alarm and report it off. Returns false (state unchanged) if that fails.

Definition at line 324 of file ds3231.cpp.

◆ disable_alarm()

void esphome::ds3231::DS3231Component::disable_alarm ( uint8_t alarm)
inline

Definition at line 90 of file ds3231.h.

◆ disable_square_wave()

void esphome::ds3231::DS3231Component::disable_square_wave ( )

Switch INT/SQW back to the (active-low) alarm interrupt output.

Definition at line 422 of file ds3231.cpp.

◆ dump_config()

void esphome::ds3231::DS3231Component::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 116 of file ds3231.cpp.

◆ enable_alarm()

void esphome::ds3231::DS3231Component::enable_alarm ( uint8_t alarm)

Enable alarm. A match from while it was disabled is cleared first, so only the next one fires.

Definition at line 315 of file ds3231.cpp.

◆ enable_square_wave()

void esphome::ds3231::DS3231Component::enable_square_wave ( SquareWaveFrequency frequency)

Switch INT/SQW to a square-wave output at frequency. Alarms then no longer drive the pin.

Definition at line 410 of file ds3231.cpp.

◆ force_temperature_conversion()

void esphome::ds3231::DS3231Component::force_temperature_conversion ( )

Definition at line 201 of file ds3231.cpp.

◆ interrupt_handler()

void IRAM_ATTR esphome::ds3231::DS3231Component::interrupt_handler ( DS3231Component * arg)
staticprotected

Definition at line 45 of file ds3231.cpp.

◆ is_alarm_triggered()

bool esphome::ds3231::DS3231Component::is_alarm_triggered ( uint8_t alarm)

True while the alarm flag of alarm (1 or 2) is set on the chip.

Definition at line 343 of file ds3231.cpp.

◆ loop()

void esphome::ds3231::DS3231Component::loop ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 110 of file ds3231.cpp.

◆ publish_alarm_state_()

void esphome::ds3231::DS3231Component::publish_alarm_state_ ( uint8_t alarm,
bool state )
protected

Definition at line 394 of file ds3231.cpp.

◆ publish_oscillator_stopped_()

void esphome::ds3231::DS3231Component::publish_oscillator_stopped_ ( )
protected

Definition at line 400 of file ds3231.cpp.

◆ read_control_status_()

bool esphome::ds3231::DS3231Component::read_control_status_ ( )
protected

Read the control and status registers into the cached copies. Sets the warning flag on failure.

Definition at line 453 of file ds3231.cpp.

◆ read_temperature()

bool esphome::ds3231::DS3231Component::read_temperature ( float & out)

Definition at line 190 of file ds3231.cpp.

◆ set_aging_offset()

void esphome::ds3231::DS3231Component::set_aging_offset ( int8_t offset)

Aging offset in LSB (about 0.1 ppm each at 25 degC); positive values slow the clock down.

Definition at line 439 of file ds3231.cpp.

◆ set_aging_offset_config()

void esphome::ds3231::DS3231Component::set_aging_offset_config ( int8_t offset)
inline

Definition at line 52 of file ds3231.h.

◆ set_alarm_1()

void esphome::ds3231::DS3231Component::set_alarm_1 ( AlarmMode mode,
uint8_t second,
uint8_t minute,
uint8_t hour,
uint8_t day_of_month,
uint8_t day_of_week,
bool enabled )

Program alarm 1. day_of_month is used in MONTHLY mode, day_of_week (1 = Sunday) in WEEKLY mode.

Definition at line 219 of file ds3231.cpp.

◆ set_alarm_2()

void esphome::ds3231::DS3231Component::set_alarm_2 ( AlarmMode mode,
uint8_t minute,
uint8_t hour,
uint8_t day_of_month,
uint8_t day_of_week,
bool enabled )

Program alarm 2 (minute resolution, fires at second 00).

Definition at line 254 of file ds3231.cpp.

◆ set_alarm_check_interval()

void esphome::ds3231::DS3231Component::set_alarm_check_interval ( uint32_t interval)
inline

Definition at line 57 of file ds3231.h.

◆ set_alarm_enabled_()

void esphome::ds3231::DS3231Component::set_alarm_enabled_ ( uint8_t alarm,
bool enabled )
protected

Definition at line 299 of file ds3231.cpp.

◆ set_auto_clear_alarms()

void esphome::ds3231::DS3231Component::set_auto_clear_alarms ( bool auto_clear)
inline

Definition at line 56 of file ds3231.h.

◆ set_battery_backed_square_wave()

void esphome::ds3231::DS3231Component::set_battery_backed_square_wave ( bool enabled)
inline

Definition at line 50 of file ds3231.h.

◆ set_interrupt_pin()

void esphome::ds3231::DS3231Component::set_interrupt_pin ( InternalGPIOPin * pin)
inline

Definition at line 45 of file ds3231.h.

◆ set_monitor_alarms()

void esphome::ds3231::DS3231Component::set_monitor_alarms ( bool monitor)
inline

Definition at line 58 of file ds3231.h.

◆ set_output_32khz()

void esphome::ds3231::DS3231Component::set_output_32khz ( bool enabled)

Definition at line 430 of file ds3231.cpp.

◆ set_output_32khz_config()

void esphome::ds3231::DS3231Component::set_output_32khz_config ( bool enabled)
inline

Definition at line 51 of file ds3231.h.

◆ set_square_wave_frequency()

void esphome::ds3231::DS3231Component::set_square_wave_frequency ( SquareWaveFrequency frequency)
inline

Definition at line 46 of file ds3231.h.

◆ setup()

void esphome::ds3231::DS3231Component::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 47 of file ds3231.cpp.

◆ SUB_BINARY_SENSOR()

esphome::ds3231::DS3231Component::SUB_BINARY_SENSOR ( alarm_1 )

Read the calendar registers into raw. Fails if the oscillator was stopped since the time was last set.

◆ update_control_()

bool esphome::ds3231::DS3231Component::update_control_ ( uint8_t mask,
uint8_t value )
protected

Replace the bits in mask of the control register with value, on the chip and in the cache.

Definition at line 462 of file ds3231.cpp.

◆ write_aging_offset_()

bool esphome::ds3231::DS3231Component::write_aging_offset_ ( int8_t offset)
protected

Definition at line 478 of file ds3231.cpp.

◆ write_alarm_()

void esphome::ds3231::DS3231Component::write_alarm_ ( uint8_t alarm,
const uint8_t * regs,
size_t len,
bool enabled )
protected

Write the alarm registers, clear the stale flag and set the interrupt enable.

Definition at line 285 of file ds3231.cpp.

◆ write_calendar()

bool esphome::ds3231::DS3231Component::write_calendar ( const uint8_t * raw)

Write the calendar registers from raw and clear the oscillator-stop flag.

Definition at line 169 of file ds3231.cpp.

◆ write_status_()

bool esphome::ds3231::DS3231Component::write_status_ ( uint8_t clear)
protected

Write the status register, clearing the flags in clear (writing 1 to a flag leaves it unchanged).

Definition at line 471 of file ds3231.cpp.

Field Documentation

◆ aging_offset_

int8_t esphome::ds3231::DS3231Component::aging_offset_ {0}
protected

Definition at line 150 of file ds3231.h.

◆ aging_offset_configured_

bool esphome::ds3231::DS3231Component::aging_offset_configured_ {false}
protected

Definition at line 156 of file ds3231.h.

◆ alarm_active_

bool esphome::ds3231::DS3231Component::alarm_active_[2] {false, false}
protected

Set while an alarm flag has been reported, so a latched flag fires its trigger only once.

Definition at line 160 of file ds3231.h.

◆ alarm_callback_

LazyCallbackManager<void(uint8_t)> esphome::ds3231::DS3231Component::alarm_callback_
protected

Definition at line 145 of file ds3231.h.

◆ alarm_check_interval_

uint32_t esphome::ds3231::DS3231Component::alarm_check_interval_ {1000}
protected

Definition at line 147 of file ds3231.h.

◆ ALARM_PULSE_TIMEOUT_ID

uint32_t esphome::ds3231::DS3231Component::ALARM_PULSE_TIMEOUT_ID = 0
staticconstexprprotected

Scheduler ids: one pulse timer per alarm (id + alarm - 1).

Definition at line 123 of file ds3231.h.

◆ auto_clear_alarms_

bool esphome::ds3231::DS3231Component::auto_clear_alarms_ {true}
protected

Definition at line 157 of file ds3231.h.

◆ battery_backed_square_wave_

int8_t esphome::ds3231::DS3231Component::battery_backed_square_wave_ {-1}
protected

-1: leave the chip as it is, 0: off, 1: on.

Definition at line 153 of file ds3231.h.

◆ CALENDAR_LEN

size_t esphome::ds3231::DS3231Component::CALENDAR_LEN = 7
staticconstexpr

Seconds through year, the 7-byte BCD calendar the time platform decodes with time::DS_BCD_CALENDAR.

Definition at line 38 of file ds3231.h.

◆ CONTROL_A1IE

uint8_t esphome::ds3231::DS3231Component::CONTROL_A1IE = 0x01
staticconstexprprotected

Definition at line 106 of file ds3231.h.

◆ CONTROL_A2IE

uint8_t esphome::ds3231::DS3231Component::CONTROL_A2IE = 0x02
staticconstexprprotected

Definition at line 107 of file ds3231.h.

◆ CONTROL_BBSQW

uint8_t esphome::ds3231::DS3231Component::CONTROL_BBSQW = 0x40
staticconstexprprotected

Definition at line 112 of file ds3231.h.

◆ CONTROL_CONV

uint8_t esphome::ds3231::DS3231Component::CONTROL_CONV = 0x20
staticconstexprprotected

Definition at line 111 of file ds3231.h.

◆ CONTROL_EOSC

uint8_t esphome::ds3231::DS3231Component::CONTROL_EOSC = 0x80
staticconstexprprotected

Definition at line 113 of file ds3231.h.

◆ CONTROL_INTCN

uint8_t esphome::ds3231::DS3231Component::CONTROL_INTCN = 0x04
staticconstexprprotected

Definition at line 108 of file ds3231.h.

◆ control_reg_

uint8_t esphome::ds3231::DS3231Component::control_reg_ {0}
protected

Definition at line 148 of file ds3231.h.

◆ CONTROL_RS_MASK

uint8_t esphome::ds3231::DS3231Component::CONTROL_RS_MASK = 0x18
staticconstexprprotected

Definition at line 109 of file ds3231.h.

◆ CONTROL_RS_SHIFT

uint8_t esphome::ds3231::DS3231Component::CONTROL_RS_SHIFT = 3
staticconstexprprotected

Definition at line 110 of file ds3231.h.

◆ interrupt_pin_

InternalGPIOPin* esphome::ds3231::DS3231Component::interrupt_pin_ {nullptr}
protected

Definition at line 144 of file ds3231.h.

◆ monitor_alarms_

bool esphome::ds3231::DS3231Component::monitor_alarms_ {false}
protected

Definition at line 158 of file ds3231.h.

◆ output_32khz_

int8_t esphome::ds3231::DS3231Component::output_32khz_ {-1}
protected

Definition at line 154 of file ds3231.h.

◆ square_wave_configured_

bool esphome::ds3231::DS3231Component::square_wave_configured_ {false}
protected

Definition at line 155 of file ds3231.h.

◆ square_wave_frequency_

SquareWaveFrequency esphome::ds3231::DS3231Component::square_wave_frequency_ {SQUARE_WAVE_1HZ}
protected

Definition at line 151 of file ds3231.h.

◆ STATUS_A1F

uint8_t esphome::ds3231::DS3231Component::STATUS_A1F = 0x01
staticconstexprprotected

Definition at line 115 of file ds3231.h.

◆ STATUS_A2F

uint8_t esphome::ds3231::DS3231Component::STATUS_A2F = 0x02
staticconstexprprotected

Definition at line 116 of file ds3231.h.

◆ STATUS_BSY

uint8_t esphome::ds3231::DS3231Component::STATUS_BSY = 0x04
staticconstexprprotected

Definition at line 117 of file ds3231.h.

◆ STATUS_EN32KHZ

uint8_t esphome::ds3231::DS3231Component::STATUS_EN32KHZ = 0x08
staticconstexprprotected

Definition at line 118 of file ds3231.h.

◆ STATUS_FLAGS

uint8_t esphome::ds3231::DS3231Component::STATUS_FLAGS = STATUS_A1F | STATUS_A2F | STATUS_OSF
staticconstexprprotected

Definition at line 120 of file ds3231.h.

◆ STATUS_OSF

uint8_t esphome::ds3231::DS3231Component::STATUS_OSF = 0x80
staticconstexprprotected

Definition at line 119 of file ds3231.h.

◆ status_reg_

uint8_t esphome::ds3231::DS3231Component::status_reg_ {0}
protected

Definition at line 149 of file ds3231.h.


The documentation for this class was generated from the following files: