my fork

Dependents:   Nucleo_blueNRG

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Oct 28 16:40:41 2014 +0000
Revision:
90:cb3d968589d8
Release 90 of the mbed library

Changes:

- Freescale KSDK update (v1.0)
- K22 - new target addition
- KL43Z - new target addition
- Nucleo F091RC - new target addition
- Nucleo L152RE - STM32Cube driver
- Nordic - Softdevice v7.1.0
- Nvic files - BSD License
- LPC824 - various HAL fixes
- Nucleo F411RE - CMSIS - IAR files

Who changed what in which revision?

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