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:
Mon Sep 28 10:45:10 2015 +0100
Revision:
630:825f75ca301e
Parent:
441:d2c15dda23c1
Synchronized with git revision 54fbe4144faf309c37205a5d39fa665daa919f10

Full URL: https://github.com/mbedmicro/mbed/commit/54fbe4144faf309c37205a5d39fa665daa919f10/

NUCLEO_F031K6 : Add new target

Who changed what in which revision?

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