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:
107:4f6c30876dfa
.

Who changed what in which revision?

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