21 #ifndef COSA_DS1307_HH 22 #define COSA_DS1307_HH 91 } __attribute__((packed));
108 const static uint8_t
RAM_MAX = RAM_END - RAM_START + 1;
123 int read(
void* ram, uint8_t size =
sizeof(
time_t), uint8_t pos = 0);
133 int write(
void* ram, uint8_t size =
sizeof(
time_t), uint8_t pos = 0);
142 __attribute__((always_inline))
144 return (
read(&now) ==
sizeof(now));
154 __attribute__((always_inline))
156 return (
write(&now) ==
sizeof(now));
uint8_t rs
< Bitfield access.
uint8_t out
Output Control.
uint8_t reserved1
Reserved/1.
time_t clock
Time/Date in BCD.
bool get_time(time_t &now)
static const uint8_t RAM_START
static const uint8_t RAM_END
bool enable(Rate rs=RS_1_HZ)
static const uint8_t RAM_MAX
uint8_t as_uint8
Unsigned byte access.
int read(void *ram, uint8_t size=sizeof(time_t), uint8_t pos=0)
uint8_t sqwe
Square-Ware Enable.
uint8_t reserved2
Reserved/2.
bool set_time(time_t &now)
int write(void *ram, uint8_t size=sizeof(time_t), uint8_t pos=0)
control_t control
Timekeeper control register.