28 int count =
twi.
read(regs, size);
37 int count =
twi.
write(pos, regs, size);
45 uint8_t pos = offsetof(
rtcc_t,clock);
46 if (
read(&now,
sizeof(now), pos) !=
sizeof(now))
return (
false);
55 uint8_t temp = now.
day;
67 uint8_t temp = now.
day;
71 uint8_t pos = offsetof(
rtcc_t,clock);
72 int res =
write(&now,
sizeof(now), pos);
73 return (res ==
sizeof(now));
80 uint8_t pos = offsetof(
rtcc_t,alarm);
82 if (res !=
sizeof(
alarm_t))
return (
false);
94 uint8_t pos = offsetof(
rtcc_t,cs2);
96 int res =
write(&cs2,
sizeof(cs2), pos);
97 if (res !=
sizeof(cs2))
return (
false);
101 pos = offsetof(
rtcc_t,alarm);
103 return (res ==
sizeof(
alarm_t));
111 uint8_t pos = offsetof(
rtcc_t,cs2);
112 int res =
read(&cs2,
sizeof(cs2), pos);
113 if (res !=
sizeof(cs2))
return (
false);
122 uint8_t pos = offsetof(
rtcc_t,cs2);
123 int res =
write(&cs2,
sizeof(cs2), pos);
124 if (res !=
sizeof(cs2))
return (
false);
126 pos = offsetof(
rtcc_t,alarm);
129 return (res ==
sizeof(alarm));
IOStream & bcd(IOStream &outs)
uint8_t minutes
00-59 Minutes.
int read(void *regs, uint8_t size, uint8_t pos=0)
int write(void *regs, uint8_t size, uint8_t pos=0)
uint8_t hours
00-23 Hours (BCD).
IOStream & operator<<(IOStream &cout, PCF8563::alarm_t &alarm)
uint8_t month
01-12 Month.
bool set_alarm(alarm_t &alarm)
uint8_t AIE
Alarm interrupt enable.
bool set_time(time_t &now)
static const uint8_t DISABLE
uint8_t date
01-31 Date (BCD).
bool get_alarm(alarm_t &alarm)
int read(void *buf, size_t size)
uint8_t seconds
00-59 Seconds.
int write(void *buf, size_t size)
void acquire(TWI::Driver *dev)
uint8_t hours
00-23 Hours.
bool get_time(time_t &now)
uint8_t minutes
00-59 Minutes (BCD).
uint8_t day
00-06 Day (BCD).