mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Tue Jun 24 14:45:08 2014 +0100
Revision:
237:f3da66175598
Synchronized with git revision 8ef659bca81f12dfc896b5a7af7c2abbd1a1b8b7

Full URL: https://github.com/mbedmicro/mbed/commit/8ef659bca81f12dfc896b5a7af7c2abbd1a1b8b7/

[NUCLEO_F334R8] Add platform files

Who changed what in which revision?

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