COSA
An Object-Oriented Platform for Arduino Programming
|
#include <PCF8563.hh>
Classes | |
struct | alarm_t |
union | clock_control_t |
union | control_status_1_t |
union | control_status_2_t |
struct | rtcc_t |
union | timer_control_t |
Public Member Functions | |
PCF8563 () | |
bool | get_time (time_t &now) |
bool | set_time (time_t &now) |
bool | set_alarm (alarm_t &alarm) |
bool | get_alarm (alarm_t &alarm) |
bool | clear_alarm () |
bool | pending_alarm () |
Protected Types | |
enum | { FD_32_768_KHZ, FD_1_024_KHZ, FD_32_HZ, FD_1_HZ } |
enum | { TD_4_096_KHZ, TD_64_HZ, TD_1_HZ, TD_1v60_HZ } |
Protected Member Functions | |
int | read (void *regs, uint8_t size, uint8_t pos=0) |
int | write (void *regs, uint8_t size, uint8_t pos=0) |
Private Member Functions | |
bool | is_async () const |
void | sync_request () |
void | async_request () |
virtual void | on_completion (uint8_t type, int count) |
Private Attributes | |
uint8_t | m_addr |
bool | m_async |
Driver for the PCF8563, Low-Power I2C Real-Time Clock/Calendar (RTCC).
Definition at line 35 of file PCF8563.hh.
|
protected |
Frequency output in control register (FD, pp. 15).
Enumerator | |
---|---|
FD_32_768_KHZ |
32.768 Hz |
FD_1_024_KHZ |
1.024 Hz |
FD_32_HZ |
32 Hz |
FD_1_HZ |
1 Hz |
Definition at line 173 of file PCF8563.hh.
|
protected |
Timer frequency in control register (TD, pp. 16).
Enumerator | |
---|---|
TD_4_096_KHZ |
4.096 Hz. |
TD_64_HZ |
64 Hz. |
TD_1_HZ |
1 Hz. |
TD_1v60_HZ |
1/60 Hz. |
Definition at line 199 of file PCF8563.hh.
|
inline |
Construct PCF8563 device with bus address(0x51).
Definition at line 40 of file PCF8563.hh.
bool PCF8563::clear_alarm | ( | ) |
Clear the real-time clock alarm setting. Return true(1) if successful otherwise false(0).
Definition at line 118 of file PCF8563.cpp.
bool PCF8563::get_alarm | ( | alarm_t & | alarm | ) |
Read the real-time clock alarm setting. Return true(1) if successful otherwise false(0).
[out] | alarm | match structure. |
Definition at line 77 of file PCF8563.cpp.
bool PCF8563::get_time | ( | time_t & | now | ) |
Read current time from the real-time clock. Return true(1) if successful otherwise false(0).
[out] | now | time structure return value. |
Definition at line 43 of file PCF8563.cpp.
bool PCF8563::pending_alarm | ( | ) |
Check any pending alarms (signalled on interrupt pin). Returns true(1) alarm pending otherwise false(0).
Definition at line 107 of file PCF8563.cpp.
|
protected |
Read register block with the given size into the buffer from the position. Return number of bytes read or negative error code.
[in] | regs | buffer to read from register block. |
[in] | size | number of bytes to read. |
[in] | pos | address in register file to read from. |
Definition at line 24 of file PCF8563.cpp.
bool PCF8563::set_alarm | ( | alarm_t & | alarm | ) |
Set the real-time clock alarm. Return true(1) if successful otherwise false(0).
[in] | alarm | match structure to set. |
Definition at line 90 of file PCF8563.cpp.
bool PCF8563::set_time | ( | time_t & | now | ) |
Set the real-time clock to the given time. Return true(1) if successful otherwise false(0).
[in] | now | time structure to set. |
Definition at line 62 of file PCF8563.cpp.
|
protected |
Write register block at given position with the contents from buffer. Return number of bytes written or negative error code.
[in] | regs | buffer to write to register block. |
[in] | size | number of bytes to write. |
[in] | pos | address in register file to read write to. |
Definition at line 34 of file PCF8563.cpp.