uRTCLib
https://github.com/Naguissa/uRTCLib
Classes | Macros
uRTCLib.h File Reference

uRTCLib header file More...

#include "Arduino.h"
#include "Wire.h"
Include dependency graph for uRTCLib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  uRTCLib
 DS1307, DS3231 and DS3232 RTCs basic library. More...
 

Macros

#define URTCLIB
 Prevent multiple inclussion.
 
#define URTCLIB_ADDRESS   0x68
 Default RTC I2C address. More...
 
#define URTCLIB_MODEL_DS1307   1
 Model definition, DS1307.
 
#define URTCLIB_MODEL_DS3231   2
 Model definition, DS3231.
 
#define URTCLIB_MODEL_DS3232   3
 Model definition, DS3232.
 
#define URTCLIB_ALARM_TYPE_1_NONE   0b00100000
 Alarm 1 - Disabled.
 
#define URTCLIB_ALARM_TYPE_1_ALL_S   0b00010111
 Alarm 1 - Trigger every second.
 
#define URTCLIB_ALARM_TYPE_1_FIXED_S   0b00010110
 Alarm 1 - Trigger every minute at a fixed second.
 
#define URTCLIB_ALARM_TYPE_1_FIXED_MS   0b00010100
 Alarm 1 - Trigger every hour at a fixed minute and second.
 
#define URTCLIB_ALARM_TYPE_1_FIXED_HMS   0b00010000
 Alarm 1 - Trigger every day at a fixed hour, minute and second.
 
#define URTCLIB_ALARM_TYPE_1_FIXED_DHMS   0b00000000
 Alarm 1 - Trigger every month at a fixed day, hour, minute and second.
 
#define URTCLIB_ALARM_TYPE_1_FIXED_DOWHMS   0b00001000
 Alarm 1 - Trigger every week at a fixed day-of-week, hour, minute and second.
 
#define URTCLIB_ALARM_TYPE_2_NONE   0b10100000
 Alarm 2 - Disabled.
 
#define URTCLIB_ALARM_TYPE_2_ALL_M   0b10001011
 Alarm 2 - Trigger every minute at 00 seconds.
 
#define URTCLIB_ALARM_TYPE_2_FIXED_M   0b10001010
 Alarm 2 - Trigger every hour at minute and 00 seconds.
 
#define URTCLIB_ALARM_TYPE_2_FIXED_HM   0b10001000
 Alarm 2 - Trigger every day at hour, minute and 00 seconds.
 
#define URTCLIB_ALARM_TYPE_2_FIXED_DHM   0b10000000
 Alarm 2 - Trigger every month at day, hour, minute and 00 seconds.
 
#define URTCLIB_ALARM_TYPE_2_FIXED_DOWHM   0b10000100
 Alarm 2 - Trigger every week at day-of-week, hour, minute and 00 seconds.
 
#define URTCLIB_ALARM_1   URTCLIB_ALARM_TYPE_1_NONE
 When requesting for Alarm 1.
 
#define URTCLIB_ALARM_2   URTCLIB_ALARM_TYPE_2_NONE
 When requesting for Alarm 2.
 
#define URTCLIB_SQWG_OFF_0   0b11111111
 SQWG OFF, keeps output low. More...
 
#define URTCLIB_SQWG_OFF_1   0b11111110
 SQWG OFF, keeps output hight.
 
#define URTCLIB_SQWG_1H   0b00000000
 SQWG running at 1Hz.
 
#define URTCLIB_SQWG_1024H   0b00001000
 SQWG running at 1024Hz. More...
 
#define URTCLIB_SQWG_4096H   0b00010000
 SQWG running at 4096Hz.
 
#define URTCLIB_SQWG_8192H   0b00011000
 SQWG running at 8192Hz.
 
#define URTCLIB_SQWG_32768H   0b00000011
 SQWG running at 32768Hz. More...
 
#define URTCLIB_TEMP_ERROR   32767
 Temperarure read error indicator return value. More...
 
#define uRTCLIB_decToBcd(val)   ((uint8_t) ((val / 10 * 16) + (val % 10)))
 Convert normal decimal numbers to binary coded decimal.
 
#define uRTCLIB_bcdToDec(val)   ((uint8_t) ((val / 16 * 10) + (val % 16)))
 Convert binary coded decimal to normal decimal numbers.
 
#define uRTCLIB_YIELD
 Only on ESP8266, yield to don't block ESP functionality. More...
 

Detailed Description

uRTCLib header file

Macro Definition Documentation

◆ URTCLIB_ADDRESS

#define URTCLIB_ADDRESS   0x68

Default RTC I2C address.

Usual address is 0x68

◆ URTCLIB_SQWG_1024H

#define URTCLIB_SQWG_1024H   0b00001000

SQWG running at 1024Hz.

Not valid for DS1307

◆ URTCLIB_SQWG_32768H

#define URTCLIB_SQWG_32768H   0b00000011

SQWG running at 32768Hz.

Only valid for DS1307

◆ URTCLIB_SQWG_OFF_0

#define URTCLIB_SQWG_OFF_0   0b11111111

SQWG OFF, keeps output low.

Only valid for DS1307

◆ URTCLIB_TEMP_ERROR

#define URTCLIB_TEMP_ERROR   32767

Temperarure read error indicator return value.

327.67ยบ, obviously erroneous

◆ uRTCLIB_YIELD

#define uRTCLIB_YIELD

Only on ESP8266, yield to don't block ESP functionality.

When this library is used in other MCUs this is simply removed by the preprocessor