21 #ifndef COSA_DS1302_HH 22 #define COSA_DS1302_HH 83 uint8_t
read(uint8_t addr);
91 void write(uint8_t addr, uint8_t data);
98 __attribute__((always_inline))
120 __attribute__((always_inline))
132 __attribute__((always_inline))
143 void read_ram(
void* buf,
size_t size);
156 static const uint8_t
WP = 0x07;
165 } __attribute__((packed));
186 void write(uint8_t data);
uint8_t read_ram(uint8_t addr)
static const uint8_t RTC_START
Read/write bit in write mode.
void write(uint8_t addr, uint8_t data)
void set_time(time_t &now)
RTC register burst transfer.
OutputPin m_cs
Chip select, asserted high.
void write_protect(bool flag)
static const size_t RAM_MAX
Read/write bit in read mode.
DS1302(Board::DigitalPin cs=Board::D4, Board::DigitalPin sda=Board::D3, Board::DigitalPin clk=Board::D2)
IOPin m_sda
Serial data, bidirectional.
void get_time(time_t &now)
static const uint8_t RAM_END
static const uint8_t RAM_START
OutputPin m_clk
Clock for synchronized data.
void write_ram(uint8_t addr, uint8_t data)