Skip to content

Commit b10b9a4

Browse files
committed
Use scoped enumerations
Unified enumerations definitions and hardened the code. Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent 6d25f63 commit b10b9a4

File tree

4 files changed

+129
-93
lines changed

4 files changed

+129
-93
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ The following functions are not supported:
1818
The following functions have been added to support specific STM32 RTC features:
1919

2020
_RTC hours mode (12 or 24)_
21-
* **`void begin(RTCHourFormats_t format)`**
21+
* **`void begin(RTC_Hour_Format format)`**
2222

2323
_RTC clock source_
24-
* **`void setClockSource(sourceClock_t source)`** : this function must be called before `begin()`
24+
* **`void setClockSource(RTC_Source_Clock source)`** : this function must be called before `begin()`
2525

2626
_SubSeconds management_
2727
* **`uint32_t getSubSeconds(void)`**
2828
* **`void setSubSeconds(uint32_t subSeconds)`**
2929

3030
_Hour format (AM or PM)_
31-
* **`uint8_t getHours(Hour12_AM_PM_t *format)`**
32-
* **`void setHours(uint8_t hours, Hour12_AM_PM_t format)`**
33-
* **`void setTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, Hour12_AM_PM_t format)`**
34-
* **`void setAlarmHours(uint8_t hours, Hour12_AM_PM_t format)`**
35-
* **`uint8_t getAlarmHours(Hour12_AM_PM_t *format)`**
36-
* **`void setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds, Hour12_AM_PM_t format)`**
31+
* **`uint8_t getHours(RTC_AM_PM *period)`**
32+
* **`void setHours(uint8_t hours, RTC_AM_PM period)`**
33+
* **`void setTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, RTC_AM_PM period)`**
34+
* **`void setAlarmHours(uint8_t hours, RTC_AM_PM period)`**
35+
* **`uint8_t getAlarmHours(RTC_AM_PM *period)`**
36+
* **`void setAlarmTime(uint8_t hours, uint8_t minutes, uint8_t seconds, RTC_AM_PM period)`**
3737

3838
_Week day configuration_
3939
* **`uint8_t getWeekDay(void)`**

examples/RTCClockSelection/RTCClockSelection.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void setup()
6060

6161
// Select RTC clock source: RTC_LSI_CLOCK, RTC_LSE_CLOCK or RTC_HSE_CLOCK.
6262
// By default the LSI is selected as source.
63-
rtc.setClockSource(RTC_LSE_CLOCK);
63+
rtc.setClockSource(STM32RTC::RTC_LSE_CLOCK);
6464

6565
rtc.begin(); // initialize RTC 24H format
6666

0 commit comments

Comments
 (0)