Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sat Jun 03 00:22:44 2017 +0000
Revision:
46:b156ef445742
Parent:
18:6a4db94011d3
Final code for internal battlebot competition.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /**
sahilmgandhi 18:6a4db94011d3 2 ******************************************************************************
sahilmgandhi 18:6a4db94011d3 3 * @file stm32f2xx_hal_rtc_ex.h
sahilmgandhi 18:6a4db94011d3 4 * @author MCD Application Team
sahilmgandhi 18:6a4db94011d3 5 * @version V1.1.3
sahilmgandhi 18:6a4db94011d3 6 * @date 29-June-2016
sahilmgandhi 18:6a4db94011d3 7 * @brief Header file of RTC HAL Extension module.
sahilmgandhi 18:6a4db94011d3 8 ******************************************************************************
sahilmgandhi 18:6a4db94011d3 9 * @attention
sahilmgandhi 18:6a4db94011d3 10 *
sahilmgandhi 18:6a4db94011d3 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
sahilmgandhi 18:6a4db94011d3 12 *
sahilmgandhi 18:6a4db94011d3 13 * Redistribution and use in source and binary forms, with or without modification,
sahilmgandhi 18:6a4db94011d3 14 * are permitted provided that the following conditions are met:
sahilmgandhi 18:6a4db94011d3 15 * 1. Redistributions of source code must retain the above copyright notice,
sahilmgandhi 18:6a4db94011d3 16 * this list of conditions and the following disclaimer.
sahilmgandhi 18:6a4db94011d3 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
sahilmgandhi 18:6a4db94011d3 18 * this list of conditions and the following disclaimer in the documentation
sahilmgandhi 18:6a4db94011d3 19 * and/or other materials provided with the distribution.
sahilmgandhi 18:6a4db94011d3 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
sahilmgandhi 18:6a4db94011d3 21 * may be used to endorse or promote products derived from this software
sahilmgandhi 18:6a4db94011d3 22 * without specific prior written permission.
sahilmgandhi 18:6a4db94011d3 23 *
sahilmgandhi 18:6a4db94011d3 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
sahilmgandhi 18:6a4db94011d3 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sahilmgandhi 18:6a4db94011d3 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
sahilmgandhi 18:6a4db94011d3 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
sahilmgandhi 18:6a4db94011d3 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sahilmgandhi 18:6a4db94011d3 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
sahilmgandhi 18:6a4db94011d3 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
sahilmgandhi 18:6a4db94011d3 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
sahilmgandhi 18:6a4db94011d3 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
sahilmgandhi 18:6a4db94011d3 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sahilmgandhi 18:6a4db94011d3 34 *
sahilmgandhi 18:6a4db94011d3 35 ******************************************************************************
sahilmgandhi 18:6a4db94011d3 36 */
sahilmgandhi 18:6a4db94011d3 37
sahilmgandhi 18:6a4db94011d3 38 /* Define to prevent recursive inclusion -------------------------------------*/
sahilmgandhi 18:6a4db94011d3 39 #ifndef __STM32F2xx_HAL_RTC_EX_H
sahilmgandhi 18:6a4db94011d3 40 #define __STM32F2xx_HAL_RTC_EX_H
sahilmgandhi 18:6a4db94011d3 41
sahilmgandhi 18:6a4db94011d3 42 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 43 extern "C" {
sahilmgandhi 18:6a4db94011d3 44 #endif
sahilmgandhi 18:6a4db94011d3 45
sahilmgandhi 18:6a4db94011d3 46 /* Includes ------------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 47 #include "stm32f2xx_hal_def.h"
sahilmgandhi 18:6a4db94011d3 48
sahilmgandhi 18:6a4db94011d3 49 /** @addtogroup STM32F2xx_HAL_Driver
sahilmgandhi 18:6a4db94011d3 50 * @{
sahilmgandhi 18:6a4db94011d3 51 */
sahilmgandhi 18:6a4db94011d3 52
sahilmgandhi 18:6a4db94011d3 53 /** @addtogroup RTCEx
sahilmgandhi 18:6a4db94011d3 54 * @{
sahilmgandhi 18:6a4db94011d3 55 */
sahilmgandhi 18:6a4db94011d3 56
sahilmgandhi 18:6a4db94011d3 57 /* Exported types ------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 58 /** @defgroup RTCEx_Exported_Types RTC Exported Types
sahilmgandhi 18:6a4db94011d3 59 * @{
sahilmgandhi 18:6a4db94011d3 60 */
sahilmgandhi 18:6a4db94011d3 61
sahilmgandhi 18:6a4db94011d3 62 /** @brief RTC Tamper structure definition
sahilmgandhi 18:6a4db94011d3 63 */
sahilmgandhi 18:6a4db94011d3 64 typedef struct
sahilmgandhi 18:6a4db94011d3 65 {
sahilmgandhi 18:6a4db94011d3 66 uint32_t Tamper; /*!< Specifies the Tamper Pin.
sahilmgandhi 18:6a4db94011d3 67 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
sahilmgandhi 18:6a4db94011d3 68
sahilmgandhi 18:6a4db94011d3 69 uint32_t PinSelection; /*!< Specifies the Tamper Pin.
sahilmgandhi 18:6a4db94011d3 70 This parameter can be a value of @ref RTCEx_Tamper_Pins_Selection */
sahilmgandhi 18:6a4db94011d3 71
sahilmgandhi 18:6a4db94011d3 72 uint32_t Trigger; /*!< Specifies the Tamper Trigger.
sahilmgandhi 18:6a4db94011d3 73 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
sahilmgandhi 18:6a4db94011d3 74 }RTC_TamperTypeDef;
sahilmgandhi 18:6a4db94011d3 75 /**
sahilmgandhi 18:6a4db94011d3 76 * @}
sahilmgandhi 18:6a4db94011d3 77 */
sahilmgandhi 18:6a4db94011d3 78
sahilmgandhi 18:6a4db94011d3 79 /* Exported constants --------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 80 /** @defgroup RTCEx_Exported_Constants RTC Exported Constants
sahilmgandhi 18:6a4db94011d3 81 * @{
sahilmgandhi 18:6a4db94011d3 82 */
sahilmgandhi 18:6a4db94011d3 83
sahilmgandhi 18:6a4db94011d3 84 /** @defgroup RTCEx_Backup_Registers_Definitions RTC Backup Registers Definitions
sahilmgandhi 18:6a4db94011d3 85 * @{
sahilmgandhi 18:6a4db94011d3 86 */
sahilmgandhi 18:6a4db94011d3 87 #define RTC_BKP_DR0 ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 88 #define RTC_BKP_DR1 ((uint32_t)0x00000001U)
sahilmgandhi 18:6a4db94011d3 89 #define RTC_BKP_DR2 ((uint32_t)0x00000002U)
sahilmgandhi 18:6a4db94011d3 90 #define RTC_BKP_DR3 ((uint32_t)0x00000003U)
sahilmgandhi 18:6a4db94011d3 91 #define RTC_BKP_DR4 ((uint32_t)0x00000004U)
sahilmgandhi 18:6a4db94011d3 92 #define RTC_BKP_DR5 ((uint32_t)0x00000005U)
sahilmgandhi 18:6a4db94011d3 93 #define RTC_BKP_DR6 ((uint32_t)0x00000006U)
sahilmgandhi 18:6a4db94011d3 94 #define RTC_BKP_DR7 ((uint32_t)0x00000007U)
sahilmgandhi 18:6a4db94011d3 95 #define RTC_BKP_DR8 ((uint32_t)0x00000008U)
sahilmgandhi 18:6a4db94011d3 96 #define RTC_BKP_DR9 ((uint32_t)0x00000009U)
sahilmgandhi 18:6a4db94011d3 97 #define RTC_BKP_DR10 ((uint32_t)0x0000000AU)
sahilmgandhi 18:6a4db94011d3 98 #define RTC_BKP_DR11 ((uint32_t)0x0000000BU)
sahilmgandhi 18:6a4db94011d3 99 #define RTC_BKP_DR12 ((uint32_t)0x0000000CU)
sahilmgandhi 18:6a4db94011d3 100 #define RTC_BKP_DR13 ((uint32_t)0x0000000DU)
sahilmgandhi 18:6a4db94011d3 101 #define RTC_BKP_DR14 ((uint32_t)0x0000000EU)
sahilmgandhi 18:6a4db94011d3 102 #define RTC_BKP_DR15 ((uint32_t)0x0000000FU)
sahilmgandhi 18:6a4db94011d3 103 #define RTC_BKP_DR16 ((uint32_t)0x00000010U)
sahilmgandhi 18:6a4db94011d3 104 #define RTC_BKP_DR17 ((uint32_t)0x00000011U)
sahilmgandhi 18:6a4db94011d3 105 #define RTC_BKP_DR18 ((uint32_t)0x00000012U)
sahilmgandhi 18:6a4db94011d3 106 #define RTC_BKP_DR19 ((uint32_t)0x00000013U)
sahilmgandhi 18:6a4db94011d3 107 /**
sahilmgandhi 18:6a4db94011d3 108 * @}
sahilmgandhi 18:6a4db94011d3 109 */
sahilmgandhi 18:6a4db94011d3 110
sahilmgandhi 18:6a4db94011d3 111 /** @defgroup RTCEx_Time_Stamp_Edges_definitions RTC TimeStamp Edges Definitions
sahilmgandhi 18:6a4db94011d3 112 * @{
sahilmgandhi 18:6a4db94011d3 113 */
sahilmgandhi 18:6a4db94011d3 114 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 115 #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008U)
sahilmgandhi 18:6a4db94011d3 116 /**
sahilmgandhi 18:6a4db94011d3 117 * @}
sahilmgandhi 18:6a4db94011d3 118 */
sahilmgandhi 18:6a4db94011d3 119
sahilmgandhi 18:6a4db94011d3 120 /** @defgroup RTCEx_Tamper_Pins_Definitions RTC Tamper Pins Definitions
sahilmgandhi 18:6a4db94011d3 121 * @{
sahilmgandhi 18:6a4db94011d3 122 */
sahilmgandhi 18:6a4db94011d3 123 #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E
sahilmgandhi 18:6a4db94011d3 124 /**
sahilmgandhi 18:6a4db94011d3 125 * @}
sahilmgandhi 18:6a4db94011d3 126 */
sahilmgandhi 18:6a4db94011d3 127
sahilmgandhi 18:6a4db94011d3 128 /** @defgroup RTCEx_Tamper_Pins_Selection RTC tamper Pins Selection
sahilmgandhi 18:6a4db94011d3 129 * @{
sahilmgandhi 18:6a4db94011d3 130 */
sahilmgandhi 18:6a4db94011d3 131 #define RTC_TAMPERPIN_DEFAULT ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 132 #define RTC_TAMPERPIN_POS1 ((uint32_t)0x00010000U)
sahilmgandhi 18:6a4db94011d3 133
sahilmgandhi 18:6a4db94011d3 134 /**
sahilmgandhi 18:6a4db94011d3 135 * @}
sahilmgandhi 18:6a4db94011d3 136 */
sahilmgandhi 18:6a4db94011d3 137
sahilmgandhi 18:6a4db94011d3 138 /** @defgroup RTCEx_TimeStamp_Pin_Selection RTC TimeStamp Pins Selection
sahilmgandhi 18:6a4db94011d3 139 * @{
sahilmgandhi 18:6a4db94011d3 140 */
sahilmgandhi 18:6a4db94011d3 141 #define RTC_TIMESTAMPPIN_DEFAULT ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 142 #define RTC_TIMESTAMPPIN_POS1 ((uint32_t)0x00020000U)
sahilmgandhi 18:6a4db94011d3 143
sahilmgandhi 18:6a4db94011d3 144 /**
sahilmgandhi 18:6a4db94011d3 145 * @}
sahilmgandhi 18:6a4db94011d3 146 */
sahilmgandhi 18:6a4db94011d3 147
sahilmgandhi 18:6a4db94011d3 148 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTC Tamper Triggers Definitions
sahilmgandhi 18:6a4db94011d3 149 * @{
sahilmgandhi 18:6a4db94011d3 150 */
sahilmgandhi 18:6a4db94011d3 151 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 152 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002U)
sahilmgandhi 18:6a4db94011d3 153
sahilmgandhi 18:6a4db94011d3 154 /**
sahilmgandhi 18:6a4db94011d3 155 * @}
sahilmgandhi 18:6a4db94011d3 156 */
sahilmgandhi 18:6a4db94011d3 157
sahilmgandhi 18:6a4db94011d3 158 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTC Wake-up Timer Definitions
sahilmgandhi 18:6a4db94011d3 159 * @{
sahilmgandhi 18:6a4db94011d3 160 */
sahilmgandhi 18:6a4db94011d3 161 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 162 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001U)
sahilmgandhi 18:6a4db94011d3 163 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002U)
sahilmgandhi 18:6a4db94011d3 164 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003U)
sahilmgandhi 18:6a4db94011d3 165 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004U)
sahilmgandhi 18:6a4db94011d3 166 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006U)
sahilmgandhi 18:6a4db94011d3 167 /**
sahilmgandhi 18:6a4db94011d3 168 * @}
sahilmgandhi 18:6a4db94011d3 169 */
sahilmgandhi 18:6a4db94011d3 170
sahilmgandhi 18:6a4db94011d3 171 /** @defgroup RTCEx_Digital_Calibration_Definitions RTC Digital Calib Definitions
sahilmgandhi 18:6a4db94011d3 172 * @{
sahilmgandhi 18:6a4db94011d3 173 */
sahilmgandhi 18:6a4db94011d3 174 #define RTC_CALIBSIGN_POSITIVE ((uint32_t)0x00000000U)
sahilmgandhi 18:6a4db94011d3 175 #define RTC_CALIBSIGN_NEGATIVE ((uint32_t)0x00000080U)
sahilmgandhi 18:6a4db94011d3 176 /**
sahilmgandhi 18:6a4db94011d3 177 * @}
sahilmgandhi 18:6a4db94011d3 178 */
sahilmgandhi 18:6a4db94011d3 179
sahilmgandhi 18:6a4db94011d3 180 /**
sahilmgandhi 18:6a4db94011d3 181 * @}
sahilmgandhi 18:6a4db94011d3 182 */
sahilmgandhi 18:6a4db94011d3 183
sahilmgandhi 18:6a4db94011d3 184 /* Exported macro ------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 185 /** @defgroup RTCEx_Exported_Macros RTC Exported Macros
sahilmgandhi 18:6a4db94011d3 186 * @{
sahilmgandhi 18:6a4db94011d3 187 */
sahilmgandhi 18:6a4db94011d3 188
sahilmgandhi 18:6a4db94011d3 189 /* ---------------------------------WAKEUPTIMER---------------------------------*/
sahilmgandhi 18:6a4db94011d3 190 /** @defgroup RTCEx_WakeUp_Timer RTC WakeUp Timer
sahilmgandhi 18:6a4db94011d3 191 * @{
sahilmgandhi 18:6a4db94011d3 192 */
sahilmgandhi 18:6a4db94011d3 193
sahilmgandhi 18:6a4db94011d3 194 /**
sahilmgandhi 18:6a4db94011d3 195 * @brief Enable the RTC WakeUp Timer peripheral.
sahilmgandhi 18:6a4db94011d3 196 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 197 * @retval None
sahilmgandhi 18:6a4db94011d3 198 */
sahilmgandhi 18:6a4db94011d3 199 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
sahilmgandhi 18:6a4db94011d3 200
sahilmgandhi 18:6a4db94011d3 201 /**
sahilmgandhi 18:6a4db94011d3 202 * @brief Disable the RTC Wake-up Timer peripheral.
sahilmgandhi 18:6a4db94011d3 203 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 204 * @retval None
sahilmgandhi 18:6a4db94011d3 205 */
sahilmgandhi 18:6a4db94011d3 206 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
sahilmgandhi 18:6a4db94011d3 207
sahilmgandhi 18:6a4db94011d3 208 /**
sahilmgandhi 18:6a4db94011d3 209 * @brief Enable the RTC WakeUpTimer interrupt.
sahilmgandhi 18:6a4db94011d3 210 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 211 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
sahilmgandhi 18:6a4db94011d3 212 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 213 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
sahilmgandhi 18:6a4db94011d3 214 * @retval None
sahilmgandhi 18:6a4db94011d3 215 */
sahilmgandhi 18:6a4db94011d3 216 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
sahilmgandhi 18:6a4db94011d3 217
sahilmgandhi 18:6a4db94011d3 218 /**
sahilmgandhi 18:6a4db94011d3 219 * @brief Disable the RTC WakeUpTimer interrupt.
sahilmgandhi 18:6a4db94011d3 220 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 221 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
sahilmgandhi 18:6a4db94011d3 222 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 223 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
sahilmgandhi 18:6a4db94011d3 224 * @retval None
sahilmgandhi 18:6a4db94011d3 225 */
sahilmgandhi 18:6a4db94011d3 226 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
sahilmgandhi 18:6a4db94011d3 227
sahilmgandhi 18:6a4db94011d3 228 /**
sahilmgandhi 18:6a4db94011d3 229 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
sahilmgandhi 18:6a4db94011d3 230 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 231 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt to check.
sahilmgandhi 18:6a4db94011d3 232 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 233 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
sahilmgandhi 18:6a4db94011d3 234 * @retval None
sahilmgandhi 18:6a4db94011d3 235 */
sahilmgandhi 18:6a4db94011d3 236 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET)
sahilmgandhi 18:6a4db94011d3 237
sahilmgandhi 18:6a4db94011d3 238 /**
sahilmgandhi 18:6a4db94011d3 239 * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not.
sahilmgandhi 18:6a4db94011d3 240 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 241 * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check.
sahilmgandhi 18:6a4db94011d3 242 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 243 * @arg RTC_IT_WUT: WakeUpTimer interrupt
sahilmgandhi 18:6a4db94011d3 244 * @retval None
sahilmgandhi 18:6a4db94011d3 245 */
sahilmgandhi 18:6a4db94011d3 246 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
sahilmgandhi 18:6a4db94011d3 247
sahilmgandhi 18:6a4db94011d3 248 /**
sahilmgandhi 18:6a4db94011d3 249 * @brief Get the selected RTC WakeUpTimer's flag status.
sahilmgandhi 18:6a4db94011d3 250 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 251 * @param __FLAG__: specifies the RTC WakeUpTimer Flag to check.
sahilmgandhi 18:6a4db94011d3 252 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 253 * @arg RTC_FLAG_WUTF
sahilmgandhi 18:6a4db94011d3 254 * @arg RTC_FLAG_WUTWF
sahilmgandhi 18:6a4db94011d3 255 * @retval None
sahilmgandhi 18:6a4db94011d3 256 */
sahilmgandhi 18:6a4db94011d3 257 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
sahilmgandhi 18:6a4db94011d3 258
sahilmgandhi 18:6a4db94011d3 259 /**
sahilmgandhi 18:6a4db94011d3 260 * @brief Clear the RTC Wake Up timer's pending flags.
sahilmgandhi 18:6a4db94011d3 261 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 262 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
sahilmgandhi 18:6a4db94011d3 263 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 264 * @arg RTC_FLAG_WUTF
sahilmgandhi 18:6a4db94011d3 265 * @retval None
sahilmgandhi 18:6a4db94011d3 266 */
sahilmgandhi 18:6a4db94011d3 267 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
sahilmgandhi 18:6a4db94011d3 268
sahilmgandhi 18:6a4db94011d3 269 /**
sahilmgandhi 18:6a4db94011d3 270 * @brief Enable interrupt on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 271 * @retval None
sahilmgandhi 18:6a4db94011d3 272 */
sahilmgandhi 18:6a4db94011d3 273 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 274
sahilmgandhi 18:6a4db94011d3 275 /**
sahilmgandhi 18:6a4db94011d3 276 * @brief Disable interrupt on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 277 * @retval None
sahilmgandhi 18:6a4db94011d3 278 */
sahilmgandhi 18:6a4db94011d3 279 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
sahilmgandhi 18:6a4db94011d3 280
sahilmgandhi 18:6a4db94011d3 281 /**
sahilmgandhi 18:6a4db94011d3 282 * @brief Enable event on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 283 * @retval None.
sahilmgandhi 18:6a4db94011d3 284 */
sahilmgandhi 18:6a4db94011d3 285 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 286
sahilmgandhi 18:6a4db94011d3 287 /**
sahilmgandhi 18:6a4db94011d3 288 * @brief Disable event on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 289 * @retval None.
sahilmgandhi 18:6a4db94011d3 290 */
sahilmgandhi 18:6a4db94011d3 291 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
sahilmgandhi 18:6a4db94011d3 292
sahilmgandhi 18:6a4db94011d3 293 /**
sahilmgandhi 18:6a4db94011d3 294 * @brief Enable falling edge trigger on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 295 * @retval None.
sahilmgandhi 18:6a4db94011d3 296 */
sahilmgandhi 18:6a4db94011d3 297 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 298
sahilmgandhi 18:6a4db94011d3 299 /**
sahilmgandhi 18:6a4db94011d3 300 * @brief Disable falling edge trigger on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 301 * @retval None.
sahilmgandhi 18:6a4db94011d3 302 */
sahilmgandhi 18:6a4db94011d3 303 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
sahilmgandhi 18:6a4db94011d3 304
sahilmgandhi 18:6a4db94011d3 305 /**
sahilmgandhi 18:6a4db94011d3 306 * @brief Enable rising edge trigger on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 307 * @retval None.
sahilmgandhi 18:6a4db94011d3 308 */
sahilmgandhi 18:6a4db94011d3 309 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 310
sahilmgandhi 18:6a4db94011d3 311 /**
sahilmgandhi 18:6a4db94011d3 312 * @brief Disable rising edge trigger on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 313 * @retval None.
sahilmgandhi 18:6a4db94011d3 314 */
sahilmgandhi 18:6a4db94011d3 315 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
sahilmgandhi 18:6a4db94011d3 316
sahilmgandhi 18:6a4db94011d3 317 /**
sahilmgandhi 18:6a4db94011d3 318 * @brief Enable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 319 * @retval None.
sahilmgandhi 18:6a4db94011d3 320 */
sahilmgandhi 18:6a4db94011d3 321 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do{ __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();\
sahilmgandhi 18:6a4db94011d3 322 __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE();\
sahilmgandhi 18:6a4db94011d3 323 }while(0)
sahilmgandhi 18:6a4db94011d3 324
sahilmgandhi 18:6a4db94011d3 325 /**
sahilmgandhi 18:6a4db94011d3 326 * @brief Disable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 327 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 328 * @retval None.
sahilmgandhi 18:6a4db94011d3 329 */
sahilmgandhi 18:6a4db94011d3 330 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do{ __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();\
sahilmgandhi 18:6a4db94011d3 331 __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE();\
sahilmgandhi 18:6a4db94011d3 332 }while(0)
sahilmgandhi 18:6a4db94011d3 333
sahilmgandhi 18:6a4db94011d3 334 /**
sahilmgandhi 18:6a4db94011d3 335 * @brief Check whether the RTC Wake-up Timer associated Exti line interrupt flag is set or not.
sahilmgandhi 18:6a4db94011d3 336 * @retval Line Status.
sahilmgandhi 18:6a4db94011d3 337 */
sahilmgandhi 18:6a4db94011d3 338 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 339
sahilmgandhi 18:6a4db94011d3 340 /**
sahilmgandhi 18:6a4db94011d3 341 * @brief Clear the RTC Wake-up Timer associated Exti line flag.
sahilmgandhi 18:6a4db94011d3 342 * @retval None.
sahilmgandhi 18:6a4db94011d3 343 */
sahilmgandhi 18:6a4db94011d3 344 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 345
sahilmgandhi 18:6a4db94011d3 346 /**
sahilmgandhi 18:6a4db94011d3 347 * @brief Generate a Software interrupt on the RTC Wake-up Timer associated Exti line.
sahilmgandhi 18:6a4db94011d3 348 * @retval None.
sahilmgandhi 18:6a4db94011d3 349 */
sahilmgandhi 18:6a4db94011d3 350 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
sahilmgandhi 18:6a4db94011d3 351
sahilmgandhi 18:6a4db94011d3 352 /**
sahilmgandhi 18:6a4db94011d3 353 * @}
sahilmgandhi 18:6a4db94011d3 354 */
sahilmgandhi 18:6a4db94011d3 355
sahilmgandhi 18:6a4db94011d3 356 /* ---------------------------------TIMESTAMP---------------------------------*/
sahilmgandhi 18:6a4db94011d3 357 /** @defgroup RTCEx_Timestamp RTC Timestamp
sahilmgandhi 18:6a4db94011d3 358 * @{
sahilmgandhi 18:6a4db94011d3 359 */
sahilmgandhi 18:6a4db94011d3 360
sahilmgandhi 18:6a4db94011d3 361 /**
sahilmgandhi 18:6a4db94011d3 362 * @brief Enable the RTC TimeStamp peripheral.
sahilmgandhi 18:6a4db94011d3 363 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 364 * @retval None
sahilmgandhi 18:6a4db94011d3 365 */
sahilmgandhi 18:6a4db94011d3 366 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
sahilmgandhi 18:6a4db94011d3 367
sahilmgandhi 18:6a4db94011d3 368 /**
sahilmgandhi 18:6a4db94011d3 369 * @brief Disable the RTC TimeStamp peripheral.
sahilmgandhi 18:6a4db94011d3 370 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 371 * @retval None
sahilmgandhi 18:6a4db94011d3 372 */
sahilmgandhi 18:6a4db94011d3 373 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
sahilmgandhi 18:6a4db94011d3 374
sahilmgandhi 18:6a4db94011d3 375 /**
sahilmgandhi 18:6a4db94011d3 376 * @brief Enable the RTC TimeStamp interrupt.
sahilmgandhi 18:6a4db94011d3 377 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 378 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
sahilmgandhi 18:6a4db94011d3 379 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 380 * @arg RTC_IT_TS: TimeStamp interrupt
sahilmgandhi 18:6a4db94011d3 381 * @retval None
sahilmgandhi 18:6a4db94011d3 382 */
sahilmgandhi 18:6a4db94011d3 383 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
sahilmgandhi 18:6a4db94011d3 384
sahilmgandhi 18:6a4db94011d3 385 /**
sahilmgandhi 18:6a4db94011d3 386 * @brief Disable the RTC TimeStamp interrupt.
sahilmgandhi 18:6a4db94011d3 387 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 388 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
sahilmgandhi 18:6a4db94011d3 389 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 390 * @arg RTC_IT_TS: TimeStamp interrupt
sahilmgandhi 18:6a4db94011d3 391 * @retval None
sahilmgandhi 18:6a4db94011d3 392 */
sahilmgandhi 18:6a4db94011d3 393 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
sahilmgandhi 18:6a4db94011d3 394
sahilmgandhi 18:6a4db94011d3 395 /**
sahilmgandhi 18:6a4db94011d3 396 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
sahilmgandhi 18:6a4db94011d3 397 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 398 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt to check.
sahilmgandhi 18:6a4db94011d3 399 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 400 * @arg RTC_IT_TS: TimeStamp interrupt
sahilmgandhi 18:6a4db94011d3 401 * @retval None
sahilmgandhi 18:6a4db94011d3 402 */
sahilmgandhi 18:6a4db94011d3 403 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET)
sahilmgandhi 18:6a4db94011d3 404
sahilmgandhi 18:6a4db94011d3 405 /**
sahilmgandhi 18:6a4db94011d3 406 * @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not.
sahilmgandhi 18:6a4db94011d3 407 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 408 * @param __INTERRUPT__: specifies the RTC Time Stamp interrupt source to check.
sahilmgandhi 18:6a4db94011d3 409 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 410 * @arg RTC_IT_TS: TimeStamp interrupt
sahilmgandhi 18:6a4db94011d3 411 * @retval None
sahilmgandhi 18:6a4db94011d3 412 */
sahilmgandhi 18:6a4db94011d3 413 #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
sahilmgandhi 18:6a4db94011d3 414
sahilmgandhi 18:6a4db94011d3 415 /**
sahilmgandhi 18:6a4db94011d3 416 * @brief Get the selected RTC TimeStamp's flag status.
sahilmgandhi 18:6a4db94011d3 417 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 418 * @param __FLAG__: specifies the RTC TimeStamp flag to check.
sahilmgandhi 18:6a4db94011d3 419 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 420 * @arg RTC_FLAG_TSF
sahilmgandhi 18:6a4db94011d3 421 * @arg RTC_FLAG_TSOVF
sahilmgandhi 18:6a4db94011d3 422 * @retval None
sahilmgandhi 18:6a4db94011d3 423 */
sahilmgandhi 18:6a4db94011d3 424 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
sahilmgandhi 18:6a4db94011d3 425
sahilmgandhi 18:6a4db94011d3 426 /**
sahilmgandhi 18:6a4db94011d3 427 * @brief Clear the RTC Time Stamp's pending flags.
sahilmgandhi 18:6a4db94011d3 428 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 429 * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
sahilmgandhi 18:6a4db94011d3 430 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 431 * @arg RTC_FLAG_TSF
sahilmgandhi 18:6a4db94011d3 432 * @retval None
sahilmgandhi 18:6a4db94011d3 433 */
sahilmgandhi 18:6a4db94011d3 434 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
sahilmgandhi 18:6a4db94011d3 435
sahilmgandhi 18:6a4db94011d3 436 /**
sahilmgandhi 18:6a4db94011d3 437 * @}
sahilmgandhi 18:6a4db94011d3 438 */
sahilmgandhi 18:6a4db94011d3 439
sahilmgandhi 18:6a4db94011d3 440 /* ---------------------------------TAMPER------------------------------------*/
sahilmgandhi 18:6a4db94011d3 441 /** @defgroup RTCEx_Tamper RTC Tamper
sahilmgandhi 18:6a4db94011d3 442 * @{
sahilmgandhi 18:6a4db94011d3 443 */
sahilmgandhi 18:6a4db94011d3 444
sahilmgandhi 18:6a4db94011d3 445 /**
sahilmgandhi 18:6a4db94011d3 446 * @brief Enable the RTC Tamper1 input detection.
sahilmgandhi 18:6a4db94011d3 447 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 448 * @retval None
sahilmgandhi 18:6a4db94011d3 449 */
sahilmgandhi 18:6a4db94011d3 450 #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP1E))
sahilmgandhi 18:6a4db94011d3 451
sahilmgandhi 18:6a4db94011d3 452 /**
sahilmgandhi 18:6a4db94011d3 453 * @brief Disable the RTC Tamper1 input detection.
sahilmgandhi 18:6a4db94011d3 454 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 455 * @retval None
sahilmgandhi 18:6a4db94011d3 456 */
sahilmgandhi 18:6a4db94011d3 457 #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP1E))
sahilmgandhi 18:6a4db94011d3 458
sahilmgandhi 18:6a4db94011d3 459 /**
sahilmgandhi 18:6a4db94011d3 460 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
sahilmgandhi 18:6a4db94011d3 461 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 462 * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check.
sahilmgandhi 18:6a4db94011d3 463 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 464 * @arg RTC_IT_TAMP1
sahilmgandhi 18:6a4db94011d3 465 * @retval None
sahilmgandhi 18:6a4db94011d3 466 */
sahilmgandhi 18:6a4db94011d3 467 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET)
sahilmgandhi 18:6a4db94011d3 468
sahilmgandhi 18:6a4db94011d3 469 /**
sahilmgandhi 18:6a4db94011d3 470 * @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
sahilmgandhi 18:6a4db94011d3 471 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 472 * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check.
sahilmgandhi 18:6a4db94011d3 473 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 474 * @arg RTC_IT_TAMP: Tamper interrupt
sahilmgandhi 18:6a4db94011d3 475 * @retval None
sahilmgandhi 18:6a4db94011d3 476 */
sahilmgandhi 18:6a4db94011d3 477 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAFCR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
sahilmgandhi 18:6a4db94011d3 478
sahilmgandhi 18:6a4db94011d3 479 /**
sahilmgandhi 18:6a4db94011d3 480 * @brief Get the selected RTC Tamper's flag status.
sahilmgandhi 18:6a4db94011d3 481 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 482 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
sahilmgandhi 18:6a4db94011d3 483 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 484 * @arg RTC_FLAG_TAMP1F
sahilmgandhi 18:6a4db94011d3 485 * @retval None
sahilmgandhi 18:6a4db94011d3 486 */
sahilmgandhi 18:6a4db94011d3 487 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
sahilmgandhi 18:6a4db94011d3 488
sahilmgandhi 18:6a4db94011d3 489 /**
sahilmgandhi 18:6a4db94011d3 490 * @brief Clear the RTC Tamper's pending flags.
sahilmgandhi 18:6a4db94011d3 491 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 492 * @param __FLAG__: specifies the RTC Tamper Flag to clear.
sahilmgandhi 18:6a4db94011d3 493 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 494 * @arg RTC_FLAG_TAMP1F
sahilmgandhi 18:6a4db94011d3 495 * @retval None
sahilmgandhi 18:6a4db94011d3 496 */
sahilmgandhi 18:6a4db94011d3 497 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
sahilmgandhi 18:6a4db94011d3 498 /**
sahilmgandhi 18:6a4db94011d3 499 * @}
sahilmgandhi 18:6a4db94011d3 500 */
sahilmgandhi 18:6a4db94011d3 501
sahilmgandhi 18:6a4db94011d3 502 /* --------------------------TAMPER/TIMESTAMP---------------------------------*/
sahilmgandhi 18:6a4db94011d3 503 /** @defgroup RTCEx_Tamper_Timestamp EXTI RTC Tamper Timestamp EXTI
sahilmgandhi 18:6a4db94011d3 504 * @{
sahilmgandhi 18:6a4db94011d3 505 */
sahilmgandhi 18:6a4db94011d3 506
sahilmgandhi 18:6a4db94011d3 507 /**
sahilmgandhi 18:6a4db94011d3 508 * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 509 * @retval None
sahilmgandhi 18:6a4db94011d3 510 */
sahilmgandhi 18:6a4db94011d3 511 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
sahilmgandhi 18:6a4db94011d3 512
sahilmgandhi 18:6a4db94011d3 513 /**
sahilmgandhi 18:6a4db94011d3 514 * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 515 * @retval None
sahilmgandhi 18:6a4db94011d3 516 */
sahilmgandhi 18:6a4db94011d3 517 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
sahilmgandhi 18:6a4db94011d3 518
sahilmgandhi 18:6a4db94011d3 519 /**
sahilmgandhi 18:6a4db94011d3 520 * @brief Enable event on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 521 * @retval None.
sahilmgandhi 18:6a4db94011d3 522 */
sahilmgandhi 18:6a4db94011d3 523 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
sahilmgandhi 18:6a4db94011d3 524
sahilmgandhi 18:6a4db94011d3 525 /**
sahilmgandhi 18:6a4db94011d3 526 * @brief Disable event on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 527 * @retval None.
sahilmgandhi 18:6a4db94011d3 528 */
sahilmgandhi 18:6a4db94011d3 529 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
sahilmgandhi 18:6a4db94011d3 530
sahilmgandhi 18:6a4db94011d3 531 /**
sahilmgandhi 18:6a4db94011d3 532 * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 533 * @retval None.
sahilmgandhi 18:6a4db94011d3 534 */
sahilmgandhi 18:6a4db94011d3 535 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
sahilmgandhi 18:6a4db94011d3 536
sahilmgandhi 18:6a4db94011d3 537 /**
sahilmgandhi 18:6a4db94011d3 538 * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 539 * @retval None.
sahilmgandhi 18:6a4db94011d3 540 */
sahilmgandhi 18:6a4db94011d3 541 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
sahilmgandhi 18:6a4db94011d3 542
sahilmgandhi 18:6a4db94011d3 543 /**
sahilmgandhi 18:6a4db94011d3 544 * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 545 * @retval None.
sahilmgandhi 18:6a4db94011d3 546 */
sahilmgandhi 18:6a4db94011d3 547 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
sahilmgandhi 18:6a4db94011d3 548
sahilmgandhi 18:6a4db94011d3 549 /**
sahilmgandhi 18:6a4db94011d3 550 * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 551 * @retval None.
sahilmgandhi 18:6a4db94011d3 552 */
sahilmgandhi 18:6a4db94011d3 553 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
sahilmgandhi 18:6a4db94011d3 554
sahilmgandhi 18:6a4db94011d3 555 /**
sahilmgandhi 18:6a4db94011d3 556 * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 557 * @retval None.
sahilmgandhi 18:6a4db94011d3 558 */
sahilmgandhi 18:6a4db94011d3 559 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() do{ __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();\
sahilmgandhi 18:6a4db94011d3 560 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE();\
sahilmgandhi 18:6a4db94011d3 561 }while(0)
sahilmgandhi 18:6a4db94011d3 562
sahilmgandhi 18:6a4db94011d3 563 /**
sahilmgandhi 18:6a4db94011d3 564 * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
sahilmgandhi 18:6a4db94011d3 565 * This parameter can be:
sahilmgandhi 18:6a4db94011d3 566 * @retval None.
sahilmgandhi 18:6a4db94011d3 567 */
sahilmgandhi 18:6a4db94011d3 568 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() do{ __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE();\
sahilmgandhi 18:6a4db94011d3 569 __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE();\
sahilmgandhi 18:6a4db94011d3 570 }while(0)
sahilmgandhi 18:6a4db94011d3 571
sahilmgandhi 18:6a4db94011d3 572 /**
sahilmgandhi 18:6a4db94011d3 573 * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not.
sahilmgandhi 18:6a4db94011d3 574 * @retval Line Status.
sahilmgandhi 18:6a4db94011d3 575 */
sahilmgandhi 18:6a4db94011d3 576 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
sahilmgandhi 18:6a4db94011d3 577
sahilmgandhi 18:6a4db94011d3 578 /**
sahilmgandhi 18:6a4db94011d3 579 * @brief Clear the RTC Tamper and Timestamp associated Exti line flag.
sahilmgandhi 18:6a4db94011d3 580 * @retval None.
sahilmgandhi 18:6a4db94011d3 581 */
sahilmgandhi 18:6a4db94011d3 582 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
sahilmgandhi 18:6a4db94011d3 583
sahilmgandhi 18:6a4db94011d3 584 /**
sahilmgandhi 18:6a4db94011d3 585 * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line
sahilmgandhi 18:6a4db94011d3 586 * @retval None.
sahilmgandhi 18:6a4db94011d3 587 */
sahilmgandhi 18:6a4db94011d3 588 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
sahilmgandhi 18:6a4db94011d3 589 /**
sahilmgandhi 18:6a4db94011d3 590 * @}
sahilmgandhi 18:6a4db94011d3 591 */
sahilmgandhi 18:6a4db94011d3 592
sahilmgandhi 18:6a4db94011d3 593 /* ------------------------------Calibration----------------------------------*/
sahilmgandhi 18:6a4db94011d3 594 /** @defgroup RTCEx_Calibration RTC Calibration
sahilmgandhi 18:6a4db94011d3 595 * @{
sahilmgandhi 18:6a4db94011d3 596 */
sahilmgandhi 18:6a4db94011d3 597
sahilmgandhi 18:6a4db94011d3 598 /**
sahilmgandhi 18:6a4db94011d3 599 * @brief Enable the Coarse calibration process.
sahilmgandhi 18:6a4db94011d3 600 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 601 * @retval None
sahilmgandhi 18:6a4db94011d3 602 */
sahilmgandhi 18:6a4db94011d3 603 #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE))
sahilmgandhi 18:6a4db94011d3 604
sahilmgandhi 18:6a4db94011d3 605 /**
sahilmgandhi 18:6a4db94011d3 606 * @brief Disable the Coarse calibration process.
sahilmgandhi 18:6a4db94011d3 607 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 608 * @retval None
sahilmgandhi 18:6a4db94011d3 609 */
sahilmgandhi 18:6a4db94011d3 610 #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE))
sahilmgandhi 18:6a4db94011d3 611
sahilmgandhi 18:6a4db94011d3 612 /**
sahilmgandhi 18:6a4db94011d3 613 * @brief Enable the RTC calibration output.
sahilmgandhi 18:6a4db94011d3 614 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 615 * @retval None
sahilmgandhi 18:6a4db94011d3 616 */
sahilmgandhi 18:6a4db94011d3 617 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
sahilmgandhi 18:6a4db94011d3 618
sahilmgandhi 18:6a4db94011d3 619 /**
sahilmgandhi 18:6a4db94011d3 620 * @brief Disable the calibration output.
sahilmgandhi 18:6a4db94011d3 621 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 622 * @retval None
sahilmgandhi 18:6a4db94011d3 623 */
sahilmgandhi 18:6a4db94011d3 624 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
sahilmgandhi 18:6a4db94011d3 625
sahilmgandhi 18:6a4db94011d3 626 /**
sahilmgandhi 18:6a4db94011d3 627 * @brief Enable the clock reference detection.
sahilmgandhi 18:6a4db94011d3 628 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 629 * @retval None
sahilmgandhi 18:6a4db94011d3 630 */
sahilmgandhi 18:6a4db94011d3 631 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
sahilmgandhi 18:6a4db94011d3 632
sahilmgandhi 18:6a4db94011d3 633 /**
sahilmgandhi 18:6a4db94011d3 634 * @brief Disable the clock reference detection.
sahilmgandhi 18:6a4db94011d3 635 * @param __HANDLE__: specifies the RTC handle.
sahilmgandhi 18:6a4db94011d3 636 * @retval None
sahilmgandhi 18:6a4db94011d3 637 */
sahilmgandhi 18:6a4db94011d3 638 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
sahilmgandhi 18:6a4db94011d3 639
sahilmgandhi 18:6a4db94011d3 640 /**
sahilmgandhi 18:6a4db94011d3 641 * @}
sahilmgandhi 18:6a4db94011d3 642 */
sahilmgandhi 18:6a4db94011d3 643
sahilmgandhi 18:6a4db94011d3 644 /**
sahilmgandhi 18:6a4db94011d3 645 * @}
sahilmgandhi 18:6a4db94011d3 646 */
sahilmgandhi 18:6a4db94011d3 647
sahilmgandhi 18:6a4db94011d3 648 /* Exported functions --------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 649 /** @defgroup RTCEx_Exported_Functions RTC Exported Functions
sahilmgandhi 18:6a4db94011d3 650 * @{
sahilmgandhi 18:6a4db94011d3 651 */
sahilmgandhi 18:6a4db94011d3 652
sahilmgandhi 18:6a4db94011d3 653 /** @addtogroup RTCEx_Exported_Functions_Group1
sahilmgandhi 18:6a4db94011d3 654 * @{
sahilmgandhi 18:6a4db94011d3 655 */
sahilmgandhi 18:6a4db94011d3 656 /* RTC TimeStamp and Tamper functions *****************************************/
sahilmgandhi 18:6a4db94011d3 657 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
sahilmgandhi 18:6a4db94011d3 658 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
sahilmgandhi 18:6a4db94011d3 659 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 660 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
sahilmgandhi 18:6a4db94011d3 661
sahilmgandhi 18:6a4db94011d3 662 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
sahilmgandhi 18:6a4db94011d3 663 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
sahilmgandhi 18:6a4db94011d3 664 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
sahilmgandhi 18:6a4db94011d3 665 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 666
sahilmgandhi 18:6a4db94011d3 667 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 668 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 669 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
sahilmgandhi 18:6a4db94011d3 670 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
sahilmgandhi 18:6a4db94011d3 671 /**
sahilmgandhi 18:6a4db94011d3 672 * @}
sahilmgandhi 18:6a4db94011d3 673 */
sahilmgandhi 18:6a4db94011d3 674
sahilmgandhi 18:6a4db94011d3 675 /** @addtogroup RTCEx_Exported_Functions_Group2
sahilmgandhi 18:6a4db94011d3 676 * @{
sahilmgandhi 18:6a4db94011d3 677 */
sahilmgandhi 18:6a4db94011d3 678 /* RTC Wake-up functions ******************************************************/
sahilmgandhi 18:6a4db94011d3 679 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
sahilmgandhi 18:6a4db94011d3 680 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
sahilmgandhi 18:6a4db94011d3 681 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 682 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 683 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 684 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 685 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
sahilmgandhi 18:6a4db94011d3 686 /**
sahilmgandhi 18:6a4db94011d3 687 * @}
sahilmgandhi 18:6a4db94011d3 688 */
sahilmgandhi 18:6a4db94011d3 689
sahilmgandhi 18:6a4db94011d3 690 /** @addtogroup RTCEx_Exported_Functions_Group3
sahilmgandhi 18:6a4db94011d3 691 * @{
sahilmgandhi 18:6a4db94011d3 692 */
sahilmgandhi 18:6a4db94011d3 693 /* Extension Control functions ************************************************/
sahilmgandhi 18:6a4db94011d3 694 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
sahilmgandhi 18:6a4db94011d3 695 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
sahilmgandhi 18:6a4db94011d3 696
sahilmgandhi 18:6a4db94011d3 697 HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value);
sahilmgandhi 18:6a4db94011d3 698 HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 699 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef* hrtc);
sahilmgandhi 18:6a4db94011d3 700 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 701 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 702 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 703 /**
sahilmgandhi 18:6a4db94011d3 704 * @}
sahilmgandhi 18:6a4db94011d3 705 */
sahilmgandhi 18:6a4db94011d3 706
sahilmgandhi 18:6a4db94011d3 707 /** @addtogroup RTCEx_Exported_Functions_Group4
sahilmgandhi 18:6a4db94011d3 708 * @{
sahilmgandhi 18:6a4db94011d3 709 */
sahilmgandhi 18:6a4db94011d3 710 /* Extension RTC features functions *******************************************/
sahilmgandhi 18:6a4db94011d3 711 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
sahilmgandhi 18:6a4db94011d3 712 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
sahilmgandhi 18:6a4db94011d3 713 /**
sahilmgandhi 18:6a4db94011d3 714 * @}
sahilmgandhi 18:6a4db94011d3 715 */
sahilmgandhi 18:6a4db94011d3 716
sahilmgandhi 18:6a4db94011d3 717 /**
sahilmgandhi 18:6a4db94011d3 718 * @}
sahilmgandhi 18:6a4db94011d3 719 */
sahilmgandhi 18:6a4db94011d3 720
sahilmgandhi 18:6a4db94011d3 721 /* Private types -------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 722 /* Private variables ---------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 723 /* Private constants ---------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 724 /** @defgroup RTCEx_Private_Constants RTC Private Constants
sahilmgandhi 18:6a4db94011d3 725 * @{
sahilmgandhi 18:6a4db94011d3 726 */
sahilmgandhi 18:6a4db94011d3 727 #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 */
sahilmgandhi 18:6a4db94011d3 728 #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)EXTI_IMR_MR22) /*!< External interrupt line 22 Connected to the RTC Wake-up event */
sahilmgandhi 18:6a4db94011d3 729 /**
sahilmgandhi 18:6a4db94011d3 730 * @}
sahilmgandhi 18:6a4db94011d3 731 */
sahilmgandhi 18:6a4db94011d3 732
sahilmgandhi 18:6a4db94011d3 733 /* Private macros ------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 734 /** @defgroup RTCEx_Private_Macros RTC Private Macros
sahilmgandhi 18:6a4db94011d3 735 * @{
sahilmgandhi 18:6a4db94011d3 736 */
sahilmgandhi 18:6a4db94011d3 737
sahilmgandhi 18:6a4db94011d3 738 /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters
sahilmgandhi 18:6a4db94011d3 739 * @{
sahilmgandhi 18:6a4db94011d3 740 */
sahilmgandhi 18:6a4db94011d3 741 #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
sahilmgandhi 18:6a4db94011d3 742 ((BKP) == RTC_BKP_DR1) || \
sahilmgandhi 18:6a4db94011d3 743 ((BKP) == RTC_BKP_DR2) || \
sahilmgandhi 18:6a4db94011d3 744 ((BKP) == RTC_BKP_DR3) || \
sahilmgandhi 18:6a4db94011d3 745 ((BKP) == RTC_BKP_DR4) || \
sahilmgandhi 18:6a4db94011d3 746 ((BKP) == RTC_BKP_DR5) || \
sahilmgandhi 18:6a4db94011d3 747 ((BKP) == RTC_BKP_DR6) || \
sahilmgandhi 18:6a4db94011d3 748 ((BKP) == RTC_BKP_DR7) || \
sahilmgandhi 18:6a4db94011d3 749 ((BKP) == RTC_BKP_DR8) || \
sahilmgandhi 18:6a4db94011d3 750 ((BKP) == RTC_BKP_DR9) || \
sahilmgandhi 18:6a4db94011d3 751 ((BKP) == RTC_BKP_DR10) || \
sahilmgandhi 18:6a4db94011d3 752 ((BKP) == RTC_BKP_DR11) || \
sahilmgandhi 18:6a4db94011d3 753 ((BKP) == RTC_BKP_DR12) || \
sahilmgandhi 18:6a4db94011d3 754 ((BKP) == RTC_BKP_DR13) || \
sahilmgandhi 18:6a4db94011d3 755 ((BKP) == RTC_BKP_DR14) || \
sahilmgandhi 18:6a4db94011d3 756 ((BKP) == RTC_BKP_DR15) || \
sahilmgandhi 18:6a4db94011d3 757 ((BKP) == RTC_BKP_DR16) || \
sahilmgandhi 18:6a4db94011d3 758 ((BKP) == RTC_BKP_DR17) || \
sahilmgandhi 18:6a4db94011d3 759 ((BKP) == RTC_BKP_DR18) || \
sahilmgandhi 18:6a4db94011d3 760 ((BKP) == RTC_BKP_DR19))
sahilmgandhi 18:6a4db94011d3 761 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
sahilmgandhi 18:6a4db94011d3 762 ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
sahilmgandhi 18:6a4db94011d3 763
sahilmgandhi 18:6a4db94011d3 764 #define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_DEFAULT) || \
sahilmgandhi 18:6a4db94011d3 765 ((PIN) == RTC_TAMPERPIN_POS1))
sahilmgandhi 18:6a4db94011d3 766
sahilmgandhi 18:6a4db94011d3 767 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT) || \
sahilmgandhi 18:6a4db94011d3 768 ((PIN) == RTC_TIMESTAMPPIN_POS1))
sahilmgandhi 18:6a4db94011d3 769
sahilmgandhi 18:6a4db94011d3 770 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
sahilmgandhi 18:6a4db94011d3 771 ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE))
sahilmgandhi 18:6a4db94011d3 772
sahilmgandhi 18:6a4db94011d3 773 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
sahilmgandhi 18:6a4db94011d3 774 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
sahilmgandhi 18:6a4db94011d3 775 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
sahilmgandhi 18:6a4db94011d3 776 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
sahilmgandhi 18:6a4db94011d3 777 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
sahilmgandhi 18:6a4db94011d3 778 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
sahilmgandhi 18:6a4db94011d3 779
sahilmgandhi 18:6a4db94011d3 780 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFFU)
sahilmgandhi 18:6a4db94011d3 781 #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \
sahilmgandhi 18:6a4db94011d3 782 ((SIGN) == RTC_CALIBSIGN_NEGATIVE))
sahilmgandhi 18:6a4db94011d3 783
sahilmgandhi 18:6a4db94011d3 784 #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20U)
sahilmgandhi 18:6a4db94011d3 785 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & ((uint32_t)!(RTC_TAFCR_TAMP1E))) == 0x00U) && ((TAMPER) != (uint32_t)RESET))
sahilmgandhi 18:6a4db94011d3 786 /**
sahilmgandhi 18:6a4db94011d3 787 * @}
sahilmgandhi 18:6a4db94011d3 788 */
sahilmgandhi 18:6a4db94011d3 789
sahilmgandhi 18:6a4db94011d3 790 /**
sahilmgandhi 18:6a4db94011d3 791 * @}
sahilmgandhi 18:6a4db94011d3 792 */
sahilmgandhi 18:6a4db94011d3 793
sahilmgandhi 18:6a4db94011d3 794 /**
sahilmgandhi 18:6a4db94011d3 795 * @}
sahilmgandhi 18:6a4db94011d3 796 */
sahilmgandhi 18:6a4db94011d3 797
sahilmgandhi 18:6a4db94011d3 798 /**
sahilmgandhi 18:6a4db94011d3 799 * @}
sahilmgandhi 18:6a4db94011d3 800 */
sahilmgandhi 18:6a4db94011d3 801
sahilmgandhi 18:6a4db94011d3 802 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 803 }
sahilmgandhi 18:6a4db94011d3 804 #endif
sahilmgandhi 18:6a4db94011d3 805
sahilmgandhi 18:6a4db94011d3 806 #endif /* __STM32F2xx_HAL_RTC_EX_H */
sahilmgandhi 18:6a4db94011d3 807
sahilmgandhi 18:6a4db94011d3 808 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/