Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TUKS-COURSE-TIMER by
stm32l4xx_hal_rtc_ex.h
00001 /** 00002 ****************************************************************************** 00003 * @file stm32l4xx_hal_rtc_ex.h 00004 * @author MCD Application Team 00005 * @version V1.5.1 00006 * @date 31-May-2016 00007 * @brief Header file of RTC HAL Extended module. 00008 ****************************************************************************** 00009 * @attention 00010 * 00011 * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> 00012 * 00013 * Redistribution and use in source and binary forms, with or without modification, 00014 * are permitted provided that the following conditions are met: 00015 * 1. Redistributions of source code must retain the above copyright notice, 00016 * this list of conditions and the following disclaimer. 00017 * 2. Redistributions in binary form must reproduce the above copyright notice, 00018 * this list of conditions and the following disclaimer in the documentation 00019 * and/or other materials provided with the distribution. 00020 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00021 * may be used to endorse or promote products derived from this software 00022 * without specific prior written permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00025 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00026 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00027 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00028 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00029 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00030 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00032 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00033 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 ****************************************************************************** 00036 */ 00037 00038 /* Define to prevent recursive inclusion -------------------------------------*/ 00039 #ifndef __STM32L4xx_HAL_RTC_EX_H 00040 #define __STM32L4xx_HAL_RTC_EX_H 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00046 /* Includes ------------------------------------------------------------------*/ 00047 #include "stm32l4xx_hal_def.h" 00048 00049 /** @addtogroup STM32L4xx_HAL_Driver 00050 * @{ 00051 */ 00052 00053 /** @addtogroup RTCEx 00054 * @{ 00055 */ 00056 00057 /* Exported types ------------------------------------------------------------*/ 00058 /** @defgroup RTCEx_Exported_Types RTCEx Exported Types 00059 * @{ 00060 */ 00061 /** 00062 * @brief RTC Tamper structure definition 00063 */ 00064 typedef struct { 00065 uint32_t Tamper; /*!< Specifies the Tamper Pin. 00066 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */ 00067 00068 uint32_t Interrupt; /*!< Specifies the Tamper Interrupt. 00069 This parameter can be a value of @ref RTCEx_Tamper_Interrupt_Definitions */ 00070 00071 uint32_t Trigger; /*!< Specifies the Tamper Trigger. 00072 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */ 00073 00074 uint32_t NoErase; /*!< Specifies the Tamper no erase mode. 00075 This parameter can be a value of @ref RTCEx_Tamper_EraseBackUp_Definitions */ 00076 00077 uint32_t MaskFlag; /*!< Specifies the Tamper Flag masking. 00078 This parameter can be a value of @ref RTCEx_Tamper_MaskFlag_Definitions */ 00079 00080 uint32_t Filter; /*!< Specifies the RTC Filter Tamper. 00081 This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */ 00082 00083 uint32_t SamplingFrequency; /*!< Specifies the sampling frequency. 00084 This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */ 00085 00086 uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration . 00087 This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */ 00088 00089 uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp . 00090 This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */ 00091 00092 uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection. 00093 This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */ 00094 } RTC_TamperTypeDef; 00095 00096 /** 00097 * @} 00098 */ 00099 00100 /* Exported constants --------------------------------------------------------*/ 00101 /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants 00102 * @{ 00103 */ 00104 00105 /** @defgroup RTCEx_Output_selection_Definitions RTC Output Selection Definitions 00106 * @{ 00107 */ 00108 #define RTC_OUTPUT_DISABLE ((uint32_t)0x00000000) 00109 #define RTC_OUTPUT_ALARMA ((uint32_t)0x00200000) 00110 #define RTC_OUTPUT_ALARMB ((uint32_t)0x00400000) 00111 #define RTC_OUTPUT_WAKEUP ((uint32_t)0x00600000) 00112 /** 00113 * @} 00114 */ 00115 00116 /** @defgroup RTCEx_Backup_Registers_Definitions RTC Backup Registers Definitions 00117 * @{ 00118 */ 00119 #define RTC_BKP_DR0 ((uint32_t)0x00000000) 00120 #define RTC_BKP_DR1 ((uint32_t)0x00000001) 00121 #define RTC_BKP_DR2 ((uint32_t)0x00000002) 00122 #define RTC_BKP_DR3 ((uint32_t)0x00000003) 00123 #define RTC_BKP_DR4 ((uint32_t)0x00000004) 00124 #define RTC_BKP_DR5 ((uint32_t)0x00000005) 00125 #define RTC_BKP_DR6 ((uint32_t)0x00000006) 00126 #define RTC_BKP_DR7 ((uint32_t)0x00000007) 00127 #define RTC_BKP_DR8 ((uint32_t)0x00000008) 00128 #define RTC_BKP_DR9 ((uint32_t)0x00000009) 00129 #define RTC_BKP_DR10 ((uint32_t)0x0000000A) 00130 #define RTC_BKP_DR11 ((uint32_t)0x0000000B) 00131 #define RTC_BKP_DR12 ((uint32_t)0x0000000C) 00132 #define RTC_BKP_DR13 ((uint32_t)0x0000000D) 00133 #define RTC_BKP_DR14 ((uint32_t)0x0000000E) 00134 #define RTC_BKP_DR15 ((uint32_t)0x0000000F) 00135 #define RTC_BKP_DR16 ((uint32_t)0x00000010) 00136 #define RTC_BKP_DR17 ((uint32_t)0x00000011) 00137 #define RTC_BKP_DR18 ((uint32_t)0x00000012) 00138 #define RTC_BKP_DR19 ((uint32_t)0x00000013) 00139 #define RTC_BKP_DR20 ((uint32_t)0x00000014) 00140 #define RTC_BKP_DR21 ((uint32_t)0x00000015) 00141 #define RTC_BKP_DR22 ((uint32_t)0x00000016) 00142 #define RTC_BKP_DR23 ((uint32_t)0x00000017) 00143 #define RTC_BKP_DR24 ((uint32_t)0x00000018) 00144 #define RTC_BKP_DR25 ((uint32_t)0x00000019) 00145 #define RTC_BKP_DR26 ((uint32_t)0x0000001A) 00146 #define RTC_BKP_DR27 ((uint32_t)0x0000001B) 00147 #define RTC_BKP_DR28 ((uint32_t)0x0000001C) 00148 #define RTC_BKP_DR29 ((uint32_t)0x0000001D) 00149 #define RTC_BKP_DR30 ((uint32_t)0x0000001E) 00150 #define RTC_BKP_DR31 ((uint32_t)0x0000001F) 00151 /** 00152 * @} 00153 */ 00154 00155 /** @defgroup RTCEx_TimeStamp_Edges_definitions RTC TimeStamp Edges Definitions 00156 * @{ 00157 */ 00158 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000) 00159 #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008) 00160 /** 00161 * @} 00162 */ 00163 00164 /** @defgroup RTCEx_TimeStamp_Pin_Selection RTC TimeStamp Pins Selection 00165 * @{ 00166 */ 00167 #define RTC_TIMESTAMPPIN_DEFAULT ((uint32_t)0x00000000) 00168 /** 00169 * @} 00170 */ 00171 00172 /** @defgroup RTCEx_Tamper_Pins_Definitions RTC Tamper Pins Definitions 00173 * @{ 00174 */ 00175 #if defined(RTC_TAMPER1_SUPPORT) 00176 #define RTC_TAMPER_1 RTC_TAMPCR_TAMP1E 00177 #endif /* RTC_TAMPER1_SUPPORT */ 00178 #define RTC_TAMPER_2 RTC_TAMPCR_TAMP2E 00179 #if defined(RTC_TAMPER3_SUPPORT) 00180 #define RTC_TAMPER_3 RTC_TAMPCR_TAMP3E 00181 #endif /* RTC_TAMPER3_SUPPORT */ 00182 /** 00183 * @} 00184 */ 00185 00186 /** @defgroup RTCEx_Tamper_Interrupt_Definitions RTC Tamper Interrupts Definitions 00187 * @{ 00188 */ 00189 #if defined(RTC_TAMPER1_SUPPORT) 00190 #define RTC_TAMPER1_INTERRUPT RTC_TAMPCR_TAMP1IE 00191 #endif /* RTC_TAMPER1_SUPPORT */ 00192 #define RTC_TAMPER2_INTERRUPT RTC_TAMPCR_TAMP2IE 00193 #if defined(RTC_TAMPER3_SUPPORT) 00194 #define RTC_TAMPER3_INTERRUPT RTC_TAMPCR_TAMP3IE 00195 #endif /* RTC_TAMPER3_SUPPORT */ 00196 #define RTC_ALL_TAMPER_INTERRUPT RTC_TAMPCR_TAMPIE 00197 /** 00198 * @} 00199 */ 00200 00201 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTC Tamper Triggers Definitions 00202 * @{ 00203 */ 00204 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000) 00205 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002) 00206 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE 00207 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE 00208 /** 00209 * @} 00210 */ 00211 00212 /** @defgroup RTCEx_Tamper_EraseBackUp_Definitions RTC Tamper EraseBackUp Definitions 00213 * @{ 00214 */ 00215 #define RTC_TAMPER_ERASE_BACKUP_ENABLE ((uint32_t)0x00000000) 00216 #define RTC_TAMPER_ERASE_BACKUP_DISABLE ((uint32_t)0x00020000) 00217 /** 00218 * @} 00219 */ 00220 00221 /** @defgroup RTCEx_Tamper_MaskFlag_Definitions RTC Tamper Mask Flag Definitions 00222 * @{ 00223 */ 00224 #define RTC_TAMPERMASK_FLAG_DISABLE ((uint32_t)0x00000000) 00225 #define RTC_TAMPERMASK_FLAG_ENABLE ((uint32_t)0x00040000) 00226 /** 00227 * @} 00228 */ 00229 00230 /** @defgroup RTCEx_Tamper_Filter_Definitions RTC Tamper Filter Definitions 00231 * @{ 00232 */ 00233 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */ 00234 00235 #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2 00236 consecutive samples at the active level */ 00237 #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4 00238 consecutive samples at the active level */ 00239 #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8 00240 consecutive samples at the active level. */ 00241 /** 00242 * @} 00243 */ 00244 00245 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTC Tamper Sampling Frequencies Definitions 00246 * @{ 00247 */ 00248 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled 00249 with a frequency = RTCCLK / 32768 */ 00250 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled 00251 with a frequency = RTCCLK / 16384 */ 00252 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled 00253 with a frequency = RTCCLK / 8192 */ 00254 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled 00255 with a frequency = RTCCLK / 4096 */ 00256 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled 00257 with a frequency = RTCCLK / 2048 */ 00258 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled 00259 with a frequency = RTCCLK / 1024 */ 00260 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled 00261 with a frequency = RTCCLK / 512 */ 00262 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled 00263 with a frequency = RTCCLK / 256 */ 00264 /** 00265 * @} 00266 */ 00267 00268 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTC Tamper Pin Precharge Duration Definitions 00269 * @{ 00270 */ 00271 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before 00272 sampling during 1 RTCCLK cycle */ 00273 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before 00274 sampling during 2 RTCCLK cycles */ 00275 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before 00276 sampling during 4 RTCCLK cycles */ 00277 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before 00278 sampling during 8 RTCCLK cycles */ 00279 /** 00280 * @} 00281 */ 00282 00283 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTC Tamper TimeStamp On Tamper Detection Definitions 00284 * @{ 00285 */ 00286 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAMPCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */ 00287 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */ 00288 /** 00289 * @} 00290 */ 00291 00292 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTC Tamper Pull Up Definitions 00293 * @{ 00294 */ 00295 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event saved */ 00296 #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAMPCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */ 00297 /** 00298 * @} 00299 */ 00300 00301 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTC Wakeup Timer Definitions 00302 * @{ 00303 */ 00304 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000) 00305 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001) 00306 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002) 00307 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003) 00308 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004) 00309 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006) 00310 /** 00311 * @} 00312 */ 00313 00314 /** @defgroup RTCEx_Smooth_calib_period_Definitions RTC Smooth Calib Period Definitions 00315 * @{ 00316 */ 00317 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibration 00318 period is 32s, else 2exp20 RTCCLK seconds */ 00319 #define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibration 00320 period is 16s, else 2exp19 RTCCLK seconds */ 00321 #define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibration 00322 period is 8s, else 2exp18 RTCCLK seconds */ 00323 /** 00324 * @} 00325 */ 00326 00327 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTC Smooth Calib Plus Pulses Definitions 00328 * @{ 00329 */ 00330 #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added 00331 during a X -second window = Y - CALM[8:0] 00332 with Y = 512, 256, 128 when X = 32, 16, 8 */ 00333 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited 00334 during a 32-second window = CALM[8:0] */ 00335 /** 00336 * @} 00337 */ 00338 00339 /** @defgroup RTCEx_Calib_Output_selection_Definitions RTC Calib Output Selection Definitions 00340 * @{ 00341 */ 00342 #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000) 00343 #define RTC_CALIBOUTPUT_1HZ ((uint32_t)0x00080000) 00344 /** 00345 * @} 00346 */ 00347 00348 /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions RTC Add 1 Second Parameter Definitions 00349 * @{ 00350 */ 00351 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000) 00352 #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000) 00353 /** 00354 * @} 00355 */ 00356 00357 /** 00358 * @} 00359 */ 00360 00361 /* Exported macros -----------------------------------------------------------*/ 00362 /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros 00363 * @{ 00364 */ 00365 00366 /** 00367 * @brief Enable the RTC WakeUp Timer peripheral. 00368 * @param __HANDLE__: specifies the RTC handle. 00369 * @retval None 00370 */ 00371 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE)) 00372 00373 /** 00374 * @brief Disable the RTC WakeUp Timer peripheral. 00375 * @param __HANDLE__: specifies the RTC handle. 00376 * @retval None 00377 */ 00378 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE)) 00379 00380 /** 00381 * @brief Enable the RTC WakeUpTimer interrupt. 00382 * @param __HANDLE__: specifies the RTC handle. 00383 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled. 00384 * This parameter can be: 00385 * @arg RTC_IT_WUT: WakeUpTimer interrupt 00386 * @retval None 00387 */ 00388 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) 00389 00390 /** 00391 * @brief Disable the RTC WakeUpTimer interrupt. 00392 * @param __HANDLE__: specifies the RTC handle. 00393 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be disabled. 00394 * This parameter can be: 00395 * @arg RTC_IT_WUT: WakeUpTimer interrupt 00396 * @retval None 00397 */ 00398 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) 00399 00400 /** 00401 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not. 00402 * @param __HANDLE__: specifies the RTC handle. 00403 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to check. 00404 * This parameter can be: 00405 * @arg RTC_IT_WUT: WakeUpTimer interrupt 00406 * @retval None 00407 */ 00408 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET) ? SET : RESET) 00409 00410 /** 00411 * @brief Check whether the specified RTC Wake Up timer interrupt is enabled or not. 00412 * @param __HANDLE__: specifies the RTC handle. 00413 * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check. 00414 * This parameter can be: 00415 * @arg RTC_IT_WUT: WakeUpTimer interrupt 00416 * @retval None 00417 */ 00418 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) 00419 00420 /** 00421 * @brief Get the selected RTC WakeUpTimer's flag status. 00422 * @param __HANDLE__: specifies the RTC handle. 00423 * @param __FLAG__: specifies the RTC WakeUpTimer Flag is pending or not. 00424 * This parameter can be: 00425 * @arg RTC_FLAG_WUTF 00426 * @arg RTC_FLAG_WUTWF 00427 * @retval None 00428 */ 00429 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET) 00430 00431 /** 00432 * @brief Clear the RTC Wake Up timer's pending flags. 00433 * @param __HANDLE__: specifies the RTC handle. 00434 * @param __FLAG__: specifies the RTC WakeUpTimer Flag to clear. 00435 * This parameter can be: 00436 * @arg RTC_FLAG_WUTF 00437 * @retval None 00438 */ 00439 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) 00440 00441 #if defined(RTC_TAMPER1_SUPPORT) 00442 /** 00443 * @brief Enable the RTC Tamper1 input detection. 00444 * @param __HANDLE__: specifies the RTC handle. 00445 * @retval None 00446 */ 00447 #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP1E)) 00448 00449 /** 00450 * @brief Disable the RTC Tamper1 input detection. 00451 * @param __HANDLE__: specifies the RTC handle. 00452 * @retval None 00453 */ 00454 #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP1E)) 00455 #endif /* RTC_TAMPER1_SUPPORT */ 00456 00457 /** 00458 * @brief Enable the RTC Tamper2 input detection. 00459 * @param __HANDLE__: specifies the RTC handle. 00460 * @retval None 00461 */ 00462 #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP2E)) 00463 00464 /** 00465 * @brief Disable the RTC Tamper2 input detection. 00466 * @param __HANDLE__: specifies the RTC handle. 00467 * @retval None 00468 */ 00469 #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP2E)) 00470 00471 #if defined(RTC_TAMPER3_SUPPORT) 00472 /** 00473 * @brief Enable the RTC Tamper3 input detection. 00474 * @param __HANDLE__: specifies the RTC handle. 00475 * @retval None 00476 */ 00477 #define __HAL_RTC_TAMPER3_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP3E)) 00478 00479 /** 00480 * @brief Disable the RTC Tamper3 input detection. 00481 * @param __HANDLE__: specifies the RTC handle. 00482 * @retval None 00483 */ 00484 #define __HAL_RTC_TAMPER3_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP3E)) 00485 #endif /* RTC_TAMPER3_SUPPORT */ 00486 00487 /** 00488 * @brief Enable the RTC Tamper interrupt. 00489 * @param __HANDLE__: specifies the RTC handle. 00490 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be enabled. 00491 * This parameter can be any combination of the following values: 00492 * @arg RTC_IT_TAMP: All tampers interrupts 00493 * @arg RTC_IT_TAMP1: Tamper1 interrupt 00494 * @arg RTC_IT_TAMP2: Tamper2 interrupt 00495 * @arg RTC_IT_TAMP3: Tamper3 interrupt 00496 * @retval None 00497 */ 00498 #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__)) 00499 00500 /** 00501 * @brief Disable the RTC Tamper interrupt. 00502 * @param __HANDLE__: specifies the RTC handle. 00503 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be disabled. 00504 * This parameter can be any combination of the following values: 00505 * @arg RTC_IT_TAMP: All tampers interrupts 00506 * @arg RTC_IT_TAMP1: Tamper1 interrupt 00507 * @arg RTC_IT_TAMP2: Tamper2 interrupt 00508 * @arg RTC_IT_TAMP3: Tamper3 interrupt 00509 * @retval None 00510 */ 00511 #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR &= ~(__INTERRUPT__)) 00512 00513 /** 00514 * @brief Check whether the specified RTC Tamper interrupt has occurred or not. 00515 * @param __HANDLE__: specifies the RTC handle. 00516 * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check. 00517 * This parameter can be: 00518 * @arg RTC_IT_TAMP1: Tamper1 interrupt 00519 * @arg RTC_IT_TAMP2: Tamper2 interrupt 00520 * @arg RTC_IT_TAMP3: Tamper3 interrupt 00521 * @retval None 00522 */ 00523 #if defined(RTC_TAMPER1_SUPPORT) && defined(RTC_TAMPER3_SUPPORT) 00524 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP1) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 3)) != RESET) ? SET : RESET) : \ 00525 ((__INTERRUPT__) == RTC_IT_TAMP2) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5)) != RESET) ? SET : RESET) : \ 00526 (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 7)) != RESET) ? SET : RESET)) 00527 #else 00528 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5)) != RESET) ? SET : RESET) 00529 #endif /* RTC_TAMPER1_SUPPORT && RTC_TAMPER3_SUPPORT */ 00530 00531 /** 00532 * @brief Check whether the specified RTC Tamper interrupt is enabled or not. 00533 * @param __HANDLE__: specifies the RTC handle. 00534 * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check. 00535 * This parameter can be: 00536 * @arg RTC_IT_TAMP: All tampers interrupts 00537 * @arg RTC_IT_TAMP1: Tamper1 interrupt 00538 * @arg RTC_IT_TAMP2: Tamper2 interrupt 00539 * @arg RTC_IT_TAMP3: Tamper3 interrupt 00540 * @retval None 00541 */ 00542 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR) & (__INTERRUPT__)) != RESET) ? SET : RESET) 00543 00544 /** 00545 * @brief Get the selected RTC Tamper's flag status. 00546 * @param __HANDLE__: specifies the RTC handle. 00547 * @param __FLAG__: specifies the RTC Tamper Flag is pending or not. 00548 * This parameter can be: 00549 * @arg RTC_FLAG_TAMP1F: Tamper1 flag 00550 * @arg RTC_FLAG_TAMP2F: Tamper2 flag 00551 * @arg RTC_FLAG_TAMP3F: Tamper3 flag 00552 * @retval None 00553 */ 00554 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET) 00555 00556 /** 00557 * @brief Clear the RTC Tamper's pending flags. 00558 * @param __HANDLE__: specifies the RTC handle. 00559 * @param __FLAG__: specifies the RTC Tamper Flag sources to clear. 00560 * This parameter can be: 00561 * @arg RTC_FLAG_TAMP1F: Tamper1 flag 00562 * @arg RTC_FLAG_TAMP2F: Tamper2 flag 00563 * @arg RTC_FLAG_TAMP3F: Tamper3 flag 00564 * @retval None 00565 */ 00566 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) 00567 00568 /** 00569 * @brief Enable the RTC TimeStamp peripheral. 00570 * @param __HANDLE__: specifies the RTC handle. 00571 * @retval None 00572 */ 00573 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE)) 00574 00575 /** 00576 * @brief Disable the RTC TimeStamp peripheral. 00577 * @param __HANDLE__: specifies the RTC handle. 00578 * @retval None 00579 */ 00580 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE)) 00581 00582 /** 00583 * @brief Enable the RTC TimeStamp interrupt. 00584 * @param __HANDLE__: specifies the RTC handle. 00585 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt source to be enabled. 00586 * This parameter can be: 00587 * @arg RTC_IT_TS: TimeStamp interrupt 00588 * @retval None 00589 */ 00590 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) 00591 00592 /** 00593 * @brief Disable the RTC TimeStamp interrupt. 00594 * @param __HANDLE__: specifies the RTC handle. 00595 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt source to be disabled. 00596 * This parameter can be: 00597 * @arg RTC_IT_TS: TimeStamp interrupt 00598 * @retval None 00599 */ 00600 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) 00601 00602 /** 00603 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not. 00604 * @param __HANDLE__: specifies the RTC handle. 00605 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt source to check. 00606 * This parameter can be: 00607 * @arg RTC_IT_TS: TimeStamp interrupt 00608 * @retval None 00609 */ 00610 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET) ? SET : RESET) 00611 00612 /** 00613 * @brief Check whether the specified RTC Time Stamp interrupt is enabled or not. 00614 * @param __HANDLE__: specifies the RTC handle. 00615 * @param __INTERRUPT__: specifies the RTC Time Stamp interrupt source to check. 00616 * This parameter can be: 00617 * @arg RTC_IT_TS: TimeStamp interrupt 00618 * @retval None 00619 */ 00620 #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) 00621 00622 /** 00623 * @brief Get the selected RTC TimeStamp's flag status. 00624 * @param __HANDLE__: specifies the RTC handle. 00625 * @param __FLAG__: specifies the RTC TimeStamp Flag is pending or not. 00626 * This parameter can be: 00627 * @arg RTC_FLAG_TSF 00628 * @arg RTC_FLAG_TSOVF 00629 * @retval None 00630 */ 00631 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET) 00632 00633 /** 00634 * @brief Clear the RTC Time Stamp's pending flags. 00635 * @param __HANDLE__: specifies the RTC handle. 00636 * @param __FLAG__: specifies the RTC Alarm Flag sources to clear. 00637 * This parameter can be: 00638 * @arg RTC_FLAG_TSF 00639 * @arg RTC_FLAG_TSOVF 00640 * @retval None 00641 */ 00642 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) 00643 00644 /** 00645 * @brief Enable the RTC internal TimeStamp peripheral. 00646 * @param __HANDLE__: specifies the RTC handle. 00647 * @retval None 00648 */ 00649 #define __HAL_RTC_INTERNAL_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ITSE)) 00650 00651 /** 00652 * @brief Disable the RTC internal TimeStamp peripheral. 00653 * @param __HANDLE__: specifies the RTC handle. 00654 * @retval None 00655 */ 00656 #define __HAL_RTC_INTERNAL_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ITSE)) 00657 00658 /** 00659 * @brief Get the selected RTC Internal Time Stamp's flag status. 00660 * @param __HANDLE__: specifies the RTC handle. 00661 * @param __FLAG__: specifies the RTC Internal Time Stamp Flag is pending or not. 00662 * This parameter can be: 00663 * @arg RTC_FLAG_ITSF 00664 * @retval None 00665 */ 00666 #define __HAL_RTC_INTERNAL_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET) 00667 00668 /** 00669 * @brief Clear the RTC Internal Time Stamp's pending flags. 00670 * @param __HANDLE__: specifies the RTC handle. 00671 * @param __FLAG__: specifies the RTC Internal Time Stamp Flag source to clear. 00672 * This parameter can be: 00673 * @arg RTC_FLAG_ITSF 00674 * @retval None 00675 */ 00676 #define __HAL_RTC_INTERNAL_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) 00677 00678 /** 00679 * @brief Enable the RTC calibration output. 00680 * @param __HANDLE__: specifies the RTC handle. 00681 * @retval None 00682 */ 00683 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE)) 00684 00685 /** 00686 * @brief Disable the calibration output. 00687 * @param __HANDLE__: specifies the RTC handle. 00688 * @retval None 00689 */ 00690 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE)) 00691 00692 /** 00693 * @brief Enable the clock reference detection. 00694 * @param __HANDLE__: specifies the RTC handle. 00695 * @retval None 00696 */ 00697 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON)) 00698 00699 /** 00700 * @brief Disable the clock reference detection. 00701 * @param __HANDLE__: specifies the RTC handle. 00702 * @retval None 00703 */ 00704 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON)) 00705 00706 /** 00707 * @brief Get the selected RTC shift operation's flag status. 00708 * @param __HANDLE__: specifies the RTC handle. 00709 * @param __FLAG__: specifies the RTC shift operation Flag is pending or not. 00710 * This parameter can be: 00711 * @arg RTC_FLAG_SHPF 00712 * @retval None 00713 */ 00714 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET) 00715 00716 /** 00717 * @brief Enable interrupt on the RTC WakeUp Timer associated Exti line. 00718 * @retval None 00719 */ 00720 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 00721 00722 /** 00723 * @brief Disable interrupt on the RTC WakeUp Timer associated Exti line. 00724 * @retval None 00725 */ 00726 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 00727 00728 /** 00729 * @brief Enable event on the RTC WakeUp Timer associated Exti line. 00730 * @retval None 00731 */ 00732 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 00733 00734 /** 00735 * @brief Disable event on the RTC WakeUp Timer associated Exti line. 00736 * @retval None 00737 */ 00738 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 00739 00740 /** 00741 * @brief Enable falling edge trigger on the RTC WakeUp Timer associated Exti line. 00742 * @retval None 00743 */ 00744 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 00745 00746 /** 00747 * @brief Disable falling edge trigger on the RTC WakeUp Timer associated Exti line. 00748 * @retval None 00749 */ 00750 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 00751 00752 /** 00753 * @brief Enable rising edge trigger on the RTC WakeUp Timer associated Exti line. 00754 * @retval None 00755 */ 00756 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 00757 00758 /** 00759 * @brief Disable rising edge trigger on the RTC WakeUp Timer associated Exti line. 00760 * @retval None 00761 */ 00762 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) 00763 00764 /** 00765 * @brief Enable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line. 00766 * @retval None 00767 */ 00768 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ 00769 __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE(); \ 00770 __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE(); \ 00771 } while(0) 00772 00773 /** 00774 * @brief Disable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line. 00775 * This parameter can be: 00776 * @retval None 00777 */ 00778 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ 00779 __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE(); \ 00780 __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE(); \ 00781 } while(0) 00782 00783 /** 00784 * @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not. 00785 * @retval Line Status. 00786 */ 00787 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 00788 00789 /** 00790 * @brief Clear the RTC WakeUp Timer associated Exti line flag. 00791 * @retval None 00792 */ 00793 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 00794 00795 /** 00796 * @brief Generate a Software interrupt on the RTC WakeUp Timer associated Exti line. 00797 * @retval None 00798 */ 00799 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) 00800 00801 /** 00802 * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line. 00803 * @retval None 00804 */ 00805 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 00806 00807 /** 00808 * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line. 00809 * @retval None 00810 */ 00811 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 00812 00813 /** 00814 * @brief Enable event on the RTC Tamper and Timestamp associated Exti line. 00815 * @retval None 00816 */ 00817 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 00818 00819 /** 00820 * @brief Disable event on the RTC Tamper and Timestamp associated Exti line. 00821 * @retval None 00822 */ 00823 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 00824 00825 /** 00826 * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. 00827 * @retval None 00828 */ 00829 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 00830 00831 /** 00832 * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. 00833 * @retval None 00834 */ 00835 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 00836 00837 /** 00838 * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. 00839 * @retval None 00840 */ 00841 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 00842 00843 /** 00844 * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. 00845 * @retval None 00846 */ 00847 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) 00848 00849 /** 00850 * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. 00851 * @retval None 00852 */ 00853 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ 00854 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE(); \ 00855 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); \ 00856 } while(0) 00857 00858 /** 00859 * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. 00860 * This parameter can be: 00861 * @retval None 00862 */ 00863 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ 00864 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE(); \ 00865 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE(); \ 00866 } while(0) 00867 00868 /** 00869 * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not. 00870 * @retval Line Status. 00871 */ 00872 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 00873 00874 /** 00875 * @brief Clear the RTC Tamper and Timestamp associated Exti line flag. 00876 * @retval None 00877 */ 00878 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 00879 00880 /** 00881 * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line 00882 * @retval None 00883 */ 00884 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) 00885 00886 /** 00887 * @} 00888 */ 00889 00890 /* Exported functions --------------------------------------------------------*/ 00891 /** @addtogroup RTCEx_Exported_Functions 00892 * @{ 00893 */ 00894 00895 /* RTC TimeStamp and Tamper functions *****************************************/ 00896 /** @addtogroup RTCEx_Exported_Functions_Group1 00897 * @{ 00898 */ 00899 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); 00900 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); 00901 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc); 00902 HAL_StatusTypeDef HAL_RTCEx_SetInternalTimeStamp(RTC_HandleTypeDef *hrtc); 00903 HAL_StatusTypeDef HAL_RTCEx_DeactivateInternalTimeStamp(RTC_HandleTypeDef *hrtc); 00904 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format); 00905 00906 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); 00907 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); 00908 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper); 00909 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc); 00910 00911 #if defined(RTC_TAMPER1_SUPPORT) 00912 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); 00913 #endif /* RTC_TAMPER1_SUPPORT */ 00914 void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc); 00915 #if defined(RTC_TAMPER3_SUPPORT) 00916 void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc); 00917 #endif /* RTC_TAMPER3_SUPPORT */ 00918 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc); 00919 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 00920 #if defined(RTC_TAMPER1_SUPPORT) 00921 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 00922 #endif /* RTC_TAMPER1_SUPPORT */ 00923 HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 00924 #if defined(RTC_TAMPER3_SUPPORT) 00925 HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 00926 #endif /* RTC_TAMPER3_SUPPORT */ 00927 /** 00928 * @} 00929 */ 00930 00931 /* RTC Wake-up functions ******************************************************/ 00932 /** @addtogroup RTCEx_Exported_Functions_Group2 00933 * @{ 00934 */ 00935 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); 00936 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); 00937 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc); 00938 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc); 00939 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc); 00940 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc); 00941 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 00942 /** 00943 * @} 00944 */ 00945 00946 /* Extended Control functions ************************************************/ 00947 /** @addtogroup RTCEx_Exported_Functions_Group3 00948 * @{ 00949 */ 00950 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); 00951 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); 00952 00953 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue); 00954 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS); 00955 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput); 00956 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc); 00957 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc); 00958 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc); 00959 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc); 00960 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc); 00961 /** 00962 * @} 00963 */ 00964 00965 /* Extended RTC features functions *******************************************/ 00966 /** @addtogroup RTCEx_Exported_Functions_Group4 00967 * @{ 00968 */ 00969 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc); 00970 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); 00971 /** 00972 * @} 00973 */ 00974 00975 /** 00976 * @} 00977 */ 00978 00979 /* Private types -------------------------------------------------------------*/ 00980 /* Private variables ---------------------------------------------------------*/ 00981 /* Private constants ---------------------------------------------------------*/ 00982 /** @defgroup RTCEx_Private_Constants RTCEx Private Constants 00983 * @{ 00984 */ 00985 #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)0x00080000) /*!< External interrupt line 19 Connected to the RTC Tamper and Time Stamp events */ 00986 #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the RTC Wakeup event */ 00987 00988 /** 00989 * @} 00990 */ 00991 00992 /* Private macros ------------------------------------------------------------*/ 00993 /** @defgroup RTCEx_Private_Macros RTCEx Private Macros 00994 * @{ 00995 */ 00996 00997 /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters 00998 * @{ 00999 */ 01000 01001 #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \ 01002 ((OUTPUT) == RTC_OUTPUT_ALARMA) || \ 01003 ((OUTPUT) == RTC_OUTPUT_ALARMB) || \ 01004 ((OUTPUT) == RTC_OUTPUT_WAKEUP)) 01005 01006 #define IS_RTC_BKP(BKP) ((BKP) < (uint32_t) RTC_BKP_NUMBER) 01007 01008 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \ 01009 ((EDGE) == RTC_TIMESTAMPEDGE_FALLING)) 01010 01011 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFD6) == 0x00) && ((TAMPER) != (uint32_t)RESET)) 01012 01013 #define IS_RTC_TAMPER_INTERRUPT(INTERRUPT) ((((INTERRUPT) & (uint32_t)0xFFB6FFFB) == 0x00) && ((INTERRUPT) != (uint32_t)RESET)) 01014 01015 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT)) 01016 01017 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \ 01018 ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \ 01019 ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ 01020 ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL)) 01021 01022 #define IS_RTC_TAMPER_ERASE_MODE(MODE) (((MODE) == RTC_TAMPER_ERASE_BACKUP_ENABLE) || \ 01023 ((MODE) == RTC_TAMPER_ERASE_BACKUP_DISABLE)) 01024 01025 #define IS_RTC_TAMPER_MASKFLAG_STATE(STATE) (((STATE) == RTC_TAMPERMASK_FLAG_ENABLE) || \ 01026 ((STATE) == RTC_TAMPERMASK_FLAG_DISABLE)) 01027 01028 #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \ 01029 ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \ 01030 ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \ 01031 ((FILTER) == RTC_TAMPERFILTER_8SAMPLE)) 01032 01033 #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \ 01034 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \ 01035 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \ 01036 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \ 01037 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \ 01038 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \ 01039 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \ 01040 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256)) 01041 01042 #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \ 01043 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \ 01044 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \ 01045 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK)) 01046 01047 #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \ 01048 ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE)) 01049 01050 #define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \ 01051 ((STATE) == RTC_TAMPER_PULLUP_DISABLE)) 01052 01053 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \ 01054 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \ 01055 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \ 01056 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \ 01057 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \ 01058 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS)) 01059 01060 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF) 01061 01062 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \ 01063 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \ 01064 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC)) 01065 01066 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \ 01067 ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET)) 01068 01069 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF) 01070 01071 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \ 01072 ((SEL) == RTC_SHIFTADD1S_SET)) 01073 01074 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF) 01075 01076 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \ 01077 ((OUTPUT) == RTC_CALIBOUTPUT_1HZ)) 01078 01079 /** 01080 * @} 01081 */ 01082 01083 /** 01084 * @} 01085 */ 01086 01087 /** 01088 * @} 01089 */ 01090 01091 /** 01092 * @} 01093 */ 01094 01095 #ifdef __cplusplus 01096 } 01097 #endif 01098 01099 #endif /* __STM32L4xx_HAL_RTC_EX_H */ 01100 01101 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Tue Jul 12 2022 17:38:50 by
