lzbp li / mbed-stm32l0l1-src-1

Fork of mbed-stm32l0/l1-src by lzbp li

Committer:
mbed_official
Date:
Fri Oct 31 11:00:10 2014 +0000
Revision:
376:cb4d9db17537
Synchronized with git revision 07b49da75eac883fc8916d3d6b6962664b8db29e

Full URL: https://github.com/mbedmicro/mbed/commit/07b49da75eac883fc8916d3d6b6962664b8db29e/

Targets: DISCO_L053C8 - new platform - STM32L0 Discovery board

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 376:cb4d9db17537 1 /**
mbed_official 376:cb4d9db17537 2 ******************************************************************************
mbed_official 376:cb4d9db17537 3 * @file stm32l0xx_hal_rtc_ex.h
mbed_official 376:cb4d9db17537 4 * @author MCD Application Team
mbed_official 376:cb4d9db17537 5 * @version V1.1.0
mbed_official 376:cb4d9db17537 6 * @date 18-June-2014
mbed_official 376:cb4d9db17537 7 * @brief Header file of PWR HAL Extension module.
mbed_official 376:cb4d9db17537 8 ******************************************************************************
mbed_official 376:cb4d9db17537 9 * @attention
mbed_official 376:cb4d9db17537 10 *
mbed_official 376:cb4d9db17537 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 376:cb4d9db17537 12 *
mbed_official 376:cb4d9db17537 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 376:cb4d9db17537 14 * are permitted provided that the following conditions are met:
mbed_official 376:cb4d9db17537 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 376:cb4d9db17537 16 * this list of conditions and the following disclaimer.
mbed_official 376:cb4d9db17537 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 376:cb4d9db17537 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 376:cb4d9db17537 19 * and/or other materials provided with the distribution.
mbed_official 376:cb4d9db17537 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 376:cb4d9db17537 21 * may be used to endorse or promote products derived from this software
mbed_official 376:cb4d9db17537 22 * without specific prior written permission.
mbed_official 376:cb4d9db17537 23 *
mbed_official 376:cb4d9db17537 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 376:cb4d9db17537 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 376:cb4d9db17537 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 376:cb4d9db17537 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 376:cb4d9db17537 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 376:cb4d9db17537 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 376:cb4d9db17537 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 376:cb4d9db17537 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 376:cb4d9db17537 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 376:cb4d9db17537 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 376:cb4d9db17537 34 *
mbed_official 376:cb4d9db17537 35 ******************************************************************************
mbed_official 376:cb4d9db17537 36 */
mbed_official 376:cb4d9db17537 37
mbed_official 376:cb4d9db17537 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 376:cb4d9db17537 39 #ifndef __STM32L0xx_HAL_RTC_EX_H
mbed_official 376:cb4d9db17537 40 #define __STM32L0xx_HAL_RTC_EX_H
mbed_official 376:cb4d9db17537 41
mbed_official 376:cb4d9db17537 42 #ifdef __cplusplus
mbed_official 376:cb4d9db17537 43 extern "C" {
mbed_official 376:cb4d9db17537 44 #endif
mbed_official 376:cb4d9db17537 45
mbed_official 376:cb4d9db17537 46 /* Includes ------------------------------------------------------------------*/
mbed_official 376:cb4d9db17537 47 #include "stm32l0xx_hal_def.h"
mbed_official 376:cb4d9db17537 48
mbed_official 376:cb4d9db17537 49 /** @addtogroup STM32L0xx_HAL_Driver
mbed_official 376:cb4d9db17537 50 * @{
mbed_official 376:cb4d9db17537 51 */
mbed_official 376:cb4d9db17537 52
mbed_official 376:cb4d9db17537 53 /** @addtogroup RTCEx
mbed_official 376:cb4d9db17537 54 * @{
mbed_official 376:cb4d9db17537 55 */
mbed_official 376:cb4d9db17537 56
mbed_official 376:cb4d9db17537 57 /* Exported types ------------------------------------------------------------*/
mbed_official 376:cb4d9db17537 58
mbed_official 376:cb4d9db17537 59 /**
mbed_official 376:cb4d9db17537 60 * @brief RTC Tamper structure definition
mbed_official 376:cb4d9db17537 61 */
mbed_official 376:cb4d9db17537 62 typedef struct
mbed_official 376:cb4d9db17537 63 {
mbed_official 376:cb4d9db17537 64 uint32_t Tamper; /*!< Specifies the Tamper Pin.
mbed_official 376:cb4d9db17537 65 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
mbed_official 376:cb4d9db17537 66
mbed_official 376:cb4d9db17537 67 uint32_t Interrupt; /*!< Specifies the Tamper Interrupt.
mbed_official 376:cb4d9db17537 68 This parameter can be a value of @ref RTCEx_Tamper_Interrupt_Definitions */
mbed_official 376:cb4d9db17537 69
mbed_official 376:cb4d9db17537 70 uint32_t Trigger; /*!< Specifies the Tamper Trigger.
mbed_official 376:cb4d9db17537 71 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
mbed_official 376:cb4d9db17537 72
mbed_official 376:cb4d9db17537 73 uint32_t NoErase; /*!< Specifies the Tamper no erase mode.
mbed_official 376:cb4d9db17537 74 This parameter can be a value of @ref RTCEx_Tamper_EraseBackUp_Definitions */
mbed_official 376:cb4d9db17537 75
mbed_official 376:cb4d9db17537 76 uint32_t MaskFlag; /*!< Specifies the Tamper Flag masking.
mbed_official 376:cb4d9db17537 77 This parameter can be a value of @ref RTCEx_Tamper_MaskFlag_Definitions */
mbed_official 376:cb4d9db17537 78
mbed_official 376:cb4d9db17537 79 uint32_t Filter; /*!< Specifies the RTC Filter Tamper.
mbed_official 376:cb4d9db17537 80 This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */
mbed_official 376:cb4d9db17537 81
mbed_official 376:cb4d9db17537 82 uint32_t SamplingFrequency; /*!< Specifies the sampling frequency.
mbed_official 376:cb4d9db17537 83 This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */
mbed_official 376:cb4d9db17537 84
mbed_official 376:cb4d9db17537 85 uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration .
mbed_official 376:cb4d9db17537 86 This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */
mbed_official 376:cb4d9db17537 87
mbed_official 376:cb4d9db17537 88 uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp .
mbed_official 376:cb4d9db17537 89 This parameter can be a value of @ref RTCEx_Tamper_PullUP_Definitions */
mbed_official 376:cb4d9db17537 90
mbed_official 376:cb4d9db17537 91 uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection.
mbed_official 376:cb4d9db17537 92 This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */
mbed_official 376:cb4d9db17537 93 }RTC_TamperTypeDef;
mbed_official 376:cb4d9db17537 94
mbed_official 376:cb4d9db17537 95 /* Exported constants --------------------------------------------------------*/
mbed_official 376:cb4d9db17537 96 /** @defgroup RTCEx_Exported_Constants
mbed_official 376:cb4d9db17537 97 * @{
mbed_official 376:cb4d9db17537 98 */
mbed_official 376:cb4d9db17537 99
mbed_official 376:cb4d9db17537 100 /** @defgroup RTCEx_Backup_Registers_Definitions
mbed_official 376:cb4d9db17537 101 * @{
mbed_official 376:cb4d9db17537 102 */
mbed_official 376:cb4d9db17537 103 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 104 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
mbed_official 376:cb4d9db17537 105 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
mbed_official 376:cb4d9db17537 106 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
mbed_official 376:cb4d9db17537 107 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
mbed_official 376:cb4d9db17537 108
mbed_official 376:cb4d9db17537 109 #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
mbed_official 376:cb4d9db17537 110 ((BKP) == RTC_BKP_DR1) || \
mbed_official 376:cb4d9db17537 111 ((BKP) == RTC_BKP_DR2) || \
mbed_official 376:cb4d9db17537 112 ((BKP) == RTC_BKP_DR3) || \
mbed_official 376:cb4d9db17537 113 ((BKP) == RTC_BKP_DR4))
mbed_official 376:cb4d9db17537 114 /**
mbed_official 376:cb4d9db17537 115 * @}
mbed_official 376:cb4d9db17537 116 */
mbed_official 376:cb4d9db17537 117
mbed_official 376:cb4d9db17537 118 /** @defgroup RTCEx_Time_Stamp_Edges_definitions
mbed_official 376:cb4d9db17537 119 * @{
mbed_official 376:cb4d9db17537 120 */
mbed_official 376:cb4d9db17537 121 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 122 #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008)
mbed_official 376:cb4d9db17537 123
mbed_official 376:cb4d9db17537 124 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
mbed_official 376:cb4d9db17537 125 ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
mbed_official 376:cb4d9db17537 126 /**
mbed_official 376:cb4d9db17537 127 * @}
mbed_official 376:cb4d9db17537 128 */
mbed_official 376:cb4d9db17537 129
mbed_official 376:cb4d9db17537 130 /** @defgroup RTCEx_Tamper_Pins_Definitions
mbed_official 376:cb4d9db17537 131 * @{
mbed_official 376:cb4d9db17537 132 */
mbed_official 376:cb4d9db17537 133 #define RTC_TAMPER_1 RTC_TAMPCR_TAMP1E
mbed_official 376:cb4d9db17537 134 #define RTC_TAMPER_2 RTC_TAMPCR_TAMP2E
mbed_official 376:cb4d9db17537 135
mbed_official 376:cb4d9db17537 136 #define IS_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFF6) == 0x00) && ((TAMPER) != (uint32_t)RESET))
mbed_official 376:cb4d9db17537 137 /**
mbed_official 376:cb4d9db17537 138 * @}
mbed_official 376:cb4d9db17537 139 */
mbed_official 376:cb4d9db17537 140
mbed_official 376:cb4d9db17537 141 /** @defgroup RTCEx_Tamper_Interrupt_Definitions
mbed_official 376:cb4d9db17537 142 * @{
mbed_official 376:cb4d9db17537 143 */
mbed_official 376:cb4d9db17537 144 #define RTC_TAMPER1_INTERRUPT RTC_TAMPCR_TAMP1IE
mbed_official 376:cb4d9db17537 145 #define RTC_TAMPER2_INTERRUPT RTC_TAMPCR_TAMP2IE
mbed_official 376:cb4d9db17537 146 #define RTC_TAMPER1_2_INTERRUPT RTC_TAMPCR_TAMPIE
mbed_official 376:cb4d9db17537 147
mbed_official 376:cb4d9db17537 148 #define IS_TAMPER_INTERRUPT(INTERRUPT) (((INTERRUPT) == RTC_TAMPER1_INTERRUPT) || \
mbed_official 376:cb4d9db17537 149 ((INTERRUPT) == RTC_TAMPER2_INTERRUPT) || \
mbed_official 376:cb4d9db17537 150 ((INTERRUPT) == RTC_TAMPER1_2_INTERRUPT))
mbed_official 376:cb4d9db17537 151 /**
mbed_official 376:cb4d9db17537 152 * @}
mbed_official 376:cb4d9db17537 153 */
mbed_official 376:cb4d9db17537 154
mbed_official 376:cb4d9db17537 155 /** @defgroup RTCEx_TimeStamp_Pin_Selection
mbed_official 376:cb4d9db17537 156 * @{
mbed_official 376:cb4d9db17537 157 */
mbed_official 376:cb4d9db17537 158 #define RTC_TIMESTAMPPIN_PC13 ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 159
mbed_official 376:cb4d9db17537 160 #define IS_RTC_TIMESTAMP_PIN(PIN) ((PIN) == RTC_TIMESTAMPPIN_PC13)
mbed_official 376:cb4d9db17537 161 /**
mbed_official 376:cb4d9db17537 162 * @}
mbed_official 376:cb4d9db17537 163 */
mbed_official 376:cb4d9db17537 164
mbed_official 376:cb4d9db17537 165 /** @defgroup RTCEx_Tamper_Trigger_Definitions
mbed_official 376:cb4d9db17537 166 * @{
mbed_official 376:cb4d9db17537 167 */
mbed_official 376:cb4d9db17537 168 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 169 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002)
mbed_official 376:cb4d9db17537 170 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
mbed_official 376:cb4d9db17537 171 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
mbed_official 376:cb4d9db17537 172
mbed_official 376:cb4d9db17537 173 #define IS_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
mbed_official 376:cb4d9db17537 174 ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
mbed_official 376:cb4d9db17537 175 ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
mbed_official 376:cb4d9db17537 176 ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))
mbed_official 376:cb4d9db17537 177
mbed_official 376:cb4d9db17537 178 /**
mbed_official 376:cb4d9db17537 179 * @}
mbed_official 376:cb4d9db17537 180 */
mbed_official 376:cb4d9db17537 181
mbed_official 376:cb4d9db17537 182 /** @defgroup RTCEx_Tamper_EraseBackUp_Definitions
mbed_official 376:cb4d9db17537 183 * @{
mbed_official 376:cb4d9db17537 184 */
mbed_official 376:cb4d9db17537 185 #define RTC_TAMPERERASEBACKUP_ENABLED ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 186 #define RTC_TAMPERERASEBACKUP_DISABLED ((uint32_t)0x00020000)
mbed_official 376:cb4d9db17537 187
mbed_official 376:cb4d9db17537 188 #define IS_TAMPER_ERASE_MODE(MODE) (((MODE) == RTC_TAMPERERASEBACKUP_ENABLED) || \
mbed_official 376:cb4d9db17537 189 ((MODE) == RTC_TAMPERERASEBACKUP_DISABLED))
mbed_official 376:cb4d9db17537 190 /**
mbed_official 376:cb4d9db17537 191 * @}
mbed_official 376:cb4d9db17537 192 */
mbed_official 376:cb4d9db17537 193
mbed_official 376:cb4d9db17537 194 /** @defgroup RTCEx_Tamper_MaskFlag_Definitions
mbed_official 376:cb4d9db17537 195 * @{
mbed_official 376:cb4d9db17537 196 */
mbed_official 376:cb4d9db17537 197 #define RTC_MASKTAMPERFLAG_DISABLED ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 198 #define RTC_MASKTAMPERFLAG_ENABLED ((uint32_t)0x00040000)
mbed_official 376:cb4d9db17537 199
mbed_official 376:cb4d9db17537 200 #define IS_TAMPER_MASKFLAG_STATE(STATE) (((STATE) == RTC_MASKTAMPERFLAG_ENABLED) || \
mbed_official 376:cb4d9db17537 201 ((STATE) == RTC_MASKTAMPERFLAG_DISABLED))
mbed_official 376:cb4d9db17537 202 /**
mbed_official 376:cb4d9db17537 203 * @}
mbed_official 376:cb4d9db17537 204 */
mbed_official 376:cb4d9db17537 205
mbed_official 376:cb4d9db17537 206 /** @defgroup RTCEx_Tamper_Filter_Definitions
mbed_official 376:cb4d9db17537 207 * @{
mbed_official 376:cb4d9db17537 208 */
mbed_official 376:cb4d9db17537 209 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
mbed_official 376:cb4d9db17537 210
mbed_official 376:cb4d9db17537 211 #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2
mbed_official 376:cb4d9db17537 212 consecutive samples at the active level */
mbed_official 376:cb4d9db17537 213 #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4
mbed_official 376:cb4d9db17537 214 consecutive samples at the active level */
mbed_official 376:cb4d9db17537 215 #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8
mbed_official 376:cb4d9db17537 216 consecutive samples at the active leve. */
mbed_official 376:cb4d9db17537 217
mbed_official 376:cb4d9db17537 218 #define IS_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \
mbed_official 376:cb4d9db17537 219 ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \
mbed_official 376:cb4d9db17537 220 ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \
mbed_official 376:cb4d9db17537 221 ((FILTER) == RTC_TAMPERFILTER_8SAMPLE))
mbed_official 376:cb4d9db17537 222 /**
mbed_official 376:cb4d9db17537 223 * @}
mbed_official 376:cb4d9db17537 224 */
mbed_official 376:cb4d9db17537 225
mbed_official 376:cb4d9db17537 226 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions
mbed_official 376:cb4d9db17537 227 * @{
mbed_official 376:cb4d9db17537 228 */
mbed_official 376:cb4d9db17537 229 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
mbed_official 376:cb4d9db17537 230 with a frequency = RTCCLK / 32768 */
mbed_official 376:cb4d9db17537 231 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled
mbed_official 376:cb4d9db17537 232 with a frequency = RTCCLK / 16384 */
mbed_official 376:cb4d9db17537 233 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
mbed_official 376:cb4d9db17537 234 with a frequency = RTCCLK / 8192 */
mbed_official 376:cb4d9db17537 235 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
mbed_official 376:cb4d9db17537 236 with a frequency = RTCCLK / 4096 */
mbed_official 376:cb4d9db17537 237 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
mbed_official 376:cb4d9db17537 238 with a frequency = RTCCLK / 2048 */
mbed_official 376:cb4d9db17537 239 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
mbed_official 376:cb4d9db17537 240 with a frequency = RTCCLK / 1024 */
mbed_official 376:cb4d9db17537 241 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
mbed_official 376:cb4d9db17537 242 with a frequency = RTCCLK / 512 */
mbed_official 376:cb4d9db17537 243 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
mbed_official 376:cb4d9db17537 244 with a frequency = RTCCLK / 256 */
mbed_official 376:cb4d9db17537 245
mbed_official 376:cb4d9db17537 246 #define IS_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
mbed_official 376:cb4d9db17537 247 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
mbed_official 376:cb4d9db17537 248 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
mbed_official 376:cb4d9db17537 249 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
mbed_official 376:cb4d9db17537 250 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
mbed_official 376:cb4d9db17537 251 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
mbed_official 376:cb4d9db17537 252 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
mbed_official 376:cb4d9db17537 253 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
mbed_official 376:cb4d9db17537 254 /**
mbed_official 376:cb4d9db17537 255 * @}
mbed_official 376:cb4d9db17537 256 */
mbed_official 376:cb4d9db17537 257
mbed_official 376:cb4d9db17537 258 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions
mbed_official 376:cb4d9db17537 259 * @{
mbed_official 376:cb4d9db17537 260 */
mbed_official 376:cb4d9db17537 261 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
mbed_official 376:cb4d9db17537 262 sampling during 1 RTCCLK cycle */
mbed_official 376:cb4d9db17537 263 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
mbed_official 376:cb4d9db17537 264 sampling during 2 RTCCLK cycles */
mbed_official 376:cb4d9db17537 265 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
mbed_official 376:cb4d9db17537 266 sampling during 4 RTCCLK cycles */
mbed_official 376:cb4d9db17537 267 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
mbed_official 376:cb4d9db17537 268 sampling during 8 RTCCLK cycles */
mbed_official 376:cb4d9db17537 269
mbed_official 376:cb4d9db17537 270 #define IS_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
mbed_official 376:cb4d9db17537 271 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
mbed_official 376:cb4d9db17537 272 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
mbed_official 376:cb4d9db17537 273 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
mbed_official 376:cb4d9db17537 274 /**
mbed_official 376:cb4d9db17537 275 * @}
mbed_official 376:cb4d9db17537 276 */
mbed_official 376:cb4d9db17537 277
mbed_official 376:cb4d9db17537 278 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions
mbed_official 376:cb4d9db17537 279 * @{
mbed_official 376:cb4d9db17537 280 */
mbed_official 376:cb4d9db17537 281 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAMPCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */
mbed_official 376:cb4d9db17537 282 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
mbed_official 376:cb4d9db17537 283
mbed_official 376:cb4d9db17537 284 #define IS_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
mbed_official 376:cb4d9db17537 285 ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
mbed_official 376:cb4d9db17537 286 /**
mbed_official 376:cb4d9db17537 287 * @}
mbed_official 376:cb4d9db17537 288 */
mbed_official 376:cb4d9db17537 289
mbed_official 376:cb4d9db17537 290 /** @defgroup RTCEx_Tamper_PullUP_Definitions
mbed_official 376:cb4d9db17537 291 * @{
mbed_official 376:cb4d9db17537 292 */
mbed_official 376:cb4d9db17537 293 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event saved */
mbed_official 376:cb4d9db17537 294 #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAMPCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */
mbed_official 376:cb4d9db17537 295
mbed_official 376:cb4d9db17537 296 #define IS_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \
mbed_official 376:cb4d9db17537 297 ((STATE) == RTC_TAMPER_PULLUP_DISABLE))
mbed_official 376:cb4d9db17537 298 /**
mbed_official 376:cb4d9db17537 299 * @}
mbed_official 376:cb4d9db17537 300 */
mbed_official 376:cb4d9db17537 301
mbed_official 376:cb4d9db17537 302 /** @defgroup RTCEx_Wakeup_Timer_Definitions
mbed_official 376:cb4d9db17537 303 * @{
mbed_official 376:cb4d9db17537 304 */
mbed_official 376:cb4d9db17537 305 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 306 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001)
mbed_official 376:cb4d9db17537 307 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002)
mbed_official 376:cb4d9db17537 308 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003)
mbed_official 376:cb4d9db17537 309 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004)
mbed_official 376:cb4d9db17537 310 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006)
mbed_official 376:cb4d9db17537 311
mbed_official 376:cb4d9db17537 312 #define IS_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
mbed_official 376:cb4d9db17537 313 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
mbed_official 376:cb4d9db17537 314 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
mbed_official 376:cb4d9db17537 315 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
mbed_official 376:cb4d9db17537 316 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
mbed_official 376:cb4d9db17537 317 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
mbed_official 376:cb4d9db17537 318
mbed_official 376:cb4d9db17537 319 #define IS_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
mbed_official 376:cb4d9db17537 320 /**
mbed_official 376:cb4d9db17537 321 * @}
mbed_official 376:cb4d9db17537 322 */
mbed_official 376:cb4d9db17537 323
mbed_official 376:cb4d9db17537 324 /** @defgroup RTCEx_Digital_Calibration_Definitions
mbed_official 376:cb4d9db17537 325 * @{
mbed_official 376:cb4d9db17537 326 */
mbed_official 376:cb4d9db17537 327 #define RTC_CALIBSIGN_POSITIVE ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 328 #define RTC_CALIBSIGN_NEGATIVE ((uint32_t)0x00000080)
mbed_official 376:cb4d9db17537 329
mbed_official 376:cb4d9db17537 330 #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \
mbed_official 376:cb4d9db17537 331 ((SIGN) == RTC_CALIBSIGN_NEGATIVE))
mbed_official 376:cb4d9db17537 332
mbed_official 376:cb4d9db17537 333 #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20)
mbed_official 376:cb4d9db17537 334 /**
mbed_official 376:cb4d9db17537 335 * @}
mbed_official 376:cb4d9db17537 336 */
mbed_official 376:cb4d9db17537 337
mbed_official 376:cb4d9db17537 338 /** @defgroup RTCEx_Smooth_calib_period_Definitions
mbed_official 376:cb4d9db17537 339 * @{
mbed_official 376:cb4d9db17537 340 */
mbed_official 376:cb4d9db17537 341 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
mbed_official 376:cb4d9db17537 342 period is 32s, else 2exp20 RTCCLK seconds */
mbed_official 376:cb4d9db17537 343 #define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
mbed_official 376:cb4d9db17537 344 period is 16s, else 2exp19 RTCCLK seconds */
mbed_official 376:cb4d9db17537 345 #define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
mbed_official 376:cb4d9db17537 346 period is 8s, else 2exp18 RTCCLK seconds */
mbed_official 376:cb4d9db17537 347
mbed_official 376:cb4d9db17537 348 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
mbed_official 376:cb4d9db17537 349 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
mbed_official 376:cb4d9db17537 350 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC))
mbed_official 376:cb4d9db17537 351 /**
mbed_official 376:cb4d9db17537 352 * @}
mbed_official 376:cb4d9db17537 353 */
mbed_official 376:cb4d9db17537 354
mbed_official 376:cb4d9db17537 355 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions
mbed_official 376:cb4d9db17537 356 * @{
mbed_official 376:cb4d9db17537 357 */
mbed_official 376:cb4d9db17537 358 #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added
mbed_official 376:cb4d9db17537 359 during a X -second window = Y - CALM[8:0]
mbed_official 376:cb4d9db17537 360 with Y = 512, 256, 128 when X = 32, 16, 8 */
mbed_official 376:cb4d9db17537 361 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
mbed_official 376:cb4d9db17537 362 during a 32-second window = CALM[8:0] */
mbed_official 376:cb4d9db17537 363
mbed_official 376:cb4d9db17537 364 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
mbed_official 376:cb4d9db17537 365 ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
mbed_official 376:cb4d9db17537 366 /**
mbed_official 376:cb4d9db17537 367 * @}
mbed_official 376:cb4d9db17537 368 */
mbed_official 376:cb4d9db17537 369
mbed_official 376:cb4d9db17537 370 /** @defgroup RTCEx_Smooth_calib_Minus_pulses_Definitions
mbed_official 376:cb4d9db17537 371 * @{
mbed_official 376:cb4d9db17537 372 */
mbed_official 376:cb4d9db17537 373 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF)
mbed_official 376:cb4d9db17537 374 /**
mbed_official 376:cb4d9db17537 375 * @}
mbed_official 376:cb4d9db17537 376 */
mbed_official 376:cb4d9db17537 377
mbed_official 376:cb4d9db17537 378 /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions
mbed_official 376:cb4d9db17537 379 * @{
mbed_official 376:cb4d9db17537 380 */
mbed_official 376:cb4d9db17537 381 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 382 #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000)
mbed_official 376:cb4d9db17537 383
mbed_official 376:cb4d9db17537 384 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \
mbed_official 376:cb4d9db17537 385 ((SEL) == RTC_SHIFTADD1S_SET))
mbed_official 376:cb4d9db17537 386 /**
mbed_official 376:cb4d9db17537 387 * @}
mbed_official 376:cb4d9db17537 388 */
mbed_official 376:cb4d9db17537 389
mbed_official 376:cb4d9db17537 390 /** @defgroup RTCEx_Substract_Fraction_Of_Second_Value
mbed_official 376:cb4d9db17537 391 * @{
mbed_official 376:cb4d9db17537 392 */
mbed_official 376:cb4d9db17537 393 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF)
mbed_official 376:cb4d9db17537 394 /**
mbed_official 376:cb4d9db17537 395 * @}
mbed_official 376:cb4d9db17537 396 */
mbed_official 376:cb4d9db17537 397
mbed_official 376:cb4d9db17537 398 /** @defgroup RTCEx_Calib_Output_selection_Definitions
mbed_official 376:cb4d9db17537 399 * @{
mbed_official 376:cb4d9db17537 400 */
mbed_official 376:cb4d9db17537 401 #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 402 #define RTC_CALIBOUTPUT_1HZ ((uint32_t)0x00080000)
mbed_official 376:cb4d9db17537 403
mbed_official 376:cb4d9db17537 404 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \
mbed_official 376:cb4d9db17537 405 ((OUTPUT) == RTC_CALIBOUTPUT_1HZ))
mbed_official 376:cb4d9db17537 406 /**
mbed_official 376:cb4d9db17537 407 * @}
mbed_official 376:cb4d9db17537 408 */
mbed_official 376:cb4d9db17537 409
mbed_official 376:cb4d9db17537 410 /**
mbed_official 376:cb4d9db17537 411 * @}
mbed_official 376:cb4d9db17537 412 */
mbed_official 376:cb4d9db17537 413
mbed_official 376:cb4d9db17537 414 /* Exported macro ------------------------------------------------------------*/
mbed_official 376:cb4d9db17537 415 /** @defgroup RTCEx_Exported macro
mbed_official 376:cb4d9db17537 416 * @{
mbed_official 376:cb4d9db17537 417 */
mbed_official 376:cb4d9db17537 418
mbed_official 376:cb4d9db17537 419 /**
mbed_official 376:cb4d9db17537 420 * @brief Enable the RTC WakeUp Timer peripheral.
mbed_official 376:cb4d9db17537 421 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 422 * @retval None
mbed_official 376:cb4d9db17537 423 */
mbed_official 376:cb4d9db17537 424 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
mbed_official 376:cb4d9db17537 425
mbed_official 376:cb4d9db17537 426 /**
mbed_official 376:cb4d9db17537 427 * @brief Disable the RTC WakeUp Timer peripheral.
mbed_official 376:cb4d9db17537 428 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 429 * @retval None
mbed_official 376:cb4d9db17537 430 */
mbed_official 376:cb4d9db17537 431 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
mbed_official 376:cb4d9db17537 432
mbed_official 376:cb4d9db17537 433 /**
mbed_official 376:cb4d9db17537 434 * @brief Enable the RTC TimeStamp peripheral.
mbed_official 376:cb4d9db17537 435 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 436 * @retval None
mbed_official 376:cb4d9db17537 437 */
mbed_official 376:cb4d9db17537 438 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
mbed_official 376:cb4d9db17537 439
mbed_official 376:cb4d9db17537 440 /**
mbed_official 376:cb4d9db17537 441 * @brief Disable the RTC TimeStamp peripheral.
mbed_official 376:cb4d9db17537 442 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 443 * @retval None
mbed_official 376:cb4d9db17537 444 */
mbed_official 376:cb4d9db17537 445 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
mbed_official 376:cb4d9db17537 446
mbed_official 376:cb4d9db17537 447 /**
mbed_official 376:cb4d9db17537 448 * @brief Enable the RTC calibration output.
mbed_official 376:cb4d9db17537 449 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 450 * @retval None
mbed_official 376:cb4d9db17537 451 */
mbed_official 376:cb4d9db17537 452 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
mbed_official 376:cb4d9db17537 453
mbed_official 376:cb4d9db17537 454 /**
mbed_official 376:cb4d9db17537 455 * @brief Disable the calibration output.
mbed_official 376:cb4d9db17537 456 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 457 * @retval None
mbed_official 376:cb4d9db17537 458 */
mbed_official 376:cb4d9db17537 459 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
mbed_official 376:cb4d9db17537 460
mbed_official 376:cb4d9db17537 461 /**
mbed_official 376:cb4d9db17537 462 * @brief Enable the clock reference detection.
mbed_official 376:cb4d9db17537 463 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 464 * @retval None
mbed_official 376:cb4d9db17537 465 */
mbed_official 376:cb4d9db17537 466 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
mbed_official 376:cb4d9db17537 467
mbed_official 376:cb4d9db17537 468 /**
mbed_official 376:cb4d9db17537 469 * @brief Disable the clock reference detection.
mbed_official 376:cb4d9db17537 470 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 471 * @retval None
mbed_official 376:cb4d9db17537 472 */
mbed_official 376:cb4d9db17537 473 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
mbed_official 376:cb4d9db17537 474
mbed_official 376:cb4d9db17537 475 /**
mbed_official 376:cb4d9db17537 476 * @brief Enable the RTC TimeStamp interrupt.
mbed_official 376:cb4d9db17537 477 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 478 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 479 * This parameter can be:
mbed_official 376:cb4d9db17537 480 * @arg RTC_IT_TS: TimeStamp interrupt
mbed_official 376:cb4d9db17537 481 * @retval None
mbed_official 376:cb4d9db17537 482 */
mbed_official 376:cb4d9db17537 483 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
mbed_official 376:cb4d9db17537 484
mbed_official 376:cb4d9db17537 485 /**
mbed_official 376:cb4d9db17537 486 * @brief Disable the RTC TimeStamp interrupt.
mbed_official 376:cb4d9db17537 487 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 488 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 489 * This parameter can be:
mbed_official 376:cb4d9db17537 490 * @arg RTC_IT_TS: TimeStamp interrupt
mbed_official 376:cb4d9db17537 491 * @retval None
mbed_official 376:cb4d9db17537 492 */
mbed_official 376:cb4d9db17537 493 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
mbed_official 376:cb4d9db17537 494
mbed_official 376:cb4d9db17537 495 /**
mbed_official 376:cb4d9db17537 496 * @brief Enable the RTC WakeUpTimer interrupt.
mbed_official 376:cb4d9db17537 497 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 498 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 499 * This parameter can be:
mbed_official 376:cb4d9db17537 500 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
mbed_official 376:cb4d9db17537 501 * @retval None
mbed_official 376:cb4d9db17537 502 */
mbed_official 376:cb4d9db17537 503 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
mbed_official 376:cb4d9db17537 504
mbed_official 376:cb4d9db17537 505 /**
mbed_official 376:cb4d9db17537 506 * @brief Disable the RTC WakeUpTimer interrupt.
mbed_official 376:cb4d9db17537 507 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 508 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 509 * This parameter can be:
mbed_official 376:cb4d9db17537 510 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
mbed_official 376:cb4d9db17537 511 * @retval None
mbed_official 376:cb4d9db17537 512 */
mbed_official 376:cb4d9db17537 513 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
mbed_official 376:cb4d9db17537 514
mbed_official 376:cb4d9db17537 515 /**
mbed_official 376:cb4d9db17537 516 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
mbed_official 376:cb4d9db17537 517 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 518 * @param __FLAG__: specifies the RTC Tamper interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 519 * This parameter can be:
mbed_official 376:cb4d9db17537 520 * @arg RTC_IT_TAMP1
mbed_official 376:cb4d9db17537 521 * @retval None
mbed_official 376:cb4d9db17537 522 */
mbed_official 376:cb4d9db17537 523 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 524
mbed_official 376:cb4d9db17537 525 /**
mbed_official 376:cb4d9db17537 526 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
mbed_official 376:cb4d9db17537 527 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 528 * @param __FLAG__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 529 * This parameter can be:
mbed_official 376:cb4d9db17537 530 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
mbed_official 376:cb4d9db17537 531 * @retval None
mbed_official 376:cb4d9db17537 532 */
mbed_official 376:cb4d9db17537 533 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 534
mbed_official 376:cb4d9db17537 535 /**
mbed_official 376:cb4d9db17537 536 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
mbed_official 376:cb4d9db17537 537 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 538 * @param __FLAG__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 539 * This parameter can be:
mbed_official 376:cb4d9db17537 540 * @arg RTC_IT_TS: TimeStamp interrupt
mbed_official 376:cb4d9db17537 541 * @retval None
mbed_official 376:cb4d9db17537 542 */
mbed_official 376:cb4d9db17537 543 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 544
mbed_official 376:cb4d9db17537 545 /**
mbed_official 376:cb4d9db17537 546 * @brief Get the selected RTC TimeStamp's flag status.
mbed_official 376:cb4d9db17537 547 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 548 * @param __FLAG__: specifies the RTC TimeStamp Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 549 * This parameter can be:
mbed_official 376:cb4d9db17537 550 * @arg RTC_FLAG_TSF
mbed_official 376:cb4d9db17537 551 * @arg RTC_FLAG_TSOVF
mbed_official 376:cb4d9db17537 552 * @retval None
mbed_official 376:cb4d9db17537 553 */
mbed_official 376:cb4d9db17537 554 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 555
mbed_official 376:cb4d9db17537 556 /**
mbed_official 376:cb4d9db17537 557 * @brief Get the selected RTC WakeUpTimer's flag status.
mbed_official 376:cb4d9db17537 558 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 559 * @param __FLAG__: specifies the RTC WakeUpTimer Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 560 * This parameter can be:
mbed_official 376:cb4d9db17537 561 * @arg RTC_FLAG_WUTF
mbed_official 376:cb4d9db17537 562 * @arg RTC_FLAG_WUTWF
mbed_official 376:cb4d9db17537 563 * @retval None
mbed_official 376:cb4d9db17537 564 */
mbed_official 376:cb4d9db17537 565 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 566
mbed_official 376:cb4d9db17537 567 /**
mbed_official 376:cb4d9db17537 568 * @brief Get the selected RTC Tamper's flag status.
mbed_official 376:cb4d9db17537 569 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 570 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 571 * This parameter can be:
mbed_official 376:cb4d9db17537 572 * @arg RTC_FLAG_TAMP1F
mbed_official 376:cb4d9db17537 573 * @retval None
mbed_official 376:cb4d9db17537 574 */
mbed_official 376:cb4d9db17537 575 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 576
mbed_official 376:cb4d9db17537 577 /**
mbed_official 376:cb4d9db17537 578 * @brief Get the selected RTC shift operation's flag status.
mbed_official 376:cb4d9db17537 579 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 580 * @param __FLAG__: specifies the RTC shift operation Flag is pending or not.
mbed_official 376:cb4d9db17537 581 * This parameter can be:
mbed_official 376:cb4d9db17537 582 * @arg RTC_FLAG_SHPF
mbed_official 376:cb4d9db17537 583 * @retval None
mbed_official 376:cb4d9db17537 584 */
mbed_official 376:cb4d9db17537 585 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 586
mbed_official 376:cb4d9db17537 587 /**
mbed_official 376:cb4d9db17537 588 * @brief Clear the RTC Time Stamp's pending flags.
mbed_official 376:cb4d9db17537 589 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 590 * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 591 * This parameter can be:
mbed_official 376:cb4d9db17537 592 * @arg RTC_FLAG_TSF
mbed_official 376:cb4d9db17537 593 * @retval None
mbed_official 376:cb4d9db17537 594 */
mbed_official 376:cb4d9db17537 595 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
mbed_official 376:cb4d9db17537 596
mbed_official 376:cb4d9db17537 597 /**
mbed_official 376:cb4d9db17537 598 * @brief Clear the RTC Tamper's pending flags.
mbed_official 376:cb4d9db17537 599 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 600 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 601 * This parameter can be:
mbed_official 376:cb4d9db17537 602 * @arg RTC_FLAG_TAMP1F
mbed_official 376:cb4d9db17537 603 * @retval None
mbed_official 376:cb4d9db17537 604 */
mbed_official 376:cb4d9db17537 605 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
mbed_official 376:cb4d9db17537 606
mbed_official 376:cb4d9db17537 607 /**
mbed_official 376:cb4d9db17537 608 * @brief Clear the RTC Wake Up timer's pending flags.
mbed_official 376:cb4d9db17537 609 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 610 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 611 * This parameter can be:
mbed_official 376:cb4d9db17537 612 * @arg RTC_FLAG_WUTF
mbed_official 376:cb4d9db17537 613 * @retval None
mbed_official 376:cb4d9db17537 614 */
mbed_official 376:cb4d9db17537 615 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
mbed_official 376:cb4d9db17537 616
mbed_official 376:cb4d9db17537 617 /**
mbed_official 376:cb4d9db17537 618 * @}
mbed_official 376:cb4d9db17537 619 */
mbed_official 376:cb4d9db17537 620
mbed_official 376:cb4d9db17537 621 /* Exported functions --------------------------------------------------------*/
mbed_official 376:cb4d9db17537 622
mbed_official 376:cb4d9db17537 623 /* RTC TimeStamp and Tamper functions *****************************************/
mbed_official 376:cb4d9db17537 624 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
mbed_official 376:cb4d9db17537 625 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
mbed_official 376:cb4d9db17537 626 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 627 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
mbed_official 376:cb4d9db17537 628
mbed_official 376:cb4d9db17537 629 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
mbed_official 376:cb4d9db17537 630 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
mbed_official 376:cb4d9db17537 631 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
mbed_official 376:cb4d9db17537 632
mbed_official 376:cb4d9db17537 633 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
mbed_official 376:cb4d9db17537 634 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
mbed_official 376:cb4d9db17537 635 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 636 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 637
mbed_official 376:cb4d9db17537 638 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
mbed_official 376:cb4d9db17537 639 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
mbed_official 376:cb4d9db17537 640
mbed_official 376:cb4d9db17537 641 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue);
mbed_official 376:cb4d9db17537 642 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
mbed_official 376:cb4d9db17537 643 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
mbed_official 376:cb4d9db17537 644 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 645 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 646 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 647 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 648 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 649
mbed_official 376:cb4d9db17537 650 /* Peripheral State functions ***************************************************/
mbed_official 376:cb4d9db17537 651 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 652 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 653
mbed_official 376:cb4d9db17537 654 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 655 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 656 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 657 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 658 void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 659
mbed_official 376:cb4d9db17537 660 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 376:cb4d9db17537 661 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 376:cb4d9db17537 662 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 376:cb4d9db17537 663 HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 376:cb4d9db17537 664 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 376:cb4d9db17537 665
mbed_official 376:cb4d9db17537 666
mbed_official 376:cb4d9db17537 667 /**
mbed_official 376:cb4d9db17537 668 * @}
mbed_official 376:cb4d9db17537 669 */
mbed_official 376:cb4d9db17537 670
mbed_official 376:cb4d9db17537 671 /**
mbed_official 376:cb4d9db17537 672 * @}
mbed_official 376:cb4d9db17537 673 */
mbed_official 376:cb4d9db17537 674
mbed_official 376:cb4d9db17537 675 #ifdef __cplusplus
mbed_official 376:cb4d9db17537 676 }
mbed_official 376:cb4d9db17537 677 #endif
mbed_official 376:cb4d9db17537 678
mbed_official 376:cb4d9db17537 679 #endif /* __STM32L0xx_HAL_PWR_EX_H */
mbed_official 376:cb4d9db17537 680
mbed_official 376:cb4d9db17537 681 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/