ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
real_time_clock.h File Reference

Go to the source code of this file.

Data Structures

class  esphome::time::RealTimeClock
 The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock. More...
 
struct  esphome::time::BcdCalendarLayout
 Layout of a 7-byte BCD calendar: second, minute, hour, weekday and day of the month in either order, month and year since 2000. More...
 

Namespaces

namespace  esphome
 
namespace  esphome::time
 

Enumerations

enum class  esphome::time::BcdWeekday : uint8_t { esphome::time::ONE_HOT , esphome::time::FROM_1 , esphome::time::FROM_0 }
 How the weekday byte of a BCD calendar names the day, Sunday first. More...
 

Functions

template<BcdCalendarLayout LAYOUT>
 esphome::time::__attribute__ ((noinline)) ESPTime decode_bcd_calendar(const uint8_t *raw)
 Decode the 7-byte BCD calendar at raw in the given layout and fill in the UTC timestamp.
 
template<BcdCalendarLayout LAYOUT>
 esphome::time::__attribute__ ((noinline)) void encode_bcd_calendar(const ESPTime &time
 Encode time into the 7-byte BCD calendar at raw in the given layout, always in 24-hour mode.
 
 esphome::time::for (size_t i=0;i< 7;i++) raw[i]
 
if esphome::time::constexpr (LAYOUT.weekday==BcdWeekday::ONE_HOT)
 

Variables

constexpr BcdCalendarLayout esphome::time::EPSON_BCD_CALENDAR {.weekday = BcdWeekday::ONE_HOT}
 Epson RX8025T, RX8111, RX8130.
 
constexpr BcdCalendarLayout esphome::time::DS_BCD_CALENDAR
 DS1307, DS3231.
 
constexpr BcdCalendarLayout esphome::time::PCF_BCD_CALENDAR {.weekday = BcdWeekday::FROM_0, .weekday_before_day = false}
 PCF8563, PCF85063, BM8563.
 
uint8_t * esphome::time::raw
 
 esphome::time::value [LAYOUT.day_index()] = time.day_of_month