98 #include "stm32fxxx_hal.h"
100 #include "attributes.h"
113 #ifndef RTC_SYNC_PREDIV
114 #define RTC_SYNC_PREDIV 0x3FF
117 #ifndef RTC_ASYNC_PREDIV
118 #define RTC_ASYNC_PREDIV 0x1F
121 #ifndef RTC_NVIC_PRIORITY
122 #define RTC_NVIC_PRIORITY 0x04
125 #ifndef RTC_NVIC_WAKEUP_SUBPRIORITY
126 #define RTC_NVIC_WAKEUP_SUBPRIORITY 0x00
129 #ifndef RTC_NVIC_ALARM_SUBPRIORITY
130 #define RTC_NVIC_ALARM_SUBPRIORITY 0x01
RTC Struct for date/time.
Definition: tm_stm32_rtc.h:146
uint8_t TM_RTC_GetDaysInMonth(uint8_t month, uint8_t year)
Gets number of days in month.
Definition: tm_stm32_rtc.h:179
Definition: tm_stm32_rtc.h:214
uint8_t Hours
Definition: tm_stm32_rtc.h:224
void TM_RTC_AlarmBHandler(void)
RTC Alarm B handler function. Called when interrupt is triggered for alarm B.
void TM_RTC_AlarmAHandler(void)
RTC Alarm A handler function. Called when interrupt is triggered for alarm A.
Definition: tm_stm32_rtc.h:187
TM_RTC_Int_t
RTC Interrupt enumeration.
Definition: tm_stm32_rtc.h:178
TM_RTC_Result_t TM_RTC_SetDateTime(TM_RTC_t *data, TM_RTC_Format_t format)
Sets date and time to internal RTC registers.
Definition: tm_stm32_rtc.h:186
uint8_t Day
Definition: tm_stm32_rtc.h:153
Definition: tm_stm32_rtc.h:189
TM_RTC_ClockSource_t
Select RTC clock source.
Definition: tm_stm32_rtc.h:196
Definition: tm_stm32_rtc.h:180
uint8_t Minutes
Definition: tm_stm32_rtc.h:223
TM_RTC_Result_t
RTC Result enumeration.
Definition: tm_stm32_rtc.h:162
TM_RTC_Result_t TM_RTC_Interrupts(TM_RTC_Int_t int_value)
Selects RTC wakeup interrupts interval.
TM_RTC_AlarmType_t Type
Definition: tm_stm32_rtc.h:221
Definition: tm_stm32_rtc.h:205
uint8_t Seconds
Definition: tm_stm32_rtc.h:147
Definition: tm_stm32_rtc.h:183
uint16_t Subseconds
Definition: tm_stm32_rtc.h:148
TM_RTC_Result_t TM_RTC_GetDateTime(TM_RTC_t *data, TM_RTC_Format_t format)
Gets date and time from internal RTC registers.
Definition: tm_stm32_rtc.h:188
uint8_t Year
Definition: tm_stm32_rtc.h:155
uint32_t TM_RTC_ReadBackupRegister(uint8_t location)
Reads RTC backup register value. This method allows you to read 32bit value from backup register 0 - ...
TM_RTC_AlarmType_t
RTC Alarm type.
Definition: tm_stm32_rtc.h:204
Definition: tm_stm32_rtc.h:198
Definition: tm_stm32_rtc.h:197
Definition: tm_stm32_rtc.h:163
Definition: tm_stm32_rtc.h:206
TM_RTC_Alarm_t
Alarm identifier you will use for Alarm functions.
Definition: tm_stm32_rtc.h:212
Definition: tm_stm32_rtc.h:171
TM_RTC_Result_t TM_RTC_EnableAlarm(TM_RTC_Alarm_t Alarm, TM_RTC_AlarmTime_t *AlarmTime, TM_RTC_Format_t format)
Enables alarm A or alarm B.
uint8_t Seconds
Definition: tm_stm32_rtc.h:222
uint8_t Month
Definition: tm_stm32_rtc.h:154
Definition: tm_stm32_rtc.h:213
Definition: tm_stm32_rtc.h:184
Definition: tm_stm32_rtc.h:164
TM_RTC_Result_t TM_RTC_GetDateTimeFromUnix(TM_RTC_t *data, uint32_t unix)
Gets formatted time from seconds till 01.01.1970 00:00:00 It fills struct with valid data...
TM_RTC_Result_t TM_RTC_DisableAlarm(TM_RTC_Alarm_t Alarm)
Disables specific alarm.
uint8_t Minutes
Definition: tm_stm32_rtc.h:150
uint32_t TM_RTC_GetUnixTimeStamp(TM_RTC_t *data)
Gets number of seconds from date and time since 01.01.1970 00:00:00.
uint32_t TM_RTC_Init(TM_RTC_ClockSource_t source)
Initializes RTC and starts counting.
Definition: tm_stm32_rtc.h:182
RTC structure for alarm time.
Definition: tm_stm32_rtc.h:220
Definition: tm_stm32_rtc.h:181
TM_RTC_Format_t
RTC date and time format.
Definition: tm_stm32_rtc.h:170
void TM_RTC_WakeupHandler(void)
RTC Wakeup handler function. Called when wakeup interrupt is triggered.
Definition: tm_stm32_rtc.h:172
uint8_t Hours
Definition: tm_stm32_rtc.h:151
uint8_t Day
Definition: tm_stm32_rtc.h:225
Definition: tm_stm32_rtc.h:185
TM_RTC_Result_t TM_RTC_SetDateTimeString(char *str)
Sets date and time using string formatted date time.
uint8_t WeekDay
Definition: tm_stm32_rtc.h:152
void TM_RTC_WriteBackupRegister(uint8_t location, uint32_t value)
Writes RTC backup register value. This method allows you to write 32bit value from backup register 0 ...
uint16_t TM_RTC_GetDaysInYear(uint8_t year)
Gets number of days in specific year.
uint32_t Unix
Definition: tm_stm32_rtc.h:156