1 /** 2 ****************************************************************************** 3 * @file stm32wbxx_hal_rtc_ex.h 4 * @author MCD Application Team 5 * @brief Header file of RTC HAL Extended module. 6 ****************************************************************************** 7 * @attention 8 * 9 * Copyright (c) 2019 STMicroelectronics. 10 * All rights reserved. 11 * 12 * This software is licensed under terms that can be found in the LICENSE file 13 * in the root directory of this software component. 14 * If no LICENSE file comes with this software, it is provided AS-IS. 15 * 16 ****************************************************************************** 17 */ 18 19 /* Define to prevent recursive inclusion -------------------------------------*/ 20 #ifndef STM32WBxx_HAL_RTC_EX_H 21 #define STM32WBxx_HAL_RTC_EX_H 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 /* Includes ------------------------------------------------------------------*/ 28 #include "stm32wbxx_hal_def.h" 29 30 /** @addtogroup STM32WBxx_HAL_Driver 31 * @{ 32 */ 33 34 /** @defgroup RTCEx RTCEx 35 * @{ 36 */ 37 38 /* Exported types ------------------------------------------------------------*/ 39 40 /** @defgroup RTCEx_Exported_Types RTCEx Exported Types 41 * @{ 42 */ 43 44 /** 45 * @brief RTC Tamper structure definition 46 */ 47 typedef struct 48 { 49 uint32_t Tamper; /*!< Specifies the Tamper Pin. 50 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */ 51 52 uint32_t Interrupt; /*!< Specifies the Tamper Interrupt. 53 This parameter can be a value of @ref RTCEx_Tamper_Interrupt_Definitions */ 54 55 uint32_t Trigger; /*!< Specifies the Tamper Trigger. 56 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */ 57 58 uint32_t NoErase; /*!< Specifies the Tamper no erase mode. 59 This parameter can be a value of @ref RTCEx_Tamper_EraseBackUp_Definitions */ 60 61 uint32_t MaskFlag; /*!< Specifies the Tamper Flag masking. 62 This parameter can be a value of @ref RTCEx_Tamper_MaskFlag_Definitions */ 63 64 uint32_t Filter; /*!< Specifies the RTC Filter Tamper. 65 This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */ 66 67 uint32_t SamplingFrequency; /*!< Specifies the sampling frequency. 68 This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */ 69 70 uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration . 71 This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */ 72 73 uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp . 74 This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */ 75 76 uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection. 77 This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */ 78 } RTC_TamperTypeDef; 79 /** 80 * @} 81 */ 82 83 /* Exported constants --------------------------------------------------------*/ 84 /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants 85 * @{ 86 */ 87 88 /** @defgroup RTCEx_Output_selection_Definitions RTCEx Output Selection Definition 89 * @{ 90 */ 91 #define RTC_OUTPUT_DISABLE ((uint32_t)0x00000000U) 92 #define RTC_OUTPUT_ALARMA ((uint32_t)RTC_CR_OSEL_0) 93 #define RTC_OUTPUT_ALARMB ((uint32_t)RTC_CR_OSEL_1) 94 #define RTC_OUTPUT_WAKEUP ((uint32_t)RTC_CR_OSEL) 95 96 /** 97 * @} 98 */ 99 100 /** @defgroup RTCEx_Backup_Registers_Definitions RTCEx Backup Registers Definition 101 * @{ 102 */ 103 #define RTC_BKP_DR0 ((uint32_t)0x00000000U) 104 #define RTC_BKP_DR1 ((uint32_t)0x00000001U) 105 #define RTC_BKP_DR2 ((uint32_t)0x00000002U) 106 #define RTC_BKP_DR3 ((uint32_t)0x00000003U) 107 #define RTC_BKP_DR4 ((uint32_t)0x00000004U) 108 #define RTC_BKP_DR5 ((uint32_t)0x00000005U) 109 #define RTC_BKP_DR6 ((uint32_t)0x00000006U) 110 #define RTC_BKP_DR7 ((uint32_t)0x00000007U) 111 #define RTC_BKP_DR8 ((uint32_t)0x00000008U) 112 #define RTC_BKP_DR9 ((uint32_t)0x00000009U) 113 #define RTC_BKP_DR10 ((uint32_t)0x0000000AU) 114 #define RTC_BKP_DR11 ((uint32_t)0x0000000BU) 115 #define RTC_BKP_DR12 ((uint32_t)0x0000000CU) 116 #define RTC_BKP_DR13 ((uint32_t)0x0000000DU) 117 #define RTC_BKP_DR14 ((uint32_t)0x0000000EU) 118 #define RTC_BKP_DR15 ((uint32_t)0x0000000FU) 119 #define RTC_BKP_DR16 ((uint32_t)0x00000010U) 120 #define RTC_BKP_DR17 ((uint32_t)0x00000011U) 121 #define RTC_BKP_DR18 ((uint32_t)0x00000012U) 122 #define RTC_BKP_DR19 ((uint32_t)0x00000013U) 123 124 /** 125 * @} 126 */ 127 128 129 /** @defgroup RTCEx_Time_Stamp_Edges_definitions RTCEx Time Stamp Edges definition 130 * @{ 131 */ 132 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000U) 133 #define RTC_TIMESTAMPEDGE_FALLING RTC_CR_TSEDGE 134 135 /** 136 * @} 137 */ 138 139 /** @defgroup RTCEx_TimeStamp_Pin_Selections RTCEx TimeStamp Pin Selection 140 * @{ 141 */ 142 #define RTC_TIMESTAMPPIN_DEFAULT ((uint32_t)0x00000000U) 143 144 /** 145 * @} 146 */ 147 148 149 /** @defgroup RTCEx_Tamper_Pins_Definitions RTCEx Tamper Pins Definition 150 * @{ 151 */ 152 #if defined(RTC_TAMPER1_SUPPORT) 153 #define RTC_TAMPER_1 RTC_TAMPCR_TAMP1E 154 #endif /* RTC_TAMPER1_SUPPORT */ 155 156 #define RTC_TAMPER_2 RTC_TAMPCR_TAMP2E 157 158 #if defined(RTC_TAMPER3_SUPPORT) 159 #define RTC_TAMPER_3 RTC_TAMPCR_TAMP3E 160 #endif /* RTC_TAMPER3_SUPPORT */ 161 /** 162 * @} 163 */ 164 165 166 /** @defgroup RTCEx_Tamper_Interrupt_Definitions RTCEx Tamper Interrupt Definitions 167 * @{ 168 */ 169 #if defined(RTC_TAMPER1_SUPPORT) 170 #define RTC_TAMPER1_INTERRUPT RTC_TAMPCR_TAMP1IE 171 #endif /* RTC_TAMPER1_SUPPORT */ 172 173 174 #define RTC_TAMPER2_INTERRUPT RTC_TAMPCR_TAMP2IE 175 176 #if defined(RTC_TAMPER3_SUPPORT) 177 #define RTC_TAMPER3_INTERRUPT RTC_TAMPCR_TAMP3IE 178 #endif /* RTC_TAMPER3_SUPPORT */ 179 #define RTC_ALL_TAMPER_INTERRUPT RTC_TAMPCR_TAMPIE 180 /** 181 * @} 182 */ 183 184 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTCEx Tamper Trigger Definitions 185 * @{ 186 */ 187 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000U) 188 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002U) 189 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE 190 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE 191 192 /** 193 * @} 194 */ 195 196 /** @defgroup RTCEx_Tamper_EraseBackUp_Definitions RTCEx Tamper EraseBackUp Definitions 197 * @{ 198 */ 199 #define RTC_TAMPER_ERASE_BACKUP_ENABLE ((uint32_t)0x00000000U) 200 #define RTC_TAMPER_ERASE_BACKUP_DISABLE ((uint32_t)0x00020000U) 201 /** 202 * @} 203 */ 204 205 /** @defgroup RTCEx_Tamper_MaskFlag_Definitions RTCEx Tamper MaskFlag Definitions 206 * @{ 207 */ 208 #define RTC_TAMPERMASK_FLAG_DISABLE ((uint32_t)0x00000000U) 209 #define RTC_TAMPERMASK_FLAG_ENABLE ((uint32_t)0x00040000U) 210 211 /** 212 * @} 213 */ 214 215 /** @defgroup RTCEx_Tamper_Filter_Definitions RTCEx Tamper Filter Definitions 216 * @{ 217 */ 218 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000U) /*!< Tamper filter is disabled */ 219 220 #define RTC_TAMPERFILTER_2SAMPLE RTC_TAMPCR_TAMPFLT_0 /*!< Tamper is activated after 2 221 consecutive samples at the active level */ 222 #define RTC_TAMPERFILTER_4SAMPLE RTC_TAMPCR_TAMPFLT_1 /*!< Tamper is activated after 4 223 consecutive samples at the active level */ 224 #define RTC_TAMPERFILTER_8SAMPLE RTC_TAMPCR_TAMPFLT /*!< Tamper is activated after 8 225 consecutive samples at the active level */ 226 227 /** 228 * @} 229 */ 230 231 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTCEx Tamper Sampling Frequencies Definitions 232 * @{ 233 */ 234 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000U) /*!< Each of the tamper inputs are sampled 235 with a frequency = RTCCLK / 32768 */ 236 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 RTC_TAMPCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled 237 with a frequency = RTCCLK / 16384 */ 238 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 RTC_TAMPCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled 239 with a frequency = RTCCLK / 8192 */ 240 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_1)) /*!< Each of the tamper inputs are sampled 241 with a frequency = RTCCLK / 4096 */ 242 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 RTC_TAMPCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled 243 with a frequency = RTCCLK / 2048 */ 244 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_2)) /*!< Each of the tamper inputs are sampled 245 with a frequency = RTCCLK / 1024 */ 246 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_1 | RTC_TAMPCR_TAMPFREQ_2)) /*!< Each of the tamper inputs are sampled 247 with a frequency = RTCCLK / 512 */ 248 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_1 | \ 249 RTC_TAMPCR_TAMPFREQ_2)) /*!< Each of the tamper inputs are sampled 250 with a frequency = RTCCLK / 256 */ 251 252 /** 253 * @} 254 */ 255 256 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTCEx Tamper Pin Precharge Duration Definitions 257 * @{ 258 */ 259 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000U) /*!< Tamper pins are pre-charged before 260 sampling during 1 RTCCLK cycle */ 261 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK RTC_TAMPCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before 262 sampling during 2 RTCCLK cycles */ 263 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK RTC_TAMPCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before 264 sampling during 4 RTCCLK cycles */ 265 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)(RTC_TAMPCR_TAMPPRCH_0 | RTC_TAMPCR_TAMPPRCH_1)) /*!< Tamper pins are pre-charged before 266 sampling during 8 RTCCLK cycles */ 267 268 /** 269 * @} 270 */ 271 272 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTCEx Tamper TimeStampOnTamperDetection Definitions 273 * @{ 274 */ 275 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE RTC_TAMPCR_TAMPTS /*!< TimeStamp on Tamper Detection event saved */ 276 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000U) /*!< TimeStamp on Tamper Detection event is not saved */ 277 278 /** 279 * @} 280 */ 281 282 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTCEx Tamper Pull UP Definitions 283 * @{ 284 */ 285 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000U) /*!< Tamper pins are pre-charged before sampling */ 286 #define RTC_TAMPER_PULLUP_DISABLE RTC_TAMPCR_TAMPPUDIS /*!< Tamper pins pre-charge is disabled */ 287 288 /** 289 * @} 290 */ 291 292 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTCEx Wakeup Timer Definitions 293 * @{ 294 */ 295 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000U) 296 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 RTC_CR_WUCKSEL_0 297 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 RTC_CR_WUCKSEL_1 298 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t) (RTC_CR_WUCKSEL_0 | RTC_CR_WUCKSEL_1)) 299 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS RTC_CR_WUCKSEL_2 300 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t) (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_2)) 301 /** 302 * @} 303 */ 304 305 /** @defgroup RTCEx_Smooth_calib_period_Definitions RTCEx Smooth calib period Definitions 306 * @{ 307 */ 308 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000U) /*!< If RTCCLK = 32768 Hz, Smooth calibation 309 period is 32s, else 2exp20 RTCCLK pulses */ 310 #define RTC_SMOOTHCALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< If RTCCLK = 32768 Hz, Smooth calibation 311 period is 16s, else 2exp19 RTCCLK pulses */ 312 #define RTC_SMOOTHCALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< If RTCCLK = 32768 Hz, Smooth calibation 313 period is 8s, else 2exp18 RTCCLK pulses */ 314 315 /** 316 * @} 317 */ 318 319 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTCEx Smooth calib Plus pulses Definitions 320 * @{ 321 */ 322 #define RTC_SMOOTHCALIB_PLUSPULSES_SET RTC_CALR_CALP /*!< The number of RTCCLK pulses added 323 during a X -second window = Y - CALM[8:0] 324 with Y = 512, 256, 128 when X = 32, 16, 8 */ 325 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000U) /*!< The number of RTCCLK pulses subbstited 326 during a 32-second window = CALM[8:0] */ 327 328 /** 329 * @} 330 */ 331 /** @defgroup RTCEx_Calib_Output_selection_Definitions RTCEx Calib Output selection Definitions 332 * @{ 333 */ 334 #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000U) 335 #define RTC_CALIBOUTPUT_1HZ RTC_CR_COSEL 336 337 /** 338 * @} 339 */ 340 341 342 /** @defgroup RTCEx_Add_1_Second_Parameter_Definition RTCEx Add 1 Second Parameter Definitions 343 * @{ 344 */ 345 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000U) 346 #define RTC_SHIFTADD1S_SET RTC_SHIFTR_ADD1S 347 /** 348 * @} 349 */ 350 /** @defgroup RTCEx_Interrupts_Definitions RTCEx Interrupts Definitions 351 * @{ 352 */ 353 #if defined(RTC_TAMPER3_SUPPORT) 354 #define RTC_IT_TAMP3 ((uint32_t)RTC_TAMPCR_TAMP3IE) /*!< Enable Tamper 3 Interrupt */ 355 #endif /* RTC_TAMPER3_SUPPORT */ 356 /** 357 * @} 358 */ 359 360 /** @defgroup RTCEx_Flags_Definitions RTCEx Flags Definitions 361 * @{ 362 */ 363 #if defined(RTC_TAMPER3_SUPPORT) 364 #define RTC_FLAG_TAMP3F ((uint32_t)RTC_ISR_TAMP3F) 365 #endif /* RTC_TAMPER3_SUPPORT */ 366 /** 367 * @} 368 */ 369 370 /** 371 * @} 372 */ 373 374 /* Exported macros -----------------------------------------------------------*/ 375 /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros 376 * @{ 377 */ 378 379 /* ---------------------------------WAKEUPTIMER-------------------------------*/ 380 /** @defgroup RTCEx_WakeUp_Timer RTC WakeUp Timer 381 * @{ 382 */ 383 /** 384 * @brief Enable the RTC WakeUp Timer peripheral. 385 * @param __HANDLE__ specifies the RTC handle. 386 * @retval None 387 */ 388 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE)) 389 390 /** 391 * @brief Disable the RTC WakeUp Timer peripheral. 392 * @param __HANDLE__ specifies the RTC handle. 393 * @retval None 394 */ 395 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE)) 396 397 /** 398 * @brief Enable the RTC WakeUpTimer interrupt. 399 * @param __HANDLE__ specifies the RTC handle. 400 * @param __INTERRUPT__ specifies the RTC WakeUpTimer interrupt sources to be enabled. 401 * This parameter can be: 402 * @arg RTC_IT_WUT: WakeUpTimer interrupt 403 * @retval None 404 */ 405 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) 406 407 /** 408 * @brief Disable the RTC WakeUpTimer interrupt. 409 * @param __HANDLE__ specifies the RTC handle. 410 * @param __INTERRUPT__ specifies the RTC WakeUpTimer interrupt sources to be disabled. 411 * This parameter can be: 412 * @arg RTC_IT_WUT: WakeUpTimer interrupt 413 * @retval None 414 */ 415 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) 416 417 /** 418 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not. 419 * @param __HANDLE__ specifies the RTC handle. 420 * @param __INTERRUPT__ specifies the RTC WakeUpTimer interrupt to check. 421 * This parameter can be: 422 * @arg RTC_IT_WUT: WakeUpTimer interrupt 423 * @retval None 424 */ 425 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR)\ 426 & ((__INTERRUPT__)>> 4U)) != 0U) ? 1U : 0U) 427 428 /** 429 * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not. 430 * @param __HANDLE__ specifies the RTC handle. 431 * @param __INTERRUPT__ specifies the RTC Wake Up timer interrupt sources to check. 432 * This parameter can be: 433 * @arg RTC_IT_WUT: WakeUpTimer interrupt 434 * @retval None 435 */ 436 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR)\ 437 & (__INTERRUPT__)) != 0U) ? 1U : 0U) 438 439 /** 440 * @brief Get the selected RTC WakeUpTimer's flag status. 441 * @param __HANDLE__ specifies the RTC handle. 442 * @param __FLAG__ specifies the RTC WakeUpTimer Flag is pending or not. 443 * This parameter can be: 444 * @arg RTC_FLAG_WUTF 445 * @arg RTC_FLAG_WUTWF 446 * @retval None 447 */ 448 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR)\ 449 & (__FLAG__)) != 0U) ? 1U : 0U) 450 451 /** 452 * @brief Clear the RTC Wake Up timer's pending flags. 453 * @param __HANDLE__ specifies the RTC handle. 454 * @param __FLAG__ specifies the RTC WakeUpTimer Flag to clear. 455 * This parameter can be: 456 * @arg RTC_FLAG_WUTF 457 * @retval None 458 */ 459 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__)\ 460 | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) 461 462 /** 463 * @brief Enable interrupt on the RTC WakeUp Timer associated Exti line of core 1. 464 * @retval None 465 */ 466 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 467 468 /** 469 * @brief Disable interrupt on the RTC WakeUp Timer associated Exti line of core 1. 470 * @retval None 471 */ 472 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 473 474 475 /** 476 * @brief Enable interrupt on the RTC WakeUp Timer associated Exti line of core 2. 477 * @retval None 478 */ 479 #define __HAL_RTC_WAKEUPTIMER_EXTIC2_ENABLE_IT() (EXTI->C2IMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 480 481 /** 482 * @brief Disable interrupt on the RTC WakeUp Timer associated Exti line of core 2. 483 * @retval None 484 */ 485 #define __HAL_RTC_WAKEUPTIMER_EXTIC2_DISABLE_IT() (EXTI->C2IMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 486 487 488 /** 489 * @brief Enable event on the RTC WakeUp Timer associated Exti line of core 1. 490 * @retval None. 491 */ 492 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 493 494 /** 495 * @brief Enable event on the RTC WakeUp Timer associated Exti line of core 2. 496 * @retval None. 497 */ 498 #define __HAL_RTC_WAKEUPTIMER_EXTIC2_ENABLE_EVENT() (EXTI->C2EMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 499 500 501 /** 502 * @brief Disable event on the RTC WakeUp Timer associated Exti line of core 1. 503 * @retval None. 504 */ 505 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 506 507 /** 508 * @brief Disable event on the RTC WakeUp Timer associated Exti line of core 2. 509 * @retval None. 510 */ 511 #define __HAL_RTC_WAKEUPTIMER_EXTIC2_DISABLE_EVENT() (EXTI->C2EMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 512 513 514 /*---------------*/ 515 /** 516 * @brief Enable falling edge trigger on the RTC WakeUp Timer associated Exti line. 517 * @retval None. 518 */ 519 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 520 521 /** 522 * @brief Disable falling edge trigger on the RTC WakeUp Timer associated Exti line. 523 * @retval None. 524 */ 525 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 526 527 /** 528 * @brief Enable rising edge trigger on the RTC WakeUp Timer associated Exti line. 529 * @retval None. 530 */ 531 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 532 533 /** 534 * @brief Disable rising edge trigger on the RTC WakeUp Timer associated Exti line. 535 * @retval None. 536 */ 537 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 538 539 540 /** 541 * @brief Enable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line. 542 * @retval None 543 */ 544 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() \ 545 do { \ 546 __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE(); \ 547 __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE(); \ 548 } while(0U) 549 550 /** 551 * @brief Disable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line. 552 * This parameter can be: 553 * @retval None 554 */ 555 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() \ 556 do { \ 557 __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE(); \ 558 __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE(); \ 559 } while(0U) 560 561 /** 562 * @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not of core 1. 563 * @retval Line Status. 564 */ 565 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 566 567 /** 568 * @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not of core 2. 569 * @retval Line Status. 570 */ 571 #define __HAL_RTC_WAKEUPTIMER_EXTIC2_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 572 573 574 575 /** 576 * @brief Clear the RTC WakeUp Timer associated Exti line flag of core 1. 577 * @retval None. 578 */ 579 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 580 581 /** 582 * @brief Clear the RTC WakeUp Timer associated Exti line flag of core 2. 583 * @retval None. 584 */ 585 #define __HAL_RTC_WAKEUPTIMER_EXTIC2_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 586 587 588 /*---------------*/ 589 /** 590 * @brief Generate a Software interrupt on the RTC WakeUp Timer associated Exti line. 591 * @retval None. 592 */ 593 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 594 /*---------------*/ 595 596 /** 597 * @} 598 */ 599 600 /* ---------------------------------TIMESTAMP---------------------------------*/ 601 /** @defgroup RTCEx_Timestamp RTC Timestamp 602 * @{ 603 */ 604 /** 605 * @brief Enable the RTC TimeStamp peripheral. 606 * @param __HANDLE__ specifies the RTC handle. 607 * @retval None 608 */ 609 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE)) 610 611 /** 612 * @brief Disable the RTC TimeStamp peripheral. 613 * @param __HANDLE__ specifies the RTC handle. 614 * @retval None 615 */ 616 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE)) 617 618 /** 619 * @brief Enable the RTC TimeStamp interrupt. 620 * @param __HANDLE__ specifies the RTC handle. 621 * @param __INTERRUPT__ specifies the RTC TimeStamp interrupt source to be enabled. 622 * This parameter can be: 623 * @arg RTC_IT_TS: TimeStamp interrupt 624 * @retval None 625 */ 626 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) 627 628 /** 629 * @brief Disable the RTC TimeStamp interrupt. 630 * @param __HANDLE__ specifies the RTC handle. 631 * @param __INTERRUPT__ specifies the RTC TimeStamp interrupt source to be disabled. 632 * This parameter can be: 633 * @arg RTC_IT_TS: TimeStamp interrupt 634 * @retval None 635 */ 636 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) 637 638 /** 639 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not. 640 * @param __HANDLE__ specifies the RTC handle. 641 * @param __INTERRUPT__ specifies the RTC TimeStamp interrupt to check. 642 * This parameter can be: 643 * @arg RTC_IT_TS: TimeStamp interrupt 644 * @retval None 645 */ 646 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR)\ 647 & ((__INTERRUPT__)>> 4U)) != 0U) ? 1U : 0U) 648 649 /** 650 * @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not. 651 * @param __HANDLE__ specifies the RTC handle. 652 * @param __INTERRUPT__ specifies the RTC Time Stamp interrupt source to check. 653 * This parameter can be: 654 * @arg RTC_IT_TS: TimeStamp interrupt 655 * @retval None 656 */ 657 #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR)\ 658 & (__INTERRUPT__)) != 0U) ? 1U : 0U) 659 660 /** 661 * @brief Get the selected RTC TimeStamp's flag status. 662 * @param __HANDLE__ specifies the RTC handle. 663 * @param __FLAG__ specifies the RTC TimeStamp Flag is pending or not. 664 * This parameter can be: 665 * @arg RTC_FLAG_TSF 666 * @arg RTC_FLAG_TSOVF 667 * @retval None 668 */ 669 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR)\ 670 & (__FLAG__)) != 0U) ? 1U : 0U) 671 672 /** 673 * @brief Clear the RTC Time Stamp's pending flags. 674 * @param __HANDLE__ specifies the RTC handle. 675 * @param __FLAG__ specifies the RTC TimeStamp Flag to clear. 676 * This parameter can be: 677 * @arg RTC_FLAG_TSF 678 * @arg RTC_FLAG_TSOVF 679 * @retval None 680 */ 681 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__)\ 682 | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) 683 684 685 /** 686 * @} 687 */ 688 689 /* ---------------------------------TAMPER------------------------------------*/ 690 /** @defgroup RTCEx_Tamper RTC Tamper 691 * @{ 692 */ 693 694 #if defined(RTC_TAMPER1_SUPPORT) 695 /** 696 * @brief Enable the RTC Tamper1 input detection. 697 * @param __HANDLE__ specifies the RTC handle. 698 * @retval None 699 */ 700 #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR\ 701 |= (RTC_TAMPCR_TAMP1E)) 702 703 /** 704 * @brief Disable the RTC Tamper1 input detection. 705 * @param __HANDLE__ specifies the RTC handle. 706 * @retval None 707 */ 708 #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR\ 709 &= ~(RTC_TAMPCR_TAMP1E)) 710 #endif /* RTC_TAMPER1_SUPPORT */ 711 712 /** 713 * @brief Enable the RTC Tamper2 input detection. 714 * @param __HANDLE__ specifies the RTC handle. 715 * @retval None 716 */ 717 #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR\ 718 |= (RTC_TAMPCR_TAMP2E)) 719 720 /** 721 * @brief Disable the RTC Tamper2 input detection. 722 * @param __HANDLE__ specifies the RTC handle. 723 * @retval None 724 */ 725 #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR\ 726 &= ~(RTC_TAMPCR_TAMP2E)) 727 728 #if defined(RTC_TAMPER3_SUPPORT) 729 /** 730 * @brief Enable the RTC Tamper3 input detection. 731 * @param __HANDLE__ specifies the RTC handle. 732 * @retval None 733 */ 734 #define __HAL_RTC_TAMPER3_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR\ 735 |= (RTC_TAMPCR_TAMP3E)) 736 737 /** 738 * @brief Disable the RTC Tamper3 input detection. 739 * @param __HANDLE__ specifies the RTC handle. 740 * @retval None 741 */ 742 #define __HAL_RTC_TAMPER3_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR\ 743 &= ~(RTC_TAMPCR_TAMP3E)) 744 #endif /* RTC_TAMPER3_SUPPORT */ 745 746 747 /**************************************************************************************************/ 748 749 /** 750 * @brief Enable the RTC Tamper interrupt. 751 * @param __HANDLE__ specifies the RTC handle. 752 * @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be enabled. 753 * This parameter can be any combination of the following values: 754 * @arg RTC_IT_TAMP: All tampers interrupts 755 * @arg RTC_IT_TAMP1: Tamper1 interrupt (*) 756 * @arg RTC_IT_TAMP2: Tamper2 interrupt 757 * @arg RTC_IT_TAMP3: Tamper3 interrupt (*) 758 * 759 * (*) Value not defined in all devices. \n 760 * 761 * @retval None 762 */ 763 #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__)) 764 765 /** 766 * @brief Disable the RTC Tamper interrupt. 767 * @param __HANDLE__ specifies the RTC handle. 768 * @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be disabled. 769 * This parameter can be any combination of the following values: 770 * @arg RTC_IT_TAMP: All tampers interrupts 771 * @arg RTC_IT_TAMP1: Tamper1 interrupt (*) 772 * @arg RTC_IT_TAMP2: Tamper2 interrupt 773 * @arg RTC_IT_TAMP3: Tamper3 interrupt (*) 774 * 775 * (*) Value not defined in all devices. \n 776 * 777 * @retval None 778 */ 779 #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR\ 780 &= ~(__INTERRUPT__)) 781 782 /**************************************************************************************************/ 783 784 /** 785 * @brief Check whether the specified RTC Tamper interrupt has occurred or not. 786 * @param __HANDLE__ specifies the RTC handle. 787 * @param __INTERRUPT__ specifies the RTC Tamper interrupt to check. 788 * This parameter can be: 789 * @arg RTC_IT_TAMP1: Tamper1 interrupt (*) 790 * @arg RTC_IT_TAMP2: Tamper2 interrupt 791 * @arg RTC_IT_TAMP3: Tamper3 interrupt (*) 792 * 793 * (*) Value not defined in all devices. \n 794 * 795 * @retval None 796 */ 797 798 /**************************************************************************************************/ 799 800 /** 801 * @brief Check whether the specified RTC Tamper interrupt has been enabled or not. 802 * @param __HANDLE__ specifies the RTC handle. 803 * @param __INTERRUPT__ specifies the RTC Tamper interrupt source to check. 804 * This parameter can be: 805 * @arg RTC_IT_TAMP: All tampers interrupts 806 * @arg RTC_IT_TAMP1: Tamper1 interrupt (*) 807 * @arg RTC_IT_TAMP2: Tamper2 interrupt 808 * @arg RTC_IT_TAMP3: Tamper3 interrupt (*) 809 * 810 * (*) Value not defined in all devices. \n 811 * 812 * @retval None 813 */ 814 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR)\ 815 & (__INTERRUPT__)) != 0U) ? 1U : 0U) 816 817 818 /** 819 * @brief Get the selected RTC Tamper's flag status. 820 * @param __HANDLE__ specifies the RTC handle. 821 * @param __FLAG__ specifies the RTC Tamper Flag is pending or not. 822 * This parameter can be: 823 * @arg RTC_FLAG_TAMP1F: Tamper1 flag (*) 824 * @arg RTC_FLAG_TAMP2F: Tamper2 flag 825 * @arg RTC_FLAG_TAMP3F: Tamper3 flag (*) 826 * 827 * (*) Value not defined in all devices. \n 828 * 829 * @retval None 830 */ 831 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR)\ 832 & (__FLAG__)) != 0U) ? 1U : 0U) 833 834 /** 835 * @brief Clear the RTC Tamper's pending flags. 836 * @param __HANDLE__ specifies the RTC handle. 837 * @param __FLAG__ specifies the RTC Tamper Flag to clear. 838 * This parameter can be: 839 * @arg RTC_FLAG_TAMP1F: Tamper1 flag (*) 840 * @arg RTC_FLAG_TAMP2F: Tamper2 flag 841 * @arg RTC_FLAG_TAMP3F: Tamper3 flag (*) 842 * 843 * (*) Value not defined in all devices. \n 844 * 845 * @retval None 846 */ 847 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__)\ 848 | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) 849 850 851 /**************************************************************************************************/ 852 853 854 #if defined(RTC_INTERNALTS_SUPPORT) 855 /** 856 * @brief Enable the RTC internal TimeStamp peripheral. 857 * @param __HANDLE__ specifies the RTC handle. 858 * @retval None 859 */ 860 #define __HAL_RTC_INTERNAL_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ITSE)) 861 862 /** 863 * @brief Disable the RTC internal TimeStamp peripheral. 864 * @param __HANDLE__ specifies the RTC handle. 865 * @retval None 866 */ 867 #define __HAL_RTC_INTERNAL_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ITSE)) 868 869 /** 870 * @brief Get the selected RTC Internal Time Stamp's flag status. 871 * @param __HANDLE__ specifies the RTC handle. 872 * @param __FLAG__ specifies the RTC Internal Time Stamp Flag is pending or not. 873 * This parameter can be: 874 * @arg RTC_FLAG_ITSF 875 * @retval None 876 */ 877 #define __HAL_RTC_INTERNAL_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR)\ 878 & (__FLAG__)) != 0U) ? 1U : 0U) 879 880 /** 881 * @brief Clear the RTC Internal Time Stamp's pending flags. 882 * @param __HANDLE__ specifies the RTC handle. 883 * @param __FLAG__ specifies the RTC Internal Time Stamp Flag source to clear. 884 * This parameter can be: 885 * @arg RTC_FLAG_ITSF 886 * @retval None 887 */ 888 #define __HAL_RTC_INTERNAL_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__)\ 889 | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) 890 #endif /* RTC_INTERNALTS_SUPPORT */ 891 /**************************************************************************************************/ 892 893 /** 894 * @} 895 */ 896 897 /* --------------------------TAMPER/TIMESTAMP---------------------------------*/ 898 /** @defgroup RTCEx_Tamper_Timestamp EXTI RTC Tamper Timestamp EXTI 899 * @{ 900 */ 901 902 /* TAMPER TIMESTAMP EXTI */ 903 /* --------------------- */ 904 905 /** 906 * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line of core 1. 907 * @retval None 908 */ 909 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 910 911 /** 912 * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line of core 2. 913 * @retval None 914 */ 915 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTIC2_ENABLE_IT() (EXTI->C2IMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 916 917 /** 918 * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line of core 1. 919 * @retval None 920 */ 921 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 922 923 /** 924 * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line of core 2. 925 * @retval None 926 */ 927 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTIC2_DISABLE_IT() (EXTI->C2IMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 928 929 /** 930 * @brief Enable event on the RTC Tamper and Timestamp associated Exti line of core 1. 931 * @retval None. 932 */ 933 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 934 935 /** 936 * @brief Enable event on the RTC Tamper and Timestamp associated Exti line of core 2. 937 * @retval None. 938 */ 939 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTIC2_ENABLE_EVENT() (EXTI->C2EMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 940 941 /** 942 * @brief Disable event on the RTC Tamper and Timestamp associated Exti line of core 1. 943 * @retval None. 944 */ 945 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 946 947 /** 948 * @brief Disable event on the RTC Tamper and Timestamp associated Exti line of core 2. 949 * @retval None. 950 */ 951 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTIC2_DISABLE_EVENT() (EXTI->C2EMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 952 953 /*-----------------*/ 954 /** 955 * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. 956 * @retval None. 957 */ 958 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 959 960 /** 961 * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. 962 * @retval None. 963 */ 964 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 965 966 /** 967 * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. 968 * @retval None. 969 */ 970 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 971 972 /** 973 * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. 974 * @retval None. 975 */ 976 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 977 978 979 /** 980 * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. 981 * @retval None. 982 */ 983 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() \ 984 do { \ 985 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE(); \ 986 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); \ 987 } while(0U) 988 989 /** 990 * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. 991 * This parameter can be: 992 * @retval None. 993 */ 994 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() \ 995 do { \ 996 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE(); \ 997 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE(); \ 998 } while(0U) 999 1000 /** 1001 * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not of core 1. 1002 * @retval Line Status. 1003 */ 1004 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 1005 1006 /** 1007 * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not of core 2. 1008 * @retval Line Status. 1009 */ 1010 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTIC2_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 1011 1012 /** 1013 * @brief Clear the RTC Tamper and Timestamp associated Exti line flag of core 1. 1014 * @retval None. 1015 */ 1016 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 1017 1018 /** 1019 * @brief Clear the RTC Tamper and Timestamp associated Exti line flag of core 2. 1020 * @retval None. 1021 */ 1022 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTIC2_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 1023 1024 /** 1025 * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line 1026 * @retval None. 1027 */ 1028 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 1029 1030 1031 1032 /** 1033 * @} 1034 */ 1035 1036 /* ------------------------------Calibration----------------------------------*/ 1037 /** @defgroup RTCEx_Calibration RTC Calibration 1038 * @{ 1039 */ 1040 1041 /** 1042 * @brief Enable the RTC calibration output. 1043 * @param __HANDLE__ specifies the RTC handle. 1044 * @retval None 1045 */ 1046 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE)) 1047 1048 /** 1049 * @brief Disable the calibration output. 1050 * @param __HANDLE__ specifies the RTC handle. 1051 * @retval None 1052 */ 1053 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE)) 1054 1055 1056 /** 1057 * @brief Enable the clock reference detection. 1058 * @param __HANDLE__ specifies the RTC handle. 1059 * @retval None 1060 */ 1061 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON)) 1062 1063 /** 1064 * @brief Disable the clock reference detection. 1065 * @param __HANDLE__ specifies the RTC handle. 1066 * @retval None 1067 */ 1068 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON)) 1069 1070 1071 /** 1072 * @brief Get the selected RTC shift operation's flag status. 1073 * @param __HANDLE__ specifies the RTC handle. 1074 * @param __FLAG__ specifies the RTC shift operation Flag is pending or not. 1075 * This parameter can be: 1076 * @arg RTC_FLAG_SHPF 1077 * @retval None 1078 */ 1079 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR)\ 1080 & (__FLAG__)) != 0U)? 1U : 0U) 1081 /** 1082 * @} 1083 */ 1084 1085 /** 1086 * @} 1087 */ 1088 1089 /* Exported functions --------------------------------------------------------*/ 1090 /** @defgroup RTCEx_Exported_Functions RTCEx Exported Functions 1091 * @{ 1092 */ 1093 1094 /* RTC TimeStamp and Tamper functions *****************************************/ 1095 /** @defgroup RTCEx_Exported_Functions_Group1 Extended RTC TimeStamp and Tamper functions 1096 * @{ 1097 */ 1098 1099 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); 1100 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); 1101 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc); 1102 #if defined(RTC_INTERNALTS_SUPPORT) 1103 HAL_StatusTypeDef HAL_RTCEx_SetInternalTimeStamp(RTC_HandleTypeDef *hrtc); 1104 HAL_StatusTypeDef HAL_RTCEx_DeactivateInternalTimeStamp(RTC_HandleTypeDef *hrtc); 1105 #endif /* RTC_INTERNALTS_SUPPORT */ 1106 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, 1107 RTC_DateTypeDef *sTimeStampDate, uint32_t Format); 1108 1109 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper); 1110 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper); 1111 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper); 1112 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc); 1113 1114 #if defined(RTC_TAMPER1_SUPPORT) 1115 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); 1116 #endif /* RTC_TAMPER1_SUPPORT */ 1117 void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc); 1118 #if defined(RTC_TAMPER3_SUPPORT) 1119 void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc); 1120 #endif /* RTC_TAMPER3_SUPPORT */ 1121 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc); 1122 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 1123 #if defined(RTC_TAMPER1_SUPPORT) 1124 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 1125 #endif /* RTC_TAMPER1_SUPPORT */ 1126 HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 1127 #if defined(RTC_TAMPER3_SUPPORT) 1128 HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 1129 #endif /* RTC_TAMPER3_SUPPORT */ 1130 /** 1131 * @} 1132 */ 1133 1134 /* RTC Wake-up functions ******************************************************/ 1135 /** @defgroup RTCEx_Exported_Functions_Group2 Extended RTC Wake-up functions 1136 * @{ 1137 */ 1138 1139 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); 1140 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); 1141 HAL_StatusTypeDef HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc); 1142 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc); 1143 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc); 1144 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc); 1145 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 1146 /** 1147 * @} 1148 */ 1149 1150 /* Extended Control functions ************************************************/ 1151 /** @defgroup RTCEx_Exported_Functions_Group3 Extended Peripheral Control functions 1152 * @{ 1153 */ 1154 1155 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); 1156 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); 1157 1158 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, 1159 uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue); 1160 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS); 1161 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput); 1162 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc); 1163 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc); 1164 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc); 1165 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc); 1166 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc); 1167 /** 1168 * @} 1169 */ 1170 1171 /* Extended RTC features functions *******************************************/ 1172 /** @defgroup RTCEx_Exported_Functions_Group4 Extended features functions 1173 * @{ 1174 */ 1175 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc); 1176 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 1177 /** 1178 * @} 1179 */ 1180 1181 /** 1182 * @} 1183 */ 1184 1185 /* Private types -------------------------------------------------------------*/ 1186 /* Private variables ---------------------------------------------------------*/ 1187 /* Private constants ---------------------------------------------------------*/ 1188 /** @defgroup RTCEx_Private_Constants RTCEx Private Constants 1189 * @{ 1190 */ 1191 1192 /* Masks Definition */ 1193 1194 #if defined(RTC_TAMPER1_SUPPORT) && defined(RTC_TAMPER3_SUPPORT) 1195 1196 #define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP3F | RTC_FLAG_TAMP2F | \ 1197 RTC_FLAG_TAMP1F| RTC_FLAG_TSOVF | RTC_FLAG_TSF | \ 1198 RTC_FLAG_WUTF | RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | \ 1199 RTC_FLAG_INITF | RTC_FLAG_RSF | \ 1200 RTC_FLAG_INITS | RTC_FLAG_SHPF | RTC_FLAG_WUTWF | \ 1201 RTC_FLAG_ALRBWF | RTC_FLAG_ALRAWF)) 1202 1203 #define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP3E | RTC_TAMPCR_TAMP2E | RTC_TAMPCR_TAMP1E)) 1204 #define RTC_TAMPCR_TAMPXIE ((uint32_t) (RTC_TAMPER1_INTERRUPT | RTC_TAMPER2_INTERRUPT | \ 1205 RTC_TAMPER3_INTERRUPT | RTC_ALL_TAMPER_INTERRUPT)) 1206 1207 #else 1208 1209 #define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP2F | \ 1210 RTC_FLAG_TSOVF | RTC_FLAG_TSF | RTC_FLAG_WUTF | \ 1211 RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | \ 1212 RTC_FLAG_INITF | RTC_FLAG_RSF | RTC_FLAG_INITS | \ 1213 RTC_FLAG_SHPF | RTC_FLAG_WUTWF |RTC_FLAG_ALRBWF | \ 1214 RTC_FLAG_ALRAWF)) 1215 1216 #define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP2E)) 1217 #define RTC_TAMPCR_TAMPXIE ((uint32_t) (RTC_TAMPER2_INTERRUPT | RTC_ALL_TAMPER_INTERRUPT)) 1218 1219 #endif /* RTC_TAMPER1_SUPPORT && RTC_TAMPER3_SUPPORT */ 1220 1221 #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT (EXTI_IMR1_IM18) /*!< External interrupt line 18 Connected to the RTC Tamper and Time Stamp events */ 1222 #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT (EXTI_IMR1_IM19) /*!< External interrupt line 19 Connected to the RTC Wakeup event */ 1223 1224 /** 1225 * @} 1226 */ 1227 1228 /* Private macros ------------------------------------------------------------*/ 1229 /** @defgroup RTCEx_Private_Macros RTCEx Private Macros 1230 * @{ 1231 */ 1232 1233 /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters 1234 * @{ 1235 */ 1236 1237 #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \ 1238 ((OUTPUT) == RTC_OUTPUT_ALARMA) || \ 1239 ((OUTPUT) == RTC_OUTPUT_ALARMB) || \ 1240 ((OUTPUT) == RTC_OUTPUT_WAKEUP)) 1241 1242 #define IS_RTC_BKP(BKP) ((BKP) < (uint32_t) RTC_BKP_NUMBER) 1243 1244 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \ 1245 ((EDGE) == RTC_TIMESTAMPEDGE_FALLING)) 1246 1247 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER)\ 1248 & ((uint32_t)(0xFFFFFFFFU ^ RTC_TAMPCR_TAMPXE))) == 0x00U) && ((TAMPER) != 0U)) 1249 1250 #define IS_RTC_TAMPER_INTERRUPT(INTERRUPT) ((((INTERRUPT)\ 1251 & (uint32_t)(0xFFFFFFFFU ^ RTC_TAMPCR_TAMPXIE)) == 0x00U) && ((INTERRUPT) != 0U)) 1252 1253 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT)) 1254 1255 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \ 1256 ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \ 1257 ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ 1258 ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL)) 1259 1260 #define IS_RTC_TAMPER_ERASE_MODE(MODE) (((MODE) == RTC_TAMPER_ERASE_BACKUP_ENABLE) || \ 1261 ((MODE) == RTC_TAMPER_ERASE_BACKUP_DISABLE)) 1262 1263 #define IS_RTC_TAMPER_MASKFLAG_STATE(STATE) (((STATE) == RTC_TAMPERMASK_FLAG_ENABLE) || \ 1264 ((STATE) == RTC_TAMPERMASK_FLAG_DISABLE)) 1265 1266 #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \ 1267 ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \ 1268 ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \ 1269 ((FILTER) == RTC_TAMPERFILTER_8SAMPLE)) 1270 1271 #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \ 1272 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \ 1273 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \ 1274 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \ 1275 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \ 1276 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \ 1277 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \ 1278 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256)) 1279 1280 #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \ 1281 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \ 1282 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \ 1283 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK)) 1284 1285 #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \ 1286 ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE)) 1287 1288 #define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \ 1289 ((STATE) == RTC_TAMPER_PULLUP_DISABLE)) 1290 1291 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \ 1292 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \ 1293 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \ 1294 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \ 1295 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \ 1296 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS)) 1297 1298 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= RTC_WUTR_WUT) 1299 1300 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \ 1301 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \ 1302 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC)) 1303 1304 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \ 1305 ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET)) 1306 1307 1308 /** @defgroup RTCEx_Smooth_calib_Minus_pulses_Definitions RTCEx Smooth calib Minus pulses Definitions 1309 * @{ 1310 */ 1311 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= RTC_CALR_CALM) 1312 /** 1313 * @} 1314 */ 1315 1316 1317 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \ 1318 ((SEL) == RTC_SHIFTADD1S_SET)) 1319 1320 1321 1322 /** @defgroup RTCEx_Subtract_Fraction_Of_Second_Value RTCEx Subtract Fraction Of Second Value 1323 * @{ 1324 */ 1325 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= RTC_SHIFTR_SUBFS) 1326 /** 1327 * @} 1328 */ 1329 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \ 1330 ((OUTPUT) == RTC_CALIBOUTPUT_1HZ)) 1331 1332 /** 1333 * @} 1334 */ 1335 1336 /** 1337 * @} 1338 */ 1339 1340 1341 1342 /** 1343 * @} 1344 */ 1345 1346 /** 1347 * @} 1348 */ 1349 1350 #ifdef __cplusplus 1351 } 1352 #endif 1353 1354 #endif /* STM32WBxx_HAL_RTC_EX_H */ 1355