|
1 | 1 | # STM32RTC
|
2 | 2 | A RTC library for STM32.
|
| 3 | + |
| 4 | +# API |
| 5 | + |
| 6 | +This library is based on the Arduino RTCZero library. |
| 7 | +The library allows to take control of the internal RTC of the STM32 boards. |
| 8 | + |
| 9 | +The following functions are not supported: |
| 10 | + |
| 11 | +* **`void standbyMode()`**: use the STM32 Low Power library instead. |
| 12 | +* **`uint8_t getAlarmMonth()`**: month not supported by STM32 RTC architecture. |
| 13 | +* **`uint8_t getAlarmYear()`**: year not supported by STM32 RTC architecture. |
| 14 | +* **`void setAlarmMonth(uint8_t month)`**: month not supported by STM32 RTC architecture. |
| 15 | +* **`void setAlarmYear(uint8_t year)`**: year not supported by STM32 RTC architecture. |
| 16 | +* **`void setAlarmDate(uint8_t day, uint8_t month, uint8_t year)`**: month and year not supported by STM32 RTC architecture. |
| 17 | + |
| 18 | +The following functions have been added to support specific STM32 RTC features: |
| 19 | + |
| 20 | +_RTC hours mode (12 or 24)_ |
| 21 | +* **`void begin(RTCHourFormats_t format)`** |
| 22 | + |
| 23 | +_RTC clock source_ |
| 24 | +* **`void setClockSource(sourceClock_t source)`** : this function must be called before `begin()` |
| 25 | + |
| 26 | +_SubSeconds management_ |
| 27 | +* **`uint32_t getSubSeconds(void)`** |
| 28 | +* **`void setSubSeconds(uint32_t subSeconds)`** |
| 29 | + |
| 30 | +_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)`** |
| 37 | + |
| 38 | +_Week day configuration_ |
| 39 | +* **`uint8_t getWeekDay(void)`** |
| 40 | +* **`void setWeekDay(uint8_t weekDay)`** |
| 41 | +* **`void setDate(uint8_t weekDay, uint8_t day, uint8_t month, uint8_t year)`** |
| 42 | + |
| 43 | +Refer to the Arduino RTC documentation for the other functions |
| 44 | +http://arduino.cc/en/Reference/RTC |
| 45 | + |
| 46 | +## Source |
| 47 | + |
| 48 | +Source files available at: |
| 49 | +https://github.com/stm32duino/STM32RTC |
0 commit comments