142 #include "stm32f4xx.h"
143 #include "stm32f4xx_rcc.h"
144 #include "stm32f4xx_rtc.h"
145 #include "stm32f4xx_pwr.h"
146 #include "stm32f4xx_exti.h"
149 #include "attributes.h"
162 #ifndef RTC_SYNC_PREDIV
163 #define RTC_SYNC_PREDIV 0x3FF
166 #ifndef RTC_ASYNC_PREDIV
167 #define RTC_ASYNC_PREDIV 0x1F
171 #define RTC_PRIORITY 0x04
174 #ifndef RTC_WAKEUP_SUBPRIORITY
175 #define RTC_WAKEUP_SUBPRIORITY 0x00
178 #ifndef RTC_ALARM_SUBPRIORITY
179 #define RTC_ALARM_SUBPRIORITY 0x01
void TM_RTC_DisableAlarm(TM_RTC_Alarm_t Alarm)
Disables specific alarm.
RTC Struct for date/time.
Definition: tm_stm32f4_rtc.h:195
uint8_t TM_RTC_GetDaysInMonth(uint8_t month, uint8_t year)
Get number of days in month.
void TM_RTC_GetDateTime(TM_RTC_t *data, TM_RTC_Format_t format)
Get date and time from internal RTC registers.
uint16_t subseconds
Definition: tm_stm32f4_rtc.h:197
Definition: tm_stm32f4_rtc.h:233
uint32_t unix
Definition: tm_stm32f4_rtc.h:205
Definition: tm_stm32f4_rtc.h:268
uint8_t seconds
Definition: tm_stm32f4_rtc.h:196
void TM_RTC_Interrupts(TM_RTC_Int_t int_value)
Select RTC wakeup interrupts interval.
uint8_t year
Definition: tm_stm32f4_rtc.h:204
uint8_t day
Definition: tm_stm32f4_rtc.h:279
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_stm32f4_rtc.h:241
TM_RTC_Int_t
RTC Interrupt enumeration.
Definition: tm_stm32f4_rtc.h:232
TM_RTC_Result_t TM_RTC_SetDateTime(TM_RTC_t *data, TM_RTC_Format_t format)
Set date and time to internal RTC registers.
Definition: tm_stm32f4_rtc.h:240
Definition: tm_stm32f4_rtc.h:243
TM_RTC_ClockSource_t
Select RTC clock source.
Definition: tm_stm32f4_rtc.h:250
Definition: tm_stm32f4_rtc.h:234
TM_RTC_Result_t
RTC Result enumeration.
Definition: tm_stm32f4_rtc.h:216
Definition: tm_stm32f4_rtc.h:259
Definition: tm_stm32f4_rtc.h:237
uint8_t minutes
Definition: tm_stm32f4_rtc.h:277
Definition: tm_stm32f4_rtc.h:242
uint8_t hours
Definition: tm_stm32f4_rtc.h:200
TM_RTC_AlarmType_t alarmtype
Definition: tm_stm32f4_rtc.h:275
uint32_t TM_RTC_ReadBackupRegister(uint8_t location)
Read RTC backup register value. This method allows you to read 32bit value from backup register 0 - 1...
TM_RTC_AlarmType_t
RTC Alarm type.
Definition: tm_stm32f4_rtc.h:258
Definition: tm_stm32f4_rtc.h:252
Definition: tm_stm32f4_rtc.h:251
Definition: tm_stm32f4_rtc.h:217
Definition: tm_stm32f4_rtc.h:260
uint8_t minutes
Definition: tm_stm32f4_rtc.h:199
TM_RTC_Alarm_t
Alarm identifier you will use for Alarm functions.
Definition: tm_stm32f4_rtc.h:266
Definition: tm_stm32f4_rtc.h:225
Definition: tm_stm32f4_rtc.h:267
Definition: tm_stm32f4_rtc.h:238
Definition: tm_stm32f4_rtc.h:218
uint8_t day
Definition: tm_stm32f4_rtc.h:201
uint32_t TM_RTC_GetUnixTimeStamp(TM_RTC_t *data)
Get 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_stm32f4_rtc.h:236
void TM_RTC_RequestHandler(void)
RTC Wakeup handler function. Called when wakeup interrupt is triggered.
RTC structure for alarm time.
Definition: tm_stm32f4_rtc.h:274
uint8_t date
Definition: tm_stm32f4_rtc.h:202
Definition: tm_stm32f4_rtc.h:235
TM_RTC_Format_t
RTC date and time format.
Definition: tm_stm32f4_rtc.h:224
Definition: tm_stm32f4_rtc.h:226
TM_RTC_t TM_RTC_Time_t
Backward compatibility for RTC time.
Definition: tm_stm32f4_rtc.h:211
Definition: tm_stm32f4_rtc.h:239
uint8_t month
Definition: tm_stm32f4_rtc.h:203
TM_RTC_Result_t TM_RTC_SetDateTimeString(char *str)
Set date and time using string formatted date time.
uint8_t hours
Definition: tm_stm32f4_rtc.h:278
uint8_t seconds
Definition: tm_stm32f4_rtc.h:276
void TM_RTC_WriteBackupRegister(uint8_t location, uint32_t value)
Write RTC backup register value. This method allows you to write 32bit value from backup register 0 -...
uint16_t TM_RTC_GetDaysInYear(uint8_t year)
Get number of days in specific year.
void TM_RTC_GetDateTimeFromUnix(TM_RTC_t *data, uint32_t unix)
Get formatted time from seconds till 01.01.1970 00:00:00 It fills struct with valid data...
void TM_RTC_SetAlarm(TM_RTC_Alarm_t Alarm, TM_RTC_AlarmTime_t *AlarmTime, TM_RTC_Format_t format)
Enables alarm A or alarm B.