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:
108:34e6b704fe68
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 93:e188a91d3eaa 1 /**
Kojto 93:e188a91d3eaa 2 ******************************************************************************
Kojto 93:e188a91d3eaa 3 * @file stm32f0xx_hal_rtc_ex.h
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 8 ******************************************************************************
Kojto 93:e188a91d3eaa 9 * @attention
Kojto 93:e188a91d3eaa 10 *
Kojto 108:34e6b704fe68 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 93:e188a91d3eaa 12 *
Kojto 93:e188a91d3eaa 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 93:e188a91d3eaa 14 * are permitted provided that the following conditions are met:
Kojto 93:e188a91d3eaa 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 93:e188a91d3eaa 16 * this list of conditions and the following disclaimer.
Kojto 93:e188a91d3eaa 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 93:e188a91d3eaa 18 * this list of conditions and the following disclaimer in the documentation
Kojto 93:e188a91d3eaa 19 * and/or other materials provided with the distribution.
Kojto 93:e188a91d3eaa 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 93:e188a91d3eaa 21 * may be used to endorse or promote products derived from this software
Kojto 93:e188a91d3eaa 22 * without specific prior written permission.
Kojto 93:e188a91d3eaa 23 *
Kojto 93:e188a91d3eaa 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 93:e188a91d3eaa 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 93:e188a91d3eaa 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 93:e188a91d3eaa 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 93:e188a91d3eaa 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 93:e188a91d3eaa 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 93:e188a91d3eaa 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 93:e188a91d3eaa 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 93:e188a91d3eaa 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 93:e188a91d3eaa 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 93:e188a91d3eaa 34 *
Kojto 93:e188a91d3eaa 35 ******************************************************************************
Kojto 93:e188a91d3eaa 36 */
Kojto 93:e188a91d3eaa 37
Kojto 93:e188a91d3eaa 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 93:e188a91d3eaa 39 #ifndef __STM32F0xx_HAL_RTC_EX_H
Kojto 93:e188a91d3eaa 40 #define __STM32F0xx_HAL_RTC_EX_H
Kojto 93:e188a91d3eaa 41
Kojto 93:e188a91d3eaa 42 #ifdef __cplusplus
Kojto 93:e188a91d3eaa 43 extern "C" {
Kojto 93:e188a91d3eaa 44 #endif
Kojto 93:e188a91d3eaa 45
Kojto 93:e188a91d3eaa 46 /* Includes ------------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 47 #include "stm32f0xx_hal_def.h"
Kojto 93:e188a91d3eaa 48
Kojto 93:e188a91d3eaa 49 /** @addtogroup STM32F0xx_HAL_Driver
Kojto 93:e188a91d3eaa 50 * @{
Kojto 93:e188a91d3eaa 51 */
Kojto 93:e188a91d3eaa 52
Kojto 108:34e6b704fe68 53 /** @defgroup RTCEx RTCEx
Kojto 93:e188a91d3eaa 54 * @{
Kojto 93:e188a91d3eaa 55 */
Kojto 93:e188a91d3eaa 56
Kojto 93:e188a91d3eaa 57 /* Exported types ------------------------------------------------------------*/
Kojto 93:e188a91d3eaa 58
Kojto 93:e188a91d3eaa 59 /** @defgroup RTCEx_Exported_Types RTCEx Exported Types
Kojto 93:e188a91d3eaa 60 * @{
Kojto 93:e188a91d3eaa 61 */
Kojto 93:e188a91d3eaa 62
Kojto 93:e188a91d3eaa 63 /**
Kojto 93:e188a91d3eaa 64 * @brief RTC Tamper structure definition
Kojto 93:e188a91d3eaa 65 */
Kojto 93:e188a91d3eaa 66 typedef struct
Kojto 93:e188a91d3eaa 67 {
Kojto 93:e188a91d3eaa 68 uint32_t Tamper; /*!< Specifies the Tamper Pin.
Kojto 93:e188a91d3eaa 69 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
Kojto 93:e188a91d3eaa 70
Kojto 93:e188a91d3eaa 71 uint32_t Trigger; /*!< Specifies the Tamper Trigger.
Kojto 93:e188a91d3eaa 72 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
Kojto 93:e188a91d3eaa 73
Kojto 93:e188a91d3eaa 74 uint32_t Filter; /*!< Specifies the RTC Filter Tamper.
Kojto 93:e188a91d3eaa 75 This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */
Kojto 93:e188a91d3eaa 76
Kojto 93:e188a91d3eaa 77 uint32_t SamplingFrequency; /*!< Specifies the sampling frequency.
Kojto 93:e188a91d3eaa 78 This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */
Kojto 93:e188a91d3eaa 79
Kojto 93:e188a91d3eaa 80 uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration .
Kojto 93:e188a91d3eaa 81 This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */
Kojto 93:e188a91d3eaa 82
Kojto 93:e188a91d3eaa 83 uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp .
Kojto 93:e188a91d3eaa 84 This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */
Kojto 93:e188a91d3eaa 85
Kojto 93:e188a91d3eaa 86 uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection.
Kojto 93:e188a91d3eaa 87 This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */
Kojto 93:e188a91d3eaa 88 }RTC_TamperTypeDef;
Kojto 93:e188a91d3eaa 89 /**
Kojto 93:e188a91d3eaa 90 * @}
Kojto 93:e188a91d3eaa 91 */
Kojto 93:e188a91d3eaa 92
Kojto 93:e188a91d3eaa 93 /* Exported constants --------------------------------------------------------*/
Kojto 93:e188a91d3eaa 94 /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants
Kojto 93:e188a91d3eaa 95 * @{
Kojto 93:e188a91d3eaa 96 */
Kojto 93:e188a91d3eaa 97
Kojto 93:e188a91d3eaa 98 /** @defgroup RTCEx_Output_selection_Definitions RTCEx Output Selection Definition
Kojto 93:e188a91d3eaa 99 * @{
Kojto 93:e188a91d3eaa 100 */
Kojto 93:e188a91d3eaa 101 #define RTC_OUTPUT_DISABLE ((uint32_t)0x00000000)
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 104 #define RTC_OUTPUT_WAKEUP ((uint32_t)0x00600000)
Kojto 93:e188a91d3eaa 105 #endif
Kojto 93:e188a91d3eaa 106
Kojto 93:e188a91d3eaa 107 /**
Kojto 93:e188a91d3eaa 108 * @}
Kojto 93:e188a91d3eaa 109 */
Kojto 93:e188a91d3eaa 110
Kojto 93:e188a91d3eaa 111 #if !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F030xC) && !defined(STM32F070x6) && !defined(STM32F070xB)
Kojto 93:e188a91d3eaa 112 /** @defgroup RTCEx_Backup_Registers_Definitions RTCEx Backup Registers Definition
Kojto 93:e188a91d3eaa 113 * @{
Kojto 93:e188a91d3eaa 114 */
Kojto 93:e188a91d3eaa 115 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
Kojto 93:e188a91d3eaa 116 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
Kojto 93:e188a91d3eaa 117 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
Kojto 93:e188a91d3eaa 118 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
Kojto 93:e188a91d3eaa 119 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
Kojto 93:e188a91d3eaa 120 /**
Kojto 93:e188a91d3eaa 121 * @}
Kojto 93:e188a91d3eaa 122 */
Kojto 93:e188a91d3eaa 123 #endif /* !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F030xC) && !defined(STM32F070x6) && !defined(STM32F070xB) */
Kojto 93:e188a91d3eaa 124
Kojto 93:e188a91d3eaa 125 /** @defgroup RTCEx_Time_Stamp_Edges_definitions RTCEx Time Stamp Edges definition
Kojto 93:e188a91d3eaa 126 * @{
Kojto 93:e188a91d3eaa 127 */
Kojto 93:e188a91d3eaa 128 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000)
Kojto 93:e188a91d3eaa 129 #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008)
Kojto 93:e188a91d3eaa 130
Kojto 93:e188a91d3eaa 131 /**
Kojto 93:e188a91d3eaa 132 * @}
Kojto 93:e188a91d3eaa 133 */
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 145 /** @defgroup RTCEx_Tamper_Pins_Definitions RTCEx Tamper Pins Definition
Kojto 93:e188a91d3eaa 146 * @{
Kojto 93:e188a91d3eaa 147 */
Kojto 93:e188a91d3eaa 148 #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E
Kojto 93:e188a91d3eaa 149 #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E
Kojto 93:e188a91d3eaa 150 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx)
Kojto 93:e188a91d3eaa 151 #define RTC_TAMPER_3 RTC_TAFCR_TAMP3E
Kojto 93:e188a91d3eaa 152 #endif
Kojto 93:e188a91d3eaa 153
Kojto 93:e188a91d3eaa 154 /**
Kojto 93:e188a91d3eaa 155 * @}
Kojto 93:e188a91d3eaa 156 */
Kojto 93:e188a91d3eaa 157
Kojto 93:e188a91d3eaa 158
Kojto 93:e188a91d3eaa 159
Kojto 93:e188a91d3eaa 160 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTCEx Tamper Trigger Definition
Kojto 93:e188a91d3eaa 161 * @{
Kojto 93:e188a91d3eaa 162 */
Kojto 93:e188a91d3eaa 163 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
Kojto 93:e188a91d3eaa 164 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002)
Kojto 93:e188a91d3eaa 165 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
Kojto 93:e188a91d3eaa 166 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
Kojto 93:e188a91d3eaa 167
Kojto 93:e188a91d3eaa 168
Kojto 93:e188a91d3eaa 169 /**
Kojto 93:e188a91d3eaa 170 * @}
Kojto 93:e188a91d3eaa 171 */
Kojto 93:e188a91d3eaa 172
Kojto 93:e188a91d3eaa 173 /** @defgroup RTCEx_Tamper_Filter_Definitions RTCEx Tamper Filter Definition
Kojto 93:e188a91d3eaa 174 * @{
Kojto 93:e188a91d3eaa 175 */
Kojto 93:e188a91d3eaa 176 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
Kojto 93:e188a91d3eaa 177
Kojto 93:e188a91d3eaa 178 #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2
Kojto 93:e188a91d3eaa 179 consecutive samples at the active level */
Kojto 93:e188a91d3eaa 180 #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4
Kojto 93:e188a91d3eaa 181 consecutive samples at the active level */
Kojto 93:e188a91d3eaa 182 #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8
Kojto 93:e188a91d3eaa 183 consecutive samples at the active level. */
Kojto 93:e188a91d3eaa 184
Kojto 93:e188a91d3eaa 185 /**
Kojto 93:e188a91d3eaa 186 * @}
Kojto 93:e188a91d3eaa 187 */
Kojto 93:e188a91d3eaa 188
Kojto 93:e188a91d3eaa 189 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTCEx Tamper Sampling Frequencies Definition
Kojto 93:e188a91d3eaa 190 * @{
Kojto 93:e188a91d3eaa 191 */
Kojto 93:e188a91d3eaa 192 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
Kojto 93:e188a91d3eaa 193 with a frequency = RTCCLK / 32768 */
Kojto 93:e188a91d3eaa 194 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled
Kojto 93:e188a91d3eaa 195 with a frequency = RTCCLK / 16384 */
Kojto 93:e188a91d3eaa 196 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
Kojto 93:e188a91d3eaa 197 with a frequency = RTCCLK / 8192 */
Kojto 93:e188a91d3eaa 198 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
Kojto 93:e188a91d3eaa 199 with a frequency = RTCCLK / 4096 */
Kojto 93:e188a91d3eaa 200 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
Kojto 93:e188a91d3eaa 201 with a frequency = RTCCLK / 2048 */
Kojto 93:e188a91d3eaa 202 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
Kojto 93:e188a91d3eaa 203 with a frequency = RTCCLK / 1024 */
Kojto 93:e188a91d3eaa 204 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
Kojto 93:e188a91d3eaa 205 with a frequency = RTCCLK / 512 */
Kojto 93:e188a91d3eaa 206 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
Kojto 93:e188a91d3eaa 207 with a frequency = RTCCLK / 256 */
Kojto 93:e188a91d3eaa 208
Kojto 93:e188a91d3eaa 209 /**
Kojto 93:e188a91d3eaa 210 * @}
Kojto 93:e188a91d3eaa 211 */
Kojto 93:e188a91d3eaa 212
Kojto 93:e188a91d3eaa 213 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTCEx Tamper Pin Precharge Duration Definition
Kojto 93:e188a91d3eaa 214 * @{
Kojto 93:e188a91d3eaa 215 */
Kojto 93:e188a91d3eaa 216 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
Kojto 93:e188a91d3eaa 217 sampling during 1 RTCCLK cycle */
Kojto 93:e188a91d3eaa 218 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
Kojto 93:e188a91d3eaa 219 sampling during 2 RTCCLK cycles */
Kojto 93:e188a91d3eaa 220 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
Kojto 93:e188a91d3eaa 221 sampling during 4 RTCCLK cycles */
Kojto 93:e188a91d3eaa 222 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
Kojto 93:e188a91d3eaa 223 sampling during 8 RTCCLK cycles */
Kojto 93:e188a91d3eaa 224
Kojto 93:e188a91d3eaa 225 /**
Kojto 93:e188a91d3eaa 226 * @}
Kojto 93:e188a91d3eaa 227 */
Kojto 93:e188a91d3eaa 228
Kojto 93:e188a91d3eaa 229 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTCEx Tamper TimeStampOnTamperDetection Definition
Kojto 93:e188a91d3eaa 230 * @{
Kojto 93:e188a91d3eaa 231 */
Kojto 93:e188a91d3eaa 232 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */
Kojto 93:e188a91d3eaa 233 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
Kojto 93:e188a91d3eaa 234
Kojto 93:e188a91d3eaa 235 /**
Kojto 93:e188a91d3eaa 236 * @}
Kojto 93:e188a91d3eaa 237 */
Kojto 93:e188a91d3eaa 238
Kojto 93:e188a91d3eaa 239 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTCEx Tamper Pull UP Definition
Kojto 93:e188a91d3eaa 240 * @{
Kojto 93:e188a91d3eaa 241 */
Kojto 108:34e6b704fe68 242 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before sampling */
Kojto 93:e188a91d3eaa 243 #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */
Kojto 93:e188a91d3eaa 244
Kojto 93:e188a91d3eaa 245 /**
Kojto 93:e188a91d3eaa 246 * @}
Kojto 93:e188a91d3eaa 247 */
Kojto 93:e188a91d3eaa 248
Kojto 93:e188a91d3eaa 249 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC)
Kojto 93:e188a91d3eaa 250 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTCEx Wakeup Timer Definition
Kojto 93:e188a91d3eaa 251 * @{
Kojto 93:e188a91d3eaa 252 */
Kojto 93:e188a91d3eaa 253 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
Kojto 93:e188a91d3eaa 254 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001)
Kojto 93:e188a91d3eaa 255 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002)
Kojto 93:e188a91d3eaa 256 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003)
Kojto 93:e188a91d3eaa 257 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004)
Kojto 93:e188a91d3eaa 258 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006)
Kojto 93:e188a91d3eaa 259
Kojto 93:e188a91d3eaa 260
Kojto 93:e188a91d3eaa 261 /**
Kojto 93:e188a91d3eaa 262 * @}
Kojto 93:e188a91d3eaa 263 */
Kojto 93:e188a91d3eaa 264 #endif /* defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F070xB) || defined(STM32F030xC) */
Kojto 93:e188a91d3eaa 265
Kojto 93:e188a91d3eaa 266 /** @defgroup RTCEx_Smooth_calib_period_Definitions RTCEx Smooth calib period Definition
Kojto 93:e188a91d3eaa 267 * @{
Kojto 93:e188a91d3eaa 268 */
Kojto 93:e188a91d3eaa 269 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
Kojto 93:e188a91d3eaa 270 period is 32s, else 2exp20 RTCCLK seconds */
Kojto 93:e188a91d3eaa 271 #define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
Kojto 93:e188a91d3eaa 272 period is 16s, else 2exp19 RTCCLK seconds */
Kojto 93:e188a91d3eaa 273 #define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
Kojto 93:e188a91d3eaa 274 period is 8s, else 2exp18 RTCCLK seconds */
Kojto 93:e188a91d3eaa 275
Kojto 93:e188a91d3eaa 276 /**
Kojto 93:e188a91d3eaa 277 * @}
Kojto 93:e188a91d3eaa 278 */
Kojto 93:e188a91d3eaa 279
Kojto 93:e188a91d3eaa 280 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTCEx Smooth calib Plus pulses Definition
Kojto 93:e188a91d3eaa 281 * @{
Kojto 93:e188a91d3eaa 282 */
Kojto 93:e188a91d3eaa 283 #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added
Kojto 93:e188a91d3eaa 284 during a X -second window = Y - CALM[8:0]
Kojto 93:e188a91d3eaa 285 with Y = 512, 256, 128 when X = 32, 16, 8 */
Kojto 93:e188a91d3eaa 286 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
Kojto 93:e188a91d3eaa 287 during a 32-second window = CALM[8:0] */
Kojto 93:e188a91d3eaa 288
Kojto 93:e188a91d3eaa 289 /**
Kojto 93:e188a91d3eaa 290 * @}
Kojto 93:e188a91d3eaa 291 */
Kojto 108:34e6b704fe68 292 /** @defgroup RTCEx_Calib_Output_selection_Definitions RTCEx Calib Output selection Definitions
Kojto 93:e188a91d3eaa 293 * @{
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 298 /**
Kojto 93:e188a91d3eaa 299 * @}
Kojto 93:e188a91d3eaa 300 */
Kojto 93:e188a91d3eaa 301
Kojto 93:e188a91d3eaa 302 /** @defgroup RTCEx_Add_1_Second_Parameter_Definition RTCEx Add 1 Second Parameter Definition
Kojto 93:e188a91d3eaa 303 * @{
Kojto 93:e188a91d3eaa 304 */
Kojto 93:e188a91d3eaa 305 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000)
Kojto 93:e188a91d3eaa 306 #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000)
Kojto 93:e188a91d3eaa 307
Kojto 93:e188a91d3eaa 308 /**
Kojto 93:e188a91d3eaa 309 * @}
Kojto 93:e188a91d3eaa 310 */
Kojto 108:34e6b704fe68 311
Kojto 93:e188a91d3eaa 312 /**
Kojto 93:e188a91d3eaa 313 * @}
Kojto 93:e188a91d3eaa 314 */
Kojto 93:e188a91d3eaa 315
Kojto 108:34e6b704fe68 316 /* Exported macros -----------------------------------------------------------*/
Kojto 93:e188a91d3eaa 317 /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros
Kojto 93:e188a91d3eaa 318 * @{
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 326 /**
Kojto 93:e188a91d3eaa 327 * @brief Enable the RTC WakeUp Timer peripheral.
Kojto 93:e188a91d3eaa 328 * @param __HANDLE__: specifies the RTC handle.
Kojto 93:e188a91d3eaa 329 * @retval None
Kojto 93:e188a91d3eaa 330 */
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 408
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 492 * @param __HANDLE__: specifies the RTC handle.
Kojto 93:e188a91d3eaa 493 * @retval None
Kojto 93:e188a91d3eaa 494 */
Kojto 93:e188a91d3eaa 495 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
Kojto 93:e188a91d3eaa 496
Kojto 93:e188a91d3eaa 497 /**
Kojto 108:34e6b704fe68 498 * @brief Disable the RTC TimeStamp peripheral.
Kojto 93:e188a91d3eaa 499 * @param __HANDLE__: specifies the RTC handle.
Kojto 93:e188a91d3eaa 500 * @retval None
Kojto 93:e188a91d3eaa 501 */
Kojto 93:e188a91d3eaa 502 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
Kojto 93:e188a91d3eaa 503
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 825 * @brief Enable the RTC calibration output.
Kojto 93:e188a91d3eaa 826 * @param __HANDLE__: specifies the RTC handle.
Kojto 93:e188a91d3eaa 827 * @retval None
Kojto 93:e188a91d3eaa 828 */
Kojto 93:e188a91d3eaa 829 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
Kojto 93:e188a91d3eaa 830
Kojto 93:e188a91d3eaa 831 /**
Kojto 93:e188a91d3eaa 832 * @brief Disable the calibration output.
Kojto 93:e188a91d3eaa 833 * @param __HANDLE__: specifies the RTC handle.
Kojto 93:e188a91d3eaa 834 * @retval None
Kojto 93:e188a91d3eaa 835 */
Kojto 93:e188a91d3eaa 836 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
Kojto 93:e188a91d3eaa 837
Kojto 93:e188a91d3eaa 838 /**
Kojto 93:e188a91d3eaa 839 * @brief Enable the clock reference detection.
Kojto 93:e188a91d3eaa 840 * @param __HANDLE__: specifies the RTC handle.
Kojto 93:e188a91d3eaa 841 * @retval None
Kojto 93:e188a91d3eaa 842 */
Kojto 93:e188a91d3eaa 843 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
Kojto 93:e188a91d3eaa 844
Kojto 93:e188a91d3eaa 845 /**
Kojto 93:e188a91d3eaa 846 * @brief Disable the clock reference detection.
Kojto 93:e188a91d3eaa 847 * @param __HANDLE__: specifies the RTC handle.
Kojto 93:e188a91d3eaa 848 * @retval None
Kojto 93:e188a91d3eaa 849 */
Kojto 93:e188a91d3eaa 850 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
Kojto 93:e188a91d3eaa 851
Kojto 93:e188a91d3eaa 852 /**
Kojto 93:e188a91d3eaa 853 * @brief Get the selected RTC shift operation's flag status.
Kojto 93:e188a91d3eaa 854 * @param __HANDLE__: specifies the RTC handle.
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 858 * @retval None
Kojto 93:e188a91d3eaa 859 */
Kojto 93:e188a91d3eaa 860 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
Kojto 93:e188a91d3eaa 861 /**
Kojto 108:34e6b704fe68 862 * @}
Kojto 93:e188a91d3eaa 863 */
Kojto 93:e188a91d3eaa 864
Kojto 93:e188a91d3eaa 865 /**
Kojto 93:e188a91d3eaa 866 * @}
Kojto 93:e188a91d3eaa 867 */
Kojto 108:34e6b704fe68 868
Kojto 93:e188a91d3eaa 869 /* Exported functions --------------------------------------------------------*/
Kojto 108:34e6b704fe68 870 /** @defgroup RTCEx_Exported_Functions RTCEx Exported Functions
Kojto 93:e188a91d3eaa 871 * @{
Kojto 93:e188a91d3eaa 872 */
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 876 * @{
Kojto 93:e188a91d3eaa 877 */
Kojto 93:e188a91d3eaa 878
Kojto 93:e188a91d3eaa 879 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
Kojto 93:e188a91d3eaa 880 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
Kojto 93:e188a91d3eaa 881 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 882 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
Kojto 93:e188a91d3eaa 883
Kojto 93:e188a91d3eaa 884 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
Kojto 93:e188a91d3eaa 885 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
Kojto 93:e188a91d3eaa 886 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
Kojto 93:e188a91d3eaa 887 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 888
Kojto 93:e188a91d3eaa 889 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 892 void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 893 #endif
Kojto 93:e188a91d3eaa 894 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 895 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 93:e188a91d3eaa 896 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 899 HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 93:e188a91d3eaa 900 #endif
Kojto 93:e188a91d3eaa 901 /**
Kojto 93:e188a91d3eaa 902 * @}
Kojto 93:e188a91d3eaa 903 */
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 908 * @{
Kojto 93:e188a91d3eaa 909 */
Kojto 93:e188a91d3eaa 910
Kojto 93:e188a91d3eaa 911 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
Kojto 93:e188a91d3eaa 912 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
Kojto 93:e188a91d3eaa 913 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 914 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 915 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 916 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 917 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 93:e188a91d3eaa 918 #endif
Kojto 93:e188a91d3eaa 919 /**
Kojto 93:e188a91d3eaa 920 * @}
Kojto 93:e188a91d3eaa 921 */
Kojto 93:e188a91d3eaa 922
Kojto 108:34e6b704fe68 923 /* Extended Control functions ************************************************/
Kojto 108:34e6b704fe68 924 /** @defgroup RTCEx_Exported_Functions_Group3 Extended Peripheral Control functions
Kojto 93:e188a91d3eaa 925 * @{
Kojto 93:e188a91d3eaa 926 */
Kojto 108:34e6b704fe68 927
Kojto 93:e188a91d3eaa 928 #if !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F030xC) && !defined(STM32F070x6) && !defined(STM32F070xB)
Kojto 93:e188a91d3eaa 929 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 932
Kojto 93:e188a91d3eaa 933 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue);
Kojto 93:e188a91d3eaa 934 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
Kojto 93:e188a91d3eaa 935 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
Kojto 93:e188a91d3eaa 936 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 937 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 938 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 939 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 940 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
Kojto 93:e188a91d3eaa 941 /**
Kojto 93:e188a91d3eaa 942 * @}
Kojto 93:e188a91d3eaa 943 */
Kojto 93:e188a91d3eaa 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 93:e188a91d3eaa 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 93:e188a91d3eaa 1042 /**
Kojto 93:e188a91d3eaa 1043 * @}
Kojto 93:e188a91d3eaa 1044 */
Kojto 93:e188a91d3eaa 1045
Kojto 93:e188a91d3eaa 1046 /**
Kojto 93:e188a91d3eaa 1047 * @}
Kojto 93:e188a91d3eaa 1048 */
Kojto 93:e188a91d3eaa 1049
Kojto 93:e188a91d3eaa 1050 /**
Kojto 93:e188a91d3eaa 1051 * @}
Kojto 108:34e6b704fe68 1052 */
Kojto 93:e188a91d3eaa 1053
Kojto 108:34e6b704fe68 1054 /**
Kojto 108:34e6b704fe68 1055 * @}
Kojto 108:34e6b704fe68 1056 */
Kojto 108:34e6b704fe68 1057
Kojto 93:e188a91d3eaa 1058 #ifdef __cplusplus
Kojto 93:e188a91d3eaa 1059 }
Kojto 93:e188a91d3eaa 1060 #endif
Kojto 93:e188a91d3eaa 1061
Kojto 93:e188a91d3eaa 1062 #endif /* __STM32F0xx_HAL_RTC_EX_H */
Kojto 93:e188a91d3eaa 1063
Kojto 93:e188a91d3eaa 1064 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Kojto 93:e188a91d3eaa 1065