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:
112:6f327212ef96
.

Who changed what in which revision?

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