JasonEdinburgh / RV-3028_C7-Arduino_Library

An Arduino library for the extremely low power, very precise, and highly configurable RV-3028-C7 Real Time Clock from Micro Crystal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RTC RV-3028-C7 Arduino Library

Real Time Clock

Application Manual

The RV-3028-C7 is an extremely precise, extremely low power, highly configurable RTC. Under ideal conditions it runs at approximately 40nA with +/-5ppm per year of deviation (+/- 160 seconds worst case per year). This library was originally forked from the Sparkfun RV-1805 library, and costumized and enhanced to the RV-3028-C7.

This library allows the user to:

  • Set time using hard numbers or the BUILD_TIME from the Arduino compiler
  • Read time
  • Configure various aspects of the RTC including setting of alarms, trickle charging or power switchover mode

Examples are included to get you started.

Repository Contents

  • /examples - Example sketches for the library (.ino). Run these from the Arduino IDE.
  • /src - Source files for the library (.cpp, .h).
  • keywords.txt - Keywords from this library that will be highlighted in the Arduino IDE.
  • library.properties - General library properties for the Arduino package manager.

Documentation

The library enables the following functions:


General functions


Please call begin() sometime after initializing the I2C interface with Wire.begin().

begin()
is12Hour()
isPM()
set12Hour()
set24Hour()

Set Time functions


setTime(sec, min, hour, weekday, date, month, year);
setSeconds(value)
setMinutes(value)
setHours(value)
setWeekday(value)
setDate(value)
setMonth(value)
setYear(value)
setToCompilerTime()

Get Time functions


Please call "updateTime()" before calling one of the other getTime functions.

updateTime()
getSeconds()
getMinutes()
getHours()
getWeekday()
getDate()
getMonth()
getYear()
stringDateUSA()
stringDate()
stringTime()
stringTimeStamp()

UNIX Time functions


Attention: UNIX Time and real time are INDEPENDENT!

setUNIX(value)
getUNIX()

Alarm Interrupt functions


enableAlarmInterrupt(min, hour, date_or_weekday, bool setWeekdayAlarm_not_Date, mode)
disableAlarmInterrupt()
readAlarmInterruptFlag()

Set the alarm mode in the following way:
0: When minutes, hours and weekday/date match (once per weekday/date)
1: When hours and weekday/date match (once per weekday/date)
2: When minutes and weekday/date match (once per hour per weekday/date)
3: When weekday/date match (once per weekday/date)
4: When hours and minutes match (once per day)
5: When hours match (once per day)
6: When minutes match (once per hour)
7: All disabled – Default value
If you want to set a weekday alarm (setWeekdayAlarm_not_Date = true), set 'date_or_weekday' from 0 (Sunday) to 6 (Saturday).
For further information about the alarm mode see Application Manual p. 68.


Trickle charge functions


enableTrickleCharge(uint8_t tcr = TCR_11K)
disableTrickleCharge()

At "enableTrickleCharge" you can choose the series resistor:
TCR_1K for 1kOhm
TCR_3K for 3kOhm
TCR_6K for 6kOhm
TCR_11K for 11kOhm
See Application Manual p. 48 for more information.


Backup Switchover Mode


setBackupSwitchoverMode(mode)

0 = Switchover disabled
1 = Direct Switching Mode
2 = Standby Mode
3 = Level Switching Mode
See Application Manual p. 45 for more information.

License Information

This product is open source!

Please review the LICENSE.md file for license information.

If you have any questions or concerns on licensing, please contact constantinkoch@outlook.com.

Distributed as-is; no warranty is given.

About

An Arduino library for the extremely low power, very precise, and highly configurable RV-3028-C7 Real Time Clock from Micro Crystal.

License:Other


Languages

Language:C++ 100.0%