meh

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Sep 02 14:17:43 2015 +0100
Revision:
106:ba1f97679dad
Parent:
99:dbbf35b96557
Child:
110:165afa46840b
Release 106  of the mbed library

Changes:
- new platform - Nucleo F446RE
- STM32F4 Cube driver update v2.3.2
- ST cmsis driver v2.3.2
- nordic bugfix gcc linker start address
- lpc11u68 - bugfix for serial ports

Who changed what in which revision?

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