mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Jul 02 16:30:08 2015 +0100
Revision:
581:39197bcd20f2
Parent:
532:fe11edbda85c
Child:
613:bc40b8d2aec4
Synchronized with git revision ae2d3cdffe70184eb8736d94f76c45c93f4b7724

Full URL: https://github.com/mbedmicro/mbed/commit/ae2d3cdffe70184eb8736d94f76c45c93f4b7724/

Make it possible to build the core mbed library with yotta

Who changed what in which revision?

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