mbed library sources

Dependents:   Marvino mbot

Fork of mbed-src by mbed official

Committer:
jaerts
Date:
Tue Dec 22 13:22:16 2015 +0000
Revision:
637:ed69428d4850
Parent:
610:813dcc80987e
Add very shady LPC1768 CAN Filter implementation

Who changed what in which revision?

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