ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
bm8563.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome::bm8563 {
7
8class BM8563 final : public time::RealTimeClock, public i2c::I2CDevice {
9 public:
10 void setup() override;
11 void update() override;
12 void dump_config() override;
13
14 void write_time();
15 void read_time();
16 void start_timer(uint32_t duration_s);
17
18 private:
19 void get_time_(ESPTime &time);
20 void get_date_(ESPTime &time);
21
22 void set_time_(const ESPTime &time);
23 void set_date_(const ESPTime &time);
24
25 void set_timer_irq_(uint32_t duration_s);
26 void clear_irq_();
27 void disable_irq_();
28
29 void write_byte_(uint8_t reg, uint8_t value);
30 void write_register_(uint8_t reg, const uint8_t *data, size_t len);
31 optional<uint8_t> read_register_(uint8_t reg);
32
33 uint8_t bcd2_to_byte_(uint8_t value);
34 uint8_t byte_to_bcd2_(uint8_t value);
35};
36
37} // namespace esphome::bm8563
void update() override
Definition bm8563.cpp:29
void dump_config() override
Definition bm8563.cpp:31
void start_timer(uint32_t duration_s)
Definition bm8563.cpp:36
void setup() override
Definition bm8563.cpp:22
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
I2CRegister reg(uint8_t a_register)
calls the I2CRegister constructor
Definition i2c.h:152
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock.
const void size_t len
Definition hal.h:68
static void uint32_t
A more user-friendly version of struct tm from time.h.
Definition time.h:23