diff --git a/README.md b/README.md index 0638068..d2a74b3 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,11 @@ The following functions are not supported: The following functions have been added to support specific STM32 RTC features: _RTC hours mode (12 or 24)_ -* **`void begin(RTC_Hour_Format format)`** +* **`void begin(Hour_Format format)`** _RTC clock source_ -* **`RTC_Source_Clock setClockSource(void)`** : get current clock source. -* **`void setClockSource(RTC_Source_Clock source)`** : this function must be called before `begin()`. +* **`Source_Clock getClockSource(void)`** : get current clock source. +* **`void setClockSource(Source_Clock source)`** : this function must be called before `begin()`. _RTC Asynchronous and Synchronous prescaler_ * **`void getPrediv(int8_t *predivA, int16_t *predivS)`** : get user (a)synchronous prescaler values if set else computed ones for the current clock source. @@ -42,12 +42,12 @@ _SubSeconds management_ * **`void setSubSeconds(uint32_t subSeconds)`** _Hour format (AM or PM)_ -* **`uint8_t getHours(RTC_AM_PM *period)`** -* **`void setHours(uint8_t hours, RTC_AM_PM period)`** -* **`void setTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, RTC_AM_PM period)`** -* **`void setAlarmHours(uint8_t hours, RTC_AM_PM period)`** -* **`uint8_t getAlarmHours(RTC_AM_PM *period)`** -* **`void setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds, RTC_AM_PM period)`** +* **`uint8_t getHours(AM_PM *period)`** +* **`void setHours(uint8_t hours, AM_PM period)`** +* **`void setTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, AM_PM period)`** +* **`void setAlarmHours(uint8_t hours, AM_PM period)`** +* **`uint8_t getAlarmHours(AM_PM *period)`** +* **`void setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds, AM_PM period)`** _Week day configuration_ * **`uint8_t getWeekDay(void)`** @@ -55,7 +55,7 @@ _Week day configuration_ * **`void setDate(uint8_t weekDay, uint8_t day, uint8_t month, uint8_t year)`** _Time and date configuration (added for convenience)_ -* **`void getTime(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint32_t *subSeconds, RTC_AM_PM *period = NULL)`** +* **`void getTime(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint32_t *subSeconds, AM_PM *period = NULL)`** * **`void getDate(uint8_t *weekDay, uint8_t *day, uint8_t *month, uint8_t *year)`** Refer to the Arduino RTC documentation for the other functions diff --git a/examples/Epoch/Epoch.ino b/examples/Epoch/Epoch.ino index 7c627b7..e23ec7a 100644 --- a/examples/Epoch/Epoch.ino +++ b/examples/Epoch/Epoch.ino @@ -44,9 +44,9 @@ STM32RTC& rtc = STM32RTC::getInstance(); void setup() { Serial.begin(9600); - // Select RTC clock source: RTC_LSI_CLOCK, RTC_LSE_CLOCK or RTC_HSE_CLOCK. + // Select RTC clock source: LSI_CLOCK, LSE_CLOCK or HSE_CLOCK. // By default the LSI is selected as source. - //rtc.setClockSource(STM32RTC::RTC_LSE_CLOCK); + //rtc.setClockSource(STM32RTC::LSE_CLOCK); rtc.begin(); // initialize RTC 24H format diff --git a/examples/RTCClockSelection/RTCClockSelection.ino b/examples/RTCClockSelection/RTCClockSelection.ino index 48c0f0f..8551355 100644 --- a/examples/RTCClockSelection/RTCClockSelection.ino +++ b/examples/RTCClockSelection/RTCClockSelection.ino @@ -58,9 +58,9 @@ void setup() { Serial.begin(9600); - // Select RTC clock source: RTC_LSI_CLOCK, RTC_LSE_CLOCK or RTC_HSE_CLOCK. + // Select RTC clock source: LSI_CLOCK, LSE_CLOCK or HSE_CLOCK. // By default the LSI is selected as source. - rtc.setClockSource(STM32RTC::RTC_LSE_CLOCK); + rtc.setClockSource(STM32RTC::LSE_CLOCK); rtc.begin(); // initialize RTC 24H format diff --git a/examples/SimpleRTC/SimpleRTC.ino b/examples/SimpleRTC/SimpleRTC.ino index 5e64263..0e11d6b 100644 --- a/examples/SimpleRTC/SimpleRTC.ino +++ b/examples/SimpleRTC/SimpleRTC.ino @@ -57,9 +57,9 @@ void setup() { Serial.begin(9600); - // Select RTC clock source: RTC_LSI_CLOCK, RTC_LSE_CLOCK or RTC_HSE_CLOCK. + // Select RTC clock source: LSI_CLOCK, LSE_CLOCK or HSE_CLOCK. // By default the LSI is selected as source. - //rtc.setClockSource(STM32RTC::RTC_LSE_CLOCK); + //rtc.setClockSource(STM32RTC::LSE_CLOCK); rtc.begin(); // initialize RTC 24H format diff --git a/examples/advancedRTCAlarm/advancedRTCAlarm.ino b/examples/advancedRTCAlarm/advancedRTCAlarm.ino index d057c09..ec9e30e 100644 --- a/examples/advancedRTCAlarm/advancedRTCAlarm.ino +++ b/examples/advancedRTCAlarm/advancedRTCAlarm.ino @@ -40,9 +40,9 @@ void setup() { Serial.begin(9600); - // Select RTC clock source: RTC_LSI_CLOCK, RTC_LSE_CLOCK or RTC_HSE_CLOCK. + // Select RTC clock source: LSI_CLOCK, LSE_CLOCK or HSE_CLOCK. // By default the LSI is selected as source. - //rtc.setClockSource(STM32RTC::RTC_LSE_CLOCK); + //rtc.setClockSource(STM32RTC::LSE_CLOCK); rtc.begin(); // initialize RTC 24H format diff --git a/examples/simpleRTCAlarm/simpleRTCAlarm.ino b/examples/simpleRTCAlarm/simpleRTCAlarm.ino index 8613084..4f37ddc 100644 --- a/examples/simpleRTCAlarm/simpleRTCAlarm.ino +++ b/examples/simpleRTCAlarm/simpleRTCAlarm.ino @@ -55,9 +55,9 @@ void setup() { Serial.begin(9600); - // Select RTC clock source: RTC_LSI_CLOCK, RTC_LSE_CLOCK or RTC_HSE_CLOCK. + // Select RTC clock source: LSI_CLOCK, LSE_CLOCK or HSE_CLOCK. // By default the LSI is selected as source. - //rtc.setClockSource(STM32RTC::RTC_LSE_CLOCK); + //rtc.setClockSource(STM32RTC::LSE_CLOCK); rtc.begin(); // initialize RTC 24H format diff --git a/keywords.txt b/keywords.txt index 06b6d7e..cf8016e 100644 --- a/keywords.txt +++ b/keywords.txt @@ -85,10 +85,10 @@ MATCH_HHMMSS LITERAL1 MATCH_DHHMMSS LITERAL1 MATCH_MMDDHHMMSS LITERAL1 MATCH_YYMMDDHHMMSS LITERAL1 -RTC_HOUR_12 LITERAL1 -RTC_HOUR_24 LITERAL1 -RTC_AM LITERAL1 -RTC_PM LITERAL1 -RTC_LSE_CLOCK LITERAL1 -RTC_LSI_CLOCK LITERAL1 -RTC_HSE_CLOCK LITERAL1 +HOUR_12 LITERAL1 +HOUR_24 LITERAL1 +AM LITERAL1 +PM LITERAL1 +LSE_CLOCK LITERAL1 +LSI_CLOCK LITERAL1 +HSE_CLOCK LITERAL1 diff --git a/src/STM32RTC.cpp b/src/STM32RTC.cpp index 5b0876e..dbdfc35 100644 --- a/src/STM32RTC.cpp +++ b/src/STM32RTC.cpp @@ -49,10 +49,10 @@ bool STM32RTC::_configured = false; /** * @brief initializes the RTC * @param resetTime: if true reconfigures the RTC - * @param format: hour format: RTC_HOUR_12 or RTC_HOUR_24(default) + * @param format: hour format: HOUR_12 or HOUR_24(default) * @retval None */ -void STM32RTC::begin(bool resetTime, RTC_Hour_Format format) +void STM32RTC::begin(bool resetTime, Hour_Format format) { if(resetTime == true) { _configured = false; @@ -63,15 +63,15 @@ void STM32RTC::begin(bool resetTime, RTC_Hour_Format format) /** * @brief initializes the RTC - * @param format: hour format: RTC_HOUR_12 or RTC_HOUR_24(default) + * @param format: hour format: HOUR_12 or HOUR_24(default) * @retval None */ -void STM32RTC::begin(RTC_Hour_Format format) +void STM32RTC::begin(Hour_Format format) { if(_configured == false) { - RTC_init((format == RTC_HOUR_12)? HOUR_FORMAT_12: HOUR_FORMAT_24, - (_clockSource == RTC_LSE_CLOCK)? LSE_CLOCK: - (_clockSource == RTC_HSE_CLOCK)? HSE_CLOCK : LSI_CLOCK); + RTC_init((format == HOUR_12)? HOUR_FORMAT_12: HOUR_FORMAT_24, + (_clockSource == LSE_CLOCK)? ::LSE_CLOCK: + (_clockSource == HSE_CLOCK)? ::HSE_CLOCK : ::LSI_CLOCK); // Must be set before call of sync methods _configured = true; syncTime(); @@ -106,9 +106,9 @@ void STM32RTC::end(void) /** * @brief get the RTC clock source. - * @retval clock source: RTC_LSI_CLOCK, RTC_LSE_CLOCK or RTC_HSE_CLOCK + * @retval clock source: LSI_CLOCK, LSE_CLOCK or HSE_CLOCK */ -STM32RTC::RTC_Source_Clock STM32RTC::getClockSource(void) +STM32RTC::Source_Clock STM32RTC::getClockSource(void) { return _clockSource; } @@ -116,15 +116,15 @@ STM32RTC::RTC_Source_Clock STM32RTC::getClockSource(void) /** * @brief set the RTC clock source. By default LSI clock is selected. This * method must be called before begin(). - * @param source: clock source: RTC_LSI_CLOCK, RTC_LSE_CLOCK or RTC_HSE_CLOCK + * @param source: clock source: LSI_CLOCK, LSE_CLOCK or HSE_CLOCK * @retval None */ -void STM32RTC::setClockSource(RTC_Source_Clock source) +void STM32RTC::setClockSource(Source_Clock source) { if(IS_CLOCK_SOURCE(source)) { _clockSource = source; - RTC_SetClockSource((_clockSource == RTC_LSE_CLOCK)? LSE_CLOCK: - (_clockSource == RTC_HSE_CLOCK)? HSE_CLOCK : LSI_CLOCK); + RTC_SetClockSource((_clockSource == LSE_CLOCK)? ::LSE_CLOCK: + (_clockSource == HSE_CLOCK)? ::HSE_CLOCK : ::LSI_CLOCK); } } @@ -174,7 +174,7 @@ void STM32RTC::enableAlarm(Alarm_Match match) case MATCH_MMSS: case MATCH_SS: RTC_StartAlarm(_alarmDay, _alarmHours, _alarmMinutes, _alarmSeconds, - _alarmSubSeconds, (_alarmPeriod == RTC_AM)? AM: PM, + _alarmSubSeconds, (_alarmPeriod == AM)? HOUR_AM: HOUR_PM, static_cast(_alarmMatch)); _alarmEnabled = true; break; @@ -261,7 +261,7 @@ uint8_t STM32RTC::getMinutes(void) * pointer to the current hour period set in the RTC: AM or PM * @retval return the current hours from the RTC. */ -uint8_t STM32RTC::getHours(RTC_AM_PM *period) +uint8_t STM32RTC::getHours(AM_PM *period) { syncTime(); if(period != NULL) { @@ -280,7 +280,7 @@ uint8_t STM32RTC::getHours(RTC_AM_PM *period) * pointer to the current hour period set in the RTC: AM or PM * @retval none */ -void STM32RTC::getTime(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint32_t *subSeconds, RTC_AM_PM *period) +void STM32RTC::getTime(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint32_t *subSeconds, AM_PM *period) { syncTime(); if(hours != NULL) { @@ -401,7 +401,7 @@ uint8_t STM32RTC::getAlarmMinutes(void) * pointer to the current hour format set in the RTC: AM or PM * @retval return the current alarm hour. */ -uint8_t STM32RTC::getAlarmHours(RTC_AM_PM *period) +uint8_t STM32RTC::getAlarmHours(AM_PM *period) { syncAlarmTime(); if(period != NULL) { @@ -458,7 +458,7 @@ void STM32RTC::setSubSeconds(uint32_t subSeconds) if(subSeconds < 1000) { _subSeconds = subSeconds; } - RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == RTC_AM)? AM : PM); + RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == AM)? HOUR_AM : HOUR_PM); } } @@ -474,7 +474,7 @@ void STM32RTC::setSeconds(uint8_t seconds) if(seconds < 60) { _seconds = seconds; } - RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == RTC_AM)? AM : PM); + RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == AM)? HOUR_AM : HOUR_PM); } } @@ -490,7 +490,7 @@ void STM32RTC::setMinutes(uint8_t minutes) if(minutes < 60) { _minutes = minutes; } - RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == RTC_AM)? AM : PM); + RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == AM)? HOUR_AM : HOUR_PM); } } @@ -506,7 +506,7 @@ void STM32RTC::setHours(uint8_t hours) if(hours < 24) { _hours = hours; } - RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == RTC_AM)? AM : PM); + RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == AM)? HOUR_AM : HOUR_PM); } } @@ -516,7 +516,7 @@ void STM32RTC::setHours(uint8_t hours) * @param hours format: AM or PM * @retval none */ -void STM32RTC::setHours(uint8_t hours, RTC_AM_PM period) +void STM32RTC::setHours(uint8_t hours, AM_PM period) { if (_configured) { syncTime(); @@ -524,7 +524,7 @@ void STM32RTC::setHours(uint8_t hours, RTC_AM_PM period) _hours = hours; } _hoursPeriod = period; - RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == RTC_AM)? AM : PM); + RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == AM)? HOUR_AM : HOUR_PM); } } @@ -548,7 +548,7 @@ void STM32RTC::setTime(uint8_t hours, uint8_t minutes, uint8_t seconds) if(hours < 24) { _hours = hours; } - RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == RTC_AM)? AM : PM); + RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == AM)? HOUR_AM : HOUR_PM); } } @@ -560,7 +560,7 @@ void STM32RTC::setTime(uint8_t hours, uint8_t minutes, uint8_t seconds) * @param hour format: AM or PM * @retval none */ -void STM32RTC::setTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, RTC_AM_PM period) +void STM32RTC::setTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, AM_PM period) { if (_configured) { syncTime(); @@ -577,7 +577,7 @@ void STM32RTC::setTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t _hours = hours; } _hoursPeriod = period; - RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == RTC_AM)? AM : PM); + RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == AM)? HOUR_AM : HOUR_PM); } } @@ -744,7 +744,7 @@ void STM32RTC::setAlarmHours(uint8_t hours) * @param hour format: AM or PM * @retval none */ -void STM32RTC::setAlarmHours(uint8_t hours, RTC_AM_PM period) +void STM32RTC::setAlarmHours(uint8_t hours, AM_PM period) { if (_configured) { if(hours < 24) { @@ -778,7 +778,7 @@ void STM32RTC::setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds) * @param hour format: AM or PM * @retval none */ -void STM32RTC::setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds, RTC_AM_PM period) +void STM32RTC::setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds, AM_PM period) { if (_configured) { setAlarmHours(hours, period); @@ -925,7 +925,7 @@ void STM32RTC::setEpoch(uint32_t ts) _seconds = tmp->tm_sec; RTC_SetDate(_year, _month, _day, _wday); - RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == RTC_AM)? AM : PM); + RTC_SetTime(_hours, _minutes, _seconds, _subSeconds, (_hoursPeriod == AM)? HOUR_AM : HOUR_PM); } } @@ -944,7 +944,7 @@ void STM32RTC::setY2kEpoch(uint32_t ts) * @brief configure RTC source clock for low power * @param none */ -void STM32RTC::configForLowPower(RTC_Source_Clock source) +void STM32RTC::configForLowPower(Source_Clock source) { #if defined(HAL_PWR_MODULE_ENABLED) if (!_configured){ @@ -954,7 +954,7 @@ void STM32RTC::configForLowPower(RTC_Source_Clock source) } else { if (_clockSource != source) { // Save current config - RTC_AM_PM period, alarmPeriod = _alarmPeriod; + AM_PM period, alarmPeriod = _alarmPeriod; uint32_t subSeconds; uint8_t seconds, minutes, hours, weekDay, day, month, years; uint8_t alarmSeconds, alarmMinutes, alarmHours, alarmDay; @@ -993,9 +993,9 @@ void STM32RTC::configForLowPower(RTC_Source_Clock source) void STM32RTC::syncTime(void) { if(_configured) { - hourAM_PM_t p = AM; + hourAM_PM_t p = HOUR_AM; RTC_GetTime(&_hours, &_minutes, &_seconds, &_subSeconds, &p); - _hoursPeriod = (p == AM)? RTC_AM : RTC_PM; + _hoursPeriod = (p == HOUR_AM)? AM : PM; } } @@ -1017,11 +1017,11 @@ void STM32RTC::syncDate(void) void STM32RTC::syncAlarmTime(void) { if(_configured) { - hourAM_PM_t p = AM; + hourAM_PM_t p = HOUR_AM; uint8_t match; RTC_GetAlarm(&_alarmDay, &_alarmHours, &_alarmMinutes, &_alarmSeconds, &_alarmSubSeconds, &p, &match); - _alarmPeriod = (p == AM)? RTC_AM : RTC_PM; + _alarmPeriod = (p == HOUR_AM)? AM : PM; switch (static_cast(match)) { case MATCH_OFF: case MATCH_YYMMDDHHMMSS://kept for compatibility diff --git a/src/STM32RTC.h b/src/STM32RTC.h index b4de135..dba00c4 100644 --- a/src/STM32RTC.h +++ b/src/STM32RTC.h @@ -48,23 +48,23 @@ typedef void(*voidFuncPtr)(void *); -#define IS_CLOCK_SOURCE(SRC) (((SRC) == STM32RTC::RTC_LSI_CLOCK) || ((SRC) == STM32RTC::RTC_LSE_CLOCK) ||\ - ((SRC) == STM32RTC::RTC_HSE_CLOCK)) -#define IS_HOUR_FORMAT(FMT) (((FMT) == STM32RTC::RTC_HOUR_12) || ((FMT) == STM32RTC::RTC_HOUR_24)) +#define IS_CLOCK_SOURCE(SRC) (((SRC) == STM32RTC::LSI_CLOCK) || ((SRC) == STM32RTC::LSE_CLOCK) ||\ + ((SRC) == STM32RTC::HSE_CLOCK)) +#define IS_HOUR_FORMAT(FMT) (((FMT) == STM32RTC::HOUR_12) || ((FMT) == STM32RTC::HOUR_24)) class STM32RTC { public: - enum RTC_Hour_Format : uint8_t + enum Hour_Format : uint8_t { - RTC_HOUR_12 = HOUR_FORMAT_12, - RTC_HOUR_24 = HOUR_FORMAT_24 + HOUR_12 = HOUR_FORMAT_12, + HOUR_24 = HOUR_FORMAT_24 }; - enum RTC_AM_PM : uint8_t + enum AM_PM : uint8_t { - RTC_AM = AM, - RTC_PM = PM + AM = HOUR_AM, + PM = HOUR_PM }; enum Alarm_Match: uint8_t @@ -79,11 +79,11 @@ class STM32RTC { MATCH_MMDDHHMMSS = SS_MSK | MM_MSK | HH_MSK | D_MSK | M_MSK, MATCH_YYMMDDHHMMSS = SS_MSK | MM_MSK | HH_MSK | D_MSK | M_MSK | Y_MSK }; - enum RTC_Source_Clock: uint8_t + enum Source_Clock: uint8_t { - RTC_LSI_CLOCK = LSI_CLOCK, - RTC_LSE_CLOCK = LSE_CLOCK, - RTC_HSE_CLOCK = HSE_CLOCK + LSI_CLOCK = ::LSI_CLOCK, + LSE_CLOCK = ::LSE_CLOCK, + HSE_CLOCK = ::HSE_CLOCK }; static STM32RTC& getInstance() { @@ -95,13 +95,13 @@ class STM32RTC { STM32RTC(STM32RTC const&) = delete; void operator=(STM32RTC const&) = delete; - void begin(bool resetTime, RTC_Hour_Format format = RTC_HOUR_24); - void begin(RTC_Hour_Format format = RTC_HOUR_24); + void begin(bool resetTime, Hour_Format format = HOUR_24); + void begin(Hour_Format format = HOUR_24); void end(void); - RTC_Source_Clock getClockSource(void); - void setClockSource(RTC_Source_Clock source); + Source_Clock getClockSource(void); + void setClockSource(Source_Clock source); void enableAlarm(Alarm_Match match); void disableAlarm(void); @@ -117,8 +117,8 @@ class STM32RTC { uint32_t getSubSeconds(void); uint8_t getSeconds(void); uint8_t getMinutes(void); - uint8_t getHours(RTC_AM_PM *period = NULL); - void getTime(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint32_t *subSeconds, RTC_AM_PM *period = NULL); + uint8_t getHours(AM_PM *period = NULL); + void getTime(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint32_t *subSeconds, AM_PM *period = NULL); uint8_t getWeekDay(void); uint8_t getDay(void); @@ -129,7 +129,7 @@ class STM32RTC { uint32_t getAlarmSubSeconds(void); uint8_t getAlarmSeconds(void); uint8_t getAlarmMinutes(void); - uint8_t getAlarmHours(RTC_AM_PM *period = NULL); + uint8_t getAlarmHours(AM_PM *period = NULL); uint8_t getAlarmDay(void); @@ -143,9 +143,9 @@ class STM32RTC { void setSeconds(uint8_t seconds); void setMinutes(uint8_t minutes); void setHours(uint8_t hours); - void setHours(uint8_t hours, RTC_AM_PM period); + void setHours(uint8_t hours, AM_PM period); void setTime(uint8_t hours, uint8_t minutes, uint8_t seconds); - void setTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, RTC_AM_PM period); + void setTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, AM_PM period); void setWeekDay(uint8_t weekDay); void setDay(uint8_t day); @@ -157,9 +157,9 @@ class STM32RTC { void setAlarmSeconds(uint8_t seconds); void setAlarmMinutes(uint8_t minutes); void setAlarmHours(uint8_t hours); - void setAlarmHours(uint8_t hours, RTC_AM_PM period); + void setAlarmHours(uint8_t hours, AM_PM period); void setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds); - void setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds, RTC_AM_PM period); + void setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds, AM_PM period); void setAlarmDay(uint8_t day); @@ -188,11 +188,11 @@ class STM32RTC { friend class STM32LowPower; private: - STM32RTC(void): _clockSource(RTC_LSI_CLOCK) {} + STM32RTC(void): _clockSource(LSI_CLOCK) {} static bool _configured; - RTC_AM_PM _hoursPeriod; + AM_PM _hoursPeriod; uint8_t _hours; uint8_t _minutes; uint8_t _seconds; @@ -207,13 +207,13 @@ class STM32RTC { uint8_t _alarmMinutes; uint8_t _alarmSeconds; uint32_t _alarmSubSeconds; - RTC_AM_PM _alarmPeriod; + AM_PM _alarmPeriod; Alarm_Match _alarmMatch; bool _alarmEnabled; - RTC_Source_Clock _clockSource; + Source_Clock _clockSource; - void configForLowPower(RTC_Source_Clock source); + void configForLowPower(Source_Clock source); void syncTime(void); void syncDate(void);