TUKS MCU Introductory course / TUKS-COURSE-TIMER
Committer:
elmot
Date:
Fri Feb 24 21:13:56 2017 +0000
Revision:
1:d0dfbce63a89
Ready-to-copy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elmot 1:d0dfbce63a89 1 /**
elmot 1:d0dfbce63a89 2 ******************************************************************************
elmot 1:d0dfbce63a89 3 * @file stm32l4xx_hal_rtc_ex.h
elmot 1:d0dfbce63a89 4 * @author MCD Application Team
elmot 1:d0dfbce63a89 5 * @version V1.5.1
elmot 1:d0dfbce63a89 6 * @date 31-May-2016
elmot 1:d0dfbce63a89 7 * @brief Header file of RTC HAL Extended module.
elmot 1:d0dfbce63a89 8 ******************************************************************************
elmot 1:d0dfbce63a89 9 * @attention
elmot 1:d0dfbce63a89 10 *
elmot 1:d0dfbce63a89 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
elmot 1:d0dfbce63a89 12 *
elmot 1:d0dfbce63a89 13 * Redistribution and use in source and binary forms, with or without modification,
elmot 1:d0dfbce63a89 14 * are permitted provided that the following conditions are met:
elmot 1:d0dfbce63a89 15 * 1. Redistributions of source code must retain the above copyright notice,
elmot 1:d0dfbce63a89 16 * this list of conditions and the following disclaimer.
elmot 1:d0dfbce63a89 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
elmot 1:d0dfbce63a89 18 * this list of conditions and the following disclaimer in the documentation
elmot 1:d0dfbce63a89 19 * and/or other materials provided with the distribution.
elmot 1:d0dfbce63a89 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
elmot 1:d0dfbce63a89 21 * may be used to endorse or promote products derived from this software
elmot 1:d0dfbce63a89 22 * without specific prior written permission.
elmot 1:d0dfbce63a89 23 *
elmot 1:d0dfbce63a89 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
elmot 1:d0dfbce63a89 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
elmot 1:d0dfbce63a89 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
elmot 1:d0dfbce63a89 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
elmot 1:d0dfbce63a89 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
elmot 1:d0dfbce63a89 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
elmot 1:d0dfbce63a89 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
elmot 1:d0dfbce63a89 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
elmot 1:d0dfbce63a89 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
elmot 1:d0dfbce63a89 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
elmot 1:d0dfbce63a89 34 *
elmot 1:d0dfbce63a89 35 ******************************************************************************
elmot 1:d0dfbce63a89 36 */
elmot 1:d0dfbce63a89 37
elmot 1:d0dfbce63a89 38 /* Define to prevent recursive inclusion -------------------------------------*/
elmot 1:d0dfbce63a89 39 #ifndef __STM32L4xx_HAL_RTC_EX_H
elmot 1:d0dfbce63a89 40 #define __STM32L4xx_HAL_RTC_EX_H
elmot 1:d0dfbce63a89 41
elmot 1:d0dfbce63a89 42 #ifdef __cplusplus
elmot 1:d0dfbce63a89 43 extern "C" {
elmot 1:d0dfbce63a89 44 #endif
elmot 1:d0dfbce63a89 45
elmot 1:d0dfbce63a89 46 /* Includes ------------------------------------------------------------------*/
elmot 1:d0dfbce63a89 47 #include "stm32l4xx_hal_def.h"
elmot 1:d0dfbce63a89 48
elmot 1:d0dfbce63a89 49 /** @addtogroup STM32L4xx_HAL_Driver
elmot 1:d0dfbce63a89 50 * @{
elmot 1:d0dfbce63a89 51 */
elmot 1:d0dfbce63a89 52
elmot 1:d0dfbce63a89 53 /** @addtogroup RTCEx
elmot 1:d0dfbce63a89 54 * @{
elmot 1:d0dfbce63a89 55 */
elmot 1:d0dfbce63a89 56
elmot 1:d0dfbce63a89 57 /* Exported types ------------------------------------------------------------*/
elmot 1:d0dfbce63a89 58 /** @defgroup RTCEx_Exported_Types RTCEx Exported Types
elmot 1:d0dfbce63a89 59 * @{
elmot 1:d0dfbce63a89 60 */
elmot 1:d0dfbce63a89 61 /**
elmot 1:d0dfbce63a89 62 * @brief RTC Tamper structure definition
elmot 1:d0dfbce63a89 63 */
elmot 1:d0dfbce63a89 64 typedef struct
elmot 1:d0dfbce63a89 65 {
elmot 1:d0dfbce63a89 66 uint32_t Tamper; /*!< Specifies the Tamper Pin.
elmot 1:d0dfbce63a89 67 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
elmot 1:d0dfbce63a89 68
elmot 1:d0dfbce63a89 69 uint32_t Interrupt; /*!< Specifies the Tamper Interrupt.
elmot 1:d0dfbce63a89 70 This parameter can be a value of @ref RTCEx_Tamper_Interrupt_Definitions */
elmot 1:d0dfbce63a89 71
elmot 1:d0dfbce63a89 72 uint32_t Trigger; /*!< Specifies the Tamper Trigger.
elmot 1:d0dfbce63a89 73 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
elmot 1:d0dfbce63a89 74
elmot 1:d0dfbce63a89 75 uint32_t NoErase; /*!< Specifies the Tamper no erase mode.
elmot 1:d0dfbce63a89 76 This parameter can be a value of @ref RTCEx_Tamper_EraseBackUp_Definitions */
elmot 1:d0dfbce63a89 77
elmot 1:d0dfbce63a89 78 uint32_t MaskFlag; /*!< Specifies the Tamper Flag masking.
elmot 1:d0dfbce63a89 79 This parameter can be a value of @ref RTCEx_Tamper_MaskFlag_Definitions */
elmot 1:d0dfbce63a89 80
elmot 1:d0dfbce63a89 81 uint32_t Filter; /*!< Specifies the RTC Filter Tamper.
elmot 1:d0dfbce63a89 82 This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */
elmot 1:d0dfbce63a89 83
elmot 1:d0dfbce63a89 84 uint32_t SamplingFrequency; /*!< Specifies the sampling frequency.
elmot 1:d0dfbce63a89 85 This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */
elmot 1:d0dfbce63a89 86
elmot 1:d0dfbce63a89 87 uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration .
elmot 1:d0dfbce63a89 88 This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */
elmot 1:d0dfbce63a89 89
elmot 1:d0dfbce63a89 90 uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp .
elmot 1:d0dfbce63a89 91 This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */
elmot 1:d0dfbce63a89 92
elmot 1:d0dfbce63a89 93 uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection.
elmot 1:d0dfbce63a89 94 This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */
elmot 1:d0dfbce63a89 95 }RTC_TamperTypeDef;
elmot 1:d0dfbce63a89 96
elmot 1:d0dfbce63a89 97 /**
elmot 1:d0dfbce63a89 98 * @}
elmot 1:d0dfbce63a89 99 */
elmot 1:d0dfbce63a89 100
elmot 1:d0dfbce63a89 101 /* Exported constants --------------------------------------------------------*/
elmot 1:d0dfbce63a89 102 /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants
elmot 1:d0dfbce63a89 103 * @{
elmot 1:d0dfbce63a89 104 */
elmot 1:d0dfbce63a89 105
elmot 1:d0dfbce63a89 106 /** @defgroup RTCEx_Output_selection_Definitions RTC Output Selection Definitions
elmot 1:d0dfbce63a89 107 * @{
elmot 1:d0dfbce63a89 108 */
elmot 1:d0dfbce63a89 109 #define RTC_OUTPUT_DISABLE ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 110 #define RTC_OUTPUT_ALARMA ((uint32_t)0x00200000)
elmot 1:d0dfbce63a89 111 #define RTC_OUTPUT_ALARMB ((uint32_t)0x00400000)
elmot 1:d0dfbce63a89 112 #define RTC_OUTPUT_WAKEUP ((uint32_t)0x00600000)
elmot 1:d0dfbce63a89 113 /**
elmot 1:d0dfbce63a89 114 * @}
elmot 1:d0dfbce63a89 115 */
elmot 1:d0dfbce63a89 116
elmot 1:d0dfbce63a89 117 /** @defgroup RTCEx_Backup_Registers_Definitions RTC Backup Registers Definitions
elmot 1:d0dfbce63a89 118 * @{
elmot 1:d0dfbce63a89 119 */
elmot 1:d0dfbce63a89 120 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 121 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
elmot 1:d0dfbce63a89 122 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
elmot 1:d0dfbce63a89 123 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
elmot 1:d0dfbce63a89 124 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
elmot 1:d0dfbce63a89 125 #define RTC_BKP_DR5 ((uint32_t)0x00000005)
elmot 1:d0dfbce63a89 126 #define RTC_BKP_DR6 ((uint32_t)0x00000006)
elmot 1:d0dfbce63a89 127 #define RTC_BKP_DR7 ((uint32_t)0x00000007)
elmot 1:d0dfbce63a89 128 #define RTC_BKP_DR8 ((uint32_t)0x00000008)
elmot 1:d0dfbce63a89 129 #define RTC_BKP_DR9 ((uint32_t)0x00000009)
elmot 1:d0dfbce63a89 130 #define RTC_BKP_DR10 ((uint32_t)0x0000000A)
elmot 1:d0dfbce63a89 131 #define RTC_BKP_DR11 ((uint32_t)0x0000000B)
elmot 1:d0dfbce63a89 132 #define RTC_BKP_DR12 ((uint32_t)0x0000000C)
elmot 1:d0dfbce63a89 133 #define RTC_BKP_DR13 ((uint32_t)0x0000000D)
elmot 1:d0dfbce63a89 134 #define RTC_BKP_DR14 ((uint32_t)0x0000000E)
elmot 1:d0dfbce63a89 135 #define RTC_BKP_DR15 ((uint32_t)0x0000000F)
elmot 1:d0dfbce63a89 136 #define RTC_BKP_DR16 ((uint32_t)0x00000010)
elmot 1:d0dfbce63a89 137 #define RTC_BKP_DR17 ((uint32_t)0x00000011)
elmot 1:d0dfbce63a89 138 #define RTC_BKP_DR18 ((uint32_t)0x00000012)
elmot 1:d0dfbce63a89 139 #define RTC_BKP_DR19 ((uint32_t)0x00000013)
elmot 1:d0dfbce63a89 140 #define RTC_BKP_DR20 ((uint32_t)0x00000014)
elmot 1:d0dfbce63a89 141 #define RTC_BKP_DR21 ((uint32_t)0x00000015)
elmot 1:d0dfbce63a89 142 #define RTC_BKP_DR22 ((uint32_t)0x00000016)
elmot 1:d0dfbce63a89 143 #define RTC_BKP_DR23 ((uint32_t)0x00000017)
elmot 1:d0dfbce63a89 144 #define RTC_BKP_DR24 ((uint32_t)0x00000018)
elmot 1:d0dfbce63a89 145 #define RTC_BKP_DR25 ((uint32_t)0x00000019)
elmot 1:d0dfbce63a89 146 #define RTC_BKP_DR26 ((uint32_t)0x0000001A)
elmot 1:d0dfbce63a89 147 #define RTC_BKP_DR27 ((uint32_t)0x0000001B)
elmot 1:d0dfbce63a89 148 #define RTC_BKP_DR28 ((uint32_t)0x0000001C)
elmot 1:d0dfbce63a89 149 #define RTC_BKP_DR29 ((uint32_t)0x0000001D)
elmot 1:d0dfbce63a89 150 #define RTC_BKP_DR30 ((uint32_t)0x0000001E)
elmot 1:d0dfbce63a89 151 #define RTC_BKP_DR31 ((uint32_t)0x0000001F)
elmot 1:d0dfbce63a89 152 /**
elmot 1:d0dfbce63a89 153 * @}
elmot 1:d0dfbce63a89 154 */
elmot 1:d0dfbce63a89 155
elmot 1:d0dfbce63a89 156 /** @defgroup RTCEx_TimeStamp_Edges_definitions RTC TimeStamp Edges Definitions
elmot 1:d0dfbce63a89 157 * @{
elmot 1:d0dfbce63a89 158 */
elmot 1:d0dfbce63a89 159 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 160 #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008)
elmot 1:d0dfbce63a89 161 /**
elmot 1:d0dfbce63a89 162 * @}
elmot 1:d0dfbce63a89 163 */
elmot 1:d0dfbce63a89 164
elmot 1:d0dfbce63a89 165 /** @defgroup RTCEx_TimeStamp_Pin_Selection RTC TimeStamp Pins Selection
elmot 1:d0dfbce63a89 166 * @{
elmot 1:d0dfbce63a89 167 */
elmot 1:d0dfbce63a89 168 #define RTC_TIMESTAMPPIN_DEFAULT ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 169 /**
elmot 1:d0dfbce63a89 170 * @}
elmot 1:d0dfbce63a89 171 */
elmot 1:d0dfbce63a89 172
elmot 1:d0dfbce63a89 173 /** @defgroup RTCEx_Tamper_Pins_Definitions RTC Tamper Pins Definitions
elmot 1:d0dfbce63a89 174 * @{
elmot 1:d0dfbce63a89 175 */
elmot 1:d0dfbce63a89 176 #if defined(RTC_TAMPER1_SUPPORT)
elmot 1:d0dfbce63a89 177 #define RTC_TAMPER_1 RTC_TAMPCR_TAMP1E
elmot 1:d0dfbce63a89 178 #endif /* RTC_TAMPER1_SUPPORT */
elmot 1:d0dfbce63a89 179 #define RTC_TAMPER_2 RTC_TAMPCR_TAMP2E
elmot 1:d0dfbce63a89 180 #if defined(RTC_TAMPER3_SUPPORT)
elmot 1:d0dfbce63a89 181 #define RTC_TAMPER_3 RTC_TAMPCR_TAMP3E
elmot 1:d0dfbce63a89 182 #endif /* RTC_TAMPER3_SUPPORT */
elmot 1:d0dfbce63a89 183 /**
elmot 1:d0dfbce63a89 184 * @}
elmot 1:d0dfbce63a89 185 */
elmot 1:d0dfbce63a89 186
elmot 1:d0dfbce63a89 187 /** @defgroup RTCEx_Tamper_Interrupt_Definitions RTC Tamper Interrupts Definitions
elmot 1:d0dfbce63a89 188 * @{
elmot 1:d0dfbce63a89 189 */
elmot 1:d0dfbce63a89 190 #if defined(RTC_TAMPER1_SUPPORT)
elmot 1:d0dfbce63a89 191 #define RTC_TAMPER1_INTERRUPT RTC_TAMPCR_TAMP1IE
elmot 1:d0dfbce63a89 192 #endif /* RTC_TAMPER1_SUPPORT */
elmot 1:d0dfbce63a89 193 #define RTC_TAMPER2_INTERRUPT RTC_TAMPCR_TAMP2IE
elmot 1:d0dfbce63a89 194 #if defined(RTC_TAMPER3_SUPPORT)
elmot 1:d0dfbce63a89 195 #define RTC_TAMPER3_INTERRUPT RTC_TAMPCR_TAMP3IE
elmot 1:d0dfbce63a89 196 #endif /* RTC_TAMPER3_SUPPORT */
elmot 1:d0dfbce63a89 197 #define RTC_ALL_TAMPER_INTERRUPT RTC_TAMPCR_TAMPIE
elmot 1:d0dfbce63a89 198 /**
elmot 1:d0dfbce63a89 199 * @}
elmot 1:d0dfbce63a89 200 */
elmot 1:d0dfbce63a89 201
elmot 1:d0dfbce63a89 202 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTC Tamper Triggers Definitions
elmot 1:d0dfbce63a89 203 * @{
elmot 1:d0dfbce63a89 204 */
elmot 1:d0dfbce63a89 205 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 206 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002)
elmot 1:d0dfbce63a89 207 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
elmot 1:d0dfbce63a89 208 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
elmot 1:d0dfbce63a89 209 /**
elmot 1:d0dfbce63a89 210 * @}
elmot 1:d0dfbce63a89 211 */
elmot 1:d0dfbce63a89 212
elmot 1:d0dfbce63a89 213 /** @defgroup RTCEx_Tamper_EraseBackUp_Definitions RTC Tamper EraseBackUp Definitions
elmot 1:d0dfbce63a89 214 * @{
elmot 1:d0dfbce63a89 215 */
elmot 1:d0dfbce63a89 216 #define RTC_TAMPER_ERASE_BACKUP_ENABLE ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 217 #define RTC_TAMPER_ERASE_BACKUP_DISABLE ((uint32_t)0x00020000)
elmot 1:d0dfbce63a89 218 /**
elmot 1:d0dfbce63a89 219 * @}
elmot 1:d0dfbce63a89 220 */
elmot 1:d0dfbce63a89 221
elmot 1:d0dfbce63a89 222 /** @defgroup RTCEx_Tamper_MaskFlag_Definitions RTC Tamper Mask Flag Definitions
elmot 1:d0dfbce63a89 223 * @{
elmot 1:d0dfbce63a89 224 */
elmot 1:d0dfbce63a89 225 #define RTC_TAMPERMASK_FLAG_DISABLE ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 226 #define RTC_TAMPERMASK_FLAG_ENABLE ((uint32_t)0x00040000)
elmot 1:d0dfbce63a89 227 /**
elmot 1:d0dfbce63a89 228 * @}
elmot 1:d0dfbce63a89 229 */
elmot 1:d0dfbce63a89 230
elmot 1:d0dfbce63a89 231 /** @defgroup RTCEx_Tamper_Filter_Definitions RTC Tamper Filter Definitions
elmot 1:d0dfbce63a89 232 * @{
elmot 1:d0dfbce63a89 233 */
elmot 1:d0dfbce63a89 234 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
elmot 1:d0dfbce63a89 235
elmot 1:d0dfbce63a89 236 #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2
elmot 1:d0dfbce63a89 237 consecutive samples at the active level */
elmot 1:d0dfbce63a89 238 #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4
elmot 1:d0dfbce63a89 239 consecutive samples at the active level */
elmot 1:d0dfbce63a89 240 #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8
elmot 1:d0dfbce63a89 241 consecutive samples at the active level. */
elmot 1:d0dfbce63a89 242 /**
elmot 1:d0dfbce63a89 243 * @}
elmot 1:d0dfbce63a89 244 */
elmot 1:d0dfbce63a89 245
elmot 1:d0dfbce63a89 246 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTC Tamper Sampling Frequencies Definitions
elmot 1:d0dfbce63a89 247 * @{
elmot 1:d0dfbce63a89 248 */
elmot 1:d0dfbce63a89 249 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
elmot 1:d0dfbce63a89 250 with a frequency = RTCCLK / 32768 */
elmot 1:d0dfbce63a89 251 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled
elmot 1:d0dfbce63a89 252 with a frequency = RTCCLK / 16384 */
elmot 1:d0dfbce63a89 253 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
elmot 1:d0dfbce63a89 254 with a frequency = RTCCLK / 8192 */
elmot 1:d0dfbce63a89 255 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
elmot 1:d0dfbce63a89 256 with a frequency = RTCCLK / 4096 */
elmot 1:d0dfbce63a89 257 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
elmot 1:d0dfbce63a89 258 with a frequency = RTCCLK / 2048 */
elmot 1:d0dfbce63a89 259 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
elmot 1:d0dfbce63a89 260 with a frequency = RTCCLK / 1024 */
elmot 1:d0dfbce63a89 261 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
elmot 1:d0dfbce63a89 262 with a frequency = RTCCLK / 512 */
elmot 1:d0dfbce63a89 263 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
elmot 1:d0dfbce63a89 264 with a frequency = RTCCLK / 256 */
elmot 1:d0dfbce63a89 265 /**
elmot 1:d0dfbce63a89 266 * @}
elmot 1:d0dfbce63a89 267 */
elmot 1:d0dfbce63a89 268
elmot 1:d0dfbce63a89 269 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTC Tamper Pin Precharge Duration Definitions
elmot 1:d0dfbce63a89 270 * @{
elmot 1:d0dfbce63a89 271 */
elmot 1:d0dfbce63a89 272 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
elmot 1:d0dfbce63a89 273 sampling during 1 RTCCLK cycle */
elmot 1:d0dfbce63a89 274 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
elmot 1:d0dfbce63a89 275 sampling during 2 RTCCLK cycles */
elmot 1:d0dfbce63a89 276 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
elmot 1:d0dfbce63a89 277 sampling during 4 RTCCLK cycles */
elmot 1:d0dfbce63a89 278 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
elmot 1:d0dfbce63a89 279 sampling during 8 RTCCLK cycles */
elmot 1:d0dfbce63a89 280 /**
elmot 1:d0dfbce63a89 281 * @}
elmot 1:d0dfbce63a89 282 */
elmot 1:d0dfbce63a89 283
elmot 1:d0dfbce63a89 284 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTC Tamper TimeStamp On Tamper Detection Definitions
elmot 1:d0dfbce63a89 285 * @{
elmot 1:d0dfbce63a89 286 */
elmot 1:d0dfbce63a89 287 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAMPCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */
elmot 1:d0dfbce63a89 288 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
elmot 1:d0dfbce63a89 289 /**
elmot 1:d0dfbce63a89 290 * @}
elmot 1:d0dfbce63a89 291 */
elmot 1:d0dfbce63a89 292
elmot 1:d0dfbce63a89 293 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTC Tamper Pull Up Definitions
elmot 1:d0dfbce63a89 294 * @{
elmot 1:d0dfbce63a89 295 */
elmot 1:d0dfbce63a89 296 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event saved */
elmot 1:d0dfbce63a89 297 #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAMPCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */
elmot 1:d0dfbce63a89 298 /**
elmot 1:d0dfbce63a89 299 * @}
elmot 1:d0dfbce63a89 300 */
elmot 1:d0dfbce63a89 301
elmot 1:d0dfbce63a89 302 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTC Wakeup Timer Definitions
elmot 1:d0dfbce63a89 303 * @{
elmot 1:d0dfbce63a89 304 */
elmot 1:d0dfbce63a89 305 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 306 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001)
elmot 1:d0dfbce63a89 307 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002)
elmot 1:d0dfbce63a89 308 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003)
elmot 1:d0dfbce63a89 309 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004)
elmot 1:d0dfbce63a89 310 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006)
elmot 1:d0dfbce63a89 311 /**
elmot 1:d0dfbce63a89 312 * @}
elmot 1:d0dfbce63a89 313 */
elmot 1:d0dfbce63a89 314
elmot 1:d0dfbce63a89 315 /** @defgroup RTCEx_Smooth_calib_period_Definitions RTC Smooth Calib Period Definitions
elmot 1:d0dfbce63a89 316 * @{
elmot 1:d0dfbce63a89 317 */
elmot 1:d0dfbce63a89 318 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibration
elmot 1:d0dfbce63a89 319 period is 32s, else 2exp20 RTCCLK seconds */
elmot 1:d0dfbce63a89 320 #define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibration
elmot 1:d0dfbce63a89 321 period is 16s, else 2exp19 RTCCLK seconds */
elmot 1:d0dfbce63a89 322 #define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibration
elmot 1:d0dfbce63a89 323 period is 8s, else 2exp18 RTCCLK seconds */
elmot 1:d0dfbce63a89 324 /**
elmot 1:d0dfbce63a89 325 * @}
elmot 1:d0dfbce63a89 326 */
elmot 1:d0dfbce63a89 327
elmot 1:d0dfbce63a89 328 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTC Smooth Calib Plus Pulses Definitions
elmot 1:d0dfbce63a89 329 * @{
elmot 1:d0dfbce63a89 330 */
elmot 1:d0dfbce63a89 331 #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added
elmot 1:d0dfbce63a89 332 during a X -second window = Y - CALM[8:0]
elmot 1:d0dfbce63a89 333 with Y = 512, 256, 128 when X = 32, 16, 8 */
elmot 1:d0dfbce63a89 334 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
elmot 1:d0dfbce63a89 335 during a 32-second window = CALM[8:0] */
elmot 1:d0dfbce63a89 336 /**
elmot 1:d0dfbce63a89 337 * @}
elmot 1:d0dfbce63a89 338 */
elmot 1:d0dfbce63a89 339
elmot 1:d0dfbce63a89 340 /** @defgroup RTCEx_Calib_Output_selection_Definitions RTC Calib Output Selection Definitions
elmot 1:d0dfbce63a89 341 * @{
elmot 1:d0dfbce63a89 342 */
elmot 1:d0dfbce63a89 343 #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 344 #define RTC_CALIBOUTPUT_1HZ ((uint32_t)0x00080000)
elmot 1:d0dfbce63a89 345 /**
elmot 1:d0dfbce63a89 346 * @}
elmot 1:d0dfbce63a89 347 */
elmot 1:d0dfbce63a89 348
elmot 1:d0dfbce63a89 349 /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions RTC Add 1 Second Parameter Definitions
elmot 1:d0dfbce63a89 350 * @{
elmot 1:d0dfbce63a89 351 */
elmot 1:d0dfbce63a89 352 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000)
elmot 1:d0dfbce63a89 353 #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000)
elmot 1:d0dfbce63a89 354 /**
elmot 1:d0dfbce63a89 355 * @}
elmot 1:d0dfbce63a89 356 */
elmot 1:d0dfbce63a89 357
elmot 1:d0dfbce63a89 358 /**
elmot 1:d0dfbce63a89 359 * @}
elmot 1:d0dfbce63a89 360 */
elmot 1:d0dfbce63a89 361
elmot 1:d0dfbce63a89 362 /* Exported macros -----------------------------------------------------------*/
elmot 1:d0dfbce63a89 363 /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros
elmot 1:d0dfbce63a89 364 * @{
elmot 1:d0dfbce63a89 365 */
elmot 1:d0dfbce63a89 366
elmot 1:d0dfbce63a89 367 /**
elmot 1:d0dfbce63a89 368 * @brief Enable the RTC WakeUp Timer peripheral.
elmot 1:d0dfbce63a89 369 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 370 * @retval None
elmot 1:d0dfbce63a89 371 */
elmot 1:d0dfbce63a89 372 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
elmot 1:d0dfbce63a89 373
elmot 1:d0dfbce63a89 374 /**
elmot 1:d0dfbce63a89 375 * @brief Disable the RTC WakeUp Timer peripheral.
elmot 1:d0dfbce63a89 376 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 377 * @retval None
elmot 1:d0dfbce63a89 378 */
elmot 1:d0dfbce63a89 379 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
elmot 1:d0dfbce63a89 380
elmot 1:d0dfbce63a89 381 /**
elmot 1:d0dfbce63a89 382 * @brief Enable the RTC WakeUpTimer interrupt.
elmot 1:d0dfbce63a89 383 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 384 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled.
elmot 1:d0dfbce63a89 385 * This parameter can be:
elmot 1:d0dfbce63a89 386 * @arg RTC_IT_WUT: WakeUpTimer interrupt
elmot 1:d0dfbce63a89 387 * @retval None
elmot 1:d0dfbce63a89 388 */
elmot 1:d0dfbce63a89 389 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
elmot 1:d0dfbce63a89 390
elmot 1:d0dfbce63a89 391 /**
elmot 1:d0dfbce63a89 392 * @brief Disable the RTC WakeUpTimer interrupt.
elmot 1:d0dfbce63a89 393 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 394 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be disabled.
elmot 1:d0dfbce63a89 395 * This parameter can be:
elmot 1:d0dfbce63a89 396 * @arg RTC_IT_WUT: WakeUpTimer interrupt
elmot 1:d0dfbce63a89 397 * @retval None
elmot 1:d0dfbce63a89 398 */
elmot 1:d0dfbce63a89 399 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
elmot 1:d0dfbce63a89 400
elmot 1:d0dfbce63a89 401 /**
elmot 1:d0dfbce63a89 402 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
elmot 1:d0dfbce63a89 403 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 404 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to check.
elmot 1:d0dfbce63a89 405 * This parameter can be:
elmot 1:d0dfbce63a89 406 * @arg RTC_IT_WUT: WakeUpTimer interrupt
elmot 1:d0dfbce63a89 407 * @retval None
elmot 1:d0dfbce63a89 408 */
elmot 1:d0dfbce63a89 409 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 410
elmot 1:d0dfbce63a89 411 /**
elmot 1:d0dfbce63a89 412 * @brief Check whether the specified RTC Wake Up timer interrupt is enabled or not.
elmot 1:d0dfbce63a89 413 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 414 * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check.
elmot 1:d0dfbce63a89 415 * This parameter can be:
elmot 1:d0dfbce63a89 416 * @arg RTC_IT_WUT: WakeUpTimer interrupt
elmot 1:d0dfbce63a89 417 * @retval None
elmot 1:d0dfbce63a89 418 */
elmot 1:d0dfbce63a89 419 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 420
elmot 1:d0dfbce63a89 421 /**
elmot 1:d0dfbce63a89 422 * @brief Get the selected RTC WakeUpTimer's flag status.
elmot 1:d0dfbce63a89 423 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 424 * @param __FLAG__: specifies the RTC WakeUpTimer Flag is pending or not.
elmot 1:d0dfbce63a89 425 * This parameter can be:
elmot 1:d0dfbce63a89 426 * @arg RTC_FLAG_WUTF
elmot 1:d0dfbce63a89 427 * @arg RTC_FLAG_WUTWF
elmot 1:d0dfbce63a89 428 * @retval None
elmot 1:d0dfbce63a89 429 */
elmot 1:d0dfbce63a89 430 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 431
elmot 1:d0dfbce63a89 432 /**
elmot 1:d0dfbce63a89 433 * @brief Clear the RTC Wake Up timer's pending flags.
elmot 1:d0dfbce63a89 434 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 435 * @param __FLAG__: specifies the RTC WakeUpTimer Flag to clear.
elmot 1:d0dfbce63a89 436 * This parameter can be:
elmot 1:d0dfbce63a89 437 * @arg RTC_FLAG_WUTF
elmot 1:d0dfbce63a89 438 * @retval None
elmot 1:d0dfbce63a89 439 */
elmot 1:d0dfbce63a89 440 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
elmot 1:d0dfbce63a89 441
elmot 1:d0dfbce63a89 442 #if defined(RTC_TAMPER1_SUPPORT)
elmot 1:d0dfbce63a89 443 /**
elmot 1:d0dfbce63a89 444 * @brief Enable the RTC Tamper1 input detection.
elmot 1:d0dfbce63a89 445 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 446 * @retval None
elmot 1:d0dfbce63a89 447 */
elmot 1:d0dfbce63a89 448 #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP1E))
elmot 1:d0dfbce63a89 449
elmot 1:d0dfbce63a89 450 /**
elmot 1:d0dfbce63a89 451 * @brief Disable the RTC Tamper1 input detection.
elmot 1:d0dfbce63a89 452 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 453 * @retval None
elmot 1:d0dfbce63a89 454 */
elmot 1:d0dfbce63a89 455 #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP1E))
elmot 1:d0dfbce63a89 456 #endif /* RTC_TAMPER1_SUPPORT */
elmot 1:d0dfbce63a89 457
elmot 1:d0dfbce63a89 458 /**
elmot 1:d0dfbce63a89 459 * @brief Enable the RTC Tamper2 input detection.
elmot 1:d0dfbce63a89 460 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 461 * @retval None
elmot 1:d0dfbce63a89 462 */
elmot 1:d0dfbce63a89 463 #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP2E))
elmot 1:d0dfbce63a89 464
elmot 1:d0dfbce63a89 465 /**
elmot 1:d0dfbce63a89 466 * @brief Disable the RTC Tamper2 input detection.
elmot 1:d0dfbce63a89 467 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 468 * @retval None
elmot 1:d0dfbce63a89 469 */
elmot 1:d0dfbce63a89 470 #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP2E))
elmot 1:d0dfbce63a89 471
elmot 1:d0dfbce63a89 472 #if defined(RTC_TAMPER3_SUPPORT)
elmot 1:d0dfbce63a89 473 /**
elmot 1:d0dfbce63a89 474 * @brief Enable the RTC Tamper3 input detection.
elmot 1:d0dfbce63a89 475 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 476 * @retval None
elmot 1:d0dfbce63a89 477 */
elmot 1:d0dfbce63a89 478 #define __HAL_RTC_TAMPER3_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP3E))
elmot 1:d0dfbce63a89 479
elmot 1:d0dfbce63a89 480 /**
elmot 1:d0dfbce63a89 481 * @brief Disable the RTC Tamper3 input detection.
elmot 1:d0dfbce63a89 482 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 483 * @retval None
elmot 1:d0dfbce63a89 484 */
elmot 1:d0dfbce63a89 485 #define __HAL_RTC_TAMPER3_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP3E))
elmot 1:d0dfbce63a89 486 #endif /* RTC_TAMPER3_SUPPORT */
elmot 1:d0dfbce63a89 487
elmot 1:d0dfbce63a89 488 /**
elmot 1:d0dfbce63a89 489 * @brief Enable the RTC Tamper interrupt.
elmot 1:d0dfbce63a89 490 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 491 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be enabled.
elmot 1:d0dfbce63a89 492 * This parameter can be any combination of the following values:
elmot 1:d0dfbce63a89 493 * @arg RTC_IT_TAMP: All tampers interrupts
elmot 1:d0dfbce63a89 494 * @arg RTC_IT_TAMP1: Tamper1 interrupt
elmot 1:d0dfbce63a89 495 * @arg RTC_IT_TAMP2: Tamper2 interrupt
elmot 1:d0dfbce63a89 496 * @arg RTC_IT_TAMP3: Tamper3 interrupt
elmot 1:d0dfbce63a89 497 * @retval None
elmot 1:d0dfbce63a89 498 */
elmot 1:d0dfbce63a89 499 #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__))
elmot 1:d0dfbce63a89 500
elmot 1:d0dfbce63a89 501 /**
elmot 1:d0dfbce63a89 502 * @brief Disable the RTC Tamper interrupt.
elmot 1:d0dfbce63a89 503 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 504 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be disabled.
elmot 1:d0dfbce63a89 505 * This parameter can be any combination of the following values:
elmot 1:d0dfbce63a89 506 * @arg RTC_IT_TAMP: All tampers interrupts
elmot 1:d0dfbce63a89 507 * @arg RTC_IT_TAMP1: Tamper1 interrupt
elmot 1:d0dfbce63a89 508 * @arg RTC_IT_TAMP2: Tamper2 interrupt
elmot 1:d0dfbce63a89 509 * @arg RTC_IT_TAMP3: Tamper3 interrupt
elmot 1:d0dfbce63a89 510 * @retval None
elmot 1:d0dfbce63a89 511 */
elmot 1:d0dfbce63a89 512 #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR &= ~(__INTERRUPT__))
elmot 1:d0dfbce63a89 513
elmot 1:d0dfbce63a89 514 /**
elmot 1:d0dfbce63a89 515 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
elmot 1:d0dfbce63a89 516 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 517 * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check.
elmot 1:d0dfbce63a89 518 * This parameter can be:
elmot 1:d0dfbce63a89 519 * @arg RTC_IT_TAMP1: Tamper1 interrupt
elmot 1:d0dfbce63a89 520 * @arg RTC_IT_TAMP2: Tamper2 interrupt
elmot 1:d0dfbce63a89 521 * @arg RTC_IT_TAMP3: Tamper3 interrupt
elmot 1:d0dfbce63a89 522 * @retval None
elmot 1:d0dfbce63a89 523 */
elmot 1:d0dfbce63a89 524 #if defined(RTC_TAMPER1_SUPPORT) && defined(RTC_TAMPER3_SUPPORT)
elmot 1:d0dfbce63a89 525 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP1) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 3)) != RESET) ? SET : RESET) : \
elmot 1:d0dfbce63a89 526 ((__INTERRUPT__) == RTC_IT_TAMP2) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5)) != RESET) ? SET : RESET) : \
elmot 1:d0dfbce63a89 527 (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 7)) != RESET) ? SET : RESET))
elmot 1:d0dfbce63a89 528 #else
elmot 1:d0dfbce63a89 529 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 530 #endif /* RTC_TAMPER1_SUPPORT && RTC_TAMPER3_SUPPORT */
elmot 1:d0dfbce63a89 531
elmot 1:d0dfbce63a89 532 /**
elmot 1:d0dfbce63a89 533 * @brief Check whether the specified RTC Tamper interrupt is enabled or not.
elmot 1:d0dfbce63a89 534 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 535 * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check.
elmot 1:d0dfbce63a89 536 * This parameter can be:
elmot 1:d0dfbce63a89 537 * @arg RTC_IT_TAMP: All tampers interrupts
elmot 1:d0dfbce63a89 538 * @arg RTC_IT_TAMP1: Tamper1 interrupt
elmot 1:d0dfbce63a89 539 * @arg RTC_IT_TAMP2: Tamper2 interrupt
elmot 1:d0dfbce63a89 540 * @arg RTC_IT_TAMP3: Tamper3 interrupt
elmot 1:d0dfbce63a89 541 * @retval None
elmot 1:d0dfbce63a89 542 */
elmot 1:d0dfbce63a89 543 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 544
elmot 1:d0dfbce63a89 545 /**
elmot 1:d0dfbce63a89 546 * @brief Get the selected RTC Tamper's flag status.
elmot 1:d0dfbce63a89 547 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 548 * @param __FLAG__: specifies the RTC Tamper Flag is pending or not.
elmot 1:d0dfbce63a89 549 * This parameter can be:
elmot 1:d0dfbce63a89 550 * @arg RTC_FLAG_TAMP1F: Tamper1 flag
elmot 1:d0dfbce63a89 551 * @arg RTC_FLAG_TAMP2F: Tamper2 flag
elmot 1:d0dfbce63a89 552 * @arg RTC_FLAG_TAMP3F: Tamper3 flag
elmot 1:d0dfbce63a89 553 * @retval None
elmot 1:d0dfbce63a89 554 */
elmot 1:d0dfbce63a89 555 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 556
elmot 1:d0dfbce63a89 557 /**
elmot 1:d0dfbce63a89 558 * @brief Clear the RTC Tamper's pending flags.
elmot 1:d0dfbce63a89 559 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 560 * @param __FLAG__: specifies the RTC Tamper Flag sources to clear.
elmot 1:d0dfbce63a89 561 * This parameter can be:
elmot 1:d0dfbce63a89 562 * @arg RTC_FLAG_TAMP1F: Tamper1 flag
elmot 1:d0dfbce63a89 563 * @arg RTC_FLAG_TAMP2F: Tamper2 flag
elmot 1:d0dfbce63a89 564 * @arg RTC_FLAG_TAMP3F: Tamper3 flag
elmot 1:d0dfbce63a89 565 * @retval None
elmot 1:d0dfbce63a89 566 */
elmot 1:d0dfbce63a89 567 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
elmot 1:d0dfbce63a89 568
elmot 1:d0dfbce63a89 569 /**
elmot 1:d0dfbce63a89 570 * @brief Enable the RTC TimeStamp peripheral.
elmot 1:d0dfbce63a89 571 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 572 * @retval None
elmot 1:d0dfbce63a89 573 */
elmot 1:d0dfbce63a89 574 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
elmot 1:d0dfbce63a89 575
elmot 1:d0dfbce63a89 576 /**
elmot 1:d0dfbce63a89 577 * @brief Disable the RTC TimeStamp peripheral.
elmot 1:d0dfbce63a89 578 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 579 * @retval None
elmot 1:d0dfbce63a89 580 */
elmot 1:d0dfbce63a89 581 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
elmot 1:d0dfbce63a89 582
elmot 1:d0dfbce63a89 583 /**
elmot 1:d0dfbce63a89 584 * @brief Enable the RTC TimeStamp interrupt.
elmot 1:d0dfbce63a89 585 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 586 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt source to be enabled.
elmot 1:d0dfbce63a89 587 * This parameter can be:
elmot 1:d0dfbce63a89 588 * @arg RTC_IT_TS: TimeStamp interrupt
elmot 1:d0dfbce63a89 589 * @retval None
elmot 1:d0dfbce63a89 590 */
elmot 1:d0dfbce63a89 591 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
elmot 1:d0dfbce63a89 592
elmot 1:d0dfbce63a89 593 /**
elmot 1:d0dfbce63a89 594 * @brief Disable the RTC TimeStamp interrupt.
elmot 1:d0dfbce63a89 595 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 596 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt source to be disabled.
elmot 1:d0dfbce63a89 597 * This parameter can be:
elmot 1:d0dfbce63a89 598 * @arg RTC_IT_TS: TimeStamp interrupt
elmot 1:d0dfbce63a89 599 * @retval None
elmot 1:d0dfbce63a89 600 */
elmot 1:d0dfbce63a89 601 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
elmot 1:d0dfbce63a89 602
elmot 1:d0dfbce63a89 603 /**
elmot 1:d0dfbce63a89 604 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
elmot 1:d0dfbce63a89 605 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 606 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt source to check.
elmot 1:d0dfbce63a89 607 * This parameter can be:
elmot 1:d0dfbce63a89 608 * @arg RTC_IT_TS: TimeStamp interrupt
elmot 1:d0dfbce63a89 609 * @retval None
elmot 1:d0dfbce63a89 610 */
elmot 1:d0dfbce63a89 611 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 612
elmot 1:d0dfbce63a89 613 /**
elmot 1:d0dfbce63a89 614 * @brief Check whether the specified RTC Time Stamp interrupt is enabled or not.
elmot 1:d0dfbce63a89 615 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 616 * @param __INTERRUPT__: specifies the RTC Time Stamp interrupt source to check.
elmot 1:d0dfbce63a89 617 * This parameter can be:
elmot 1:d0dfbce63a89 618 * @arg RTC_IT_TS: TimeStamp interrupt
elmot 1:d0dfbce63a89 619 * @retval None
elmot 1:d0dfbce63a89 620 */
elmot 1:d0dfbce63a89 621 #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 622
elmot 1:d0dfbce63a89 623 /**
elmot 1:d0dfbce63a89 624 * @brief Get the selected RTC TimeStamp's flag status.
elmot 1:d0dfbce63a89 625 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 626 * @param __FLAG__: specifies the RTC TimeStamp Flag is pending or not.
elmot 1:d0dfbce63a89 627 * This parameter can be:
elmot 1:d0dfbce63a89 628 * @arg RTC_FLAG_TSF
elmot 1:d0dfbce63a89 629 * @arg RTC_FLAG_TSOVF
elmot 1:d0dfbce63a89 630 * @retval None
elmot 1:d0dfbce63a89 631 */
elmot 1:d0dfbce63a89 632 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 633
elmot 1:d0dfbce63a89 634 /**
elmot 1:d0dfbce63a89 635 * @brief Clear the RTC Time Stamp's pending flags.
elmot 1:d0dfbce63a89 636 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 637 * @param __FLAG__: specifies the RTC Alarm Flag sources to clear.
elmot 1:d0dfbce63a89 638 * This parameter can be:
elmot 1:d0dfbce63a89 639 * @arg RTC_FLAG_TSF
elmot 1:d0dfbce63a89 640 * @arg RTC_FLAG_TSOVF
elmot 1:d0dfbce63a89 641 * @retval None
elmot 1:d0dfbce63a89 642 */
elmot 1:d0dfbce63a89 643 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
elmot 1:d0dfbce63a89 644
elmot 1:d0dfbce63a89 645 /**
elmot 1:d0dfbce63a89 646 * @brief Enable the RTC internal TimeStamp peripheral.
elmot 1:d0dfbce63a89 647 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 648 * @retval None
elmot 1:d0dfbce63a89 649 */
elmot 1:d0dfbce63a89 650 #define __HAL_RTC_INTERNAL_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ITSE))
elmot 1:d0dfbce63a89 651
elmot 1:d0dfbce63a89 652 /**
elmot 1:d0dfbce63a89 653 * @brief Disable the RTC internal TimeStamp peripheral.
elmot 1:d0dfbce63a89 654 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 655 * @retval None
elmot 1:d0dfbce63a89 656 */
elmot 1:d0dfbce63a89 657 #define __HAL_RTC_INTERNAL_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ITSE))
elmot 1:d0dfbce63a89 658
elmot 1:d0dfbce63a89 659 /**
elmot 1:d0dfbce63a89 660 * @brief Get the selected RTC Internal Time Stamp's flag status.
elmot 1:d0dfbce63a89 661 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 662 * @param __FLAG__: specifies the RTC Internal Time Stamp Flag is pending or not.
elmot 1:d0dfbce63a89 663 * This parameter can be:
elmot 1:d0dfbce63a89 664 * @arg RTC_FLAG_ITSF
elmot 1:d0dfbce63a89 665 * @retval None
elmot 1:d0dfbce63a89 666 */
elmot 1:d0dfbce63a89 667 #define __HAL_RTC_INTERNAL_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 668
elmot 1:d0dfbce63a89 669 /**
elmot 1:d0dfbce63a89 670 * @brief Clear the RTC Internal Time Stamp's pending flags.
elmot 1:d0dfbce63a89 671 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 672 * @param __FLAG__: specifies the RTC Internal Time Stamp Flag source to clear.
elmot 1:d0dfbce63a89 673 * This parameter can be:
elmot 1:d0dfbce63a89 674 * @arg RTC_FLAG_ITSF
elmot 1:d0dfbce63a89 675 * @retval None
elmot 1:d0dfbce63a89 676 */
elmot 1:d0dfbce63a89 677 #define __HAL_RTC_INTERNAL_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
elmot 1:d0dfbce63a89 678
elmot 1:d0dfbce63a89 679 /**
elmot 1:d0dfbce63a89 680 * @brief Enable the RTC calibration output.
elmot 1:d0dfbce63a89 681 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 682 * @retval None
elmot 1:d0dfbce63a89 683 */
elmot 1:d0dfbce63a89 684 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
elmot 1:d0dfbce63a89 685
elmot 1:d0dfbce63a89 686 /**
elmot 1:d0dfbce63a89 687 * @brief Disable the calibration output.
elmot 1:d0dfbce63a89 688 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 689 * @retval None
elmot 1:d0dfbce63a89 690 */
elmot 1:d0dfbce63a89 691 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
elmot 1:d0dfbce63a89 692
elmot 1:d0dfbce63a89 693 /**
elmot 1:d0dfbce63a89 694 * @brief Enable the clock reference detection.
elmot 1:d0dfbce63a89 695 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 696 * @retval None
elmot 1:d0dfbce63a89 697 */
elmot 1:d0dfbce63a89 698 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
elmot 1:d0dfbce63a89 699
elmot 1:d0dfbce63a89 700 /**
elmot 1:d0dfbce63a89 701 * @brief Disable the clock reference detection.
elmot 1:d0dfbce63a89 702 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 703 * @retval None
elmot 1:d0dfbce63a89 704 */
elmot 1:d0dfbce63a89 705 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
elmot 1:d0dfbce63a89 706
elmot 1:d0dfbce63a89 707 /**
elmot 1:d0dfbce63a89 708 * @brief Get the selected RTC shift operation's flag status.
elmot 1:d0dfbce63a89 709 * @param __HANDLE__: specifies the RTC handle.
elmot 1:d0dfbce63a89 710 * @param __FLAG__: specifies the RTC shift operation Flag is pending or not.
elmot 1:d0dfbce63a89 711 * This parameter can be:
elmot 1:d0dfbce63a89 712 * @arg RTC_FLAG_SHPF
elmot 1:d0dfbce63a89 713 * @retval None
elmot 1:d0dfbce63a89 714 */
elmot 1:d0dfbce63a89 715 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
elmot 1:d0dfbce63a89 716
elmot 1:d0dfbce63a89 717 /**
elmot 1:d0dfbce63a89 718 * @brief Enable interrupt on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 719 * @retval None
elmot 1:d0dfbce63a89 720 */
elmot 1:d0dfbce63a89 721 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
elmot 1:d0dfbce63a89 722
elmot 1:d0dfbce63a89 723 /**
elmot 1:d0dfbce63a89 724 * @brief Disable interrupt on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 725 * @retval None
elmot 1:d0dfbce63a89 726 */
elmot 1:d0dfbce63a89 727 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
elmot 1:d0dfbce63a89 728
elmot 1:d0dfbce63a89 729 /**
elmot 1:d0dfbce63a89 730 * @brief Enable event on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 731 * @retval None
elmot 1:d0dfbce63a89 732 */
elmot 1:d0dfbce63a89 733 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
elmot 1:d0dfbce63a89 734
elmot 1:d0dfbce63a89 735 /**
elmot 1:d0dfbce63a89 736 * @brief Disable event on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 737 * @retval None
elmot 1:d0dfbce63a89 738 */
elmot 1:d0dfbce63a89 739 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
elmot 1:d0dfbce63a89 740
elmot 1:d0dfbce63a89 741 /**
elmot 1:d0dfbce63a89 742 * @brief Enable falling edge trigger on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 743 * @retval None
elmot 1:d0dfbce63a89 744 */
elmot 1:d0dfbce63a89 745 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
elmot 1:d0dfbce63a89 746
elmot 1:d0dfbce63a89 747 /**
elmot 1:d0dfbce63a89 748 * @brief Disable falling edge trigger on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 749 * @retval None
elmot 1:d0dfbce63a89 750 */
elmot 1:d0dfbce63a89 751 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
elmot 1:d0dfbce63a89 752
elmot 1:d0dfbce63a89 753 /**
elmot 1:d0dfbce63a89 754 * @brief Enable rising edge trigger on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 755 * @retval None
elmot 1:d0dfbce63a89 756 */
elmot 1:d0dfbce63a89 757 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
elmot 1:d0dfbce63a89 758
elmot 1:d0dfbce63a89 759 /**
elmot 1:d0dfbce63a89 760 * @brief Disable rising edge trigger on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 761 * @retval None
elmot 1:d0dfbce63a89 762 */
elmot 1:d0dfbce63a89 763 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
elmot 1:d0dfbce63a89 764
elmot 1:d0dfbce63a89 765 /**
elmot 1:d0dfbce63a89 766 * @brief Enable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 767 * @retval None
elmot 1:d0dfbce63a89 768 */
elmot 1:d0dfbce63a89 769 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
elmot 1:d0dfbce63a89 770 __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE(); \
elmot 1:d0dfbce63a89 771 __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE(); \
elmot 1:d0dfbce63a89 772 } while(0)
elmot 1:d0dfbce63a89 773
elmot 1:d0dfbce63a89 774 /**
elmot 1:d0dfbce63a89 775 * @brief Disable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 776 * This parameter can be:
elmot 1:d0dfbce63a89 777 * @retval None
elmot 1:d0dfbce63a89 778 */
elmot 1:d0dfbce63a89 779 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
elmot 1:d0dfbce63a89 780 __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE(); \
elmot 1:d0dfbce63a89 781 __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE(); \
elmot 1:d0dfbce63a89 782 } while(0)
elmot 1:d0dfbce63a89 783
elmot 1:d0dfbce63a89 784 /**
elmot 1:d0dfbce63a89 785 * @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not.
elmot 1:d0dfbce63a89 786 * @retval Line Status.
elmot 1:d0dfbce63a89 787 */
elmot 1:d0dfbce63a89 788 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
elmot 1:d0dfbce63a89 789
elmot 1:d0dfbce63a89 790 /**
elmot 1:d0dfbce63a89 791 * @brief Clear the RTC WakeUp Timer associated Exti line flag.
elmot 1:d0dfbce63a89 792 * @retval None
elmot 1:d0dfbce63a89 793 */
elmot 1:d0dfbce63a89 794 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
elmot 1:d0dfbce63a89 795
elmot 1:d0dfbce63a89 796 /**
elmot 1:d0dfbce63a89 797 * @brief Generate a Software interrupt on the RTC WakeUp Timer associated Exti line.
elmot 1:d0dfbce63a89 798 * @retval None
elmot 1:d0dfbce63a89 799 */
elmot 1:d0dfbce63a89 800 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
elmot 1:d0dfbce63a89 801
elmot 1:d0dfbce63a89 802 /**
elmot 1:d0dfbce63a89 803 * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 804 * @retval None
elmot 1:d0dfbce63a89 805 */
elmot 1:d0dfbce63a89 806 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
elmot 1:d0dfbce63a89 807
elmot 1:d0dfbce63a89 808 /**
elmot 1:d0dfbce63a89 809 * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 810 * @retval None
elmot 1:d0dfbce63a89 811 */
elmot 1:d0dfbce63a89 812 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
elmot 1:d0dfbce63a89 813
elmot 1:d0dfbce63a89 814 /**
elmot 1:d0dfbce63a89 815 * @brief Enable event on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 816 * @retval None
elmot 1:d0dfbce63a89 817 */
elmot 1:d0dfbce63a89 818 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
elmot 1:d0dfbce63a89 819
elmot 1:d0dfbce63a89 820 /**
elmot 1:d0dfbce63a89 821 * @brief Disable event on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 822 * @retval None
elmot 1:d0dfbce63a89 823 */
elmot 1:d0dfbce63a89 824 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
elmot 1:d0dfbce63a89 825
elmot 1:d0dfbce63a89 826 /**
elmot 1:d0dfbce63a89 827 * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 828 * @retval None
elmot 1:d0dfbce63a89 829 */
elmot 1:d0dfbce63a89 830 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
elmot 1:d0dfbce63a89 831
elmot 1:d0dfbce63a89 832 /**
elmot 1:d0dfbce63a89 833 * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 834 * @retval None
elmot 1:d0dfbce63a89 835 */
elmot 1:d0dfbce63a89 836 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
elmot 1:d0dfbce63a89 837
elmot 1:d0dfbce63a89 838 /**
elmot 1:d0dfbce63a89 839 * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 840 * @retval None
elmot 1:d0dfbce63a89 841 */
elmot 1:d0dfbce63a89 842 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
elmot 1:d0dfbce63a89 843
elmot 1:d0dfbce63a89 844 /**
elmot 1:d0dfbce63a89 845 * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 846 * @retval None
elmot 1:d0dfbce63a89 847 */
elmot 1:d0dfbce63a89 848 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
elmot 1:d0dfbce63a89 849
elmot 1:d0dfbce63a89 850 /**
elmot 1:d0dfbce63a89 851 * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 852 * @retval None
elmot 1:d0dfbce63a89 853 */
elmot 1:d0dfbce63a89 854 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
elmot 1:d0dfbce63a89 855 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE(); \
elmot 1:d0dfbce63a89 856 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); \
elmot 1:d0dfbce63a89 857 } while(0)
elmot 1:d0dfbce63a89 858
elmot 1:d0dfbce63a89 859 /**
elmot 1:d0dfbce63a89 860 * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
elmot 1:d0dfbce63a89 861 * This parameter can be:
elmot 1:d0dfbce63a89 862 * @retval None
elmot 1:d0dfbce63a89 863 */
elmot 1:d0dfbce63a89 864 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
elmot 1:d0dfbce63a89 865 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE(); \
elmot 1:d0dfbce63a89 866 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE(); \
elmot 1:d0dfbce63a89 867 } while(0)
elmot 1:d0dfbce63a89 868
elmot 1:d0dfbce63a89 869 /**
elmot 1:d0dfbce63a89 870 * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not.
elmot 1:d0dfbce63a89 871 * @retval Line Status.
elmot 1:d0dfbce63a89 872 */
elmot 1:d0dfbce63a89 873 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
elmot 1:d0dfbce63a89 874
elmot 1:d0dfbce63a89 875 /**
elmot 1:d0dfbce63a89 876 * @brief Clear the RTC Tamper and Timestamp associated Exti line flag.
elmot 1:d0dfbce63a89 877 * @retval None
elmot 1:d0dfbce63a89 878 */
elmot 1:d0dfbce63a89 879 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
elmot 1:d0dfbce63a89 880
elmot 1:d0dfbce63a89 881 /**
elmot 1:d0dfbce63a89 882 * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line
elmot 1:d0dfbce63a89 883 * @retval None
elmot 1:d0dfbce63a89 884 */
elmot 1:d0dfbce63a89 885 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
elmot 1:d0dfbce63a89 886
elmot 1:d0dfbce63a89 887 /**
elmot 1:d0dfbce63a89 888 * @}
elmot 1:d0dfbce63a89 889 */
elmot 1:d0dfbce63a89 890
elmot 1:d0dfbce63a89 891 /* Exported functions --------------------------------------------------------*/
elmot 1:d0dfbce63a89 892 /** @addtogroup RTCEx_Exported_Functions
elmot 1:d0dfbce63a89 893 * @{
elmot 1:d0dfbce63a89 894 */
elmot 1:d0dfbce63a89 895
elmot 1:d0dfbce63a89 896 /* RTC TimeStamp and Tamper functions *****************************************/
elmot 1:d0dfbce63a89 897 /** @addtogroup RTCEx_Exported_Functions_Group1
elmot 1:d0dfbce63a89 898 * @{
elmot 1:d0dfbce63a89 899 */
elmot 1:d0dfbce63a89 900 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
elmot 1:d0dfbce63a89 901 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
elmot 1:d0dfbce63a89 902 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 903 HAL_StatusTypeDef HAL_RTCEx_SetInternalTimeStamp(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 904 HAL_StatusTypeDef HAL_RTCEx_DeactivateInternalTimeStamp(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 905 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
elmot 1:d0dfbce63a89 906
elmot 1:d0dfbce63a89 907 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
elmot 1:d0dfbce63a89 908 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
elmot 1:d0dfbce63a89 909 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
elmot 1:d0dfbce63a89 910 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 911
elmot 1:d0dfbce63a89 912 #if defined(RTC_TAMPER1_SUPPORT)
elmot 1:d0dfbce63a89 913 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 914 #endif /* RTC_TAMPER1_SUPPORT */
elmot 1:d0dfbce63a89 915 void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 916 #if defined(RTC_TAMPER3_SUPPORT)
elmot 1:d0dfbce63a89 917 void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 918 #endif /* RTC_TAMPER3_SUPPORT */
elmot 1:d0dfbce63a89 919 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 920 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
elmot 1:d0dfbce63a89 921 #if defined(RTC_TAMPER1_SUPPORT)
elmot 1:d0dfbce63a89 922 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
elmot 1:d0dfbce63a89 923 #endif /* RTC_TAMPER1_SUPPORT */
elmot 1:d0dfbce63a89 924 HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
elmot 1:d0dfbce63a89 925 #if defined(RTC_TAMPER3_SUPPORT)
elmot 1:d0dfbce63a89 926 HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
elmot 1:d0dfbce63a89 927 #endif /* RTC_TAMPER3_SUPPORT */
elmot 1:d0dfbce63a89 928 /**
elmot 1:d0dfbce63a89 929 * @}
elmot 1:d0dfbce63a89 930 */
elmot 1:d0dfbce63a89 931
elmot 1:d0dfbce63a89 932 /* RTC Wake-up functions ******************************************************/
elmot 1:d0dfbce63a89 933 /** @addtogroup RTCEx_Exported_Functions_Group2
elmot 1:d0dfbce63a89 934 * @{
elmot 1:d0dfbce63a89 935 */
elmot 1:d0dfbce63a89 936 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
elmot 1:d0dfbce63a89 937 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
elmot 1:d0dfbce63a89 938 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 939 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 940 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 941 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 942 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
elmot 1:d0dfbce63a89 943 /**
elmot 1:d0dfbce63a89 944 * @}
elmot 1:d0dfbce63a89 945 */
elmot 1:d0dfbce63a89 946
elmot 1:d0dfbce63a89 947 /* Extended Control functions ************************************************/
elmot 1:d0dfbce63a89 948 /** @addtogroup RTCEx_Exported_Functions_Group3
elmot 1:d0dfbce63a89 949 * @{
elmot 1:d0dfbce63a89 950 */
elmot 1:d0dfbce63a89 951 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
elmot 1:d0dfbce63a89 952 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
elmot 1:d0dfbce63a89 953
elmot 1:d0dfbce63a89 954 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue);
elmot 1:d0dfbce63a89 955 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
elmot 1:d0dfbce63a89 956 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
elmot 1:d0dfbce63a89 957 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 958 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 959 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 960 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 961 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 962 /**
elmot 1:d0dfbce63a89 963 * @}
elmot 1:d0dfbce63a89 964 */
elmot 1:d0dfbce63a89 965
elmot 1:d0dfbce63a89 966 /* Extended RTC features functions *******************************************/
elmot 1:d0dfbce63a89 967 /** @addtogroup RTCEx_Exported_Functions_Group4
elmot 1:d0dfbce63a89 968 * @{
elmot 1:d0dfbce63a89 969 */
elmot 1:d0dfbce63a89 970 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
elmot 1:d0dfbce63a89 971 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
elmot 1:d0dfbce63a89 972 /**
elmot 1:d0dfbce63a89 973 * @}
elmot 1:d0dfbce63a89 974 */
elmot 1:d0dfbce63a89 975
elmot 1:d0dfbce63a89 976 /**
elmot 1:d0dfbce63a89 977 * @}
elmot 1:d0dfbce63a89 978 */
elmot 1:d0dfbce63a89 979
elmot 1:d0dfbce63a89 980 /* Private types -------------------------------------------------------------*/
elmot 1:d0dfbce63a89 981 /* Private variables ---------------------------------------------------------*/
elmot 1:d0dfbce63a89 982 /* Private constants ---------------------------------------------------------*/
elmot 1:d0dfbce63a89 983 /** @defgroup RTCEx_Private_Constants RTCEx Private Constants
elmot 1:d0dfbce63a89 984 * @{
elmot 1:d0dfbce63a89 985 */
elmot 1:d0dfbce63a89 986 #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)0x00080000) /*!< External interrupt line 19 Connected to the RTC Tamper and Time Stamp events */
elmot 1:d0dfbce63a89 987 #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the RTC Wakeup event */
elmot 1:d0dfbce63a89 988
elmot 1:d0dfbce63a89 989 /**
elmot 1:d0dfbce63a89 990 * @}
elmot 1:d0dfbce63a89 991 */
elmot 1:d0dfbce63a89 992
elmot 1:d0dfbce63a89 993 /* Private macros ------------------------------------------------------------*/
elmot 1:d0dfbce63a89 994 /** @defgroup RTCEx_Private_Macros RTCEx Private Macros
elmot 1:d0dfbce63a89 995 * @{
elmot 1:d0dfbce63a89 996 */
elmot 1:d0dfbce63a89 997
elmot 1:d0dfbce63a89 998 /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters
elmot 1:d0dfbce63a89 999 * @{
elmot 1:d0dfbce63a89 1000 */
elmot 1:d0dfbce63a89 1001
elmot 1:d0dfbce63a89 1002 #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \
elmot 1:d0dfbce63a89 1003 ((OUTPUT) == RTC_OUTPUT_ALARMA) || \
elmot 1:d0dfbce63a89 1004 ((OUTPUT) == RTC_OUTPUT_ALARMB) || \
elmot 1:d0dfbce63a89 1005 ((OUTPUT) == RTC_OUTPUT_WAKEUP))
elmot 1:d0dfbce63a89 1006
elmot 1:d0dfbce63a89 1007 #define IS_RTC_BKP(BKP) ((BKP) < (uint32_t) RTC_BKP_NUMBER)
elmot 1:d0dfbce63a89 1008
elmot 1:d0dfbce63a89 1009 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
elmot 1:d0dfbce63a89 1010 ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
elmot 1:d0dfbce63a89 1011
elmot 1:d0dfbce63a89 1012 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFD6) == 0x00) && ((TAMPER) != (uint32_t)RESET))
elmot 1:d0dfbce63a89 1013
elmot 1:d0dfbce63a89 1014 #define IS_RTC_TAMPER_INTERRUPT(INTERRUPT) ((((INTERRUPT) & (uint32_t)0xFFB6FFFB) == 0x00) && ((INTERRUPT) != (uint32_t)RESET))
elmot 1:d0dfbce63a89 1015
elmot 1:d0dfbce63a89 1016 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT))
elmot 1:d0dfbce63a89 1017
elmot 1:d0dfbce63a89 1018 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
elmot 1:d0dfbce63a89 1019 ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
elmot 1:d0dfbce63a89 1020 ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
elmot 1:d0dfbce63a89 1021 ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))
elmot 1:d0dfbce63a89 1022
elmot 1:d0dfbce63a89 1023 #define IS_RTC_TAMPER_ERASE_MODE(MODE) (((MODE) == RTC_TAMPER_ERASE_BACKUP_ENABLE) || \
elmot 1:d0dfbce63a89 1024 ((MODE) == RTC_TAMPER_ERASE_BACKUP_DISABLE))
elmot 1:d0dfbce63a89 1025
elmot 1:d0dfbce63a89 1026 #define IS_RTC_TAMPER_MASKFLAG_STATE(STATE) (((STATE) == RTC_TAMPERMASK_FLAG_ENABLE) || \
elmot 1:d0dfbce63a89 1027 ((STATE) == RTC_TAMPERMASK_FLAG_DISABLE))
elmot 1:d0dfbce63a89 1028
elmot 1:d0dfbce63a89 1029 #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \
elmot 1:d0dfbce63a89 1030 ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \
elmot 1:d0dfbce63a89 1031 ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \
elmot 1:d0dfbce63a89 1032 ((FILTER) == RTC_TAMPERFILTER_8SAMPLE))
elmot 1:d0dfbce63a89 1033
elmot 1:d0dfbce63a89 1034 #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
elmot 1:d0dfbce63a89 1035 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
elmot 1:d0dfbce63a89 1036 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
elmot 1:d0dfbce63a89 1037 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
elmot 1:d0dfbce63a89 1038 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
elmot 1:d0dfbce63a89 1039 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
elmot 1:d0dfbce63a89 1040 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
elmot 1:d0dfbce63a89 1041 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
elmot 1:d0dfbce63a89 1042
elmot 1:d0dfbce63a89 1043 #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
elmot 1:d0dfbce63a89 1044 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
elmot 1:d0dfbce63a89 1045 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
elmot 1:d0dfbce63a89 1046 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
elmot 1:d0dfbce63a89 1047
elmot 1:d0dfbce63a89 1048 #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
elmot 1:d0dfbce63a89 1049 ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
elmot 1:d0dfbce63a89 1050
elmot 1:d0dfbce63a89 1051 #define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \
elmot 1:d0dfbce63a89 1052 ((STATE) == RTC_TAMPER_PULLUP_DISABLE))
elmot 1:d0dfbce63a89 1053
elmot 1:d0dfbce63a89 1054 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
elmot 1:d0dfbce63a89 1055 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
elmot 1:d0dfbce63a89 1056 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
elmot 1:d0dfbce63a89 1057 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
elmot 1:d0dfbce63a89 1058 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
elmot 1:d0dfbce63a89 1059 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
elmot 1:d0dfbce63a89 1060
elmot 1:d0dfbce63a89 1061 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
elmot 1:d0dfbce63a89 1062
elmot 1:d0dfbce63a89 1063 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
elmot 1:d0dfbce63a89 1064 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
elmot 1:d0dfbce63a89 1065 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC))
elmot 1:d0dfbce63a89 1066
elmot 1:d0dfbce63a89 1067 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
elmot 1:d0dfbce63a89 1068 ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
elmot 1:d0dfbce63a89 1069
elmot 1:d0dfbce63a89 1070 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF)
elmot 1:d0dfbce63a89 1071
elmot 1:d0dfbce63a89 1072 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \
elmot 1:d0dfbce63a89 1073 ((SEL) == RTC_SHIFTADD1S_SET))
elmot 1:d0dfbce63a89 1074
elmot 1:d0dfbce63a89 1075 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF)
elmot 1:d0dfbce63a89 1076
elmot 1:d0dfbce63a89 1077 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \
elmot 1:d0dfbce63a89 1078 ((OUTPUT) == RTC_CALIBOUTPUT_1HZ))
elmot 1:d0dfbce63a89 1079
elmot 1:d0dfbce63a89 1080 /**
elmot 1:d0dfbce63a89 1081 * @}
elmot 1:d0dfbce63a89 1082 */
elmot 1:d0dfbce63a89 1083
elmot 1:d0dfbce63a89 1084 /**
elmot 1:d0dfbce63a89 1085 * @}
elmot 1:d0dfbce63a89 1086 */
elmot 1:d0dfbce63a89 1087
elmot 1:d0dfbce63a89 1088 /**
elmot 1:d0dfbce63a89 1089 * @}
elmot 1:d0dfbce63a89 1090 */
elmot 1:d0dfbce63a89 1091
elmot 1:d0dfbce63a89 1092 /**
elmot 1:d0dfbce63a89 1093 * @}
elmot 1:d0dfbce63a89 1094 */
elmot 1:d0dfbce63a89 1095
elmot 1:d0dfbce63a89 1096 #ifdef __cplusplus
elmot 1:d0dfbce63a89 1097 }
elmot 1:d0dfbce63a89 1098 #endif
elmot 1:d0dfbce63a89 1099
elmot 1:d0dfbce63a89 1100 #endif /* __STM32L4xx_HAL_RTC_EX_H */
elmot 1:d0dfbce63a89 1101
elmot 1:d0dfbce63a89 1102 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/