mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Nov 03 10:30:07 2014 +0000
Revision:
381:5460fc57b6e4
Synchronized with git revision 02478cd1f27fc7b9643486472635eb515b2bca81

Full URL: https://github.com/mbedmicro/mbed/commit/02478cd1f27fc7b9643486472635eb515b2bca81/

Target: LPC1549 - Fix serial interrupt issues (issue report #616)

Who changed what in which revision?

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