meh

Fork of mbed by mbed official

Committer:
Kojto
Date:
Fri Oct 02 07:35:07 2015 +0200
Revision:
108:34e6b704fe68
Parent:
93:e188a91d3eaa
Release 108  of the mbed library

Changes:
- new platforms - ELMO_F411RE, WIZNET_7500P, ARM_MPS2_BEID
- EFM32 - bugfixes in rtc, serial
- Cortex A cmsis - update files
- STML4 - RAM fixes

Who changed what in which revision?

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