meh

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed May 13 08:08:21 2015 +0200
Revision:
99:dbbf35b96557
Parent:
90:cb3d968589d8
Child:
106:ba1f97679dad
Release 99 of the mbed library

Changes:
- new targets - MAXWSNENV, DISCO_L053C8
- STM32F4xx - ST Cube driver
- KSDK mcu - SPI timing fix
- Nordic - update to softdevice s130

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 99:dbbf35b96557 5 * @version V1.3.0
Kojto 99:dbbf35b96557 6 * @date 09-March-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.
emilmont 77:869cf507173a 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 */
emilmont 77:869cf507173a 148 #define RTC_TAMPERPIN_PC13 ((uint32_t)0x00000000)
Kojto 99:dbbf35b96557 149 #if defined (STM32F446xx)
Kojto 99:dbbf35b96557 150 #define RTC_TAMPERPIN_PA0 ((uint32_t)0x00010000)
Kojto 99:dbbf35b96557 151 #else
Kojto 99:dbbf35b96557 152 #define RTC_TAMPERPIN_PI8 ((uint32_t)0x00010000)
Kojto 99:dbbf35b96557 153 #endif /* STM32F446xx */
emilmont 77:869cf507173a 154 /**
emilmont 77:869cf507173a 155 * @}
emilmont 77:869cf507173a 156 */
emilmont 77:869cf507173a 157
Kojto 99:dbbf35b96557 158 /** @defgroup RTCEx_TimeStamp_Pin_Selection RTC TimeStamp Pins Selection
emilmont 77:869cf507173a 159 * @{
emilmont 77:869cf507173a 160 */
emilmont 77:869cf507173a 161 #define RTC_TIMESTAMPPIN_PC13 ((uint32_t)0x00000000)
Kojto 99:dbbf35b96557 162 #if defined (STM32F446xx)
Kojto 99:dbbf35b96557 163 #define RTC_TIMESTAMPPIN_PA0 ((uint32_t)0x00020000)
Kojto 99:dbbf35b96557 164 #else
Kojto 99:dbbf35b96557 165 #define RTC_TIMESTAMPPIN_PI8 ((uint32_t)0x00020000)
Kojto 99:dbbf35b96557 166 #endif /* STM32F446xx */
emilmont 77:869cf507173a 167 /**
emilmont 77:869cf507173a 168 * @}
emilmont 77:869cf507173a 169 */
emilmont 77:869cf507173a 170
Kojto 99:dbbf35b96557 171 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTC Tamper Triggers Definitions
emilmont 77:869cf507173a 172 * @{
emilmont 77:869cf507173a 173 */
emilmont 77:869cf507173a 174 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
emilmont 77:869cf507173a 175 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002)
emilmont 77:869cf507173a 176 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
emilmont 77:869cf507173a 177 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
emilmont 77:869cf507173a 178 /**
emilmont 77:869cf507173a 179 * @}
emilmont 77:869cf507173a 180 */
emilmont 77:869cf507173a 181
Kojto 99:dbbf35b96557 182 /** @defgroup RTCEx_Tamper_Filter_Definitions RTC Tamper Filter Definitions
emilmont 77:869cf507173a 183 * @{
emilmont 77:869cf507173a 184 */
emilmont 77:869cf507173a 185 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
emilmont 77:869cf507173a 186
emilmont 77:869cf507173a 187 #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2
emilmont 77:869cf507173a 188 consecutive samples at the active level */
emilmont 77:869cf507173a 189 #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4
emilmont 77:869cf507173a 190 consecutive samples at the active level */
emilmont 77:869cf507173a 191 #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8
Kojto 99:dbbf35b96557 192 consecutive samples at the active level. */
emilmont 77:869cf507173a 193 /**
emilmont 77:869cf507173a 194 * @}
emilmont 77:869cf507173a 195 */
emilmont 77:869cf507173a 196
Kojto 99:dbbf35b96557 197 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTC Tamper Sampling Frequencies Definitions
emilmont 77:869cf507173a 198 * @{
emilmont 77:869cf507173a 199 */
emilmont 77:869cf507173a 200 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
emilmont 77:869cf507173a 201 with a frequency = RTCCLK / 32768 */
emilmont 77:869cf507173a 202 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled
emilmont 77:869cf507173a 203 with a frequency = RTCCLK / 16384 */
emilmont 77:869cf507173a 204 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
emilmont 77:869cf507173a 205 with a frequency = RTCCLK / 8192 */
emilmont 77:869cf507173a 206 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
emilmont 77:869cf507173a 207 with a frequency = RTCCLK / 4096 */
emilmont 77:869cf507173a 208 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
emilmont 77:869cf507173a 209 with a frequency = RTCCLK / 2048 */
emilmont 77:869cf507173a 210 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
emilmont 77:869cf507173a 211 with a frequency = RTCCLK / 1024 */
emilmont 77:869cf507173a 212 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
emilmont 77:869cf507173a 213 with a frequency = RTCCLK / 512 */
emilmont 77:869cf507173a 214 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
emilmont 77:869cf507173a 215 with a frequency = RTCCLK / 256 */
emilmont 77:869cf507173a 216 /**
emilmont 77:869cf507173a 217 * @}
emilmont 77:869cf507173a 218 */
emilmont 77:869cf507173a 219
Kojto 99:dbbf35b96557 220 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTC Tamper Pin Precharge Duration Definitions
emilmont 77:869cf507173a 221 * @{
emilmont 77:869cf507173a 222 */
emilmont 77:869cf507173a 223 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
emilmont 77:869cf507173a 224 sampling during 1 RTCCLK cycle */
emilmont 77:869cf507173a 225 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
emilmont 77:869cf507173a 226 sampling during 2 RTCCLK cycles */
emilmont 77:869cf507173a 227 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
emilmont 77:869cf507173a 228 sampling during 4 RTCCLK cycles */
emilmont 77:869cf507173a 229 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
emilmont 77:869cf507173a 230 sampling during 8 RTCCLK cycles */
emilmont 77:869cf507173a 231 /**
emilmont 77:869cf507173a 232 * @}
emilmont 77:869cf507173a 233 */
emilmont 77:869cf507173a 234
Kojto 99:dbbf35b96557 235 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTC Tamper TimeStamp On Tamper Detection Definitions
emilmont 77:869cf507173a 236 * @{
emilmont 77:869cf507173a 237 */
emilmont 77:869cf507173a 238 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */
emilmont 77:869cf507173a 239 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
emilmont 77:869cf507173a 240 /**
emilmont 77:869cf507173a 241 * @}
emilmont 77:869cf507173a 242 */
emilmont 77:869cf507173a 243
Kojto 99:dbbf35b96557 244 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTC Tamper Pull Up Definitions
emilmont 77:869cf507173a 245 * @{
emilmont 77:869cf507173a 246 */
emilmont 77:869cf507173a 247 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event saved */
emilmont 77:869cf507173a 248 #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */
emilmont 77:869cf507173a 249 /**
emilmont 77:869cf507173a 250 * @}
emilmont 77:869cf507173a 251 */
emilmont 77:869cf507173a 252
Kojto 99:dbbf35b96557 253 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTC Wake-up Timer Definitions
emilmont 77:869cf507173a 254 * @{
emilmont 77:869cf507173a 255 */
emilmont 77:869cf507173a 256 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
emilmont 77:869cf507173a 257 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001)
emilmont 77:869cf507173a 258 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002)
emilmont 77:869cf507173a 259 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003)
emilmont 77:869cf507173a 260 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004)
emilmont 77:869cf507173a 261 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006)
emilmont 77:869cf507173a 262 /**
emilmont 77:869cf507173a 263 * @}
emilmont 77:869cf507173a 264 */
emilmont 77:869cf507173a 265
Kojto 99:dbbf35b96557 266 /** @defgroup RTCEx_Digital_Calibration_Definitions RTC Digital Calib Definitions
emilmont 77:869cf507173a 267 * @{
emilmont 77:869cf507173a 268 */
emilmont 77:869cf507173a 269 #define RTC_CALIBSIGN_POSITIVE ((uint32_t)0x00000000)
emilmont 77:869cf507173a 270 #define RTC_CALIBSIGN_NEGATIVE ((uint32_t)0x00000080)
emilmont 77:869cf507173a 271 /**
emilmont 77:869cf507173a 272 * @}
emilmont 77:869cf507173a 273 */
emilmont 77:869cf507173a 274
Kojto 99:dbbf35b96557 275 /** @defgroup RTCEx_Smooth_calib_period_Definitions RTC Smooth Calib Period Definitions
emilmont 77:869cf507173a 276 * @{
emilmont 77:869cf507173a 277 */
Kojto 99:dbbf35b96557 278 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibration
emilmont 77:869cf507173a 279 period is 32s, else 2exp20 RTCCLK seconds */
Kojto 99:dbbf35b96557 280 #define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibration
emilmont 77:869cf507173a 281 period is 16s, else 2exp19 RTCCLK seconds */
Kojto 99:dbbf35b96557 282 #define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibration
emilmont 77:869cf507173a 283 period is 8s, else 2exp18 RTCCLK seconds */
emilmont 77:869cf507173a 284 /**
emilmont 77:869cf507173a 285 * @}
emilmont 77:869cf507173a 286 */
emilmont 77:869cf507173a 287
Kojto 99:dbbf35b96557 288 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTC Smooth Calib Plus Pulses Definitions
emilmont 77:869cf507173a 289 * @{
emilmont 77:869cf507173a 290 */
emilmont 77:869cf507173a 291 #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added
emilmont 77:869cf507173a 292 during a X -second window = Y - CALM[8:0]
emilmont 77:869cf507173a 293 with Y = 512, 256, 128 when X = 32, 16, 8 */
emilmont 77:869cf507173a 294 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
emilmont 77:869cf507173a 295 during a 32-second window = CALM[8:0] */
emilmont 77:869cf507173a 296 /**
emilmont 77:869cf507173a 297 * @}
emilmont 77:869cf507173a 298 */
emilmont 77:869cf507173a 299
Kojto 99:dbbf35b96557 300 /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions RTC Add 1 Second Parameter Definitions
emilmont 77:869cf507173a 301 * @{
emilmont 77:869cf507173a 302 */
emilmont 77:869cf507173a 303 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000)
emilmont 77:869cf507173a 304 #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000)
emilmont 77:869cf507173a 305 /**
emilmont 77:869cf507173a 306 * @}
emilmont 77:869cf507173a 307 */
emilmont 77:869cf507173a 308
emilmont 77:869cf507173a 309
Kojto 99:dbbf35b96557 310 /** @defgroup RTCEx_Calib_Output_selection_Definitions RTC Calib Output Selection Definitions
emilmont 77:869cf507173a 311 * @{
emilmont 77:869cf507173a 312 */
emilmont 77:869cf507173a 313 #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000)
emilmont 77:869cf507173a 314 #define RTC_CALIBOUTPUT_1HZ ((uint32_t)0x00080000)
emilmont 77:869cf507173a 315 /**
emilmont 77:869cf507173a 316 * @}
emilmont 77:869cf507173a 317 */
emilmont 77:869cf507173a 318
emilmont 77:869cf507173a 319 /**
emilmont 77:869cf507173a 320 * @}
emilmont 77:869cf507173a 321 */
emilmont 77:869cf507173a 322
emilmont 77:869cf507173a 323 /* Exported macro ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 324 /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros
Kojto 99:dbbf35b96557 325 * @{
Kojto 99:dbbf35b96557 326 */
Kojto 99:dbbf35b96557 327
Kojto 99:dbbf35b96557 328 /* ---------------------------------WAKEUPTIMER---------------------------------*/
Kojto 99:dbbf35b96557 329 /** @defgroup RTCEx_WakeUp_Timer RTC WakeUp Timer
Kojto 99:dbbf35b96557 330 * @{
Kojto 99:dbbf35b96557 331 */
emilmont 77:869cf507173a 332
emilmont 77:869cf507173a 333 /**
emilmont 77:869cf507173a 334 * @brief Enable the RTC WakeUp Timer peripheral.
emilmont 77:869cf507173a 335 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 336 * @retval None
emilmont 77:869cf507173a 337 */
emilmont 77:869cf507173a 338 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
emilmont 77:869cf507173a 339
emilmont 77:869cf507173a 340 /**
Kojto 99:dbbf35b96557 341 * @brief Disable the RTC Wake-up Timer peripheral.
Kojto 99:dbbf35b96557 342 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 343 * @retval None
Kojto 99:dbbf35b96557 344 */
Kojto 99:dbbf35b96557 345 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
Kojto 99:dbbf35b96557 346
Kojto 99:dbbf35b96557 347 /**
Kojto 99:dbbf35b96557 348 * @brief Enable the RTC WakeUpTimer interrupt.
Kojto 99:dbbf35b96557 349 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 350 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
Kojto 99:dbbf35b96557 351 * This parameter can be:
Kojto 99:dbbf35b96557 352 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
Kojto 99:dbbf35b96557 353 * @retval None
Kojto 99:dbbf35b96557 354 */
Kojto 99:dbbf35b96557 355 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
Kojto 99:dbbf35b96557 356
Kojto 99:dbbf35b96557 357 /**
Kojto 99:dbbf35b96557 358 * @brief Disable the RTC WakeUpTimer interrupt.
Kojto 99:dbbf35b96557 359 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 360 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
Kojto 99:dbbf35b96557 361 * This parameter can be:
Kojto 99:dbbf35b96557 362 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
Kojto 99:dbbf35b96557 363 * @retval None
Kojto 99:dbbf35b96557 364 */
Kojto 99:dbbf35b96557 365 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
Kojto 99:dbbf35b96557 366
Kojto 99:dbbf35b96557 367 /**
Kojto 99:dbbf35b96557 368 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
Kojto 99:dbbf35b96557 369 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 370 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt to check.
Kojto 99:dbbf35b96557 371 * This parameter can be:
Kojto 99:dbbf35b96557 372 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
Kojto 99:dbbf35b96557 373 * @retval None
Kojto 99:dbbf35b96557 374 */
Kojto 99:dbbf35b96557 375 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 376
Kojto 99:dbbf35b96557 377 /**
Kojto 99:dbbf35b96557 378 * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not.
Kojto 99:dbbf35b96557 379 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 380 * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check.
Kojto 99:dbbf35b96557 381 * This parameter can be:
Kojto 99:dbbf35b96557 382 * @arg RTC_IT_WUT: WakeUpTimer interrupt
Kojto 99:dbbf35b96557 383 * @retval None
Kojto 99:dbbf35b96557 384 */
Kojto 99:dbbf35b96557 385 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 99:dbbf35b96557 386
Kojto 99:dbbf35b96557 387 /**
Kojto 99:dbbf35b96557 388 * @brief Get the selected RTC WakeUpTimer's flag status.
Kojto 99:dbbf35b96557 389 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 390 * @param __FLAG__: specifies the RTC WakeUpTimer Flag to check.
Kojto 99:dbbf35b96557 391 * This parameter can be:
Kojto 99:dbbf35b96557 392 * @arg RTC_FLAG_WUTF
Kojto 99:dbbf35b96557 393 * @arg RTC_FLAG_WUTWF
Kojto 99:dbbf35b96557 394 * @retval None
Kojto 99:dbbf35b96557 395 */
Kojto 99:dbbf35b96557 396 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 397
Kojto 99:dbbf35b96557 398 /**
Kojto 99:dbbf35b96557 399 * @brief Clear the RTC Wake Up timer's pending flags.
Kojto 99:dbbf35b96557 400 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 401 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
Kojto 99:dbbf35b96557 402 * This parameter can be:
Kojto 99:dbbf35b96557 403 * @arg RTC_FLAG_WUTF
Kojto 99:dbbf35b96557 404 * @retval None
Kojto 99:dbbf35b96557 405 */
Kojto 99:dbbf35b96557 406 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 99:dbbf35b96557 407
Kojto 99:dbbf35b96557 408 /**
Kojto 99:dbbf35b96557 409 * @brief Enable 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_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 413
Kojto 99:dbbf35b96557 414 /**
Kojto 99:dbbf35b96557 415 * @brief Disable interrupt 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_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 99:dbbf35b96557 419
Kojto 99:dbbf35b96557 420 /**
Kojto 99:dbbf35b96557 421 * @brief Enable 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_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 425
Kojto 99:dbbf35b96557 426 /**
Kojto 99:dbbf35b96557 427 * @brief Disable event 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_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 99:dbbf35b96557 431
Kojto 99:dbbf35b96557 432 /**
Kojto 99:dbbf35b96557 433 * @brief Enable 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_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 437
Kojto 99:dbbf35b96557 438 /**
Kojto 99:dbbf35b96557 439 * @brief Disable falling 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_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 99:dbbf35b96557 443
Kojto 99:dbbf35b96557 444 /**
Kojto 99:dbbf35b96557 445 * @brief Enable 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_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 449
Kojto 99:dbbf35b96557 450 /**
Kojto 99:dbbf35b96557 451 * @brief Disable rising 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_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 99:dbbf35b96557 455
Kojto 99:dbbf35b96557 456 /**
Kojto 99:dbbf35b96557 457 * @brief Enable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 458 * @retval None.
Kojto 99:dbbf35b96557 459 */
Kojto 99:dbbf35b96557 460 #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 461
Kojto 99:dbbf35b96557 462 /**
Kojto 99:dbbf35b96557 463 * @brief Disable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 464 * This parameter can be:
Kojto 99:dbbf35b96557 465 * @retval None.
Kojto 99:dbbf35b96557 466 */
Kojto 99:dbbf35b96557 467 #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 468
Kojto 99:dbbf35b96557 469 /**
Kojto 99:dbbf35b96557 470 * @brief Check whether the RTC Wake-up Timer associated Exti line interrupt flag is set or not.
Kojto 99:dbbf35b96557 471 * @retval Line Status.
Kojto 99:dbbf35b96557 472 */
Kojto 99:dbbf35b96557 473 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 474
Kojto 99:dbbf35b96557 475 /**
Kojto 99:dbbf35b96557 476 * @brief Clear the RTC Wake-up Timer associated Exti line flag.
Kojto 99:dbbf35b96557 477 * @retval None.
Kojto 99:dbbf35b96557 478 */
Kojto 99:dbbf35b96557 479 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 480
Kojto 99:dbbf35b96557 481 /**
Kojto 99:dbbf35b96557 482 * @brief Generate a Software interrupt on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 483 * @retval None.
Kojto 99:dbbf35b96557 484 */
Kojto 99:dbbf35b96557 485 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 486
Kojto 99:dbbf35b96557 487 /**
Kojto 99:dbbf35b96557 488 * @}
Kojto 99:dbbf35b96557 489 */
Kojto 99:dbbf35b96557 490
Kojto 99:dbbf35b96557 491 /* ---------------------------------TIMESTAMP---------------------------------*/
Kojto 99:dbbf35b96557 492 /** @defgroup RTCEx_Timestamp RTC Timestamp
Kojto 99:dbbf35b96557 493 * @{
Kojto 99:dbbf35b96557 494 */
Kojto 99:dbbf35b96557 495
Kojto 99:dbbf35b96557 496 /**
emilmont 77:869cf507173a 497 * @brief Enable the RTC TimeStamp peripheral.
emilmont 77:869cf507173a 498 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 499 * @retval None
emilmont 77:869cf507173a 500 */
emilmont 77:869cf507173a 501 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
emilmont 77:869cf507173a 502
emilmont 77:869cf507173a 503 /**
emilmont 77:869cf507173a 504 * @brief Disable the RTC TimeStamp peripheral.
emilmont 77:869cf507173a 505 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 506 * @retval None
emilmont 77:869cf507173a 507 */
emilmont 77:869cf507173a 508 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
emilmont 77:869cf507173a 509
emilmont 77:869cf507173a 510 /**
Kojto 99:dbbf35b96557 511 * @brief Enable the RTC TimeStamp interrupt.
Kojto 99:dbbf35b96557 512 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 513 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
Kojto 99:dbbf35b96557 514 * This parameter can be:
Kojto 99:dbbf35b96557 515 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 99:dbbf35b96557 516 * @retval None
Kojto 99:dbbf35b96557 517 */
Kojto 99:dbbf35b96557 518 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
Kojto 99:dbbf35b96557 519
Kojto 99:dbbf35b96557 520 /**
Kojto 99:dbbf35b96557 521 * @brief Disable the RTC TimeStamp interrupt.
Kojto 99:dbbf35b96557 522 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 523 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
Kojto 99:dbbf35b96557 524 * This parameter can be:
Kojto 99:dbbf35b96557 525 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 99:dbbf35b96557 526 * @retval None
Kojto 99:dbbf35b96557 527 */
Kojto 99:dbbf35b96557 528 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
Kojto 99:dbbf35b96557 529
Kojto 99:dbbf35b96557 530 /**
Kojto 99:dbbf35b96557 531 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
Kojto 99:dbbf35b96557 532 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 533 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt to check.
Kojto 99:dbbf35b96557 534 * This parameter can be:
Kojto 99:dbbf35b96557 535 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 99:dbbf35b96557 536 * @retval None
Kojto 99:dbbf35b96557 537 */
Kojto 99:dbbf35b96557 538 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 539
Kojto 99:dbbf35b96557 540 /**
Kojto 99:dbbf35b96557 541 * @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not.
Kojto 99:dbbf35b96557 542 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 543 * @param __INTERRUPT__: specifies the RTC Time Stamp interrupt source to check.
Kojto 99:dbbf35b96557 544 * This parameter can be:
Kojto 99:dbbf35b96557 545 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 99:dbbf35b96557 546 * @retval None
Kojto 99:dbbf35b96557 547 */
Kojto 99:dbbf35b96557 548 #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 99:dbbf35b96557 549
Kojto 99:dbbf35b96557 550 /**
Kojto 99:dbbf35b96557 551 * @brief Get the selected RTC TimeStamp's flag status.
Kojto 99:dbbf35b96557 552 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 553 * @param __FLAG__: specifies the RTC TimeStamp flag to check.
Kojto 99:dbbf35b96557 554 * This parameter can be:
Kojto 99:dbbf35b96557 555 * @arg RTC_FLAG_TSF
Kojto 99:dbbf35b96557 556 * @arg RTC_FLAG_TSOVF
Kojto 99:dbbf35b96557 557 * @retval None
Kojto 99:dbbf35b96557 558 */
Kojto 99:dbbf35b96557 559 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 560
Kojto 99:dbbf35b96557 561 /**
Kojto 99:dbbf35b96557 562 * @brief Clear the RTC Time Stamp's pending flags.
Kojto 99:dbbf35b96557 563 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 564 * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
Kojto 99:dbbf35b96557 565 * This parameter can be:
Kojto 99:dbbf35b96557 566 * @arg RTC_FLAG_TSF
Kojto 99:dbbf35b96557 567 * @retval None
Kojto 99:dbbf35b96557 568 */
Kojto 99:dbbf35b96557 569 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 99:dbbf35b96557 570
Kojto 99:dbbf35b96557 571 /**
Kojto 99:dbbf35b96557 572 * @}
Kojto 99:dbbf35b96557 573 */
Kojto 99:dbbf35b96557 574
Kojto 99:dbbf35b96557 575 /* ---------------------------------TAMPER------------------------------------*/
Kojto 99:dbbf35b96557 576 /** @defgroup RTCEx_Tamper RTC Tamper
Kojto 99:dbbf35b96557 577 * @{
Kojto 99:dbbf35b96557 578 */
Kojto 99:dbbf35b96557 579
Kojto 99:dbbf35b96557 580 /**
Kojto 99:dbbf35b96557 581 * @brief Enable the RTC Tamper1 input detection.
Kojto 99:dbbf35b96557 582 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 583 * @retval None
Kojto 99:dbbf35b96557 584 */
Kojto 99:dbbf35b96557 585 #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP1E))
Kojto 99:dbbf35b96557 586
Kojto 99:dbbf35b96557 587 /**
Kojto 99:dbbf35b96557 588 * @brief Disable the RTC Tamper1 input detection.
Kojto 99:dbbf35b96557 589 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 590 * @retval None
Kojto 99:dbbf35b96557 591 */
Kojto 99:dbbf35b96557 592 #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP1E))
Kojto 99:dbbf35b96557 593
Kojto 99:dbbf35b96557 594 /**
Kojto 99:dbbf35b96557 595 * @brief Enable the RTC Tamper2 input detection.
Kojto 99:dbbf35b96557 596 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 597 * @retval None
Kojto 99:dbbf35b96557 598 */
Kojto 99:dbbf35b96557 599 #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP2E))
Kojto 99:dbbf35b96557 600
Kojto 99:dbbf35b96557 601 /**
Kojto 99:dbbf35b96557 602 * @brief Disable the RTC Tamper2 input detection.
Kojto 99:dbbf35b96557 603 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 604 * @retval None
Kojto 99:dbbf35b96557 605 */
Kojto 99:dbbf35b96557 606 #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP2E))
Kojto 99:dbbf35b96557 607
Kojto 99:dbbf35b96557 608 /**
Kojto 99:dbbf35b96557 609 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
Kojto 99:dbbf35b96557 610 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 611 * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check.
Kojto 99:dbbf35b96557 612 * This parameter can be:
Kojto 99:dbbf35b96557 613 * @arg RTC_IT_TAMP1
Kojto 99:dbbf35b96557 614 * @arg RTC_IT_TAMP2
Kojto 99:dbbf35b96557 615 * @retval None
Kojto 99:dbbf35b96557 616 */
Kojto 99:dbbf35b96557 617 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 618
Kojto 99:dbbf35b96557 619 /**
Kojto 99:dbbf35b96557 620 * @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
Kojto 99:dbbf35b96557 621 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 622 * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check.
Kojto 99:dbbf35b96557 623 * This parameter can be:
Kojto 99:dbbf35b96557 624 * @arg RTC_IT_TAMP: Tamper interrupt
Kojto 99:dbbf35b96557 625 * @retval None
Kojto 99:dbbf35b96557 626 */
Kojto 99:dbbf35b96557 627 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAFCR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 99:dbbf35b96557 628
Kojto 99:dbbf35b96557 629 /**
Kojto 99:dbbf35b96557 630 * @brief Get the selected RTC Tamper's flag status.
Kojto 99:dbbf35b96557 631 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 632 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
Kojto 99:dbbf35b96557 633 * This parameter can be:
Kojto 99:dbbf35b96557 634 * @arg RTC_FLAG_TAMP1F
Kojto 99:dbbf35b96557 635 * @arg RTC_FLAG_TAMP2F
Kojto 99:dbbf35b96557 636 * @retval None
Kojto 99:dbbf35b96557 637 */
Kojto 99:dbbf35b96557 638 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 639
Kojto 99:dbbf35b96557 640 /**
Kojto 99:dbbf35b96557 641 * @brief Clear the RTC Tamper's pending flags.
Kojto 99:dbbf35b96557 642 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 643 * @param __FLAG__: specifies the RTC Tamper Flag to clear.
Kojto 99:dbbf35b96557 644 * This parameter can be:
Kojto 99:dbbf35b96557 645 * @arg RTC_FLAG_TAMP1F
Kojto 99:dbbf35b96557 646 * @arg RTC_FLAG_TAMP2F
Kojto 99:dbbf35b96557 647 * @retval None
Kojto 99:dbbf35b96557 648 */
Kojto 99:dbbf35b96557 649 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 99:dbbf35b96557 650 /**
Kojto 99:dbbf35b96557 651 * @}
Kojto 99:dbbf35b96557 652 */
Kojto 99:dbbf35b96557 653
Kojto 99:dbbf35b96557 654 /* --------------------------TAMPER/TIMESTAMP---------------------------------*/
Kojto 99:dbbf35b96557 655 /** @defgroup RTCEx_Tamper_Timestamp EXTI RTC Tamper Timestamp EXTI
Kojto 99:dbbf35b96557 656 * @{
Kojto 99:dbbf35b96557 657 */
Kojto 99:dbbf35b96557 658
Kojto 99:dbbf35b96557 659 /**
Kojto 99:dbbf35b96557 660 * @brief Enable 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_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 664
Kojto 99:dbbf35b96557 665 /**
Kojto 99:dbbf35b96557 666 * @brief Disable interrupt 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_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 99:dbbf35b96557 670
Kojto 99:dbbf35b96557 671 /**
Kojto 99:dbbf35b96557 672 * @brief Enable 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_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 676
Kojto 99:dbbf35b96557 677 /**
Kojto 99:dbbf35b96557 678 * @brief Disable event 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_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 99:dbbf35b96557 682
Kojto 99:dbbf35b96557 683 /**
Kojto 99:dbbf35b96557 684 * @brief Enable 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_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 688
Kojto 99:dbbf35b96557 689 /**
Kojto 99:dbbf35b96557 690 * @brief Disable falling 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_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 99:dbbf35b96557 694
Kojto 99:dbbf35b96557 695 /**
Kojto 99:dbbf35b96557 696 * @brief Enable 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_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 700
Kojto 99:dbbf35b96557 701 /**
Kojto 99:dbbf35b96557 702 * @brief Disable rising 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_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 99:dbbf35b96557 706
Kojto 99:dbbf35b96557 707 /**
Kojto 99:dbbf35b96557 708 * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 709 * @retval None.
Kojto 99:dbbf35b96557 710 */
Kojto 99:dbbf35b96557 711 #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 712
Kojto 99:dbbf35b96557 713 /**
Kojto 99:dbbf35b96557 714 * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 715 * This parameter can be:
Kojto 99:dbbf35b96557 716 * @retval None.
Kojto 99:dbbf35b96557 717 */
Kojto 99:dbbf35b96557 718 #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 719
Kojto 99:dbbf35b96557 720 /**
Kojto 99:dbbf35b96557 721 * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not.
Kojto 99:dbbf35b96557 722 * @retval Line Status.
Kojto 99:dbbf35b96557 723 */
Kojto 99:dbbf35b96557 724 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 725
Kojto 99:dbbf35b96557 726 /**
Kojto 99:dbbf35b96557 727 * @brief Clear the RTC Tamper and Timestamp associated Exti line flag.
Kojto 99:dbbf35b96557 728 * @retval None.
Kojto 99:dbbf35b96557 729 */
Kojto 99:dbbf35b96557 730 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 731
Kojto 99:dbbf35b96557 732 /**
Kojto 99:dbbf35b96557 733 * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line
Kojto 99:dbbf35b96557 734 * @retval None.
Kojto 99:dbbf35b96557 735 */
Kojto 99:dbbf35b96557 736 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 737 /**
Kojto 99:dbbf35b96557 738 * @}
Kojto 99:dbbf35b96557 739 */
Kojto 99:dbbf35b96557 740
Kojto 99:dbbf35b96557 741 /* ------------------------------Calibration----------------------------------*/
Kojto 99:dbbf35b96557 742 /** @defgroup RTCEx_Calibration RTC Calibration
Kojto 99:dbbf35b96557 743 * @{
Kojto 99:dbbf35b96557 744 */
Kojto 99:dbbf35b96557 745
Kojto 99:dbbf35b96557 746 /**
emilmont 77:869cf507173a 747 * @brief Enable the Coarse calibration process.
emilmont 77:869cf507173a 748 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 749 * @retval None
emilmont 77:869cf507173a 750 */
emilmont 77:869cf507173a 751 #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE))
emilmont 77:869cf507173a 752
emilmont 77:869cf507173a 753 /**
emilmont 77:869cf507173a 754 * @brief Disable the Coarse calibration process.
emilmont 77:869cf507173a 755 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 756 * @retval None
emilmont 77:869cf507173a 757 */
emilmont 77:869cf507173a 758 #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE))
emilmont 77:869cf507173a 759
emilmont 77:869cf507173a 760 /**
emilmont 77:869cf507173a 761 * @brief Enable the RTC calibration output.
emilmont 77:869cf507173a 762 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 763 * @retval None
emilmont 77:869cf507173a 764 */
emilmont 77:869cf507173a 765 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
emilmont 77:869cf507173a 766
emilmont 77:869cf507173a 767 /**
emilmont 77:869cf507173a 768 * @brief Disable the calibration output.
emilmont 77:869cf507173a 769 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 770 * @retval None
emilmont 77:869cf507173a 771 */
emilmont 77:869cf507173a 772 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
emilmont 77:869cf507173a 773
emilmont 77:869cf507173a 774 /**
emilmont 77:869cf507173a 775 * @brief Enable the clock reference detection.
emilmont 77:869cf507173a 776 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 777 * @retval None
emilmont 77:869cf507173a 778 */
emilmont 77:869cf507173a 779 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
emilmont 77:869cf507173a 780
emilmont 77:869cf507173a 781 /**
emilmont 77:869cf507173a 782 * @brief Disable the clock reference detection.
emilmont 77:869cf507173a 783 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 784 * @retval None
emilmont 77:869cf507173a 785 */
emilmont 77:869cf507173a 786 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
emilmont 77:869cf507173a 787
emilmont 77:869cf507173a 788 /**
emilmont 77:869cf507173a 789 * @brief Get the selected RTC shift operation's flag status.
emilmont 77:869cf507173a 790 * @param __HANDLE__: specifies the RTC handle.
emilmont 77:869cf507173a 791 * @param __FLAG__: specifies the RTC shift operation Flag is pending or not.
emilmont 77:869cf507173a 792 * This parameter can be:
emilmont 77:869cf507173a 793 * @arg RTC_FLAG_SHPF
emilmont 77:869cf507173a 794 * @retval None
emilmont 77:869cf507173a 795 */
emilmont 77:869cf507173a 796 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
emilmont 77:869cf507173a 797 /**
Kojto 99:dbbf35b96557 798 * @}
emilmont 77:869cf507173a 799 */
emilmont 77:869cf507173a 800
emilmont 77:869cf507173a 801 /**
Kojto 99:dbbf35b96557 802 * @}
emilmont 77:869cf507173a 803 */
emilmont 77:869cf507173a 804
emilmont 77:869cf507173a 805 /* Exported functions --------------------------------------------------------*/
Kojto 99:dbbf35b96557 806 /** @defgroup RTCEx_Exported_Functions RTCEx Exported Functions
Kojto 99:dbbf35b96557 807 * @{
Kojto 99:dbbf35b96557 808 */
emilmont 77:869cf507173a 809
Kojto 99:dbbf35b96557 810 /** @addtogroup RTCEx_Exported_Functions_Group1
Kojto 99:dbbf35b96557 811 * @{
Kojto 99:dbbf35b96557 812 */
emilmont 77:869cf507173a 813 /* RTC TimeStamp and Tamper functions *****************************************/
emilmont 77:869cf507173a 814 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
emilmont 77:869cf507173a 815 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
emilmont 77:869cf507173a 816 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 817 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
emilmont 77:869cf507173a 818
emilmont 77:869cf507173a 819 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
emilmont 77:869cf507173a 820 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
emilmont 77:869cf507173a 821 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
Kojto 99:dbbf35b96557 822 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 823
Kojto 99:dbbf35b96557 824 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 825 void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 826 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 827 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
emilmont 77:869cf507173a 828 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
emilmont 77:869cf507173a 829 HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 99:dbbf35b96557 830 /**
Kojto 99:dbbf35b96557 831 * @}
Kojto 99:dbbf35b96557 832 */
emilmont 77:869cf507173a 833
Kojto 99:dbbf35b96557 834 /** @addtogroup RTCEx_Exported_Functions_Group2
Kojto 99:dbbf35b96557 835 * @{
Kojto 99:dbbf35b96557 836 */
emilmont 77:869cf507173a 837 /* RTC Wake-up functions ******************************************************/
emilmont 77:869cf507173a 838 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
emilmont 77:869cf507173a 839 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
Kojto 99:dbbf35b96557 840 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 841 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 842 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 843 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 844 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 99:dbbf35b96557 845 /**
Kojto 99:dbbf35b96557 846 * @}
Kojto 99:dbbf35b96557 847 */
emilmont 77:869cf507173a 848
Kojto 99:dbbf35b96557 849 /** @addtogroup RTCEx_Exported_Functions_Group3
Kojto 99:dbbf35b96557 850 * @{
Kojto 99:dbbf35b96557 851 */
emilmont 77:869cf507173a 852 /* Extension Control functions ************************************************/
Kojto 99:dbbf35b96557 853 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
Kojto 99:dbbf35b96557 854 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
emilmont 77:869cf507173a 855
emilmont 77:869cf507173a 856 HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value);
emilmont 77:869cf507173a 857 HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 858 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue);
emilmont 77:869cf507173a 859 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
emilmont 77:869cf507173a 860 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
emilmont 77:869cf507173a 861 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 862 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 863 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 864 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 865 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 866 /**
Kojto 99:dbbf35b96557 867 * @}
Kojto 99:dbbf35b96557 868 */
emilmont 77:869cf507173a 869
Kojto 99:dbbf35b96557 870 /** @addtogroup RTCEx_Exported_Functions_Group4
Kojto 99:dbbf35b96557 871 * @{
Kojto 99:dbbf35b96557 872 */
emilmont 77:869cf507173a 873 /* Extension RTC features functions *******************************************/
Kojto 99:dbbf35b96557 874 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
emilmont 77:869cf507173a 875 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 99:dbbf35b96557 876 /**
Kojto 99:dbbf35b96557 877 * @}
Kojto 99:dbbf35b96557 878 */
emilmont 77:869cf507173a 879
Kojto 99:dbbf35b96557 880 /**
Kojto 99:dbbf35b96557 881 * @}
Kojto 99:dbbf35b96557 882 */
Kojto 99:dbbf35b96557 883
Kojto 99:dbbf35b96557 884 /* Private types -------------------------------------------------------------*/
Kojto 99:dbbf35b96557 885 /* Private variables ---------------------------------------------------------*/
Kojto 99:dbbf35b96557 886 /* Private constants ---------------------------------------------------------*/
Kojto 99:dbbf35b96557 887 /** @defgroup RTCEx_Private_Constants RTCEx Private Constants
Kojto 99:dbbf35b96557 888 * @{
Kojto 99:dbbf35b96557 889 */
Kojto 99:dbbf35b96557 890 #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 891 #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 892 /**
Kojto 99:dbbf35b96557 893 * @}
Kojto 99:dbbf35b96557 894 */
Kojto 99:dbbf35b96557 895
Kojto 99:dbbf35b96557 896 /* Private macros ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 897 /** @defgroup RTCEx_Private_Macros RTCEx Private Macros
Kojto 99:dbbf35b96557 898 * @{
Kojto 99:dbbf35b96557 899 */
Kojto 99:dbbf35b96557 900
Kojto 99:dbbf35b96557 901 /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters
Kojto 99:dbbf35b96557 902 * @{
Kojto 99:dbbf35b96557 903 */
Kojto 99:dbbf35b96557 904 #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
Kojto 99:dbbf35b96557 905 ((BKP) == RTC_BKP_DR1) || \
Kojto 99:dbbf35b96557 906 ((BKP) == RTC_BKP_DR2) || \
Kojto 99:dbbf35b96557 907 ((BKP) == RTC_BKP_DR3) || \
Kojto 99:dbbf35b96557 908 ((BKP) == RTC_BKP_DR4) || \
Kojto 99:dbbf35b96557 909 ((BKP) == RTC_BKP_DR5) || \
Kojto 99:dbbf35b96557 910 ((BKP) == RTC_BKP_DR6) || \
Kojto 99:dbbf35b96557 911 ((BKP) == RTC_BKP_DR7) || \
Kojto 99:dbbf35b96557 912 ((BKP) == RTC_BKP_DR8) || \
Kojto 99:dbbf35b96557 913 ((BKP) == RTC_BKP_DR9) || \
Kojto 99:dbbf35b96557 914 ((BKP) == RTC_BKP_DR10) || \
Kojto 99:dbbf35b96557 915 ((BKP) == RTC_BKP_DR11) || \
Kojto 99:dbbf35b96557 916 ((BKP) == RTC_BKP_DR12) || \
Kojto 99:dbbf35b96557 917 ((BKP) == RTC_BKP_DR13) || \
Kojto 99:dbbf35b96557 918 ((BKP) == RTC_BKP_DR14) || \
Kojto 99:dbbf35b96557 919 ((BKP) == RTC_BKP_DR15) || \
Kojto 99:dbbf35b96557 920 ((BKP) == RTC_BKP_DR16) || \
Kojto 99:dbbf35b96557 921 ((BKP) == RTC_BKP_DR17) || \
Kojto 99:dbbf35b96557 922 ((BKP) == RTC_BKP_DR18) || \
Kojto 99:dbbf35b96557 923 ((BKP) == RTC_BKP_DR19))
Kojto 99:dbbf35b96557 924 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
Kojto 99:dbbf35b96557 925 ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
Kojto 99:dbbf35b96557 926 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFF6) == 0x00) && ((TAMPER) != (uint32_t)RESET))
Kojto 99:dbbf35b96557 927
Kojto 99:dbbf35b96557 928 #if defined (STM32F446xx)
Kojto 99:dbbf35b96557 929 #define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_PC13) || \
Kojto 99:dbbf35b96557 930 ((PIN) == RTC_TAMPERPIN_PA0))
Kojto 99:dbbf35b96557 931 #else
Kojto 99:dbbf35b96557 932 #define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_PC13) || \
Kojto 99:dbbf35b96557 933 ((PIN) == RTC_TAMPERPIN_PI8))
Kojto 99:dbbf35b96557 934 #endif /* STM32F446xx */
Kojto 99:dbbf35b96557 935
Kojto 99:dbbf35b96557 936 #if defined (STM32F446xx)
Kojto 99:dbbf35b96557 937 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_PC13) || \
Kojto 99:dbbf35b96557 938 ((PIN) == RTC_TIMESTAMPPIN_PA0))
Kojto 99:dbbf35b96557 939 #else
Kojto 99:dbbf35b96557 940 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_PC13) || \
Kojto 99:dbbf35b96557 941 ((PIN) == RTC_TIMESTAMPPIN_PI8))
Kojto 99:dbbf35b96557 942 #endif /* STM32F446xx */
Kojto 99:dbbf35b96557 943 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
Kojto 99:dbbf35b96557 944 ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
Kojto 99:dbbf35b96557 945 ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
Kojto 99:dbbf35b96557 946 ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))
Kojto 99:dbbf35b96557 947 #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \
Kojto 99:dbbf35b96557 948 ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \
Kojto 99:dbbf35b96557 949 ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \
Kojto 99:dbbf35b96557 950 ((FILTER) == RTC_TAMPERFILTER_8SAMPLE))
Kojto 99:dbbf35b96557 951 #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
Kojto 99:dbbf35b96557 952 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
Kojto 99:dbbf35b96557 953 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
Kojto 99:dbbf35b96557 954 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
Kojto 99:dbbf35b96557 955 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
Kojto 99:dbbf35b96557 956 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
Kojto 99:dbbf35b96557 957 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
Kojto 99:dbbf35b96557 958 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
Kojto 99:dbbf35b96557 959 #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
Kojto 99:dbbf35b96557 960 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
Kojto 99:dbbf35b96557 961 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
Kojto 99:dbbf35b96557 962 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
Kojto 99:dbbf35b96557 963 #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
Kojto 99:dbbf35b96557 964 ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
Kojto 99:dbbf35b96557 965 #define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \
Kojto 99:dbbf35b96557 966 ((STATE) == RTC_TAMPER_PULLUP_DISABLE))
Kojto 99:dbbf35b96557 967 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
Kojto 99:dbbf35b96557 968 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
Kojto 99:dbbf35b96557 969 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
Kojto 99:dbbf35b96557 970 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
Kojto 99:dbbf35b96557 971 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
Kojto 99:dbbf35b96557 972 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
Kojto 99:dbbf35b96557 973
Kojto 99:dbbf35b96557 974 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
Kojto 99:dbbf35b96557 975 #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \
Kojto 99:dbbf35b96557 976 ((SIGN) == RTC_CALIBSIGN_NEGATIVE))
Kojto 99:dbbf35b96557 977
Kojto 99:dbbf35b96557 978 #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20)
Kojto 99:dbbf35b96557 979
Kojto 99:dbbf35b96557 980 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
Kojto 99:dbbf35b96557 981 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
Kojto 99:dbbf35b96557 982 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC))
Kojto 99:dbbf35b96557 983 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
Kojto 99:dbbf35b96557 984 ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
Kojto 99:dbbf35b96557 985
Kojto 99:dbbf35b96557 986
Kojto 99:dbbf35b96557 987 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF)
Kojto 99:dbbf35b96557 988 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \
Kojto 99:dbbf35b96557 989 ((SEL) == RTC_SHIFTADD1S_SET))
Kojto 99:dbbf35b96557 990 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF)
Kojto 99:dbbf35b96557 991 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \
Kojto 99:dbbf35b96557 992 ((OUTPUT) == RTC_CALIBOUTPUT_1HZ))
Kojto 99:dbbf35b96557 993 /**
Kojto 99:dbbf35b96557 994 * @}
Kojto 99:dbbf35b96557 995 */
Kojto 99:dbbf35b96557 996
Kojto 99:dbbf35b96557 997 /**
Kojto 99:dbbf35b96557 998 * @}
Kojto 99:dbbf35b96557 999 */
emilmont 77:869cf507173a 1000
emilmont 77:869cf507173a 1001 /**
emilmont 77:869cf507173a 1002 * @}
emilmont 77:869cf507173a 1003 */
emilmont 77:869cf507173a 1004
emilmont 77:869cf507173a 1005 /**
emilmont 77:869cf507173a 1006 * @}
emilmont 77:869cf507173a 1007 */
emilmont 77:869cf507173a 1008
emilmont 77:869cf507173a 1009 #ifdef __cplusplus
emilmont 77:869cf507173a 1010 }
emilmont 77:869cf507173a 1011 #endif
emilmont 77:869cf507173a 1012
emilmont 77:869cf507173a 1013 #endif /* __STM32F4xx_HAL_RTC_EX_H */
emilmont 77:869cf507173a 1014
emilmont 77:869cf507173a 1015 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/