Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
109:9296ab0bfc11
.

Who changed what in which revision?

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