20#ifndef STM32H7xx_HAL_RTC_H
21#define STM32H7xx_HAL_RTC_H
84 uint32_t OutPutPullUp;
171#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
172typedef struct __RTC_HandleTypeDef
185#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
186 void (* AlarmAEventCallback)(
struct __RTC_HandleTypeDef *hrtc);
188 void (* AlarmBEventCallback)(
struct __RTC_HandleTypeDef *hrtc);
190 void (* TimeStampEventCallback)(
struct __RTC_HandleTypeDef *hrtc);
192 void (* WakeUpTimerEventCallback)(
struct __RTC_HandleTypeDef *hrtc);
194 void (* Tamper1EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
196 void (* Tamper2EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
198 void (* Tamper3EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
201 void (* InternalTamper1EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
203 void (* InternalTamper2EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
205 void (* InternalTamper3EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
207 void (* InternalTamper4EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
209 void (* InternalTamper5EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
211 void (* InternalTamper6EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
213 void (* InternalTamper8EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
216 void (* MspInitCallback)(
struct __RTC_HandleTypeDef *hrtc);
218 void (* MspDeInitCallback)(
struct __RTC_HandleTypeDef *hrtc);
224#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
230 HAL_RTC_ALARM_A_EVENT_CB_ID = 0u,
231 HAL_RTC_ALARM_B_EVENT_CB_ID = 1u,
232 HAL_RTC_TIMESTAMP_EVENT_CB_ID = 2u,
233 HAL_RTC_WAKEUPTIMER_EVENT_CB_ID = 3u,
234 HAL_RTC_TAMPER1_EVENT_CB_ID = 4u,
235 HAL_RTC_TAMPER2_EVENT_CB_ID = 5u,
236 HAL_RTC_TAMPER3_EVENT_CB_ID = 6u,
238 HAL_RTC_INTERNAL_TAMPER1_EVENT_CB_ID = 12u,
239 HAL_RTC_INTERNAL_TAMPER2_EVENT_CB_ID = 13u,
240 HAL_RTC_INTERNAL_TAMPER3_EVENT_CB_ID = 14u,
241 HAL_RTC_INTERNAL_TAMPER4_EVENT_CB_ID = 15u,
242 HAL_RTC_INTERNAL_TAMPER5_EVENT_CB_ID = 16u,
243 HAL_RTC_INTERNAL_TAMPER6_EVENT_CB_ID = 17u,
244 HAL_RTC_INTERNAL_TAMPER8_EVENT_CB_ID = 19u,
246 HAL_RTC_MSPINIT_CB_ID = 20u,
247 HAL_RTC_MSPDEINIT_CB_ID = 21u
248} HAL_RTC_CallbackIDTypeDef;
270#define RTC_HOURFORMAT_24 0x00000000u
271#define RTC_HOURFORMAT_12 RTC_CR_FMT
280#define RTC_OUTPUT_DISABLE 0x00000000u
281#define RTC_OUTPUT_ALARMA RTC_CR_OSEL_0
282#define RTC_OUTPUT_ALARMB RTC_CR_OSEL_1
283#define RTC_OUTPUT_WAKEUP RTC_CR_OSEL
285#define RTC_OUTPUT_TAMPER RTC_CR_TAMPOE
295#define RTC_OUTPUT_POLARITY_HIGH 0x00000000u
296#define RTC_OUTPUT_POLARITY_LOW RTC_CR_POL
306#define RTC_OUTPUT_TYPE_PUSHPULL 0x00000000u
307#define RTC_OUTPUT_TYPE_OPENDRAIN RTC_CR_TAMPALRM_TYPE
308#define RTC_ALARM_OUTPUT_TYPE RTC_CR_TAMPALRM_TYPE
310#define RTC_OUTPUT_TYPE_PUSHPULL RTC_OR_ALARMOUTTYPE
311#define RTC_OUTPUT_TYPE_OPENDRAIN 0x00000000u
312#define RTC_ALARM_OUTPUT_TYPE RTC_OR_ALARMOUTTYPE
323#define RTC_OUTPUT_PULLUP_NONE 0x00000000u
324#define RTC_OUTPUT_PULLUP_ON RTC_CR_TAMPALRM_PU
335#define RTC_OUTPUT_REMAP_NONE 0x00000000u
336#define RTC_OUTPUT_REMAP_POS1 RTC_CR_OUT2EN
338#define RTC_OUTPUT_REMAP_NONE 0x00000000u
339#define RTC_OUTPUT_REMAP_POS1 RTC_OR_OUT_RMP
349#define RTC_HOURFORMAT12_AM ((uint8_t)0x00)
350#define RTC_HOURFORMAT12_PM ((uint8_t)0x01)
359#define RTC_DAYLIGHTSAVING_SUB1H RTC_CR_SUB1H
360#define RTC_DAYLIGHTSAVING_ADD1H RTC_CR_ADD1H
361#define RTC_DAYLIGHTSAVING_NONE 0x00000000u
370#define RTC_STOREOPERATION_RESET 0x00000000u
371#define RTC_STOREOPERATION_SET RTC_CR_BKP
380#define RTC_FORMAT_BIN 0x00000000u
381#define RTC_FORMAT_BCD 0x00000001u
390#define RTC_MONTH_JANUARY ((uint8_t)0x01)
391#define RTC_MONTH_FEBRUARY ((uint8_t)0x02)
392#define RTC_MONTH_MARCH ((uint8_t)0x03)
393#define RTC_MONTH_APRIL ((uint8_t)0x04)
394#define RTC_MONTH_MAY ((uint8_t)0x05)
395#define RTC_MONTH_JUNE ((uint8_t)0x06)
396#define RTC_MONTH_JULY ((uint8_t)0x07)
397#define RTC_MONTH_AUGUST ((uint8_t)0x08)
398#define RTC_MONTH_SEPTEMBER ((uint8_t)0x09)
399#define RTC_MONTH_OCTOBER ((uint8_t)0x10)
400#define RTC_MONTH_NOVEMBER ((uint8_t)0x11)
401#define RTC_MONTH_DECEMBER ((uint8_t)0x12)
411#define RTC_WEEKDAY_MONDAY ((uint8_t)0x01)
412#define RTC_WEEKDAY_TUESDAY ((uint8_t)0x02)
413#define RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03)
414#define RTC_WEEKDAY_THURSDAY ((uint8_t)0x04)
415#define RTC_WEEKDAY_FRIDAY ((uint8_t)0x05)
416#define RTC_WEEKDAY_SATURDAY ((uint8_t)0x06)
417#define RTC_WEEKDAY_SUNDAY ((uint8_t)0x07)
427#define RTC_ALARMDATEWEEKDAYSEL_DATE 0x00000000u
428#define RTC_ALARMDATEWEEKDAYSEL_WEEKDAY RTC_ALRMAR_WDSEL
438#define RTC_ALARMMASK_NONE 0x00000000u
439#define RTC_ALARMMASK_DATEWEEKDAY RTC_ALRMAR_MSK4
440#define RTC_ALARMMASK_HOURS RTC_ALRMAR_MSK3
441#define RTC_ALARMMASK_MINUTES RTC_ALRMAR_MSK2
442#define RTC_ALARMMASK_SECONDS RTC_ALRMAR_MSK1
443#define RTC_ALARMMASK_ALL (RTC_ALARMMASK_DATEWEEKDAY | \
444 RTC_ALARMMASK_HOURS | \
445 RTC_ALARMMASK_MINUTES | \
446 RTC_ALARMMASK_SECONDS)
455#define RTC_ALARM_A RTC_CR_ALRAE
456#define RTC_ALARM_B RTC_CR_ALRBE
466#define RTC_ALARMSUBSECONDMASK_ALL 0x00000000u
468#define RTC_ALARMSUBSECONDMASK_SS14_1 RTC_ALRMASSR_MASKSS_0
470#define RTC_ALARMSUBSECONDMASK_SS14_2 RTC_ALRMASSR_MASKSS_1
472#define RTC_ALARMSUBSECONDMASK_SS14_3 (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_1)
474#define RTC_ALARMSUBSECONDMASK_SS14_4 RTC_ALRMASSR_MASKSS_2
476#define RTC_ALARMSUBSECONDMASK_SS14_5 (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_2)
478#define RTC_ALARMSUBSECONDMASK_SS14_6 (RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_2)
480#define RTC_ALARMSUBSECONDMASK_SS14_7 (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_2)
482#define RTC_ALARMSUBSECONDMASK_SS14_8 RTC_ALRMASSR_MASKSS_3
484#define RTC_ALARMSUBSECONDMASK_SS14_9 (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_3)
486#define RTC_ALARMSUBSECONDMASK_SS14_10 (RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_3)
488#define RTC_ALARMSUBSECONDMASK_SS14_11 (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_3)
490#define RTC_ALARMSUBSECONDMASK_SS14_12 (RTC_ALRMASSR_MASKSS_2 | RTC_ALRMASSR_MASKSS_3)
492#define RTC_ALARMSUBSECONDMASK_SS14_13 (RTC_ALRMASSR_MASKSS_0 | RTC_ALRMASSR_MASKSS_2 | RTC_ALRMASSR_MASKSS_3)
494#define RTC_ALARMSUBSECONDMASK_SS14 (RTC_ALRMASSR_MASKSS_1 | RTC_ALRMASSR_MASKSS_2 | RTC_ALRMASSR_MASKSS_3)
496#define RTC_ALARMSUBSECONDMASK_NONE RTC_ALRMASSR_MASKSS
506#define RTC_IT_TS RTC_CR_TSIE
507#define RTC_IT_WUT RTC_CR_WUTIE
508#define RTC_IT_ALRA RTC_CR_ALRAIE
509#define RTC_IT_ALRB RTC_CR_ALRBIE
519#define RTC_FLAG_RECALPF RTC_ICSR_RECALPF
520#define RTC_FLAG_INITF RTC_ICSR_INITF
521#define RTC_FLAG_RSF RTC_ICSR_RSF
522#define RTC_FLAG_INITS RTC_ICSR_INITS
523#define RTC_FLAG_SHPF RTC_ICSR_SHPF
524#define RTC_FLAG_WUTWF RTC_ICSR_WUTWF
525#define RTC_FLAG_ALRBWF RTC_ICSR_ALRBWF
526#define RTC_FLAG_ALRAWF RTC_ICSR_ALRAWF
527#define RTC_FLAG_ITSF RTC_SR_ITSF
528#define RTC_FLAG_TSOVF RTC_SR_TSOVF
529#define RTC_FLAG_TSF RTC_SR_TSF
530#define RTC_FLAG_WUTF RTC_SR_WUTF
531#define RTC_FLAG_ALRBF RTC_SR_ALRBF
532#define RTC_FLAG_ALRAF RTC_SR_ALRAF
534#define RTC_FLAG_RECALPF RTC_ISR_RECALPF
535#define RTC_FLAG_TSOVF RTC_ISR_TSOVF
536#define RTC_FLAG_TSF RTC_ISR_TSF
537#define RTC_FLAG_ITSF RTC_ISR_ITSF
538#define RTC_FLAG_WUTF RTC_ISR_WUTF
539#define RTC_FLAG_ALRBF RTC_ISR_ALRBF
540#define RTC_FLAG_ALRAF RTC_ISR_ALRAF
541#define RTC_FLAG_INITF RTC_ISR_INITF
542#define RTC_FLAG_RSF RTC_ISR_RSF
543#define RTC_FLAG_INITS RTC_ISR_INITS
544#define RTC_FLAG_SHPF RTC_ISR_SHPF
545#define RTC_FLAG_WUTWF RTC_ISR_WUTWF
546#define RTC_FLAG_ALRBWF RTC_ISR_ALRBWF
547#define RTC_FLAG_ALRAWF RTC_ISR_ALRAWF
558#define RTC_CLEAR_ITSF RTC_SCR_CITSF
559#define RTC_CLEAR_TSOVF RTC_SCR_CTSOVF
560#define RTC_CLEAR_TSF RTC_SCR_CTSF
561#define RTC_CLEAR_WUTF RTC_SCR_CWUTF
562#define RTC_CLEAR_ALRBF RTC_SCR_CALRBF
563#define RTC_CLEAR_ALRAF RTC_SCR_CALRAF
584#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
585#define __HAL_RTC_RESET_HANDLE_STATE(__HANDLE__) do{ \
586 (__HANDLE__)->State = HAL_RTC_STATE_RESET; \
587 (__HANDLE__)->MspInitCallback = NULL; \
588 (__HANDLE__)->MspDeInitCallback = NULL; \
591#define __HAL_RTC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RTC_STATE_RESET)
599#define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__) \
601 (__HANDLE__)->Instance->WPR = 0xCAU; \
602 (__HANDLE__)->Instance->WPR = 0x53U; \
610#define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__) \
612 (__HANDLE__)->Instance->WPR = 0xFFU; \
621#define __HAL_RTC_IS_CALENDAR_INITIALIZED(__HANDLE__) (((((__HANDLE__)->Instance->ICSR) & (RTC_FLAG_INITS)) == RTC_FLAG_INITS) ? 1U : 0U)
623#define __HAL_RTC_IS_CALENDAR_INITIALIZED(__HANDLE__) (((((__HANDLE__)->Instance->ISR) & (RTC_FLAG_INITS)) == RTC_FLAG_INITS) ? 1U : 0U)
635#define __HAL_RTC_DAYLIGHT_SAVING_TIME_ADD1H(__HANDLE__, __BKP__) \
637 __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__); \
638 SET_BIT((__HANDLE__)->Instance->CR, RTC_CR_ADD1H); \
639 MODIFY_REG((__HANDLE__)->Instance->CR, RTC_CR_BKP , (__BKP__)); \
640 __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__); \
652#define __HAL_RTC_DAYLIGHT_SAVING_TIME_SUB1H(__HANDLE__, __BKP__) \
654 __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__); \
655 SET_BIT((__HANDLE__)->Instance->CR, RTC_CR_SUB1H); \
656 MODIFY_REG((__HANDLE__)->Instance->CR, RTC_CR_BKP , (__BKP__)); \
657 __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__); \
665#define __HAL_RTC_ALARMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRAE))
672#define __HAL_RTC_ALARMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRAE))
679#define __HAL_RTC_ALARMB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRBE))
686#define __HAL_RTC_ALARMB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRBE))
697#define __HAL_RTC_ALARM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
708#define __HAL_RTC_ALARM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
720#define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->MISR)& (__INTERRUPT__ >> 12)) != 0U)? 1U : 0U)
722#define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR)& (__INTERRUPT__ >> 4)) != 0U)? 1U : 0U)
734#define __HAL_RTC_ALARM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != 0U) ? 1U : 0U)
746#define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->SR) & (__FLAG__)) != 0U) ? 1U : 0U)
759#define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U)
772#define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SCR = __FLAG__)
774#define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)))
783#define __HAL_RTC_ALARM_EXTI_ENABLE_IT() (EXTI_D1->IMR1 |= RTC_EXTI_LINE_ALARM_EVENT)
785#define __HAL_RTC_ALARM_EXTI_ENABLE_IT() (EXTI->IMR1 |= RTC_EXTI_LINE_ALARM_EVENT)
793#define __HAL_RTC_ALARM_EXTI_DISABLE_IT() (EXTI_D1->IMR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
795#define __HAL_RTC_ALARM_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
803#define __HAL_RTC_ALARM_EXTI_ENABLE_EVENT() (EXTI_D1->EMR1 |= RTC_EXTI_LINE_ALARM_EVENT)
805#define __HAL_RTC_ALARM_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= RTC_EXTI_LINE_ALARM_EVENT)
813#define __HAL_RTC_ALARM_EXTI_DISABLE_EVENT() (EXTI_D1->EMR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
815#define __HAL_RTC_ALARM_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
818#if defined(DUAL_CORE)
823#define __HAL_RTC_ALARM_EXTID2_ENABLE_IT() (EXTI_D2->IMR1 |= RTC_EXTI_LINE_ALARM_EVENT)
829#define __HAL_RTC_ALARM_EXTID2_DISABLE_IT() (EXTI_D2->IMR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
835#define __HAL_RTC_ALARM_EXTID2_ENABLE_EVENT() (EXTI_D2->EMR1 |= RTC_EXTI_LINE_ALARM_EVENT)
841#define __HAL_RTC_ALARM_EXTID2_DISABLE_EVENT() (EXTI_D2->EMR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
848#define __HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR1 |= RTC_EXTI_LINE_ALARM_EVENT)
854#define __HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
860#define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR1 |= RTC_EXTI_LINE_ALARM_EVENT)
866#define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_ALARM_EVENT))
872#define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
873 __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE(); \
874 __HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE(); \
881#define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
882 __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE(); \
883 __HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE(); \
891#define __HAL_RTC_ALARM_EXTI_GET_FLAG() (EXTI_D1->PR1 & RTC_EXTI_LINE_ALARM_EVENT)
893#define __HAL_RTC_ALARM_EXTI_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_ALARM_EVENT)
901#define __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() (EXTI_D1->PR1 = (RTC_EXTI_LINE_ALARM_EVENT))
903#define __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() (EXTI->PR1 = (RTC_EXTI_LINE_ALARM_EVENT))
906#if defined(DUAL_CORE)
911#define __HAL_RTC_ALARM_EXTID2_GET_FLAG() (EXTI_D2->PR1 & RTC_EXTI_LINE_ALARM_EVENT)
917#define __HAL_RTC_ALARM_EXTID2_CLEAR_FLAG() (EXTI_D2->PR1 = (RTC_EXTI_LINE_ALARM_EVENT))
923#define __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() (EXTI->SWIER1 |= RTC_EXTI_LINE_ALARM_EVENT)
950#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
1019#define RTC_TR_RESERVED_MASK (RTC_TR_PM | RTC_TR_HT | RTC_TR_HU | \
1020 RTC_TR_MNT | RTC_TR_MNU| RTC_TR_ST | \
1023#define RTC_DR_RESERVED_MASK (RTC_DR_YT | RTC_DR_YU | RTC_DR_WDU | \
1024 RTC_DR_MT | RTC_DR_MU | RTC_DR_DT | \
1027#define RTC_INIT_MASK 0xFFFFFFFFu
1030#define RTC_ICSR_RESERVED_MASK 0x000100FFu
1031#define RTC_RSF_MASK (~(RTC_ICSR_INIT | RTC_ICSR_RSF))
1033#define RTC_ISR_RESERVED_MASK 0x0003FFFFu
1034#define RTC_RSF_MASK (~(RTC_ISR_INIT | RTC_ISR_RSF))
1037#define RTC_TIMEOUT_VALUE 1000u
1039#define RTC_EXTI_LINE_ALARM_EVENT EXTI_IMR1_IM17
1057#define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \
1058 ((OUTPUT) == RTC_OUTPUT_ALARMA) || \
1059 ((OUTPUT) == RTC_OUTPUT_ALARMB) || \
1060 ((OUTPUT) == RTC_OUTPUT_WAKEUP) || \
1061 ((OUTPUT) == RTC_OUTPUT_TAMPER))
1063#define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \
1064 ((OUTPUT) == RTC_OUTPUT_ALARMA) || \
1065 ((OUTPUT) == RTC_OUTPUT_ALARMB) || \
1066 ((OUTPUT) == RTC_OUTPUT_WAKEUP))
1069#define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HOURFORMAT_12) || \
1070 ((FORMAT) == RTC_HOURFORMAT_24))
1072#define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OUTPUT_POLARITY_HIGH) || \
1073 ((POL) == RTC_OUTPUT_POLARITY_LOW))
1075#define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OUTPUT_TYPE_OPENDRAIN) || \
1076 ((TYPE) == RTC_OUTPUT_TYPE_PUSHPULL))
1079#define IS_RTC_OUTPUT_PULLUP(TYPE) (((TYPE) == RTC_OUTPUT_PULLUP_NONE) || \
1080 ((TYPE) == RTC_OUTPUT_PULLUP_ON))
1083#define IS_RTC_OUTPUT_REMAP(REMAP) (((REMAP) == RTC_OUTPUT_REMAP_NONE) || \
1084 ((REMAP) == RTC_OUTPUT_REMAP_POS1))
1086#define IS_RTC_HOURFORMAT12(PM) (((PM) == RTC_HOURFORMAT12_AM) || \
1087 ((PM) == RTC_HOURFORMAT12_PM))
1089#define IS_RTC_DAYLIGHT_SAVING(SAVE) (((SAVE) == RTC_DAYLIGHTSAVING_SUB1H) || \
1090 ((SAVE) == RTC_DAYLIGHTSAVING_ADD1H) || \
1091 ((SAVE) == RTC_DAYLIGHTSAVING_NONE))
1093#define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_STOREOPERATION_RESET) || \
1094 ((OPERATION) == RTC_STOREOPERATION_SET))
1096#define IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_FORMAT_BIN) || \
1097 ((FORMAT) == RTC_FORMAT_BCD))
1099#define IS_RTC_YEAR(YEAR) ((YEAR) <= 99u)
1101#define IS_RTC_MONTH(MONTH) (((MONTH) >= 1u) && ((MONTH) <= 12u))
1103#define IS_RTC_DATE(DATE) (((DATE) >= 1u) && ((DATE) <= 31u))
1105#define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \
1106 ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \
1107 ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \
1108 ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \
1109 ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \
1110 ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \
1111 ((WEEKDAY) == RTC_WEEKDAY_SUNDAY))
1113#define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) > 0u) && ((DATE) <= 31u))
1115#define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \
1116 ((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \
1117 ((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \
1118 ((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \
1119 ((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \
1120 ((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \
1121 ((WEEKDAY) == RTC_WEEKDAY_SUNDAY))
1123#define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_ALARMDATEWEEKDAYSEL_DATE) || \
1124 ((SEL) == RTC_ALARMDATEWEEKDAYSEL_WEEKDAY))
1126#define IS_RTC_ALARM_MASK(MASK) (((MASK) & ~(RTC_ALARMMASK_ALL)) == 0u)
1128#define IS_RTC_ALARM(ALARM) (((ALARM) == RTC_ALARM_A) || \
1129 ((ALARM) == RTC_ALARM_B))
1131#define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= RTC_ALRMASSR_SS)
1133#define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == 0u) || \
1134 (((MASK) >= RTC_ALARMSUBSECONDMASK_SS14_1) && ((MASK) <= RTC_ALARMSUBSECONDMASK_NONE)))
1136#define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= (RTC_PRER_PREDIV_A >> RTC_PRER_PREDIV_A_Pos))
1138#define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= (RTC_PRER_PREDIV_S >> RTC_PRER_PREDIV_S_Pos))
1140#define IS_RTC_HOUR12(HOUR) (((HOUR) > 0u) && ((HOUR) <= 12u))
1142#define IS_RTC_HOUR24(HOUR) ((HOUR) <= 23u)
1144#define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= 59u)
1146#define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= 59u)
1163uint8_t RTC_ByteToBcd2(uint8_t Value);
1164uint8_t RTC_Bcd2ToByte(uint8_t Value);
#define __IO
Definition: core_cm4.h:239
void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc)
ALARM A Event Callback in non blocking mode.
Definition: stm32h7xx_hal_timebase_rtc_alarm_template.c:294
HAL_RTCStateTypeDef
HAL State structures definition.
Definition: stm32h7xx_hal_rtc.h:49
@ HAL_RTC_STATE_TIMEOUT
Definition: stm32h7xx_hal_rtc.h:53
@ HAL_RTC_STATE_ERROR
Definition: stm32h7xx_hal_rtc.h:54
@ HAL_RTC_STATE_READY
Definition: stm32h7xx_hal_rtc.h:51
@ HAL_RTC_STATE_BUSY
Definition: stm32h7xx_hal_rtc.h:52
@ HAL_RTC_STATE_RESET
Definition: stm32h7xx_hal_rtc.h:50
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47
HAL_LockTypeDef
HAL Lock structures definition.
Definition: stm32h7xx_hal_def.h:58
Header file of RTC HAL Extension module.
RTC Alarm structure definition.
Definition: stm32h7xx_hal_rtc.h:148
uint8_t AlarmDateWeekDay
Definition: stm32h7xx_hal_rtc.h:160
RTC_TimeTypeDef AlarmTime
Definition: stm32h7xx_hal_rtc.h:149
uint32_t Alarm
Definition: stm32h7xx_hal_rtc.h:164
uint32_t AlarmDateWeekDaySel
Definition: stm32h7xx_hal_rtc.h:157
uint32_t AlarmMask
Definition: stm32h7xx_hal_rtc.h:151
uint32_t AlarmSubSecondMask
Definition: stm32h7xx_hal_rtc.h:154
RTC Date structure definition.
Definition: stm32h7xx_hal_rtc.h:129
uint8_t Year
Definition: stm32h7xx_hal_rtc.h:139
uint8_t Month
Definition: stm32h7xx_hal_rtc.h:133
uint8_t Date
Definition: stm32h7xx_hal_rtc.h:136
uint8_t WeekDay
Definition: stm32h7xx_hal_rtc.h:130
RTC Handle Structure definition.
Definition: stm32h7xx_hal_rtc.h:176
RTC_TypeDef * Instance
Definition: stm32h7xx_hal_rtc.h:177
RTC_InitTypeDef Init
Definition: stm32h7xx_hal_rtc.h:179
__IO HAL_RTCStateTypeDef State
Definition: stm32h7xx_hal_rtc.h:183
HAL_LockTypeDef Lock
Definition: stm32h7xx_hal_rtc.h:181
RTC Configuration Structure definition.
Definition: stm32h7xx_hal_rtc.h:62
uint32_t OutPutPolarity
Definition: stm32h7xx_hal_rtc.h:78
uint32_t OutPutType
Definition: stm32h7xx_hal_rtc.h:81
uint32_t OutPutRemap
Definition: stm32h7xx_hal_rtc.h:75
uint32_t AsynchPrediv
Definition: stm32h7xx_hal_rtc.h:66
uint32_t HourFormat
Definition: stm32h7xx_hal_rtc.h:63
uint32_t SynchPrediv
Definition: stm32h7xx_hal_rtc.h:69
uint32_t OutPut
Definition: stm32h7xx_hal_rtc.h:72
RTC Time structure definition.
Definition: stm32h7xx_hal_rtc.h:93
uint8_t Seconds
Definition: stm32h7xx_hal_rtc.h:101
uint8_t Minutes
Definition: stm32h7xx_hal_rtc.h:98
uint8_t TimeFormat
Definition: stm32h7xx_hal_rtc.h:104
uint32_t StoreOperation
Definition: stm32h7xx_hal_rtc.h:120
uint32_t SecondFraction
Definition: stm32h7xx_hal_rtc.h:111
uint32_t DayLightSaving
Definition: stm32h7xx_hal_rtc.h:117
uint32_t SubSeconds
Definition: stm32h7xx_hal_rtc.h:107
uint8_t Hours
Definition: stm32h7xx_hal_rtc.h:94
Real-Time Clock.
Definition: stm32h723xx.h:1307