![]() |
MD_DS3231 Real Time Clock Library
1.3
Library to control DS3231 high precision clock with alarms
|
Main header file for the MD_DS3231 library. More...
#include <Arduino.h>
Classes | |
class | MD_DS3231 |
Macros | |
#define | ENABLE_12H 1 |
Enable 12H (AMP/PM) support. More... | |
#define | ENABLE_DOW 1 |
Enable Day of Week vs Date support. More... | |
#define | ENABLE_DYNAMIC_CENTURY 1 |
Enable support for dynamic century. More... | |
#define | ENABLE_RTC_INSTANCE 1 |
Enable default RTC instance creation. More... | |
#define | DS3231_RAM_MAX 19 |
Total number of RAM registers that can be read from the device. | |
Enumerations | |
enum | codeRequest_t { DS3231_CLOCK_HALT, DS3231_SQW_ENABLE, DS3231_SQW_TYPE, DS3231_12H, DS3231_TCONV, DS3231_INT_ENABLE, DS3231_A1_INT_ENABLE, DS3231_A2_INT_ENABLE, DS3231_HALTED_FLAG, DS3231_32KHZ_ENABLE, DS3231_BUSY_FLAG, DS3231_A1_FLAG, DS3231_A2_FLAG, DS3231_AGING_OFFSET } |
enum | codeStatus_t { DS3231_ERROR, DS3231_ON, DS3231_OFF, DS3231_SQW_1HZ, DS3231_SQW_1KHZ, DS3231_SQW_4KHZ, DS3231_SQW_8KHZ } |
enum | almType_t { DS3231_ALM_ERROR = -1, DS3231_ALM_SEC = 0b00001111, DS3231_ALM_S = 0b00001110, DS3231_ALM_MIN = 0b01000111, DS3231_ALM_M = 0b01000110, DS3231_ALM_MS = 0b00001100, DS3231_ALM_HM = 0b01000100, DS3231_ALM_HMS = 0b00001000, DS3231_ALM_DTHM = 0b01000000, DS3231_ALM_DTHMS = 0b00000000, DS3231_ALM_DDHM = 0b01001000, DS3231_ALM_DDHMS = 0b00010000 } |
Variables | |
MD_DS3231 | RTC |
Library created instance of the RTC class. | |
Main header file for the MD_DS3231 library.
#define ENABLE_12H 1 |
Enable 12H (AMP/PM) support.
Set to 1 (default) to enable the AM/PM support. The related code cannot be omitted by GCC optimization so if you're not using AMP/PM, disabling 12H support migh give back up to 340 bytes on the final HEX size. Note that if diabled, you should call control(DS3231_12H, DS3231_OFF) right after device initialization.
You can change the default by editing this file directly or using a command line tool like sed : sed "s/^#define ENABLE_12H 1/#define ENABLE_12H 0/" -i MD_DS3231.h
#define ENABLE_DOW 1 |
Enable Day of Week vs Date support.
Set to 1 (default) to enable Day of Week support. The related code cannot be omitted by GCC optimization so disabling day of week support if you're not using it might give back up to 212 bytes on the final HEX size.
You can change the default by editing this file directly or using a command line tool like sed : sed "s/^#define ENABLE_DOW 1/#define ENABLE_DOW 0/" -i MD_DS3231.h
#define ENABLE_DYNAMIC_CENTURY 1 |
Enable support for dynamic century.
Set to 1 (default) to enable support for dynamic centuries using the setCentury() and getCentury() methods. If disabled, century is hardcoded (via DEFAULT_CENTURY) to 20 which allow working with dates from 2000 to 2199.
You can disable this to gain 10 bytes of HEX and 2 bytes of RAM. It is only needed for backward compatility, or if you need to work with dynamic centuries.
You can change the default by editing this file directly or using a command line tool like sed : sed "s/^#define ENABLE_CENTURY 1/#define ENABLE_CENTURY 0/" -i MD_DS3231.h
#define ENABLE_RTC_INSTANCE 1 |
Enable default RTC instance creation.
Set to 1 (default) to create a default instance when the library is included. It can be useful if you want to extend the MD_DS3231 class without wasting space (around 60 bytes) because of a variable declaration you do not use.
You can change the default by editing this file directly or using a command line tool like sed : sed "s/^#define ENABLE_RTC_INSTANCE 1/#define ENABLE_RTC_INSTANCE 0/" -i MD_DS3231.h
enum almType_t |
Alarm Type specifier enumerated type.
This enumerated type is used to set and inspect the alarm types for Alarms 1 and 2 using the setAlarmType() and getAlarmType() methods.
enum codeRequest_t |
Control and Status Request enumerated type.
This enumerated type is used with the control() and status() methods to identify the control action request.
enum codeStatus_t |
Control and Status Request return values enumerated type.
This enumerated type is used as the return status from the control() and status() methods.