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