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:
110:165afa46840b
.

Who changed what in which revision?

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