Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Mar 15 14:34:00 2016 +0000
Revision:
116:c0f6e94411f5
Parent:
115:87f2f5183dfb
Release 116 of the mbed library

Changes:
- new targets - NUCLEO_L073RZ
- fixes to IOTSS BEID platform
- LPC824, LPC1549 and LPC11U68 - fix PWMOut SCT bugs
- STM32F7 - Cube driver
- STM32F4 - add RTC LSI macro, defined as 0
- STM32F3 - fix multiple ADC clock initialization
- retarget - binary mode fix for GCC

Who changed what in which revision?

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