21 #ifndef COSA_MCP7940N_HH 22 #define COSA_MCP7940N_HH 85 } __attribute__((packed));
103 __attribute__((always_inline))
113 __attribute__((always_inline))
146 } __attribute__ ((packed));
164 __attribute__((always_inline))
174 __attribute__((always_inline))
203 const static uint8_t
RAM_MAX = RAM_END - RAM_START + 1;
209 #if !defined(BOARD_ATTINY) 288 int read(
void* regs, uint8_t size, uint8_t pos = 0);
298 int write(
void* regs, uint8_t size, uint8_t pos = 0);
306 virtual void on_interrupt(uint16_t arg = 0);
uint8_t month
01-12 Month.
IOStream & operator<<(IOStream &outs, MCP7940N::alarm_t &t)
uint8_t day
< Bitfield access.
uint8_t to_binary(uint8_t value)
uint8_t as_uint8
Unsigned byte access.
uint8_t month
01-12 Month.
uint8_t reserved2
Reserved - do not use.
int write(void *regs, uint8_t size, uint8_t pos=0)
static const uint8_t RAM_END
uint8_t seconds
00-59 Seconds.
uint8_t minutes
00-59 Minutes.
uint8_t minutes
00-59 Minutes.
bool get_time(time_t &now)
static const uint8_t RAM_START
uint8_t reserved1
Reserved - do not use.
Sec, Min, Hour, Day, Date, Month.
bool square_wave(bool flag)
uint8_t seconds
00-59 Seconds.
config_t(uint8_t value=0)
AlarmInterrupt m_alarm_irq
control_t(uint8_t value=0)
bool get_alarm(uint8_t nr, time_t &alarm, uint8_t &when)
alarm_t alarm1
Alarm 1 setting (time/configuration).
static const uint8_t RAM_MAX
uint8_t hours
00-23 Hours.
time_t clock
Current time.
uint8_t reserved
Reserved.
bool set_alarm(uint8_t nr, time_t &alarm, uint8_t when)
uint8_t as_uint8
Unsigned byte access.
uint8_t hours
00-23 Hours.
control_t control
Device control register.
int8_t calibration
Time calibration (in clock cycles).
Hours match (takes into accout 12/24 hour).
uint8_t as_uint8
< Day, alarm configuration and status.
uint8_t oscon
Oscillator Running Status.
uint8_t to_bcd(uint8_t value)
uint8_t vbaten
External Battery Enable.
alarm_t alarm0
Alarm 0 setting (time/configuration).
int read(void *regs, uint8_t size, uint8_t pos=0)
uint8_t reserved3
Reserved - do not use.
timestamp_t vcc_restored
Timestamp when Vcc restored.
config_t(uint8_t value=0)
timestamp_t vcc_failed
Timestamp when Vcc fails.
uint8_t vbat
Battey Used Status.
bool clear_alarm(uint8_t nr)
bool set_time(time_t &now)
MCP7940N(Board::ExternalInterruptPin pin=Board::EXT1)