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:
Wed Jul 01 09:45:11 2015 +0100
Revision:
579:53297373a894
Parent:
489:119543c9f674
Synchronized with git revision d5b4d2ab9c47edb4dc5776e7177b0c2263459081

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

Initial version of drivers for SAMR21

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 489:119543c9f674 5 * @version V1.2.0
mbed_official 489:119543c9f674 6 * @date 06-February-2015
mbed_official 489:119543c9f674 7 * @brief Header file of RTC HAL Extended module.
mbed_official 376:cb4d9db17537 8 ******************************************************************************
mbed_official 376:cb4d9db17537 9 * @attention
mbed_official 376:cb4d9db17537 10 *
mbed_official 489:119543c9f674 11 * <h2><center>&copy; COPYRIGHT(c) 2015 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 489:119543c9f674 53 /** @defgroup RTCEx RTCEx
mbed_official 376:cb4d9db17537 54 * @{
mbed_official 376:cb4d9db17537 55 */
mbed_official 376:cb4d9db17537 56
mbed_official 489:119543c9f674 57 /* Exported types ------------------------------------------------------------*/
mbed_official 489:119543c9f674 58
mbed_official 489:119543c9f674 59 /** @defgroup RTCEx_Exported_Types RTC Extended Exported Types
mbed_official 489:119543c9f674 60 * @{
mbed_official 489:119543c9f674 61 */
mbed_official 489:119543c9f674 62
mbed_official 376:cb4d9db17537 63 /**
mbed_official 376:cb4d9db17537 64 * @brief RTC Tamper structure definition
mbed_official 376:cb4d9db17537 65 */
mbed_official 376:cb4d9db17537 66 typedef struct
mbed_official 376:cb4d9db17537 67 {
mbed_official 376:cb4d9db17537 68 uint32_t Tamper; /*!< Specifies the Tamper Pin.
mbed_official 376:cb4d9db17537 69 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
mbed_official 376:cb4d9db17537 70
mbed_official 376:cb4d9db17537 71 uint32_t Interrupt; /*!< Specifies the Tamper Interrupt.
mbed_official 376:cb4d9db17537 72 This parameter can be a value of @ref RTCEx_Tamper_Interrupt_Definitions */
mbed_official 376:cb4d9db17537 73
mbed_official 376:cb4d9db17537 74 uint32_t Trigger; /*!< Specifies the Tamper Trigger.
mbed_official 376:cb4d9db17537 75 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
mbed_official 376:cb4d9db17537 76
mbed_official 376:cb4d9db17537 77 uint32_t NoErase; /*!< Specifies the Tamper no erase mode.
mbed_official 376:cb4d9db17537 78 This parameter can be a value of @ref RTCEx_Tamper_EraseBackUp_Definitions */
mbed_official 376:cb4d9db17537 79
mbed_official 376:cb4d9db17537 80 uint32_t MaskFlag; /*!< Specifies the Tamper Flag masking.
mbed_official 376:cb4d9db17537 81 This parameter can be a value of @ref RTCEx_Tamper_MaskFlag_Definitions */
mbed_official 376:cb4d9db17537 82
mbed_official 376:cb4d9db17537 83 uint32_t Filter; /*!< Specifies the RTC Filter Tamper.
mbed_official 376:cb4d9db17537 84 This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */
mbed_official 376:cb4d9db17537 85
mbed_official 376:cb4d9db17537 86 uint32_t SamplingFrequency; /*!< Specifies the sampling frequency.
mbed_official 376:cb4d9db17537 87 This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */
mbed_official 376:cb4d9db17537 88
mbed_official 376:cb4d9db17537 89 uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration .
mbed_official 376:cb4d9db17537 90 This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */
mbed_official 376:cb4d9db17537 91
mbed_official 376:cb4d9db17537 92 uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp .
mbed_official 489:119543c9f674 93 This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */
mbed_official 376:cb4d9db17537 94
mbed_official 376:cb4d9db17537 95 uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection.
mbed_official 376:cb4d9db17537 96 This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */
mbed_official 376:cb4d9db17537 97 }RTC_TamperTypeDef;
mbed_official 489:119543c9f674 98 /**
mbed_official 489:119543c9f674 99 * @}
mbed_official 489:119543c9f674 100 */
mbed_official 376:cb4d9db17537 101
mbed_official 376:cb4d9db17537 102 /* Exported constants --------------------------------------------------------*/
mbed_official 489:119543c9f674 103 /** @defgroup RTCEx_Exported_Constants RTC Extended Exported Constants
mbed_official 376:cb4d9db17537 104 * @{
mbed_official 376:cb4d9db17537 105 */
mbed_official 376:cb4d9db17537 106
mbed_official 489:119543c9f674 107
mbed_official 489:119543c9f674 108 /** @defgroup RTCEx_Interrupts_Definitions RTC Extended Interrupts Definitions
mbed_official 489:119543c9f674 109 * @{
mbed_official 489:119543c9f674 110 */
mbed_official 489:119543c9f674 111 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
mbed_official 489:119543c9f674 112 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx)
mbed_official 489:119543c9f674 113
mbed_official 489:119543c9f674 114 #define RTC_IT_TAMP3 RTC_TAMPCR_TAMP3IE
mbed_official 489:119543c9f674 115
mbed_official 489:119543c9f674 116 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
mbed_official 489:119543c9f674 117 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx)
mbed_official 489:119543c9f674 118 */
mbed_official 489:119543c9f674 119 /**
mbed_official 489:119543c9f674 120 * @}
mbed_official 489:119543c9f674 121 */
mbed_official 489:119543c9f674 122
mbed_official 489:119543c9f674 123
mbed_official 489:119543c9f674 124 /** @defgroup RTCEx_Flags_Definitions RTC Extended Flags Definitions
mbed_official 489:119543c9f674 125 * @{
mbed_official 489:119543c9f674 126 */
mbed_official 489:119543c9f674 127 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
mbed_official 489:119543c9f674 128 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx)
mbed_official 489:119543c9f674 129
mbed_official 489:119543c9f674 130 #define RTC_FLAG_TAMP3F RTC_ISR_TAMP3F
mbed_official 489:119543c9f674 131
mbed_official 489:119543c9f674 132 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
mbed_official 489:119543c9f674 133 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx)
mbed_official 489:119543c9f674 134 */
mbed_official 489:119543c9f674 135
mbed_official 489:119543c9f674 136 /**
mbed_official 489:119543c9f674 137 * @}
mbed_official 489:119543c9f674 138 */
mbed_official 489:119543c9f674 139
mbed_official 489:119543c9f674 140 /** @defgroup RTCEx_Backup_Registers_Definitions RTC Extended Backup Registers Definition
mbed_official 376:cb4d9db17537 141 * @{
mbed_official 376:cb4d9db17537 142 */
mbed_official 376:cb4d9db17537 143 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
mbed_official 376:cb4d9db17537 144 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
mbed_official 376:cb4d9db17537 145 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
mbed_official 376:cb4d9db17537 146 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
mbed_official 376:cb4d9db17537 147 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
mbed_official 376:cb4d9db17537 148
mbed_official 489:119543c9f674 149 #define IS_RTC_BKP(__BKP__) (((__BKP__) == RTC_BKP_DR0) || \
mbed_official 489:119543c9f674 150 ((__BKP__) == RTC_BKP_DR1) || \
mbed_official 489:119543c9f674 151 ((__BKP__) == RTC_BKP_DR2) || \
mbed_official 489:119543c9f674 152 ((__BKP__) == RTC_BKP_DR3) || \
mbed_official 489:119543c9f674 153 ((__BKP__) == RTC_BKP_DR4))
mbed_official 376:cb4d9db17537 154 /**
mbed_official 376:cb4d9db17537 155 * @}
mbed_official 376:cb4d9db17537 156 */
mbed_official 489:119543c9f674 157
mbed_official 489:119543c9f674 158 /** @defgroup RTC_Mask_Definition RTC Mask Definition
mbed_official 376:cb4d9db17537 159 * @{
mbed_official 489:119543c9f674 160 */
mbed_official 489:119543c9f674 161
mbed_official 489:119543c9f674 162 /* Masks Definition */
mbed_official 489:119543c9f674 163
mbed_official 489:119543c9f674 164 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
mbed_official 489:119543c9f674 165 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx)
mbed_official 489:119543c9f674 166
mbed_official 489:119543c9f674 167 #define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP3F | RTC_FLAG_TAMP2F | \
mbed_official 489:119543c9f674 168 RTC_FLAG_TAMP1F| RTC_FLAG_TSOVF | RTC_FLAG_TSF | \
mbed_official 489:119543c9f674 169 RTC_FLAG_WUTF | RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | \
mbed_official 489:119543c9f674 170 RTC_FLAG_INIT | RTC_FLAG_INITF | RTC_FLAG_RSF | \
mbed_official 489:119543c9f674 171 RTC_FLAG_INITS | RTC_FLAG_SHPF | RTC_FLAG_WUTWF | \
mbed_official 489:119543c9f674 172 RTC_FLAG_ALRBWF | RTC_FLAG_ALRAWF))
mbed_official 376:cb4d9db17537 173
mbed_official 489:119543c9f674 174 #define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP3E | RTC_TAMPCR_TAMP2E | RTC_TAMPCR_TAMP1E))
mbed_official 489:119543c9f674 175
mbed_official 489:119543c9f674 176 #else
mbed_official 489:119543c9f674 177
mbed_official 489:119543c9f674 178 #define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP2F | RTC_FLAG_TAMP1F| \
mbed_official 489:119543c9f674 179 RTC_FLAG_TSOVF | RTC_FLAG_TSF | RTC_FLAG_WUTF | \
mbed_official 489:119543c9f674 180 RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | RTC_FLAG_INIT | \
mbed_official 489:119543c9f674 181 RTC_FLAG_INITF | RTC_FLAG_RSF | RTC_FLAG_INITS | \
mbed_official 489:119543c9f674 182 RTC_FLAG_SHPF | RTC_FLAG_WUTWF |RTC_FLAG_ALRBWF | \
mbed_official 489:119543c9f674 183 RTC_FLAG_ALRAWF))
mbed_official 489:119543c9f674 184
mbed_official 489:119543c9f674 185 #define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP2E | RTC_TAMPCR_TAMP1E))
mbed_official 489:119543c9f674 186
mbed_official 489:119543c9f674 187 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
mbed_official 489:119543c9f674 188 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx)
mbed_official 489:119543c9f674 189 */
mbed_official 376:cb4d9db17537 190 /**
mbed_official 376:cb4d9db17537 191 * @}
mbed_official 376:cb4d9db17537 192 */
mbed_official 489:119543c9f674 193
mbed_official 489:119543c9f674 194 /** @defgroup RTCEx_Time_Stamp_Edges_definitions RTC Extended Time Stamp Edges definition
mbed_official 376:cb4d9db17537 195 * @{
mbed_official 489:119543c9f674 196 */
mbed_official 489:119543c9f674 197 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 198 #define RTC_TIMESTAMPEDGE_FALLING RTC_CR_TSEDGE
mbed_official 376:cb4d9db17537 199
mbed_official 489:119543c9f674 200 #define IS_TIMESTAMP_EDGE(__EDGE__) (((__EDGE__) == RTC_TIMESTAMPEDGE_RISING) || \
mbed_official 489:119543c9f674 201 ((__EDGE__) == RTC_TIMESTAMPEDGE_FALLING))
mbed_official 376:cb4d9db17537 202 /**
mbed_official 376:cb4d9db17537 203 * @}
mbed_official 376:cb4d9db17537 204 */
mbed_official 376:cb4d9db17537 205
mbed_official 489:119543c9f674 206 /** @defgroup RTCEx_Tamper_Pins_Definitions RTC Extended Tamper Pins Definition
mbed_official 376:cb4d9db17537 207 * @{
mbed_official 376:cb4d9db17537 208 */
mbed_official 489:119543c9f674 209
mbed_official 489:119543c9f674 210 #define RTC_TAMPER_1 RTC_TAMPCR_TAMP1E
mbed_official 489:119543c9f674 211 #define RTC_TAMPER_2 RTC_TAMPCR_TAMP2E
mbed_official 489:119543c9f674 212
mbed_official 489:119543c9f674 213 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
mbed_official 489:119543c9f674 214 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx)
mbed_official 376:cb4d9db17537 215
mbed_official 489:119543c9f674 216 #define RTC_TAMPER_3 RTC_TAMPCR_TAMP3E
mbed_official 489:119543c9f674 217
mbed_official 489:119543c9f674 218 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
mbed_official 489:119543c9f674 219 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx)
mbed_official 489:119543c9f674 220 */
mbed_official 489:119543c9f674 221
mbed_official 489:119543c9f674 222 #define IS_RTC_TAMPER(__TAMPER__) ((((__TAMPER__) & ((uint32_t)(0xFFFFFFFF ^ RTC_TAMPCR_TAMPXE))) == 0x00) && ((__TAMPER__) != (uint32_t)RESET))
mbed_official 489:119543c9f674 223
mbed_official 376:cb4d9db17537 224 /**
mbed_official 376:cb4d9db17537 225 * @}
mbed_official 376:cb4d9db17537 226 */
mbed_official 376:cb4d9db17537 227
mbed_official 489:119543c9f674 228
mbed_official 489:119543c9f674 229 /** @defgroup RTCEx_Tamper_Interrupt_Definitions RTC Extended Tamper Interrupt Definitions
mbed_official 376:cb4d9db17537 230 * @{
mbed_official 376:cb4d9db17537 231 */
mbed_official 489:119543c9f674 232
mbed_official 489:119543c9f674 233 #define RTC_TAMPER1_INTERRUPT RTC_TAMPCR_TAMP1IE
mbed_official 489:119543c9f674 234 #define RTC_TAMPER2_INTERRUPT RTC_TAMPCR_TAMP2IE
mbed_official 489:119543c9f674 235 #define RTC_ALL_TAMPER_INTERRUPT RTC_TAMPCR_TAMPIE
mbed_official 489:119543c9f674 236
mbed_official 489:119543c9f674 237 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
mbed_official 489:119543c9f674 238 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx)
mbed_official 376:cb4d9db17537 239
mbed_official 489:119543c9f674 240 #define RTC_TAMPER3_INTERRUPT RTC_TAMPCR_TAMP3IE
mbed_official 489:119543c9f674 241 #define IS_RTC_TAMPER_INTERRUPT(__INTERRUPT__) (((__INTERRUPT__) == RTC_TAMPER1_INTERRUPT) || \
mbed_official 489:119543c9f674 242 ((__INTERRUPT__) == RTC_TAMPER2_INTERRUPT) || \
mbed_official 489:119543c9f674 243 ((__INTERRUPT__) == RTC_TAMPER3_INTERRUPT) || \
mbed_official 489:119543c9f674 244 ((__INTERRUPT__) == RTC_ALL_TAMPER_INTERRUPT ))
mbed_official 489:119543c9f674 245
mbed_official 489:119543c9f674 246 #else
mbed_official 489:119543c9f674 247
mbed_official 489:119543c9f674 248 #define IS_RTC_TAMPER_INTERRUPT(__INTERRUPT__) (((__INTERRUPT__) == RTC_TAMPER1_INTERRUPT) || \
mbed_official 489:119543c9f674 249 ((__INTERRUPT__) == RTC_TAMPER2_INTERRUPT) || \
mbed_official 489:119543c9f674 250 ((__INTERRUPT__) == RTC_ALL_TAMPER_INTERRUPT ))
mbed_official 489:119543c9f674 251
mbed_official 489:119543c9f674 252 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
mbed_official 489:119543c9f674 253 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx)
mbed_official 489:119543c9f674 254 */
mbed_official 489:119543c9f674 255
mbed_official 376:cb4d9db17537 256 /**
mbed_official 376:cb4d9db17537 257 * @}
mbed_official 376:cb4d9db17537 258 */
mbed_official 376:cb4d9db17537 259
mbed_official 489:119543c9f674 260 /** @defgroup RTCEx_TimeStamp_Pin_Selections RTC Extended TimeStamp Pin Selection
mbed_official 489:119543c9f674 261 * @{
mbed_official 489:119543c9f674 262 */
mbed_official 489:119543c9f674 263 #define RTC_TIMESTAMPPIN_PC13 ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 264
mbed_official 489:119543c9f674 265 #define IS_RTC_TIMESTAMP_PIN(__PIN__) (((__PIN__) == RTC_TIMESTAMPPIN_PC13))
mbed_official 489:119543c9f674 266 /**
mbed_official 489:119543c9f674 267 * @}
mbed_official 489:119543c9f674 268 */
mbed_official 489:119543c9f674 269
mbed_official 489:119543c9f674 270 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTC Extended Tamper Trigger Definition
mbed_official 376:cb4d9db17537 271 * @{
mbed_official 376:cb4d9db17537 272 */
mbed_official 376:cb4d9db17537 273 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 274 #define RTC_TAMPERTRIGGER_FALLINGEDGE RTC_TAMPCR_TAMP1TRG
mbed_official 376:cb4d9db17537 275 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
mbed_official 376:cb4d9db17537 276 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
mbed_official 376:cb4d9db17537 277
mbed_official 489:119543c9f674 278 #define IS_RTC_TAMPER_TRIGGER(__TRIGGER__) (((__TRIGGER__) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
mbed_official 489:119543c9f674 279 ((__TRIGGER__) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
mbed_official 489:119543c9f674 280 ((__TRIGGER__) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
mbed_official 489:119543c9f674 281 ((__TRIGGER__) == RTC_TAMPERTRIGGER_HIGHLEVEL))
mbed_official 376:cb4d9db17537 282
mbed_official 376:cb4d9db17537 283 /**
mbed_official 376:cb4d9db17537 284 * @}
mbed_official 376:cb4d9db17537 285 */
mbed_official 376:cb4d9db17537 286
mbed_official 489:119543c9f674 287 /** @defgroup RTCEx_Tamper_EraseBackUp_Definitions RTC Extended Tamper EraseBackUp Definitions
mbed_official 376:cb4d9db17537 288 * @{
mbed_official 376:cb4d9db17537 289 */
mbed_official 489:119543c9f674 290 #define RTC_TAMPER_ERASE_BACKUP_ENABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 291 #define RTC_TAMPER_ERASE_BACKUP_DISABLE RTC_TAMPCR_TAMP1NOERASE
mbed_official 376:cb4d9db17537 292
mbed_official 489:119543c9f674 293 #define IS_RTC_TAMPER_ERASE_MODE(__MODE__) (((__MODE__) == RTC_TAMPER_ERASE_BACKUP_ENABLE) || \
mbed_official 489:119543c9f674 294 ((__MODE__) == RTC_TAMPER_ERASE_BACKUP_DISABLE))
mbed_official 376:cb4d9db17537 295 /**
mbed_official 376:cb4d9db17537 296 * @}
mbed_official 376:cb4d9db17537 297 */
mbed_official 376:cb4d9db17537 298
mbed_official 489:119543c9f674 299 /** @defgroup RTCEx_Tamper_MaskFlag_Definitions RTC Extended Tamper MaskFlag Definitions
mbed_official 376:cb4d9db17537 300 * @{
mbed_official 376:cb4d9db17537 301 */
mbed_official 489:119543c9f674 302 #define RTC_TAMPERMASK_FLAG_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 303 #define RTC_TAMPERMASK_FLAG_ENABLE RTC_TAMPCR_TAMP1MF
mbed_official 376:cb4d9db17537 304
mbed_official 489:119543c9f674 305 #define IS_RTC_TAMPER_MASKFLAG_STATE(__STATE__) (((__STATE__) == RTC_TAMPERMASK_FLAG_ENABLE ) || \
mbed_official 489:119543c9f674 306 ((__STATE__) == RTC_TAMPERMASK_FLAG_DISABLE))
mbed_official 376:cb4d9db17537 307 /**
mbed_official 376:cb4d9db17537 308 * @}
mbed_official 376:cb4d9db17537 309 */
mbed_official 376:cb4d9db17537 310
mbed_official 489:119543c9f674 311 /** @defgroup RTCEx_Tamper_Filter_Definitions RTC Extended Tamper Filter Definitions
mbed_official 376:cb4d9db17537 312 * @{
mbed_official 376:cb4d9db17537 313 */
mbed_official 376:cb4d9db17537 314 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
mbed_official 376:cb4d9db17537 315
mbed_official 489:119543c9f674 316 #define RTC_TAMPERFILTER_2SAMPLE RTC_TAMPCR_TAMPFLT_0 /*!< Tamper is activated after 2
mbed_official 376:cb4d9db17537 317 consecutive samples at the active level */
mbed_official 489:119543c9f674 318 #define RTC_TAMPERFILTER_4SAMPLE RTC_TAMPCR_TAMPFLT_1 /*!< Tamper is activated after 4
mbed_official 376:cb4d9db17537 319 consecutive samples at the active level */
mbed_official 489:119543c9f674 320 #define RTC_TAMPERFILTER_8SAMPLE RTC_TAMPCR_TAMPFLT /*!< Tamper is activated after 8
mbed_official 376:cb4d9db17537 321 consecutive samples at the active leve. */
mbed_official 376:cb4d9db17537 322
mbed_official 489:119543c9f674 323 #define IS_RTC_TAMPER_FILTER(__FILTER__) (((__FILTER__) == RTC_TAMPERFILTER_DISABLE) || \
mbed_official 489:119543c9f674 324 ((__FILTER__) == RTC_TAMPERFILTER_2SAMPLE) || \
mbed_official 489:119543c9f674 325 ((__FILTER__) == RTC_TAMPERFILTER_4SAMPLE) || \
mbed_official 489:119543c9f674 326 ((__FILTER__) == RTC_TAMPERFILTER_8SAMPLE))
mbed_official 376:cb4d9db17537 327 /**
mbed_official 376:cb4d9db17537 328 * @}
mbed_official 376:cb4d9db17537 329 */
mbed_official 376:cb4d9db17537 330
mbed_official 489:119543c9f674 331 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTC Extended Tamper Sampling Frequencies Definitions
mbed_official 376:cb4d9db17537 332 * @{
mbed_official 376:cb4d9db17537 333 */
mbed_official 489:119543c9f674 334 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
mbed_official 489:119543c9f674 335 with a frequency = RTCCLK / 32768 */
mbed_official 489:119543c9f674 336 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 RTC_TAMPCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled
mbed_official 489:119543c9f674 337 with a frequency = RTCCLK / 16384 */
mbed_official 489:119543c9f674 338 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 RTC_TAMPCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled
mbed_official 489:119543c9f674 339 with a frequency = RTCCLK / 8192 */
mbed_official 489:119543c9f674 340 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_1)) /*!< Each of the tamper inputs are sampled
mbed_official 489:119543c9f674 341 with a frequency = RTCCLK / 4096 */
mbed_official 489:119543c9f674 342 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 RTC_TAMPCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled
mbed_official 489:119543c9f674 343 with a frequency = RTCCLK / 2048 */
mbed_official 489:119543c9f674 344 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_2)) /*!< Each of the tamper inputs are sampled
mbed_official 489:119543c9f674 345 with a frequency = RTCCLK / 1024 */
mbed_official 489:119543c9f674 346 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_1 | RTC_TAMPCR_TAMPFREQ_2)) /*!< Each of the tamper inputs are sampled
mbed_official 489:119543c9f674 347 with a frequency = RTCCLK / 512 */
mbed_official 489:119543c9f674 348 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_1 | \
mbed_official 489:119543c9f674 349 RTC_TAMPCR_TAMPFREQ_2)) /*!< Each of the tamper inputs are sampled
mbed_official 489:119543c9f674 350 with a frequency = RTCCLK / 256 */
mbed_official 376:cb4d9db17537 351
mbed_official 489:119543c9f674 352 #define IS_RTC_TAMPER_SAMPLING_FREQ(__FREQ__) (((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
mbed_official 489:119543c9f674 353 ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
mbed_official 489:119543c9f674 354 ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
mbed_official 489:119543c9f674 355 ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
mbed_official 489:119543c9f674 356 ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
mbed_official 489:119543c9f674 357 ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
mbed_official 489:119543c9f674 358 ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
mbed_official 489:119543c9f674 359 ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
mbed_official 376:cb4d9db17537 360 /**
mbed_official 376:cb4d9db17537 361 * @}
mbed_official 376:cb4d9db17537 362 */
mbed_official 376:cb4d9db17537 363
mbed_official 489:119543c9f674 364 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTC Extended Tamper Pin Precharge Duration Definitions
mbed_official 376:cb4d9db17537 365 * @{
mbed_official 376:cb4d9db17537 366 */
mbed_official 489:119543c9f674 367 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
mbed_official 489:119543c9f674 368 sampling during 1 RTCCLK cycle */
mbed_official 489:119543c9f674 369 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK RTC_TAMPCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before
mbed_official 489:119543c9f674 370 sampling during 2 RTCCLK cycles */
mbed_official 489:119543c9f674 371 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK RTC_TAMPCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before
mbed_official 489:119543c9f674 372 sampling during 4 RTCCLK cycles */
mbed_official 489:119543c9f674 373 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)(RTC_TAMPCR_TAMPPRCH_0 | RTC_TAMPCR_TAMPPRCH_1)) /*!< Tamper pins are pre-charged before
mbed_official 489:119543c9f674 374 sampling during 8 RTCCLK cycles */
mbed_official 376:cb4d9db17537 375
mbed_official 489:119543c9f674 376 #define IS_RTC_TAMPER_PRECHARGE_DURATION(__DURATION_) (((__DURATION_) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
mbed_official 489:119543c9f674 377 ((__DURATION_) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
mbed_official 489:119543c9f674 378 ((__DURATION_) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
mbed_official 489:119543c9f674 379 ((__DURATION_) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
mbed_official 376:cb4d9db17537 380 /**
mbed_official 376:cb4d9db17537 381 * @}
mbed_official 376:cb4d9db17537 382 */
mbed_official 376:cb4d9db17537 383
mbed_official 489:119543c9f674 384 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTC Extended Tamper TimeStampOnTamperDetection Definitions
mbed_official 376:cb4d9db17537 385 * @{
mbed_official 376:cb4d9db17537 386 */
mbed_official 489:119543c9f674 387 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE RTC_TAMPCR_TAMPTS /*!< TimeStamp on Tamper Detection event saved */
mbed_official 489:119543c9f674 388 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
mbed_official 376:cb4d9db17537 389
mbed_official 489:119543c9f674 390 #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(__DETECTION__) (((__DETECTION__) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
mbed_official 489:119543c9f674 391 ((__DETECTION__) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
mbed_official 376:cb4d9db17537 392 /**
mbed_official 376:cb4d9db17537 393 * @}
mbed_official 376:cb4d9db17537 394 */
mbed_official 376:cb4d9db17537 395
mbed_official 489:119543c9f674 396 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTC Extended Tamper Pull UP Definitions
mbed_official 376:cb4d9db17537 397 * @{
mbed_official 376:cb4d9db17537 398 */
mbed_official 489:119543c9f674 399 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before sampling */
mbed_official 489:119543c9f674 400 #define RTC_TAMPER_PULLUP_DISABLE RTC_TAMPCR_TAMPPUDIS /*!< Tamper pins pre-charge is disabled */
mbed_official 376:cb4d9db17537 401
mbed_official 489:119543c9f674 402 #define IS_RTC_TAMPER_PULLUP_STATE(__STATE__) (((__STATE__) == RTC_TAMPER_PULLUP_ENABLE) || \
mbed_official 489:119543c9f674 403 ((__STATE__) == RTC_TAMPER_PULLUP_DISABLE))
mbed_official 376:cb4d9db17537 404 /**
mbed_official 376:cb4d9db17537 405 * @}
mbed_official 376:cb4d9db17537 406 */
mbed_official 376:cb4d9db17537 407
mbed_official 489:119543c9f674 408 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTC Extended Wakeup Timer Definitions
mbed_official 376:cb4d9db17537 409 * @{
mbed_official 376:cb4d9db17537 410 */
mbed_official 376:cb4d9db17537 411 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 412 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 RTC_CR_WUCKSEL_0
mbed_official 489:119543c9f674 413 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 RTC_CR_WUCKSEL_1
mbed_official 489:119543c9f674 414 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t) (RTC_CR_WUCKSEL_0 | RTC_CR_WUCKSEL_1))
mbed_official 489:119543c9f674 415 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS RTC_CR_WUCKSEL_2
mbed_official 489:119543c9f674 416 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t) (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_2))
mbed_official 376:cb4d9db17537 417
mbed_official 489:119543c9f674 418 #define IS_RTC_WAKEUP_CLOCK(__CLOCK__) (((__CLOCK__) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
mbed_official 489:119543c9f674 419 ((__CLOCK__) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
mbed_official 489:119543c9f674 420 ((__CLOCK__) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
mbed_official 489:119543c9f674 421 ((__CLOCK__) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
mbed_official 489:119543c9f674 422 ((__CLOCK__) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
mbed_official 489:119543c9f674 423 ((__CLOCK__) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
mbed_official 376:cb4d9db17537 424
mbed_official 489:119543c9f674 425 #define IS_RTC_WAKEUP_COUNTER(__COUNTER__) ((__COUNTER__) <= RTC_WUTR_WUT)
mbed_official 376:cb4d9db17537 426 /**
mbed_official 376:cb4d9db17537 427 * @}
mbed_official 376:cb4d9db17537 428 */
mbed_official 376:cb4d9db17537 429
mbed_official 489:119543c9f674 430 /** @defgroup RTCEx_Smooth_calib_period_Definitions RTC Extended Smooth calib period Definitions
mbed_official 376:cb4d9db17537 431 * @{
mbed_official 376:cb4d9db17537 432 */
mbed_official 489:119543c9f674 433 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
mbed_official 489:119543c9f674 434 period is 32s, else 2exp20 RTCCLK pulses */
mbed_official 489:119543c9f674 435 #define RTC_SMOOTHCALIB_PERIOD_16SEC RTC_CAL_CALW16 /*!< If RTCCLK = 32768 Hz, Smooth calibation
mbed_official 489:119543c9f674 436 period is 16s, else 2exp19 RTCCLK pulses */
mbed_official 489:119543c9f674 437 #define RTC_SMOOTHCALIB_PERIOD_8SEC RTC_CAL_CALW8 /*!< If RTCCLK = 32768 Hz, Smooth calibation
mbed_official 489:119543c9f674 438 period is 8s, else 2exp18 RTCCLK pulses */
mbed_official 376:cb4d9db17537 439
mbed_official 489:119543c9f674 440 #define IS_RTC_SMOOTH_CALIB_PERIOD(__PERIOD__) (((__PERIOD__) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
mbed_official 489:119543c9f674 441 ((__PERIOD__) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
mbed_official 489:119543c9f674 442 ((__PERIOD__) == RTC_SMOOTHCALIB_PERIOD_8SEC))
mbed_official 376:cb4d9db17537 443 /**
mbed_official 376:cb4d9db17537 444 * @}
mbed_official 376:cb4d9db17537 445 */
mbed_official 376:cb4d9db17537 446
mbed_official 489:119543c9f674 447 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTC Extended Smooth calib Plus pulses Definitions
mbed_official 376:cb4d9db17537 448 * @{
mbed_official 376:cb4d9db17537 449 */
mbed_official 489:119543c9f674 450 #define RTC_SMOOTHCALIB_PLUSPULSES_SET RTC_CAL_CALP /*!< The number of RTCCLK pulses added
mbed_official 376:cb4d9db17537 451 during a X -second window = Y - CALM[8:0]
mbed_official 376:cb4d9db17537 452 with Y = 512, 256, 128 when X = 32, 16, 8 */
mbed_official 376:cb4d9db17537 453 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
mbed_official 376:cb4d9db17537 454 during a 32-second window = CALM[8:0] */
mbed_official 376:cb4d9db17537 455
mbed_official 489:119543c9f674 456 #define IS_RTC_SMOOTH_CALIB_PLUS(__PLUS__) (((__PLUS__) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
mbed_official 489:119543c9f674 457 ((__PLUS__) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
mbed_official 376:cb4d9db17537 458 /**
mbed_official 376:cb4d9db17537 459 * @}
mbed_official 376:cb4d9db17537 460 */
mbed_official 376:cb4d9db17537 461
mbed_official 489:119543c9f674 462 /** @defgroup RTCEx_Smooth_calib_Minus_pulses_Definitions RTC Extended Smooth calib Minus pulses Definitions
mbed_official 376:cb4d9db17537 463 * @{
mbed_official 376:cb4d9db17537 464 */
mbed_official 489:119543c9f674 465 #define IS_RTC_SMOOTH_CALIB_MINUS(__VALUE__) ((__VALUE__) <= RTC_CAL_CALM)
mbed_official 376:cb4d9db17537 466 /**
mbed_official 376:cb4d9db17537 467 * @}
mbed_official 376:cb4d9db17537 468 */
mbed_official 376:cb4d9db17537 469
mbed_official 489:119543c9f674 470 /** @defgroup RTCEx_Add_1_Second_Parameter_Definition RTC Extended Add 1 Second Parameter Definitions
mbed_official 376:cb4d9db17537 471 * @{
mbed_official 376:cb4d9db17537 472 */
mbed_official 376:cb4d9db17537 473 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 474 #define RTC_SHIFTADD1S_SET RTC_SHIFTR_ADD1S
mbed_official 376:cb4d9db17537 475
mbed_official 489:119543c9f674 476 #define IS_RTC_SHIFT_ADD1S(__SEL__) (((__SEL__) == RTC_SHIFTADD1S_RESET) || \
mbed_official 489:119543c9f674 477 ((__SEL__) == RTC_SHIFTADD1S_SET))
mbed_official 376:cb4d9db17537 478 /**
mbed_official 376:cb4d9db17537 479 * @}
mbed_official 376:cb4d9db17537 480 */
mbed_official 376:cb4d9db17537 481
mbed_official 489:119543c9f674 482 /** @defgroup RTCEx_Substract_Fraction_Of_Second_Value RTC Extended Substract Fraction Of Second Value
mbed_official 376:cb4d9db17537 483 * @{
mbed_official 376:cb4d9db17537 484 */
mbed_official 489:119543c9f674 485 #define IS_RTC_SHIFT_SUBFS(__FS__) ((__FS__) <= RTC_SHIFTR_SUBFS)
mbed_official 376:cb4d9db17537 486 /**
mbed_official 376:cb4d9db17537 487 * @}
mbed_official 376:cb4d9db17537 488 */
mbed_official 376:cb4d9db17537 489
mbed_official 489:119543c9f674 490 /** @defgroup RTCEx_Calib_Output_selection_Definitions RTC Extended Calib Output selection Definitions
mbed_official 376:cb4d9db17537 491 * @{
mbed_official 376:cb4d9db17537 492 */
mbed_official 376:cb4d9db17537 493 #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 494 #define RTC_CALIBOUTPUT_1HZ RTC_CR_COSEL
mbed_official 376:cb4d9db17537 495
mbed_official 489:119543c9f674 496 #define IS_RTC_CALIB_OUTPUT(__OUTPUT__) (((__OUTPUT__) == RTC_CALIBOUTPUT_512HZ) || \
mbed_official 489:119543c9f674 497 ((__OUTPUT__) == RTC_CALIBOUTPUT_1HZ))
mbed_official 376:cb4d9db17537 498 /**
mbed_official 376:cb4d9db17537 499 * @}
mbed_official 376:cb4d9db17537 500 */
mbed_official 376:cb4d9db17537 501
mbed_official 376:cb4d9db17537 502 /**
mbed_official 376:cb4d9db17537 503 * @}
mbed_official 376:cb4d9db17537 504 */
mbed_official 376:cb4d9db17537 505
mbed_official 376:cb4d9db17537 506 /* Exported macro ------------------------------------------------------------*/
mbed_official 489:119543c9f674 507 /** @defgroup RTCEx_Exported_Macros RTC Extended Exported Macros
mbed_official 489:119543c9f674 508 * @{
mbed_official 489:119543c9f674 509 */
mbed_official 376:cb4d9db17537 510
mbed_official 376:cb4d9db17537 511 /**
mbed_official 376:cb4d9db17537 512 * @brief Enable the RTC WakeUp Timer peripheral.
mbed_official 376:cb4d9db17537 513 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 514 * @retval None
mbed_official 376:cb4d9db17537 515 */
mbed_official 376:cb4d9db17537 516 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
mbed_official 376:cb4d9db17537 517
mbed_official 376:cb4d9db17537 518 /**
mbed_official 489:119543c9f674 519 * @brief Enable the RTC TimeStamp peripheral.
mbed_official 489:119543c9f674 520 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 521 * @retval None
mbed_official 489:119543c9f674 522 */
mbed_official 489:119543c9f674 523 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
mbed_official 489:119543c9f674 524
mbed_official 489:119543c9f674 525 /**
mbed_official 376:cb4d9db17537 526 * @brief Disable the RTC WakeUp Timer peripheral.
mbed_official 376:cb4d9db17537 527 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 528 * @retval None
mbed_official 376:cb4d9db17537 529 */
mbed_official 376:cb4d9db17537 530 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
mbed_official 376:cb4d9db17537 531
mbed_official 376:cb4d9db17537 532 /**
mbed_official 376:cb4d9db17537 533 * @brief Disable the RTC TimeStamp peripheral.
mbed_official 376:cb4d9db17537 534 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 535 * @retval None
mbed_official 376:cb4d9db17537 536 */
mbed_official 376:cb4d9db17537 537 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
mbed_official 376:cb4d9db17537 538
mbed_official 376:cb4d9db17537 539 /**
mbed_official 376:cb4d9db17537 540 * @brief Enable the RTC calibration output.
mbed_official 376:cb4d9db17537 541 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 542 * @retval None
mbed_official 376:cb4d9db17537 543 */
mbed_official 489:119543c9f674 544 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
mbed_official 376:cb4d9db17537 545
mbed_official 376:cb4d9db17537 546 /**
mbed_official 376:cb4d9db17537 547 * @brief Disable the calibration output.
mbed_official 376:cb4d9db17537 548 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 549 * @retval None
mbed_official 376:cb4d9db17537 550 */
mbed_official 489:119543c9f674 551 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
mbed_official 376:cb4d9db17537 552
mbed_official 376:cb4d9db17537 553 /**
mbed_official 376:cb4d9db17537 554 * @brief Enable the clock reference detection.
mbed_official 376:cb4d9db17537 555 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 556 * @retval None
mbed_official 376:cb4d9db17537 557 */
mbed_official 489:119543c9f674 558 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
mbed_official 376:cb4d9db17537 559
mbed_official 376:cb4d9db17537 560 /**
mbed_official 376:cb4d9db17537 561 * @brief Disable the clock reference detection.
mbed_official 376:cb4d9db17537 562 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 563 * @retval None
mbed_official 376:cb4d9db17537 564 */
mbed_official 489:119543c9f674 565 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
mbed_official 376:cb4d9db17537 566
mbed_official 376:cb4d9db17537 567 /**
mbed_official 376:cb4d9db17537 568 * @brief Enable the RTC TimeStamp interrupt.
mbed_official 376:cb4d9db17537 569 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 570 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 571 * This parameter can be:
mbed_official 376:cb4d9db17537 572 * @arg RTC_IT_TS: TimeStamp interrupt
mbed_official 376:cb4d9db17537 573 * @retval None
mbed_official 376:cb4d9db17537 574 */
mbed_official 376:cb4d9db17537 575 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
mbed_official 376:cb4d9db17537 576
mbed_official 376:cb4d9db17537 577 /**
mbed_official 489:119543c9f674 578 * @brief Enable the RTC WakeUpTimer interrupt.
mbed_official 489:119543c9f674 579 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 580 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
mbed_official 489:119543c9f674 581 * This parameter can be:
mbed_official 489:119543c9f674 582 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
mbed_official 489:119543c9f674 583 * @retval None
mbed_official 489:119543c9f674 584 */
mbed_official 489:119543c9f674 585 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
mbed_official 489:119543c9f674 586
mbed_official 489:119543c9f674 587 /**
mbed_official 376:cb4d9db17537 588 * @brief Disable the RTC TimeStamp interrupt.
mbed_official 376:cb4d9db17537 589 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 590 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 591 * This parameter can be:
mbed_official 376:cb4d9db17537 592 * @arg RTC_IT_TS: TimeStamp interrupt
mbed_official 376:cb4d9db17537 593 * @retval None
mbed_official 376:cb4d9db17537 594 */
mbed_official 376:cb4d9db17537 595 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
mbed_official 376:cb4d9db17537 596
mbed_official 376:cb4d9db17537 597 /**
mbed_official 376:cb4d9db17537 598 * @brief Disable the RTC WakeUpTimer interrupt.
mbed_official 376:cb4d9db17537 599 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 600 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 601 * This parameter can be:
mbed_official 376:cb4d9db17537 602 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
mbed_official 376:cb4d9db17537 603 * @retval None
mbed_official 376:cb4d9db17537 604 */
mbed_official 376:cb4d9db17537 605 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
mbed_official 376:cb4d9db17537 606
mbed_official 376:cb4d9db17537 607 /**
mbed_official 376:cb4d9db17537 608 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
mbed_official 376:cb4d9db17537 609 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 610 * @param __FLAG__: specifies the RTC Tamper interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 611 * This parameter can be:
mbed_official 376:cb4d9db17537 612 * @arg RTC_IT_TAMP1
mbed_official 376:cb4d9db17537 613 * @retval None
mbed_official 376:cb4d9db17537 614 */
mbed_official 376:cb4d9db17537 615 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 616
mbed_official 376:cb4d9db17537 617 /**
mbed_official 376:cb4d9db17537 618 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
mbed_official 376:cb4d9db17537 619 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 620 * @param __FLAG__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 621 * This parameter can be:
mbed_official 376:cb4d9db17537 622 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
mbed_official 376:cb4d9db17537 623 * @retval None
mbed_official 376:cb4d9db17537 624 */
mbed_official 376:cb4d9db17537 625 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 626
mbed_official 376:cb4d9db17537 627 /**
mbed_official 376:cb4d9db17537 628 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
mbed_official 376:cb4d9db17537 629 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 630 * @param __FLAG__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 631 * This parameter can be:
mbed_official 376:cb4d9db17537 632 * @arg RTC_IT_TS: TimeStamp interrupt
mbed_official 376:cb4d9db17537 633 * @retval None
mbed_official 376:cb4d9db17537 634 */
mbed_official 376:cb4d9db17537 635 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 636
mbed_official 376:cb4d9db17537 637 /**
mbed_official 376:cb4d9db17537 638 * @brief Get the selected RTC TimeStamp's flag status.
mbed_official 376:cb4d9db17537 639 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 640 * @param __FLAG__: specifies the RTC TimeStamp Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 641 * This parameter can be:
mbed_official 376:cb4d9db17537 642 * @arg RTC_FLAG_TSF
mbed_official 376:cb4d9db17537 643 * @arg RTC_FLAG_TSOVF
mbed_official 376:cb4d9db17537 644 * @retval None
mbed_official 376:cb4d9db17537 645 */
mbed_official 376:cb4d9db17537 646 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 647
mbed_official 376:cb4d9db17537 648 /**
mbed_official 376:cb4d9db17537 649 * @brief Get the selected RTC WakeUpTimer's flag status.
mbed_official 376:cb4d9db17537 650 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 651 * @param __FLAG__: specifies the RTC WakeUpTimer Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 652 * This parameter can be:
mbed_official 376:cb4d9db17537 653 * @arg RTC_FLAG_WUTF
mbed_official 376:cb4d9db17537 654 * @arg RTC_FLAG_WUTWF
mbed_official 376:cb4d9db17537 655 * @retval None
mbed_official 376:cb4d9db17537 656 */
mbed_official 376:cb4d9db17537 657 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 658
mbed_official 376:cb4d9db17537 659 /**
mbed_official 376:cb4d9db17537 660 * @brief Get the selected RTC Tamper's flag status.
mbed_official 376:cb4d9db17537 661 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 662 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 663 * This parameter can be:
mbed_official 376:cb4d9db17537 664 * @arg RTC_FLAG_TAMP1F
mbed_official 376:cb4d9db17537 665 * @retval None
mbed_official 376:cb4d9db17537 666 */
mbed_official 376:cb4d9db17537 667 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 668
mbed_official 376:cb4d9db17537 669 /**
mbed_official 376:cb4d9db17537 670 * @brief Get the selected RTC shift operation's flag status.
mbed_official 376:cb4d9db17537 671 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 672 * @param __FLAG__: specifies the RTC shift operation Flag is pending or not.
mbed_official 376:cb4d9db17537 673 * This parameter can be:
mbed_official 376:cb4d9db17537 674 * @arg RTC_FLAG_SHPF
mbed_official 376:cb4d9db17537 675 * @retval None
mbed_official 376:cb4d9db17537 676 */
mbed_official 376:cb4d9db17537 677 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 376:cb4d9db17537 678
mbed_official 376:cb4d9db17537 679 /**
mbed_official 376:cb4d9db17537 680 * @brief Clear the RTC Time Stamp's pending flags.
mbed_official 376:cb4d9db17537 681 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 682 * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 683 * This parameter can be:
mbed_official 376:cb4d9db17537 684 * @arg RTC_FLAG_TSF
mbed_official 376:cb4d9db17537 685 * @retval None
mbed_official 376:cb4d9db17537 686 */
mbed_official 489:119543c9f674 687 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& RTC_FLAGS_MASK)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
mbed_official 376:cb4d9db17537 688
mbed_official 376:cb4d9db17537 689 /**
mbed_official 376:cb4d9db17537 690 * @brief Clear the RTC Tamper's pending flags.
mbed_official 376:cb4d9db17537 691 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 692 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 693 * This parameter can be:
mbed_official 376:cb4d9db17537 694 * @arg RTC_FLAG_TAMP1F
mbed_official 376:cb4d9db17537 695 * @retval None
mbed_official 376:cb4d9db17537 696 */
mbed_official 489:119543c9f674 697 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& RTC_FLAGS_MASK)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
mbed_official 376:cb4d9db17537 698
mbed_official 376:cb4d9db17537 699 /**
mbed_official 376:cb4d9db17537 700 * @brief Clear the RTC Wake Up timer's pending flags.
mbed_official 376:cb4d9db17537 701 * @param __HANDLE__: specifies the RTC handle.
mbed_official 376:cb4d9db17537 702 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
mbed_official 376:cb4d9db17537 703 * This parameter can be:
mbed_official 376:cb4d9db17537 704 * @arg RTC_FLAG_WUTF
mbed_official 376:cb4d9db17537 705 * @retval None
mbed_official 376:cb4d9db17537 706 */
mbed_official 489:119543c9f674 707 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& RTC_FLAGS_MASK)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
mbed_official 489:119543c9f674 708
mbed_official 489:119543c9f674 709 /* WAKE-UP TIMER EXTI */
mbed_official 489:119543c9f674 710 /* ------------------ */
mbed_official 489:119543c9f674 711 /**
mbed_official 489:119543c9f674 712 * @brief Enable interrupt on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 713 * @retval None
mbed_official 489:119543c9f674 714 */
mbed_official 489:119543c9f674 715 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
mbed_official 489:119543c9f674 716
mbed_official 489:119543c9f674 717 /**
mbed_official 489:119543c9f674 718 * @brief Disable interrupt on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 719 * @retval None
mbed_official 489:119543c9f674 720 */
mbed_official 489:119543c9f674 721 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
mbed_official 489:119543c9f674 722
mbed_official 489:119543c9f674 723 /**
mbed_official 489:119543c9f674 724 * @brief Enable event on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 725 * @retval None.
mbed_official 489:119543c9f674 726 */
mbed_official 489:119543c9f674 727 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
mbed_official 489:119543c9f674 728
mbed_official 489:119543c9f674 729 /**
mbed_official 489:119543c9f674 730 * @brief Disable event on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 731 * @retval None.
mbed_official 489:119543c9f674 732 */
mbed_official 489:119543c9f674 733 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
mbed_official 489:119543c9f674 734
mbed_official 489:119543c9f674 735 /**
mbed_official 489:119543c9f674 736 * @brief Enable falling edge trigger on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 737 * @retval None.
mbed_official 489:119543c9f674 738 */
mbed_official 489:119543c9f674 739 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
mbed_official 489:119543c9f674 740
mbed_official 489:119543c9f674 741 /**
mbed_official 489:119543c9f674 742 * @brief Disable falling edge trigger on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 743 * @retval None.
mbed_official 489:119543c9f674 744 */
mbed_official 489:119543c9f674 745 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
mbed_official 489:119543c9f674 746
mbed_official 489:119543c9f674 747 /**
mbed_official 489:119543c9f674 748 * @brief Enable rising edge trigger on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 749 * @retval None.
mbed_official 489:119543c9f674 750 */
mbed_official 489:119543c9f674 751 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
mbed_official 489:119543c9f674 752
mbed_official 489:119543c9f674 753 /**
mbed_official 489:119543c9f674 754 * @brief Disable rising edge trigger on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 755 * @retval None.
mbed_official 489:119543c9f674 756 */
mbed_official 489:119543c9f674 757 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
mbed_official 489:119543c9f674 758
mbed_official 489:119543c9f674 759 /**
mbed_official 489:119543c9f674 760 * @brief Enable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 761 * @retval None.
mbed_official 489:119543c9f674 762 */
mbed_official 489:119543c9f674 763 #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 489:119543c9f674 764
mbed_official 489:119543c9f674 765 /**
mbed_official 489:119543c9f674 766 * @brief Disable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 767 * This parameter can be:
mbed_official 489:119543c9f674 768 * @retval None.
mbed_official 489:119543c9f674 769 */
mbed_official 489:119543c9f674 770 #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 489:119543c9f674 771
mbed_official 489:119543c9f674 772 /**
mbed_official 489:119543c9f674 773 * @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not.
mbed_official 489:119543c9f674 774 * @retval Line Status.
mbed_official 489:119543c9f674 775 */
mbed_official 489:119543c9f674 776 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
mbed_official 489:119543c9f674 777
mbed_official 489:119543c9f674 778 /**
mbed_official 489:119543c9f674 779 * @brief Clear the RTC WakeUp Timer associated Exti line flag.
mbed_official 489:119543c9f674 780 * @retval None.
mbed_official 489:119543c9f674 781 */
mbed_official 489:119543c9f674 782 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
mbed_official 489:119543c9f674 783
mbed_official 489:119543c9f674 784 /**
mbed_official 489:119543c9f674 785 * @brief Generate a Software interrupt on the RTC WakeUp Timer associated Exti line.
mbed_official 489:119543c9f674 786 * @retval None.
mbed_official 489:119543c9f674 787 */
mbed_official 489:119543c9f674 788 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
mbed_official 489:119543c9f674 789
mbed_official 489:119543c9f674 790
mbed_official 489:119543c9f674 791 /* TAMPER TIMESTAMP EXTI */
mbed_official 489:119543c9f674 792 /* --------------------- */
mbed_official 489:119543c9f674 793 /**
mbed_official 489:119543c9f674 794 * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 795 * @retval None
mbed_official 489:119543c9f674 796 */
mbed_official 489:119543c9f674 797 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
mbed_official 489:119543c9f674 798
mbed_official 489:119543c9f674 799 /**
mbed_official 489:119543c9f674 800 * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 801 * @retval None
mbed_official 489:119543c9f674 802 */
mbed_official 489:119543c9f674 803 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
mbed_official 489:119543c9f674 804
mbed_official 489:119543c9f674 805 /**
mbed_official 489:119543c9f674 806 * @brief Enable event on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 807 * @retval None.
mbed_official 489:119543c9f674 808 */
mbed_official 489:119543c9f674 809 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
mbed_official 489:119543c9f674 810
mbed_official 489:119543c9f674 811 /**
mbed_official 489:119543c9f674 812 * @brief Disable event on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 813 * @retval None.
mbed_official 489:119543c9f674 814 */
mbed_official 489:119543c9f674 815 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
mbed_official 489:119543c9f674 816
mbed_official 489:119543c9f674 817 /**
mbed_official 489:119543c9f674 818 * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 819 * @retval None.
mbed_official 489:119543c9f674 820 */
mbed_official 489:119543c9f674 821 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
mbed_official 489:119543c9f674 822
mbed_official 489:119543c9f674 823 /**
mbed_official 489:119543c9f674 824 * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 825 * @retval None.
mbed_official 489:119543c9f674 826 */
mbed_official 489:119543c9f674 827 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
mbed_official 489:119543c9f674 828
mbed_official 489:119543c9f674 829 /**
mbed_official 489:119543c9f674 830 * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 831 * @retval None.
mbed_official 489:119543c9f674 832 */
mbed_official 489:119543c9f674 833 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
mbed_official 489:119543c9f674 834
mbed_official 489:119543c9f674 835 /**
mbed_official 489:119543c9f674 836 * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 837 * @retval None.
mbed_official 489:119543c9f674 838 */
mbed_official 489:119543c9f674 839 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
mbed_official 489:119543c9f674 840
mbed_official 489:119543c9f674 841 /**
mbed_official 489:119543c9f674 842 * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 843 * @retval None.
mbed_official 489:119543c9f674 844 */
mbed_official 489:119543c9f674 845 #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 489:119543c9f674 846
mbed_official 489:119543c9f674 847 /**
mbed_official 489:119543c9f674 848 * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
mbed_official 489:119543c9f674 849 * This parameter can be:
mbed_official 489:119543c9f674 850 * @retval None.
mbed_official 489:119543c9f674 851 */
mbed_official 489:119543c9f674 852 #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 489:119543c9f674 853
mbed_official 489:119543c9f674 854 /**
mbed_official 489:119543c9f674 855 * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not.
mbed_official 489:119543c9f674 856 * @retval Line Status.
mbed_official 489:119543c9f674 857 */
mbed_official 489:119543c9f674 858 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
mbed_official 489:119543c9f674 859
mbed_official 489:119543c9f674 860 /**
mbed_official 489:119543c9f674 861 * @brief Clear the RTC Tamper and Timestamp associated Exti line flag.
mbed_official 489:119543c9f674 862 * @retval None.
mbed_official 489:119543c9f674 863 */
mbed_official 489:119543c9f674 864 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
mbed_official 489:119543c9f674 865
mbed_official 489:119543c9f674 866 /**
mbed_official 489:119543c9f674 867 * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line
mbed_official 489:119543c9f674 868 * @retval None.
mbed_official 489:119543c9f674 869 */
mbed_official 489:119543c9f674 870 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
mbed_official 489:119543c9f674 871
mbed_official 376:cb4d9db17537 872
mbed_official 376:cb4d9db17537 873 /**
mbed_official 376:cb4d9db17537 874 * @}
mbed_official 376:cb4d9db17537 875 */
mbed_official 376:cb4d9db17537 876
mbed_official 376:cb4d9db17537 877 /* Exported functions --------------------------------------------------------*/
mbed_official 489:119543c9f674 878 /** @defgroup RTCEx_Exported_Functions RTC Extended Exported Functions
mbed_official 489:119543c9f674 879 * @{
mbed_official 489:119543c9f674 880 */
mbed_official 489:119543c9f674 881
mbed_official 489:119543c9f674 882 /** @defgroup RTCEx_Exported_Functions_Group1 Extended RTC TimeStamp and Tamper functions
mbed_official 489:119543c9f674 883 * @{
mbed_official 489:119543c9f674 884 */
mbed_official 376:cb4d9db17537 885
mbed_official 376:cb4d9db17537 886 /* RTC TimeStamp and Tamper functions *****************************************/
mbed_official 376:cb4d9db17537 887 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
mbed_official 376:cb4d9db17537 888 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
mbed_official 376:cb4d9db17537 889 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 890 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
mbed_official 376:cb4d9db17537 891
mbed_official 376:cb4d9db17537 892 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
mbed_official 376:cb4d9db17537 893 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
mbed_official 376:cb4d9db17537 894 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
mbed_official 489:119543c9f674 895 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 896
mbed_official 489:119543c9f674 897 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 898 void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 899
mbed_official 489:119543c9f674 900 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
mbed_official 489:119543c9f674 901 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx)
mbed_official 489:119543c9f674 902
mbed_official 489:119543c9f674 903 void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 904
mbed_official 489:119543c9f674 905 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
mbed_official 489:119543c9f674 906 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx)
mbed_official 489:119543c9f674 907 */
mbed_official 489:119543c9f674 908
mbed_official 489:119543c9f674 909 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 910 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 489:119543c9f674 911 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 489:119543c9f674 912 HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 489:119543c9f674 913
mbed_official 489:119543c9f674 914 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
mbed_official 489:119543c9f674 915 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx)
mbed_official 489:119543c9f674 916
mbed_official 489:119543c9f674 917 HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 489:119543c9f674 918
mbed_official 489:119543c9f674 919 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
mbed_official 489:119543c9f674 920 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx)
mbed_official 489:119543c9f674 921 */
mbed_official 489:119543c9f674 922
mbed_official 489:119543c9f674 923 /**
mbed_official 489:119543c9f674 924 * @}
mbed_official 489:119543c9f674 925 */
mbed_official 489:119543c9f674 926
mbed_official 489:119543c9f674 927 /** @defgroup RTCEx_Exported_Functions_Group2 Extended RTC Wake-up functions
mbed_official 489:119543c9f674 928 * @{
mbed_official 489:119543c9f674 929 */
mbed_official 489:119543c9f674 930
mbed_official 489:119543c9f674 931 /* RTC Wake-up functions ******************************************************/
mbed_official 376:cb4d9db17537 932 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
mbed_official 376:cb4d9db17537 933 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
mbed_official 376:cb4d9db17537 934 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 935 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 936 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 937 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 938 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 489:119543c9f674 939 /**
mbed_official 489:119543c9f674 940 * @}
mbed_official 489:119543c9f674 941 */
mbed_official 376:cb4d9db17537 942
mbed_official 489:119543c9f674 943 /** @defgroup RTCEx_Exported_Functions_Group3 Extended Peripheral Control functions
mbed_official 489:119543c9f674 944 * @{
mbed_official 489:119543c9f674 945 */
mbed_official 489:119543c9f674 946
mbed_official 489:119543c9f674 947 /* Extended Control functions ************************************************/
mbed_official 376:cb4d9db17537 948 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
mbed_official 376:cb4d9db17537 949 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
mbed_official 376:cb4d9db17537 950
mbed_official 376:cb4d9db17537 951 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue);
mbed_official 376:cb4d9db17537 952 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
mbed_official 376:cb4d9db17537 953 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
mbed_official 376:cb4d9db17537 954 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 955 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 956 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 957 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
mbed_official 376:cb4d9db17537 958 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 959 /**
mbed_official 489:119543c9f674 960 * @}
mbed_official 489:119543c9f674 961 */
mbed_official 376:cb4d9db17537 962
mbed_official 489:119543c9f674 963 /* Extended RTC features functions *******************************************/
mbed_official 489:119543c9f674 964 /** @defgroup RTCEx_Exported_Functions_Group4 Extended features functions
mbed_official 489:119543c9f674 965 * @{
mbed_official 489:119543c9f674 966 */
mbed_official 489:119543c9f674 967 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 968 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 376:cb4d9db17537 969
mbed_official 489:119543c9f674 970 /**
mbed_official 489:119543c9f674 971 * @}
mbed_official 489:119543c9f674 972 */
mbed_official 376:cb4d9db17537 973
mbed_official 489:119543c9f674 974 /**
mbed_official 489:119543c9f674 975 * @}
mbed_official 489:119543c9f674 976 */
mbed_official 376:cb4d9db17537 977
mbed_official 376:cb4d9db17537 978 /**
mbed_official 376:cb4d9db17537 979 * @}
mbed_official 376:cb4d9db17537 980 */
mbed_official 376:cb4d9db17537 981
mbed_official 376:cb4d9db17537 982 /**
mbed_official 376:cb4d9db17537 983 * @}
mbed_official 376:cb4d9db17537 984 */
mbed_official 376:cb4d9db17537 985
mbed_official 376:cb4d9db17537 986 #ifdef __cplusplus
mbed_official 376:cb4d9db17537 987 }
mbed_official 376:cb4d9db17537 988 #endif
mbed_official 376:cb4d9db17537 989
mbed_official 489:119543c9f674 990 #endif /* __STM32L0xx_HAL_RTC_EX_H */
mbed_official 376:cb4d9db17537 991
mbed_official 376:cb4d9db17537 992 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
mbed_official 489:119543c9f674 993