|
COSA
An Object-Oriented Platform for Arduino Programming
|
#include <DS3231.hh>


Classes | |
| struct | alarm1_t |
| struct | alarm2_t |
| union | control_t |
| union | status_t |
| struct | timekeeper_t |
Public Types | |
| enum | { RS_1_HZ = 0, RS_1024_HZ = 1, RS_4096_HZ = 2, RS_8192_HZ = 3 } |
Public Member Functions | |
| DS3231 () | |
| int | read (void *regs, uint8_t size, uint8_t pos=0) |
| int | write (void *regs, uint8_t size, uint8_t pos=0) |
| bool | get_time (time_t &now) |
| bool | set_time (time_t &now) |
| bool | get_alarm1 (alarm1_t &alarm, uint8_t &mask) |
| bool | set_alarm1 (alarm1_t &alarm, uint8_t mask) |
| bool | get_alarm2 (alarm2_t &alarm, uint8_t &mask) |
| bool | set_alarm2 (alarm2_t &alarm, uint8_t mask) |
| int16_t | temperature () |
| bool | square_wave (bool flag) |
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 DS3231, Extremely Accurate I2C-Integrated RTC/TCXO/Crystal.
The Mini RTC pro module with pull-up resistors (4K7) for TWI signals.
| anonymous enum |
|
inline |
|
inline |
|
inline |
|
inline |
| int DS3231::read | ( | void * | regs, |
| uint8_t | size, | ||
| uint8_t | pos = 0 |
||
| ) |
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 25 of file DS3231.cpp.
|
inline |
|
inline |
|
inline |
| bool DS3231::square_wave | ( | bool | flag | ) |
Enable/disable square wave output (1 Hz). Returns true(1) if successful otherwise false(0).
Definition at line 81 of file DS3231.cpp.
| int16_t DS3231::temperature | ( | ) |
Read temperature from real-time clock, signed fixpoint<8:2>
Definition at line 73 of file DS3231.cpp.
| int DS3231::write | ( | void * | regs, |
| uint8_t | size, | ||
| uint8_t | pos = 0 |
||
| ) |
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 35 of file DS3231.cpp.