Skip to content

Commit

Permalink
6.2.10: weekdays defines
Browse files Browse the repository at this point in the history
  • Loading branch information
Naguissa committed Jun 11, 2020
1 parent a1098ce commit 2aad103
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=uRTCLib
version=6.2.9
version=6.2.10
author=Naguissa <[email protected]>
maintainer=Naguissa <[email protected]>
sentence=Really tiny library to basic RTC functionality on Arduino. DS1307, DS3231 and DS3232 RTCs are supported. See https://github.com/Naguissa/uEEPROMLib for EEPROM support. Temperature, Alarms, SQWG, Power lost and RAM support.
Expand Down
16 changes: 15 additions & 1 deletion src/uRTCLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html">https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html</a>
* @see <a href="mailto:[email protected]">[email protected]</a>
* @see <a href="https://github.com/Naguissa/uEEPROMLib">See uEEPROMLib for EEPROM support.</a>
* @version 6.2.9
* @version 6.2.10
*/

#include <Arduino.h>
Expand Down Expand Up @@ -411,6 +411,13 @@ uint8_t uRTCLib::year() {
* \brief Returns actual Day Of Week
*
* @return Current stored Day Of Week
* - #URTCLIB_WEEKDAY_SUNDAY
* - #URTCLIB_WEEKDAY_MONDAY
* - #URTCLIB_WEEKDAY_TUESDAY
* - #URTCLIB_WEEKDAY_WEDNESDAY
* - #URTCLIB_WEEKDAY_THURSDAY
* - #URTCLIB_WEEKDAY_FRIDAY
* - #URTCLIB_WEEKDAY_SATURDAY
*/
uint8_t uRTCLib::dayOfWeek() {
return _dayOfWeek;
Expand Down Expand Up @@ -458,6 +465,13 @@ uint8_t uRTCLib::model() {
* @param minute minute to set to HW RTC
* @param hour hour to set to HW RTC
* @param dayOfWeek day of week to set to HW RTC
* - #URTCLIB_WEEKDAY_SUNDAY
* - #URTCLIB_WEEKDAY_MONDAY
* - #URTCLIB_WEEKDAY_TUESDAY
* - #URTCLIB_WEEKDAY_WEDNESDAY
* - #URTCLIB_WEEKDAY_THURSDAY
* - #URTCLIB_WEEKDAY_FRIDAY
* - #URTCLIB_WEEKDAY_SATURDAY
* @param dayOfMonth day of month to set to HW RTC
* @param month month to set to HW RTC
* @param year year to set to HW RTC in last 2 digits mode. As RTCs only support 19xx and 20xx years (see datasheets), it's harcoded to 20xx.
Expand Down
35 changes: 34 additions & 1 deletion src/uRTCLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html">https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html</a>
* @see <a href="mailto:[email protected]">[email protected]</a>
* @see <a href="https://github.com/Naguissa/uEEPROMLib">See uEEPROMLib for EEPROM support.</a>
* @version 6.2.9
* @version 6.2.10
*/
/** \file uRTCLib.h
* \brief uRTCLib header file
Expand All @@ -38,6 +38,7 @@
*/
#define URTCLIB_ADDRESS 0x68

/************ MODELS ***********/
/**
* \brief Model definition, DS1307
*/
Expand All @@ -52,6 +53,38 @@
#define URTCLIB_MODEL_DS3232 3


/************ WEEK DAYS ***********/
/**
* \brief Week day definition, [Sun..Sat] as [1..7]. Sunday
*/
#define URTCLIB_WEEKDAY_SUNDAY 1
/**
* \brief Week day definition, [Sun..Sat] as [1..7]. Monday
*/
#define URTCLIB_WEEKDAY_MONDAY 2
/**
* \brief Week day definition, [Sun..Sat] as [1..7]. Tuesday
*/
#define URTCLIB_WEEKDAY_TUESDAY 3
/**
* \brief Week day definition, [Sun..Sat] as [1..7]. Wednesday
*/
#define URTCLIB_WEEKDAY_WEDNESDAY 4
/**
* \brief Week day definition, [Sun..Sat] as [1..7]. Thursday
*/
#define URTCLIB_WEEKDAY_THURSDAY 5
/**
* \brief Week day definition, [Sun..Sat] as [1..7]. Friday
*/
#define URTCLIB_WEEKDAY_FRIDAY 6
/**
* \brief Week day definition, [Sun..Sat] as [1..7]. Saturday
*/
#define URTCLIB_WEEKDAY_SATURDAY 7



/************ ALARM SELECTION: ***********/
//Note: Not valid for DS1307!

Expand Down

0 comments on commit 2aad103

Please sign in to comment.