SPKT

Dependencies:   F746_GUI SD_PlayerSkeleton F746_SAI_IO

Committer:
phungductung
Date:
Tue Jun 04 21:37:21 2019 +0000
Revision:
0:8ede47d38d10
SPKT

Who changed what in which revision?

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