001
targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_rtc_ex.h@0:13413ea9a877, 2022-06-12 (annotated)
- Committer:
- ganlikun
- Date:
- Sun Jun 12 14:02:44 2022 +0000
- Revision:
- 0:13413ea9a877
00
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ganlikun | 0:13413ea9a877 | 1 | /** |
ganlikun | 0:13413ea9a877 | 2 | ****************************************************************************** |
ganlikun | 0:13413ea9a877 | 3 | * @file stm32f4xx_hal_rtc_ex.h |
ganlikun | 0:13413ea9a877 | 4 | * @author MCD Application Team |
ganlikun | 0:13413ea9a877 | 5 | * @version V1.7.1 |
ganlikun | 0:13413ea9a877 | 6 | * @date 14-April-2017 |
ganlikun | 0:13413ea9a877 | 7 | * @brief Header file of RTC HAL Extension module. |
ganlikun | 0:13413ea9a877 | 8 | ****************************************************************************** |
ganlikun | 0:13413ea9a877 | 9 | * @attention |
ganlikun | 0:13413ea9a877 | 10 | * |
ganlikun | 0:13413ea9a877 | 11 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
ganlikun | 0:13413ea9a877 | 12 | * |
ganlikun | 0:13413ea9a877 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
ganlikun | 0:13413ea9a877 | 14 | * are permitted provided that the following conditions are met: |
ganlikun | 0:13413ea9a877 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
ganlikun | 0:13413ea9a877 | 16 | * this list of conditions and the following disclaimer. |
ganlikun | 0:13413ea9a877 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
ganlikun | 0:13413ea9a877 | 18 | * this list of conditions and the following disclaimer in the documentation |
ganlikun | 0:13413ea9a877 | 19 | * and/or other materials provided with the distribution. |
ganlikun | 0:13413ea9a877 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
ganlikun | 0:13413ea9a877 | 21 | * may be used to endorse or promote products derived from this software |
ganlikun | 0:13413ea9a877 | 22 | * without specific prior written permission. |
ganlikun | 0:13413ea9a877 | 23 | * |
ganlikun | 0:13413ea9a877 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
ganlikun | 0:13413ea9a877 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
ganlikun | 0:13413ea9a877 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
ganlikun | 0:13413ea9a877 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
ganlikun | 0:13413ea9a877 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
ganlikun | 0:13413ea9a877 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
ganlikun | 0:13413ea9a877 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
ganlikun | 0:13413ea9a877 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
ganlikun | 0:13413ea9a877 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
ganlikun | 0:13413ea9a877 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
ganlikun | 0:13413ea9a877 | 34 | * |
ganlikun | 0:13413ea9a877 | 35 | ****************************************************************************** |
ganlikun | 0:13413ea9a877 | 36 | */ |
ganlikun | 0:13413ea9a877 | 37 | |
ganlikun | 0:13413ea9a877 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 39 | #ifndef __STM32F4xx_HAL_RTC_EX_H |
ganlikun | 0:13413ea9a877 | 40 | #define __STM32F4xx_HAL_RTC_EX_H |
ganlikun | 0:13413ea9a877 | 41 | |
ganlikun | 0:13413ea9a877 | 42 | #ifdef __cplusplus |
ganlikun | 0:13413ea9a877 | 43 | extern "C" { |
ganlikun | 0:13413ea9a877 | 44 | #endif |
ganlikun | 0:13413ea9a877 | 45 | |
ganlikun | 0:13413ea9a877 | 46 | /* Includes ------------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 47 | #include "stm32f4xx_hal_def.h" |
ganlikun | 0:13413ea9a877 | 48 | |
ganlikun | 0:13413ea9a877 | 49 | /** @addtogroup STM32F4xx_HAL_Driver |
ganlikun | 0:13413ea9a877 | 50 | * @{ |
ganlikun | 0:13413ea9a877 | 51 | */ |
ganlikun | 0:13413ea9a877 | 52 | |
ganlikun | 0:13413ea9a877 | 53 | /** @addtogroup RTCEx |
ganlikun | 0:13413ea9a877 | 54 | * @{ |
ganlikun | 0:13413ea9a877 | 55 | */ |
ganlikun | 0:13413ea9a877 | 56 | |
ganlikun | 0:13413ea9a877 | 57 | /* Exported types ------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 58 | /** @defgroup RTCEx_Exported_Types RTCEx Exported Types |
ganlikun | 0:13413ea9a877 | 59 | * @{ |
ganlikun | 0:13413ea9a877 | 60 | */ |
ganlikun | 0:13413ea9a877 | 61 | |
ganlikun | 0:13413ea9a877 | 62 | /** |
ganlikun | 0:13413ea9a877 | 63 | * @brief RTC Tamper structure definition |
ganlikun | 0:13413ea9a877 | 64 | */ |
ganlikun | 0:13413ea9a877 | 65 | typedef struct |
ganlikun | 0:13413ea9a877 | 66 | { |
ganlikun | 0:13413ea9a877 | 67 | uint32_t Tamper; /*!< Specifies the Tamper Pin. |
ganlikun | 0:13413ea9a877 | 68 | This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */ |
ganlikun | 0:13413ea9a877 | 69 | |
ganlikun | 0:13413ea9a877 | 70 | uint32_t PinSelection; /*!< Specifies the Tamper Pin. |
ganlikun | 0:13413ea9a877 | 71 | This parameter can be a value of @ref RTCEx_Tamper_Pins_Selection */ |
ganlikun | 0:13413ea9a877 | 72 | |
ganlikun | 0:13413ea9a877 | 73 | uint32_t Trigger; /*!< Specifies the Tamper Trigger. |
ganlikun | 0:13413ea9a877 | 74 | This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */ |
ganlikun | 0:13413ea9a877 | 75 | |
ganlikun | 0:13413ea9a877 | 76 | uint32_t Filter; /*!< Specifies the RTC Filter Tamper. |
ganlikun | 0:13413ea9a877 | 77 | This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */ |
ganlikun | 0:13413ea9a877 | 78 | |
ganlikun | 0:13413ea9a877 | 79 | uint32_t SamplingFrequency; /*!< Specifies the sampling frequency. |
ganlikun | 0:13413ea9a877 | 80 | This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */ |
ganlikun | 0:13413ea9a877 | 81 | |
ganlikun | 0:13413ea9a877 | 82 | uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration . |
ganlikun | 0:13413ea9a877 | 83 | This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */ |
ganlikun | 0:13413ea9a877 | 84 | |
ganlikun | 0:13413ea9a877 | 85 | uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp . |
ganlikun | 0:13413ea9a877 | 86 | This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */ |
ganlikun | 0:13413ea9a877 | 87 | |
ganlikun | 0:13413ea9a877 | 88 | uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection. |
ganlikun | 0:13413ea9a877 | 89 | This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */ |
ganlikun | 0:13413ea9a877 | 90 | }RTC_TamperTypeDef; |
ganlikun | 0:13413ea9a877 | 91 | /** |
ganlikun | 0:13413ea9a877 | 92 | * @} |
ganlikun | 0:13413ea9a877 | 93 | */ |
ganlikun | 0:13413ea9a877 | 94 | |
ganlikun | 0:13413ea9a877 | 95 | /* Exported constants --------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 96 | /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants |
ganlikun | 0:13413ea9a877 | 97 | * @{ |
ganlikun | 0:13413ea9a877 | 98 | */ |
ganlikun | 0:13413ea9a877 | 99 | |
ganlikun | 0:13413ea9a877 | 100 | /** @defgroup RTCEx_Backup_Registers_Definitions RTC Backup Registers Definitions |
ganlikun | 0:13413ea9a877 | 101 | * @{ |
ganlikun | 0:13413ea9a877 | 102 | */ |
ganlikun | 0:13413ea9a877 | 103 | #define RTC_BKP_DR0 0x00000000U |
ganlikun | 0:13413ea9a877 | 104 | #define RTC_BKP_DR1 0x00000001U |
ganlikun | 0:13413ea9a877 | 105 | #define RTC_BKP_DR2 0x00000002U |
ganlikun | 0:13413ea9a877 | 106 | #define RTC_BKP_DR3 0x00000003U |
ganlikun | 0:13413ea9a877 | 107 | #define RTC_BKP_DR4 0x00000004U |
ganlikun | 0:13413ea9a877 | 108 | #define RTC_BKP_DR5 0x00000005U |
ganlikun | 0:13413ea9a877 | 109 | #define RTC_BKP_DR6 0x00000006U |
ganlikun | 0:13413ea9a877 | 110 | #define RTC_BKP_DR7 0x00000007U |
ganlikun | 0:13413ea9a877 | 111 | #define RTC_BKP_DR8 0x00000008U |
ganlikun | 0:13413ea9a877 | 112 | #define RTC_BKP_DR9 0x00000009U |
ganlikun | 0:13413ea9a877 | 113 | #define RTC_BKP_DR10 0x0000000AU |
ganlikun | 0:13413ea9a877 | 114 | #define RTC_BKP_DR11 0x0000000BU |
ganlikun | 0:13413ea9a877 | 115 | #define RTC_BKP_DR12 0x0000000CU |
ganlikun | 0:13413ea9a877 | 116 | #define RTC_BKP_DR13 0x0000000DU |
ganlikun | 0:13413ea9a877 | 117 | #define RTC_BKP_DR14 0x0000000EU |
ganlikun | 0:13413ea9a877 | 118 | #define RTC_BKP_DR15 0x0000000FU |
ganlikun | 0:13413ea9a877 | 119 | #define RTC_BKP_DR16 0x00000010U |
ganlikun | 0:13413ea9a877 | 120 | #define RTC_BKP_DR17 0x00000011U |
ganlikun | 0:13413ea9a877 | 121 | #define RTC_BKP_DR18 0x00000012U |
ganlikun | 0:13413ea9a877 | 122 | #define RTC_BKP_DR19 0x00000013U |
ganlikun | 0:13413ea9a877 | 123 | /** |
ganlikun | 0:13413ea9a877 | 124 | * @} |
ganlikun | 0:13413ea9a877 | 125 | */ |
ganlikun | 0:13413ea9a877 | 126 | |
ganlikun | 0:13413ea9a877 | 127 | /** @defgroup RTCEx_Time_Stamp_Edges_definitions RTC TimeStamp Edges Definitions |
ganlikun | 0:13413ea9a877 | 128 | * @{ |
ganlikun | 0:13413ea9a877 | 129 | */ |
ganlikun | 0:13413ea9a877 | 130 | #define RTC_TIMESTAMPEDGE_RISING 0x00000000U |
ganlikun | 0:13413ea9a877 | 131 | #define RTC_TIMESTAMPEDGE_FALLING 0x00000008U |
ganlikun | 0:13413ea9a877 | 132 | /** |
ganlikun | 0:13413ea9a877 | 133 | * @} |
ganlikun | 0:13413ea9a877 | 134 | */ |
ganlikun | 0:13413ea9a877 | 135 | |
ganlikun | 0:13413ea9a877 | 136 | /** @defgroup RTCEx_Tamper_Pins_Definitions RTC Tamper Pins Definitions |
ganlikun | 0:13413ea9a877 | 137 | * @{ |
ganlikun | 0:13413ea9a877 | 138 | */ |
ganlikun | 0:13413ea9a877 | 139 | #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E |
ganlikun | 0:13413ea9a877 | 140 | |
ganlikun | 0:13413ea9a877 | 141 | #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 142 | #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E |
ganlikun | 0:13413ea9a877 | 143 | #endif |
ganlikun | 0:13413ea9a877 | 144 | /** |
ganlikun | 0:13413ea9a877 | 145 | * @} |
ganlikun | 0:13413ea9a877 | 146 | */ |
ganlikun | 0:13413ea9a877 | 147 | |
ganlikun | 0:13413ea9a877 | 148 | /** @defgroup RTCEx_Tamper_Pins_Selection RTC tamper Pins Selection |
ganlikun | 0:13413ea9a877 | 149 | * @{ |
ganlikun | 0:13413ea9a877 | 150 | */ |
ganlikun | 0:13413ea9a877 | 151 | |
ganlikun | 0:13413ea9a877 | 152 | #define RTC_TAMPERPIN_DEFAULT 0x00000000U |
ganlikun | 0:13413ea9a877 | 153 | |
ganlikun | 0:13413ea9a877 | 154 | #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 155 | #define RTC_TAMPERPIN_POS1 0x00010000U |
ganlikun | 0:13413ea9a877 | 156 | #endif |
ganlikun | 0:13413ea9a877 | 157 | /** |
ganlikun | 0:13413ea9a877 | 158 | * @} |
ganlikun | 0:13413ea9a877 | 159 | */ |
ganlikun | 0:13413ea9a877 | 160 | |
ganlikun | 0:13413ea9a877 | 161 | /** @defgroup RTCEx_TimeStamp_Pin_Selection RTC TimeStamp Pins Selection |
ganlikun | 0:13413ea9a877 | 162 | * @{ |
ganlikun | 0:13413ea9a877 | 163 | */ |
ganlikun | 0:13413ea9a877 | 164 | #define RTC_TIMESTAMPPIN_DEFAULT 0x00000000U |
ganlikun | 0:13413ea9a877 | 165 | |
ganlikun | 0:13413ea9a877 | 166 | #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 167 | #define RTC_TIMESTAMPPIN_POS1 0x00020000U |
ganlikun | 0:13413ea9a877 | 168 | #endif |
ganlikun | 0:13413ea9a877 | 169 | /** |
ganlikun | 0:13413ea9a877 | 170 | * @} |
ganlikun | 0:13413ea9a877 | 171 | */ |
ganlikun | 0:13413ea9a877 | 172 | |
ganlikun | 0:13413ea9a877 | 173 | /** @defgroup RTCEx_Tamper_Trigger_Definitions RTC Tamper Triggers Definitions |
ganlikun | 0:13413ea9a877 | 174 | * @{ |
ganlikun | 0:13413ea9a877 | 175 | */ |
ganlikun | 0:13413ea9a877 | 176 | #define RTC_TAMPERTRIGGER_RISINGEDGE 0x00000000U |
ganlikun | 0:13413ea9a877 | 177 | #define RTC_TAMPERTRIGGER_FALLINGEDGE 0x00000002U |
ganlikun | 0:13413ea9a877 | 178 | #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE |
ganlikun | 0:13413ea9a877 | 179 | #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE |
ganlikun | 0:13413ea9a877 | 180 | /** |
ganlikun | 0:13413ea9a877 | 181 | * @} |
ganlikun | 0:13413ea9a877 | 182 | */ |
ganlikun | 0:13413ea9a877 | 183 | |
ganlikun | 0:13413ea9a877 | 184 | /** @defgroup RTCEx_Tamper_Filter_Definitions RTC Tamper Filter Definitions |
ganlikun | 0:13413ea9a877 | 185 | * @{ |
ganlikun | 0:13413ea9a877 | 186 | */ |
ganlikun | 0:13413ea9a877 | 187 | #define RTC_TAMPERFILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */ |
ganlikun | 0:13413ea9a877 | 188 | |
ganlikun | 0:13413ea9a877 | 189 | #define RTC_TAMPERFILTER_2SAMPLE 0x00000800U /*!< Tamper is activated after 2 |
ganlikun | 0:13413ea9a877 | 190 | consecutive samples at the active level */ |
ganlikun | 0:13413ea9a877 | 191 | #define RTC_TAMPERFILTER_4SAMPLE 0x00001000U /*!< Tamper is activated after 4 |
ganlikun | 0:13413ea9a877 | 192 | consecutive samples at the active level */ |
ganlikun | 0:13413ea9a877 | 193 | #define RTC_TAMPERFILTER_8SAMPLE 0x00001800U /*!< Tamper is activated after 8 |
ganlikun | 0:13413ea9a877 | 194 | consecutive samples at the active level. */ |
ganlikun | 0:13413ea9a877 | 195 | /** |
ganlikun | 0:13413ea9a877 | 196 | * @} |
ganlikun | 0:13413ea9a877 | 197 | */ |
ganlikun | 0:13413ea9a877 | 198 | |
ganlikun | 0:13413ea9a877 | 199 | /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTC Tamper Sampling Frequencies Definitions |
ganlikun | 0:13413ea9a877 | 200 | * @{ |
ganlikun | 0:13413ea9a877 | 201 | */ |
ganlikun | 0:13413ea9a877 | 202 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 0x00000000U /*!< Each of the tamper inputs are sampled |
ganlikun | 0:13413ea9a877 | 203 | with a frequency = RTCCLK / 32768 */ |
ganlikun | 0:13413ea9a877 | 204 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 0x00000100U /*!< Each of the tamper inputs are sampled |
ganlikun | 0:13413ea9a877 | 205 | with a frequency = RTCCLK / 16384 */ |
ganlikun | 0:13413ea9a877 | 206 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 0x00000200U /*!< Each of the tamper inputs are sampled |
ganlikun | 0:13413ea9a877 | 207 | with a frequency = RTCCLK / 8192 */ |
ganlikun | 0:13413ea9a877 | 208 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 0x00000300U /*!< Each of the tamper inputs are sampled |
ganlikun | 0:13413ea9a877 | 209 | with a frequency = RTCCLK / 4096 */ |
ganlikun | 0:13413ea9a877 | 210 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 0x00000400U /*!< Each of the tamper inputs are sampled |
ganlikun | 0:13413ea9a877 | 211 | with a frequency = RTCCLK / 2048 */ |
ganlikun | 0:13413ea9a877 | 212 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 0x00000500U /*!< Each of the tamper inputs are sampled |
ganlikun | 0:13413ea9a877 | 213 | with a frequency = RTCCLK / 1024 */ |
ganlikun | 0:13413ea9a877 | 214 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 0x00000600U /*!< Each of the tamper inputs are sampled |
ganlikun | 0:13413ea9a877 | 215 | with a frequency = RTCCLK / 512 */ |
ganlikun | 0:13413ea9a877 | 216 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 0x00000700U /*!< Each of the tamper inputs are sampled |
ganlikun | 0:13413ea9a877 | 217 | with a frequency = RTCCLK / 256 */ |
ganlikun | 0:13413ea9a877 | 218 | /** |
ganlikun | 0:13413ea9a877 | 219 | * @} |
ganlikun | 0:13413ea9a877 | 220 | */ |
ganlikun | 0:13413ea9a877 | 221 | |
ganlikun | 0:13413ea9a877 | 222 | /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTC Tamper Pin Precharge Duration Definitions |
ganlikun | 0:13413ea9a877 | 223 | * @{ |
ganlikun | 0:13413ea9a877 | 224 | */ |
ganlikun | 0:13413ea9a877 | 225 | #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before |
ganlikun | 0:13413ea9a877 | 226 | sampling during 1 RTCCLK cycle */ |
ganlikun | 0:13413ea9a877 | 227 | #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK 0x00002000U /*!< Tamper pins are pre-charged before |
ganlikun | 0:13413ea9a877 | 228 | sampling during 2 RTCCLK cycles */ |
ganlikun | 0:13413ea9a877 | 229 | #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK 0x00004000U /*!< Tamper pins are pre-charged before |
ganlikun | 0:13413ea9a877 | 230 | sampling during 4 RTCCLK cycles */ |
ganlikun | 0:13413ea9a877 | 231 | #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK 0x00006000U /*!< Tamper pins are pre-charged before |
ganlikun | 0:13413ea9a877 | 232 | sampling during 8 RTCCLK cycles */ |
ganlikun | 0:13413ea9a877 | 233 | /** |
ganlikun | 0:13413ea9a877 | 234 | * @} |
ganlikun | 0:13413ea9a877 | 235 | */ |
ganlikun | 0:13413ea9a877 | 236 | |
ganlikun | 0:13413ea9a877 | 237 | /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTC Tamper TimeStamp On Tamper Detection Definitions |
ganlikun | 0:13413ea9a877 | 238 | * @{ |
ganlikun | 0:13413ea9a877 | 239 | */ |
ganlikun | 0:13413ea9a877 | 240 | #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */ |
ganlikun | 0:13413ea9a877 | 241 | #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE 0x00000000U /*!< TimeStamp on Tamper Detection event is not saved */ |
ganlikun | 0:13413ea9a877 | 242 | /** |
ganlikun | 0:13413ea9a877 | 243 | * @} |
ganlikun | 0:13413ea9a877 | 244 | */ |
ganlikun | 0:13413ea9a877 | 245 | |
ganlikun | 0:13413ea9a877 | 246 | /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTC Tamper Pull Up Definitions |
ganlikun | 0:13413ea9a877 | 247 | * @{ |
ganlikun | 0:13413ea9a877 | 248 | */ |
ganlikun | 0:13413ea9a877 | 249 | #define RTC_TAMPER_PULLUP_ENABLE 0x00000000U /*!< TimeStamp on Tamper Detection event saved */ |
ganlikun | 0:13413ea9a877 | 250 | #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */ |
ganlikun | 0:13413ea9a877 | 251 | /** |
ganlikun | 0:13413ea9a877 | 252 | * @} |
ganlikun | 0:13413ea9a877 | 253 | */ |
ganlikun | 0:13413ea9a877 | 254 | |
ganlikun | 0:13413ea9a877 | 255 | /** @defgroup RTCEx_Wakeup_Timer_Definitions RTC Wake-up Timer Definitions |
ganlikun | 0:13413ea9a877 | 256 | * @{ |
ganlikun | 0:13413ea9a877 | 257 | */ |
ganlikun | 0:13413ea9a877 | 258 | #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 0x00000000U |
ganlikun | 0:13413ea9a877 | 259 | #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 0x00000001U |
ganlikun | 0:13413ea9a877 | 260 | #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 0x00000002U |
ganlikun | 0:13413ea9a877 | 261 | #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 0x00000003U |
ganlikun | 0:13413ea9a877 | 262 | #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS 0x00000004U |
ganlikun | 0:13413ea9a877 | 263 | #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS 0x00000006U |
ganlikun | 0:13413ea9a877 | 264 | /** |
ganlikun | 0:13413ea9a877 | 265 | * @} |
ganlikun | 0:13413ea9a877 | 266 | */ |
ganlikun | 0:13413ea9a877 | 267 | |
ganlikun | 0:13413ea9a877 | 268 | /** @defgroup RTCEx_Digital_Calibration_Definitions RTC Digital Calib Definitions |
ganlikun | 0:13413ea9a877 | 269 | * @{ |
ganlikun | 0:13413ea9a877 | 270 | */ |
ganlikun | 0:13413ea9a877 | 271 | #define RTC_CALIBSIGN_POSITIVE 0x00000000U |
ganlikun | 0:13413ea9a877 | 272 | #define RTC_CALIBSIGN_NEGATIVE 0x00000080U |
ganlikun | 0:13413ea9a877 | 273 | /** |
ganlikun | 0:13413ea9a877 | 274 | * @} |
ganlikun | 0:13413ea9a877 | 275 | */ |
ganlikun | 0:13413ea9a877 | 276 | |
ganlikun | 0:13413ea9a877 | 277 | /** @defgroup RTCEx_Smooth_calib_period_Definitions RTC Smooth Calib Period Definitions |
ganlikun | 0:13413ea9a877 | 278 | * @{ |
ganlikun | 0:13413ea9a877 | 279 | */ |
ganlikun | 0:13413ea9a877 | 280 | #define RTC_SMOOTHCALIB_PERIOD_32SEC 0x00000000U /*!< If RTCCLK = 32768 Hz, Smooth calibration |
ganlikun | 0:13413ea9a877 | 281 | period is 32s, else 2exp20 RTCCLK seconds */ |
ganlikun | 0:13413ea9a877 | 282 | #define RTC_SMOOTHCALIB_PERIOD_16SEC 0x00002000U /*!< If RTCCLK = 32768 Hz, Smooth calibration |
ganlikun | 0:13413ea9a877 | 283 | period is 16s, else 2exp19 RTCCLK seconds */ |
ganlikun | 0:13413ea9a877 | 284 | #define RTC_SMOOTHCALIB_PERIOD_8SEC 0x00004000U /*!< If RTCCLK = 32768 Hz, Smooth calibration |
ganlikun | 0:13413ea9a877 | 285 | period is 8s, else 2exp18 RTCCLK seconds */ |
ganlikun | 0:13413ea9a877 | 286 | /** |
ganlikun | 0:13413ea9a877 | 287 | * @} |
ganlikun | 0:13413ea9a877 | 288 | */ |
ganlikun | 0:13413ea9a877 | 289 | |
ganlikun | 0:13413ea9a877 | 290 | /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTC Smooth Calib Plus Pulses Definitions |
ganlikun | 0:13413ea9a877 | 291 | * @{ |
ganlikun | 0:13413ea9a877 | 292 | */ |
ganlikun | 0:13413ea9a877 | 293 | #define RTC_SMOOTHCALIB_PLUSPULSES_SET 0x00008000U /*!< The number of RTCCLK pulses added |
ganlikun | 0:13413ea9a877 | 294 | during a X -second window = Y - CALM[8:0] |
ganlikun | 0:13413ea9a877 | 295 | with Y = 512, 256, 128 when X = 32, 16, 8 */ |
ganlikun | 0:13413ea9a877 | 296 | #define RTC_SMOOTHCALIB_PLUSPULSES_RESET 0x00000000U /*!< The number of RTCCLK pulses subbstited |
ganlikun | 0:13413ea9a877 | 297 | during a 32-second window = CALM[8:0] */ |
ganlikun | 0:13413ea9a877 | 298 | /** |
ganlikun | 0:13413ea9a877 | 299 | * @} |
ganlikun | 0:13413ea9a877 | 300 | */ |
ganlikun | 0:13413ea9a877 | 301 | |
ganlikun | 0:13413ea9a877 | 302 | /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions RTC Add 1 Second Parameter Definitions |
ganlikun | 0:13413ea9a877 | 303 | * @{ |
ganlikun | 0:13413ea9a877 | 304 | */ |
ganlikun | 0:13413ea9a877 | 305 | #define RTC_SHIFTADD1S_RESET 0x00000000U |
ganlikun | 0:13413ea9a877 | 306 | #define RTC_SHIFTADD1S_SET 0x80000000U |
ganlikun | 0:13413ea9a877 | 307 | /** |
ganlikun | 0:13413ea9a877 | 308 | * @} |
ganlikun | 0:13413ea9a877 | 309 | */ |
ganlikun | 0:13413ea9a877 | 310 | |
ganlikun | 0:13413ea9a877 | 311 | |
ganlikun | 0:13413ea9a877 | 312 | /** @defgroup RTCEx_Calib_Output_selection_Definitions RTC Calib Output Selection Definitions |
ganlikun | 0:13413ea9a877 | 313 | * @{ |
ganlikun | 0:13413ea9a877 | 314 | */ |
ganlikun | 0:13413ea9a877 | 315 | #define RTC_CALIBOUTPUT_512HZ 0x00000000U |
ganlikun | 0:13413ea9a877 | 316 | #define RTC_CALIBOUTPUT_1HZ 0x00080000U |
ganlikun | 0:13413ea9a877 | 317 | /** |
ganlikun | 0:13413ea9a877 | 318 | * @} |
ganlikun | 0:13413ea9a877 | 319 | */ |
ganlikun | 0:13413ea9a877 | 320 | |
ganlikun | 0:13413ea9a877 | 321 | /** |
ganlikun | 0:13413ea9a877 | 322 | * @} |
ganlikun | 0:13413ea9a877 | 323 | */ |
ganlikun | 0:13413ea9a877 | 324 | |
ganlikun | 0:13413ea9a877 | 325 | /* Exported macro ------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 326 | /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros |
ganlikun | 0:13413ea9a877 | 327 | * @{ |
ganlikun | 0:13413ea9a877 | 328 | */ |
ganlikun | 0:13413ea9a877 | 329 | |
ganlikun | 0:13413ea9a877 | 330 | /* ---------------------------------WAKEUPTIMER---------------------------------*/ |
ganlikun | 0:13413ea9a877 | 331 | /** @defgroup RTCEx_WakeUp_Timer RTC WakeUp Timer |
ganlikun | 0:13413ea9a877 | 332 | * @{ |
ganlikun | 0:13413ea9a877 | 333 | */ |
ganlikun | 0:13413ea9a877 | 334 | |
ganlikun | 0:13413ea9a877 | 335 | /** |
ganlikun | 0:13413ea9a877 | 336 | * @brief Enable the RTC WakeUp Timer peripheral. |
ganlikun | 0:13413ea9a877 | 337 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 338 | * @retval None |
ganlikun | 0:13413ea9a877 | 339 | */ |
ganlikun | 0:13413ea9a877 | 340 | #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE)) |
ganlikun | 0:13413ea9a877 | 341 | |
ganlikun | 0:13413ea9a877 | 342 | /** |
ganlikun | 0:13413ea9a877 | 343 | * @brief Disable the RTC Wake-up Timer peripheral. |
ganlikun | 0:13413ea9a877 | 344 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 345 | * @retval None |
ganlikun | 0:13413ea9a877 | 346 | */ |
ganlikun | 0:13413ea9a877 | 347 | #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE)) |
ganlikun | 0:13413ea9a877 | 348 | |
ganlikun | 0:13413ea9a877 | 349 | /** |
ganlikun | 0:13413ea9a877 | 350 | * @brief Enable the RTC WakeUpTimer interrupt. |
ganlikun | 0:13413ea9a877 | 351 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 352 | * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. |
ganlikun | 0:13413ea9a877 | 353 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 354 | * @arg RTC_IT_WUT: WakeUpTimer A interrupt |
ganlikun | 0:13413ea9a877 | 355 | * @retval None |
ganlikun | 0:13413ea9a877 | 356 | */ |
ganlikun | 0:13413ea9a877 | 357 | #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) |
ganlikun | 0:13413ea9a877 | 358 | |
ganlikun | 0:13413ea9a877 | 359 | /** |
ganlikun | 0:13413ea9a877 | 360 | * @brief Disable the RTC WakeUpTimer interrupt. |
ganlikun | 0:13413ea9a877 | 361 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 362 | * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. |
ganlikun | 0:13413ea9a877 | 363 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 364 | * @arg RTC_IT_WUT: WakeUpTimer A interrupt |
ganlikun | 0:13413ea9a877 | 365 | * @retval None |
ganlikun | 0:13413ea9a877 | 366 | */ |
ganlikun | 0:13413ea9a877 | 367 | #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) |
ganlikun | 0:13413ea9a877 | 368 | |
ganlikun | 0:13413ea9a877 | 369 | /** |
ganlikun | 0:13413ea9a877 | 370 | * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not. |
ganlikun | 0:13413ea9a877 | 371 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 372 | * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt to check. |
ganlikun | 0:13413ea9a877 | 373 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 374 | * @arg RTC_IT_WUT: WakeUpTimer A interrupt |
ganlikun | 0:13413ea9a877 | 375 | * @retval None |
ganlikun | 0:13413ea9a877 | 376 | */ |
ganlikun | 0:13413ea9a877 | 377 | #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET) |
ganlikun | 0:13413ea9a877 | 378 | |
ganlikun | 0:13413ea9a877 | 379 | /** |
ganlikun | 0:13413ea9a877 | 380 | * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not. |
ganlikun | 0:13413ea9a877 | 381 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 382 | * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check. |
ganlikun | 0:13413ea9a877 | 383 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 384 | * @arg RTC_IT_WUT: WakeUpTimer interrupt |
ganlikun | 0:13413ea9a877 | 385 | * @retval None |
ganlikun | 0:13413ea9a877 | 386 | */ |
ganlikun | 0:13413ea9a877 | 387 | #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) |
ganlikun | 0:13413ea9a877 | 388 | |
ganlikun | 0:13413ea9a877 | 389 | /** |
ganlikun | 0:13413ea9a877 | 390 | * @brief Get the selected RTC WakeUpTimer's flag status. |
ganlikun | 0:13413ea9a877 | 391 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 392 | * @param __FLAG__: specifies the RTC WakeUpTimer Flag to check. |
ganlikun | 0:13413ea9a877 | 393 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 394 | * @arg RTC_FLAG_WUTF |
ganlikun | 0:13413ea9a877 | 395 | * @arg RTC_FLAG_WUTWF |
ganlikun | 0:13413ea9a877 | 396 | * @retval None |
ganlikun | 0:13413ea9a877 | 397 | */ |
ganlikun | 0:13413ea9a877 | 398 | #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
ganlikun | 0:13413ea9a877 | 399 | |
ganlikun | 0:13413ea9a877 | 400 | /** |
ganlikun | 0:13413ea9a877 | 401 | * @brief Clear the RTC Wake Up timer's pending flags. |
ganlikun | 0:13413ea9a877 | 402 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 403 | * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. |
ganlikun | 0:13413ea9a877 | 404 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 405 | * @arg RTC_FLAG_WUTF |
ganlikun | 0:13413ea9a877 | 406 | * @retval None |
ganlikun | 0:13413ea9a877 | 407 | */ |
ganlikun | 0:13413ea9a877 | 408 | #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
ganlikun | 0:13413ea9a877 | 409 | |
ganlikun | 0:13413ea9a877 | 410 | /** |
ganlikun | 0:13413ea9a877 | 411 | * @brief Enable interrupt on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 412 | * @retval None |
ganlikun | 0:13413ea9a877 | 413 | */ |
ganlikun | 0:13413ea9a877 | 414 | #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
ganlikun | 0:13413ea9a877 | 415 | |
ganlikun | 0:13413ea9a877 | 416 | /** |
ganlikun | 0:13413ea9a877 | 417 | * @brief Disable interrupt on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 418 | * @retval None |
ganlikun | 0:13413ea9a877 | 419 | */ |
ganlikun | 0:13413ea9a877 | 420 | #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) |
ganlikun | 0:13413ea9a877 | 421 | |
ganlikun | 0:13413ea9a877 | 422 | /** |
ganlikun | 0:13413ea9a877 | 423 | * @brief Enable event on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 424 | * @retval None. |
ganlikun | 0:13413ea9a877 | 425 | */ |
ganlikun | 0:13413ea9a877 | 426 | #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
ganlikun | 0:13413ea9a877 | 427 | |
ganlikun | 0:13413ea9a877 | 428 | /** |
ganlikun | 0:13413ea9a877 | 429 | * @brief Disable event on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 430 | * @retval None. |
ganlikun | 0:13413ea9a877 | 431 | */ |
ganlikun | 0:13413ea9a877 | 432 | #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) |
ganlikun | 0:13413ea9a877 | 433 | |
ganlikun | 0:13413ea9a877 | 434 | /** |
ganlikun | 0:13413ea9a877 | 435 | * @brief Enable falling edge trigger on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 436 | * @retval None. |
ganlikun | 0:13413ea9a877 | 437 | */ |
ganlikun | 0:13413ea9a877 | 438 | #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
ganlikun | 0:13413ea9a877 | 439 | |
ganlikun | 0:13413ea9a877 | 440 | /** |
ganlikun | 0:13413ea9a877 | 441 | * @brief Disable falling edge trigger on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 442 | * @retval None. |
ganlikun | 0:13413ea9a877 | 443 | */ |
ganlikun | 0:13413ea9a877 | 444 | #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) |
ganlikun | 0:13413ea9a877 | 445 | |
ganlikun | 0:13413ea9a877 | 446 | /** |
ganlikun | 0:13413ea9a877 | 447 | * @brief Enable rising edge trigger on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 448 | * @retval None. |
ganlikun | 0:13413ea9a877 | 449 | */ |
ganlikun | 0:13413ea9a877 | 450 | #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
ganlikun | 0:13413ea9a877 | 451 | |
ganlikun | 0:13413ea9a877 | 452 | /** |
ganlikun | 0:13413ea9a877 | 453 | * @brief Disable rising edge trigger on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 454 | * @retval None. |
ganlikun | 0:13413ea9a877 | 455 | */ |
ganlikun | 0:13413ea9a877 | 456 | #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) |
ganlikun | 0:13413ea9a877 | 457 | |
ganlikun | 0:13413ea9a877 | 458 | /** |
ganlikun | 0:13413ea9a877 | 459 | * @brief Enable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 460 | * @retval None. |
ganlikun | 0:13413ea9a877 | 461 | */ |
ganlikun | 0:13413ea9a877 | 462 | #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do { __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();\ |
ganlikun | 0:13413ea9a877 | 463 | __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE();\ |
ganlikun | 0:13413ea9a877 | 464 | } while(0U) |
ganlikun | 0:13413ea9a877 | 465 | |
ganlikun | 0:13413ea9a877 | 466 | /** |
ganlikun | 0:13413ea9a877 | 467 | * @brief Disable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 468 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 469 | * @retval None. |
ganlikun | 0:13413ea9a877 | 470 | */ |
ganlikun | 0:13413ea9a877 | 471 | #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do { __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();\ |
ganlikun | 0:13413ea9a877 | 472 | __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE();\ |
ganlikun | 0:13413ea9a877 | 473 | } while(0U) |
ganlikun | 0:13413ea9a877 | 474 | |
ganlikun | 0:13413ea9a877 | 475 | /** |
ganlikun | 0:13413ea9a877 | 476 | * @brief Check whether the RTC Wake-up Timer associated Exti line interrupt flag is set or not. |
ganlikun | 0:13413ea9a877 | 477 | * @retval Line Status. |
ganlikun | 0:13413ea9a877 | 478 | */ |
ganlikun | 0:13413ea9a877 | 479 | #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
ganlikun | 0:13413ea9a877 | 480 | |
ganlikun | 0:13413ea9a877 | 481 | /** |
ganlikun | 0:13413ea9a877 | 482 | * @brief Clear the RTC Wake-up Timer associated Exti line flag. |
ganlikun | 0:13413ea9a877 | 483 | * @retval None. |
ganlikun | 0:13413ea9a877 | 484 | */ |
ganlikun | 0:13413ea9a877 | 485 | #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
ganlikun | 0:13413ea9a877 | 486 | |
ganlikun | 0:13413ea9a877 | 487 | /** |
ganlikun | 0:13413ea9a877 | 488 | * @brief Generate a Software interrupt on the RTC Wake-up Timer associated Exti line. |
ganlikun | 0:13413ea9a877 | 489 | * @retval None. |
ganlikun | 0:13413ea9a877 | 490 | */ |
ganlikun | 0:13413ea9a877 | 491 | #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) |
ganlikun | 0:13413ea9a877 | 492 | |
ganlikun | 0:13413ea9a877 | 493 | /** |
ganlikun | 0:13413ea9a877 | 494 | * @} |
ganlikun | 0:13413ea9a877 | 495 | */ |
ganlikun | 0:13413ea9a877 | 496 | |
ganlikun | 0:13413ea9a877 | 497 | /* ---------------------------------TIMESTAMP---------------------------------*/ |
ganlikun | 0:13413ea9a877 | 498 | /** @defgroup RTCEx_Timestamp RTC Timestamp |
ganlikun | 0:13413ea9a877 | 499 | * @{ |
ganlikun | 0:13413ea9a877 | 500 | */ |
ganlikun | 0:13413ea9a877 | 501 | |
ganlikun | 0:13413ea9a877 | 502 | /** |
ganlikun | 0:13413ea9a877 | 503 | * @brief Enable the RTC TimeStamp peripheral. |
ganlikun | 0:13413ea9a877 | 504 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 505 | * @retval None |
ganlikun | 0:13413ea9a877 | 506 | */ |
ganlikun | 0:13413ea9a877 | 507 | #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE)) |
ganlikun | 0:13413ea9a877 | 508 | |
ganlikun | 0:13413ea9a877 | 509 | /** |
ganlikun | 0:13413ea9a877 | 510 | * @brief Disable the RTC TimeStamp peripheral. |
ganlikun | 0:13413ea9a877 | 511 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 512 | * @retval None |
ganlikun | 0:13413ea9a877 | 513 | */ |
ganlikun | 0:13413ea9a877 | 514 | #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE)) |
ganlikun | 0:13413ea9a877 | 515 | |
ganlikun | 0:13413ea9a877 | 516 | /** |
ganlikun | 0:13413ea9a877 | 517 | * @brief Enable the RTC TimeStamp interrupt. |
ganlikun | 0:13413ea9a877 | 518 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 519 | * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled. |
ganlikun | 0:13413ea9a877 | 520 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 521 | * @arg RTC_IT_TS: TimeStamp interrupt |
ganlikun | 0:13413ea9a877 | 522 | * @retval None |
ganlikun | 0:13413ea9a877 | 523 | */ |
ganlikun | 0:13413ea9a877 | 524 | #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) |
ganlikun | 0:13413ea9a877 | 525 | |
ganlikun | 0:13413ea9a877 | 526 | /** |
ganlikun | 0:13413ea9a877 | 527 | * @brief Disable the RTC TimeStamp interrupt. |
ganlikun | 0:13413ea9a877 | 528 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 529 | * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled. |
ganlikun | 0:13413ea9a877 | 530 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 531 | * @arg RTC_IT_TS: TimeStamp interrupt |
ganlikun | 0:13413ea9a877 | 532 | * @retval None |
ganlikun | 0:13413ea9a877 | 533 | */ |
ganlikun | 0:13413ea9a877 | 534 | #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) |
ganlikun | 0:13413ea9a877 | 535 | |
ganlikun | 0:13413ea9a877 | 536 | /** |
ganlikun | 0:13413ea9a877 | 537 | * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not. |
ganlikun | 0:13413ea9a877 | 538 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 539 | * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt to check. |
ganlikun | 0:13413ea9a877 | 540 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 541 | * @arg RTC_IT_TS: TimeStamp interrupt |
ganlikun | 0:13413ea9a877 | 542 | * @retval None |
ganlikun | 0:13413ea9a877 | 543 | */ |
ganlikun | 0:13413ea9a877 | 544 | #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET) |
ganlikun | 0:13413ea9a877 | 545 | |
ganlikun | 0:13413ea9a877 | 546 | /** |
ganlikun | 0:13413ea9a877 | 547 | * @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not. |
ganlikun | 0:13413ea9a877 | 548 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 549 | * @param __INTERRUPT__: specifies the RTC Time Stamp interrupt source to check. |
ganlikun | 0:13413ea9a877 | 550 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 551 | * @arg RTC_IT_TS: TimeStamp interrupt |
ganlikun | 0:13413ea9a877 | 552 | * @retval None |
ganlikun | 0:13413ea9a877 | 553 | */ |
ganlikun | 0:13413ea9a877 | 554 | #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) |
ganlikun | 0:13413ea9a877 | 555 | |
ganlikun | 0:13413ea9a877 | 556 | /** |
ganlikun | 0:13413ea9a877 | 557 | * @brief Get the selected RTC TimeStamp's flag status. |
ganlikun | 0:13413ea9a877 | 558 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 559 | * @param __FLAG__: specifies the RTC TimeStamp flag to check. |
ganlikun | 0:13413ea9a877 | 560 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 561 | * @arg RTC_FLAG_TSF |
ganlikun | 0:13413ea9a877 | 562 | * @arg RTC_FLAG_TSOVF |
ganlikun | 0:13413ea9a877 | 563 | * @retval None |
ganlikun | 0:13413ea9a877 | 564 | */ |
ganlikun | 0:13413ea9a877 | 565 | #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
ganlikun | 0:13413ea9a877 | 566 | |
ganlikun | 0:13413ea9a877 | 567 | /** |
ganlikun | 0:13413ea9a877 | 568 | * @brief Clear the RTC Time Stamp's pending flags. |
ganlikun | 0:13413ea9a877 | 569 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 570 | * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled. |
ganlikun | 0:13413ea9a877 | 571 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 572 | * @arg RTC_FLAG_TSF |
ganlikun | 0:13413ea9a877 | 573 | * @retval None |
ganlikun | 0:13413ea9a877 | 574 | */ |
ganlikun | 0:13413ea9a877 | 575 | #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
ganlikun | 0:13413ea9a877 | 576 | |
ganlikun | 0:13413ea9a877 | 577 | /** |
ganlikun | 0:13413ea9a877 | 578 | * @} |
ganlikun | 0:13413ea9a877 | 579 | */ |
ganlikun | 0:13413ea9a877 | 580 | |
ganlikun | 0:13413ea9a877 | 581 | /* ---------------------------------TAMPER------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 582 | /** @defgroup RTCEx_Tamper RTC Tamper |
ganlikun | 0:13413ea9a877 | 583 | * @{ |
ganlikun | 0:13413ea9a877 | 584 | */ |
ganlikun | 0:13413ea9a877 | 585 | |
ganlikun | 0:13413ea9a877 | 586 | /** |
ganlikun | 0:13413ea9a877 | 587 | * @brief Enable the RTC Tamper1 input detection. |
ganlikun | 0:13413ea9a877 | 588 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 589 | * @retval None |
ganlikun | 0:13413ea9a877 | 590 | */ |
ganlikun | 0:13413ea9a877 | 591 | #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP1E)) |
ganlikun | 0:13413ea9a877 | 592 | |
ganlikun | 0:13413ea9a877 | 593 | /** |
ganlikun | 0:13413ea9a877 | 594 | * @brief Disable the RTC Tamper1 input detection. |
ganlikun | 0:13413ea9a877 | 595 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 596 | * @retval None |
ganlikun | 0:13413ea9a877 | 597 | */ |
ganlikun | 0:13413ea9a877 | 598 | #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP1E)) |
ganlikun | 0:13413ea9a877 | 599 | |
ganlikun | 0:13413ea9a877 | 600 | #if !defined(STM32F412Zx) && !defined(STM32F412Vx) && !defined(STM32F412Rx) && !defined(STM32F412Cx) && !defined(STM32F413xx) && !defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 601 | /** |
ganlikun | 0:13413ea9a877 | 602 | * @brief Enable the RTC Tamper2 input detection. |
ganlikun | 0:13413ea9a877 | 603 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 604 | * @retval None |
ganlikun | 0:13413ea9a877 | 605 | */ |
ganlikun | 0:13413ea9a877 | 606 | #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP2E)) |
ganlikun | 0:13413ea9a877 | 607 | |
ganlikun | 0:13413ea9a877 | 608 | /** |
ganlikun | 0:13413ea9a877 | 609 | * @brief Disable the RTC Tamper2 input detection. |
ganlikun | 0:13413ea9a877 | 610 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 611 | * @retval None |
ganlikun | 0:13413ea9a877 | 612 | */ |
ganlikun | 0:13413ea9a877 | 613 | #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP2E)) |
ganlikun | 0:13413ea9a877 | 614 | #endif |
ganlikun | 0:13413ea9a877 | 615 | |
ganlikun | 0:13413ea9a877 | 616 | /** |
ganlikun | 0:13413ea9a877 | 617 | * @brief Check whether the specified RTC Tamper interrupt has occurred or not. |
ganlikun | 0:13413ea9a877 | 618 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 619 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check. |
ganlikun | 0:13413ea9a877 | 620 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 621 | * @arg RTC_IT_TAMP1 |
ganlikun | 0:13413ea9a877 | 622 | * @arg RTC_IT_TAMP2 |
ganlikun | 0:13413ea9a877 | 623 | * @retval None |
ganlikun | 0:13413ea9a877 | 624 | */ |
ganlikun | 0:13413ea9a877 | 625 | #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET) |
ganlikun | 0:13413ea9a877 | 626 | |
ganlikun | 0:13413ea9a877 | 627 | /** |
ganlikun | 0:13413ea9a877 | 628 | * @brief Check whether the specified RTC Tamper interrupt has been enabled or not. |
ganlikun | 0:13413ea9a877 | 629 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 630 | * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check. |
ganlikun | 0:13413ea9a877 | 631 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 632 | * @arg RTC_IT_TAMP: Tamper interrupt |
ganlikun | 0:13413ea9a877 | 633 | * @retval None |
ganlikun | 0:13413ea9a877 | 634 | */ |
ganlikun | 0:13413ea9a877 | 635 | #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAFCR) & (__INTERRUPT__)) != RESET) ? SET : RESET) |
ganlikun | 0:13413ea9a877 | 636 | |
ganlikun | 0:13413ea9a877 | 637 | /** |
ganlikun | 0:13413ea9a877 | 638 | * @brief Get the selected RTC Tamper's flag status. |
ganlikun | 0:13413ea9a877 | 639 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 640 | * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. |
ganlikun | 0:13413ea9a877 | 641 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 642 | * @arg RTC_FLAG_TAMP1F |
ganlikun | 0:13413ea9a877 | 643 | * @arg RTC_FLAG_TAMP2F |
ganlikun | 0:13413ea9a877 | 644 | * @retval None |
ganlikun | 0:13413ea9a877 | 645 | */ |
ganlikun | 0:13413ea9a877 | 646 | #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
ganlikun | 0:13413ea9a877 | 647 | |
ganlikun | 0:13413ea9a877 | 648 | /** |
ganlikun | 0:13413ea9a877 | 649 | * @brief Clear the RTC Tamper's pending flags. |
ganlikun | 0:13413ea9a877 | 650 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 651 | * @param __FLAG__: specifies the RTC Tamper Flag to clear. |
ganlikun | 0:13413ea9a877 | 652 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 653 | * @arg RTC_FLAG_TAMP1F |
ganlikun | 0:13413ea9a877 | 654 | * @arg RTC_FLAG_TAMP2F |
ganlikun | 0:13413ea9a877 | 655 | * @retval None |
ganlikun | 0:13413ea9a877 | 656 | */ |
ganlikun | 0:13413ea9a877 | 657 | #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
ganlikun | 0:13413ea9a877 | 658 | /** |
ganlikun | 0:13413ea9a877 | 659 | * @} |
ganlikun | 0:13413ea9a877 | 660 | */ |
ganlikun | 0:13413ea9a877 | 661 | |
ganlikun | 0:13413ea9a877 | 662 | /* --------------------------TAMPER/TIMESTAMP---------------------------------*/ |
ganlikun | 0:13413ea9a877 | 663 | /** @defgroup RTCEx_Tamper_Timestamp EXTI RTC Tamper Timestamp EXTI |
ganlikun | 0:13413ea9a877 | 664 | * @{ |
ganlikun | 0:13413ea9a877 | 665 | */ |
ganlikun | 0:13413ea9a877 | 666 | |
ganlikun | 0:13413ea9a877 | 667 | /** |
ganlikun | 0:13413ea9a877 | 668 | * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 669 | * @retval None |
ganlikun | 0:13413ea9a877 | 670 | */ |
ganlikun | 0:13413ea9a877 | 671 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
ganlikun | 0:13413ea9a877 | 672 | |
ganlikun | 0:13413ea9a877 | 673 | /** |
ganlikun | 0:13413ea9a877 | 674 | * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 675 | * @retval None |
ganlikun | 0:13413ea9a877 | 676 | */ |
ganlikun | 0:13413ea9a877 | 677 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) |
ganlikun | 0:13413ea9a877 | 678 | |
ganlikun | 0:13413ea9a877 | 679 | /** |
ganlikun | 0:13413ea9a877 | 680 | * @brief Enable event on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 681 | * @retval None. |
ganlikun | 0:13413ea9a877 | 682 | */ |
ganlikun | 0:13413ea9a877 | 683 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
ganlikun | 0:13413ea9a877 | 684 | |
ganlikun | 0:13413ea9a877 | 685 | /** |
ganlikun | 0:13413ea9a877 | 686 | * @brief Disable event on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 687 | * @retval None. |
ganlikun | 0:13413ea9a877 | 688 | */ |
ganlikun | 0:13413ea9a877 | 689 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) |
ganlikun | 0:13413ea9a877 | 690 | |
ganlikun | 0:13413ea9a877 | 691 | /** |
ganlikun | 0:13413ea9a877 | 692 | * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 693 | * @retval None. |
ganlikun | 0:13413ea9a877 | 694 | */ |
ganlikun | 0:13413ea9a877 | 695 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
ganlikun | 0:13413ea9a877 | 696 | |
ganlikun | 0:13413ea9a877 | 697 | /** |
ganlikun | 0:13413ea9a877 | 698 | * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 699 | * @retval None. |
ganlikun | 0:13413ea9a877 | 700 | */ |
ganlikun | 0:13413ea9a877 | 701 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) |
ganlikun | 0:13413ea9a877 | 702 | |
ganlikun | 0:13413ea9a877 | 703 | /** |
ganlikun | 0:13413ea9a877 | 704 | * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 705 | * @retval None. |
ganlikun | 0:13413ea9a877 | 706 | */ |
ganlikun | 0:13413ea9a877 | 707 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
ganlikun | 0:13413ea9a877 | 708 | |
ganlikun | 0:13413ea9a877 | 709 | /** |
ganlikun | 0:13413ea9a877 | 710 | * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 711 | * @retval None. |
ganlikun | 0:13413ea9a877 | 712 | */ |
ganlikun | 0:13413ea9a877 | 713 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) |
ganlikun | 0:13413ea9a877 | 714 | |
ganlikun | 0:13413ea9a877 | 715 | /** |
ganlikun | 0:13413ea9a877 | 716 | * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 717 | * @retval None. |
ganlikun | 0:13413ea9a877 | 718 | */ |
ganlikun | 0:13413ea9a877 | 719 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() do { __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();\ |
ganlikun | 0:13413ea9a877 | 720 | __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); \ |
ganlikun | 0:13413ea9a877 | 721 | } while(0U) |
ganlikun | 0:13413ea9a877 | 722 | |
ganlikun | 0:13413ea9a877 | 723 | /** |
ganlikun | 0:13413ea9a877 | 724 | * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. |
ganlikun | 0:13413ea9a877 | 725 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 726 | * @retval None. |
ganlikun | 0:13413ea9a877 | 727 | */ |
ganlikun | 0:13413ea9a877 | 728 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() do { __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE();\ |
ganlikun | 0:13413ea9a877 | 729 | __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE();\ |
ganlikun | 0:13413ea9a877 | 730 | } while(0U) |
ganlikun | 0:13413ea9a877 | 731 | |
ganlikun | 0:13413ea9a877 | 732 | /** |
ganlikun | 0:13413ea9a877 | 733 | * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not. |
ganlikun | 0:13413ea9a877 | 734 | * @retval Line Status. |
ganlikun | 0:13413ea9a877 | 735 | */ |
ganlikun | 0:13413ea9a877 | 736 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
ganlikun | 0:13413ea9a877 | 737 | |
ganlikun | 0:13413ea9a877 | 738 | /** |
ganlikun | 0:13413ea9a877 | 739 | * @brief Clear the RTC Tamper and Timestamp associated Exti line flag. |
ganlikun | 0:13413ea9a877 | 740 | * @retval None. |
ganlikun | 0:13413ea9a877 | 741 | */ |
ganlikun | 0:13413ea9a877 | 742 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
ganlikun | 0:13413ea9a877 | 743 | |
ganlikun | 0:13413ea9a877 | 744 | /** |
ganlikun | 0:13413ea9a877 | 745 | * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line |
ganlikun | 0:13413ea9a877 | 746 | * @retval None. |
ganlikun | 0:13413ea9a877 | 747 | */ |
ganlikun | 0:13413ea9a877 | 748 | #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) |
ganlikun | 0:13413ea9a877 | 749 | /** |
ganlikun | 0:13413ea9a877 | 750 | * @} |
ganlikun | 0:13413ea9a877 | 751 | */ |
ganlikun | 0:13413ea9a877 | 752 | |
ganlikun | 0:13413ea9a877 | 753 | /* ------------------------------Calibration----------------------------------*/ |
ganlikun | 0:13413ea9a877 | 754 | /** @defgroup RTCEx_Calibration RTC Calibration |
ganlikun | 0:13413ea9a877 | 755 | * @{ |
ganlikun | 0:13413ea9a877 | 756 | */ |
ganlikun | 0:13413ea9a877 | 757 | |
ganlikun | 0:13413ea9a877 | 758 | /** |
ganlikun | 0:13413ea9a877 | 759 | * @brief Enable the Coarse calibration process. |
ganlikun | 0:13413ea9a877 | 760 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 761 | * @retval None |
ganlikun | 0:13413ea9a877 | 762 | */ |
ganlikun | 0:13413ea9a877 | 763 | #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE)) |
ganlikun | 0:13413ea9a877 | 764 | |
ganlikun | 0:13413ea9a877 | 765 | /** |
ganlikun | 0:13413ea9a877 | 766 | * @brief Disable the Coarse calibration process. |
ganlikun | 0:13413ea9a877 | 767 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 768 | * @retval None |
ganlikun | 0:13413ea9a877 | 769 | */ |
ganlikun | 0:13413ea9a877 | 770 | #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE)) |
ganlikun | 0:13413ea9a877 | 771 | |
ganlikun | 0:13413ea9a877 | 772 | /** |
ganlikun | 0:13413ea9a877 | 773 | * @brief Enable the RTC calibration output. |
ganlikun | 0:13413ea9a877 | 774 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 775 | * @retval None |
ganlikun | 0:13413ea9a877 | 776 | */ |
ganlikun | 0:13413ea9a877 | 777 | #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE)) |
ganlikun | 0:13413ea9a877 | 778 | |
ganlikun | 0:13413ea9a877 | 779 | /** |
ganlikun | 0:13413ea9a877 | 780 | * @brief Disable the calibration output. |
ganlikun | 0:13413ea9a877 | 781 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 782 | * @retval None |
ganlikun | 0:13413ea9a877 | 783 | */ |
ganlikun | 0:13413ea9a877 | 784 | #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE)) |
ganlikun | 0:13413ea9a877 | 785 | |
ganlikun | 0:13413ea9a877 | 786 | /** |
ganlikun | 0:13413ea9a877 | 787 | * @brief Enable the clock reference detection. |
ganlikun | 0:13413ea9a877 | 788 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 789 | * @retval None |
ganlikun | 0:13413ea9a877 | 790 | */ |
ganlikun | 0:13413ea9a877 | 791 | #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON)) |
ganlikun | 0:13413ea9a877 | 792 | |
ganlikun | 0:13413ea9a877 | 793 | /** |
ganlikun | 0:13413ea9a877 | 794 | * @brief Disable the clock reference detection. |
ganlikun | 0:13413ea9a877 | 795 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 796 | * @retval None |
ganlikun | 0:13413ea9a877 | 797 | */ |
ganlikun | 0:13413ea9a877 | 798 | #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON)) |
ganlikun | 0:13413ea9a877 | 799 | |
ganlikun | 0:13413ea9a877 | 800 | /** |
ganlikun | 0:13413ea9a877 | 801 | * @brief Get the selected RTC shift operation's flag status. |
ganlikun | 0:13413ea9a877 | 802 | * @param __HANDLE__: specifies the RTC handle. |
ganlikun | 0:13413ea9a877 | 803 | * @param __FLAG__: specifies the RTC shift operation Flag is pending or not. |
ganlikun | 0:13413ea9a877 | 804 | * This parameter can be: |
ganlikun | 0:13413ea9a877 | 805 | * @arg RTC_FLAG_SHPF |
ganlikun | 0:13413ea9a877 | 806 | * @retval None |
ganlikun | 0:13413ea9a877 | 807 | */ |
ganlikun | 0:13413ea9a877 | 808 | #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
ganlikun | 0:13413ea9a877 | 809 | /** |
ganlikun | 0:13413ea9a877 | 810 | * @} |
ganlikun | 0:13413ea9a877 | 811 | */ |
ganlikun | 0:13413ea9a877 | 812 | |
ganlikun | 0:13413ea9a877 | 813 | /** |
ganlikun | 0:13413ea9a877 | 814 | * @} |
ganlikun | 0:13413ea9a877 | 815 | */ |
ganlikun | 0:13413ea9a877 | 816 | |
ganlikun | 0:13413ea9a877 | 817 | /* Exported functions --------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 818 | /** @defgroup RTCEx_Exported_Functions RTCEx Exported Functions |
ganlikun | 0:13413ea9a877 | 819 | * @{ |
ganlikun | 0:13413ea9a877 | 820 | */ |
ganlikun | 0:13413ea9a877 | 821 | |
ganlikun | 0:13413ea9a877 | 822 | /** @addtogroup RTCEx_Exported_Functions_Group1 |
ganlikun | 0:13413ea9a877 | 823 | * @{ |
ganlikun | 0:13413ea9a877 | 824 | */ |
ganlikun | 0:13413ea9a877 | 825 | /* RTC TimeStamp and Tamper functions *****************************************/ |
ganlikun | 0:13413ea9a877 | 826 | HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); |
ganlikun | 0:13413ea9a877 | 827 | HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); |
ganlikun | 0:13413ea9a877 | 828 | HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 829 | HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format); |
ganlikun | 0:13413ea9a877 | 830 | |
ganlikun | 0:13413ea9a877 | 831 | HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); |
ganlikun | 0:13413ea9a877 | 832 | HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); |
ganlikun | 0:13413ea9a877 | 833 | HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper); |
ganlikun | 0:13413ea9a877 | 834 | void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 835 | |
ganlikun | 0:13413ea9a877 | 836 | void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 837 | void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 838 | void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 839 | HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
ganlikun | 0:13413ea9a877 | 840 | HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
ganlikun | 0:13413ea9a877 | 841 | HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
ganlikun | 0:13413ea9a877 | 842 | /** |
ganlikun | 0:13413ea9a877 | 843 | * @} |
ganlikun | 0:13413ea9a877 | 844 | */ |
ganlikun | 0:13413ea9a877 | 845 | |
ganlikun | 0:13413ea9a877 | 846 | /** @addtogroup RTCEx_Exported_Functions_Group2 |
ganlikun | 0:13413ea9a877 | 847 | * @{ |
ganlikun | 0:13413ea9a877 | 848 | */ |
ganlikun | 0:13413ea9a877 | 849 | /* RTC Wake-up functions ******************************************************/ |
ganlikun | 0:13413ea9a877 | 850 | HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); |
ganlikun | 0:13413ea9a877 | 851 | HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); |
ganlikun | 0:13413ea9a877 | 852 | uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 853 | uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 854 | void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 855 | void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 856 | HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
ganlikun | 0:13413ea9a877 | 857 | /** |
ganlikun | 0:13413ea9a877 | 858 | * @} |
ganlikun | 0:13413ea9a877 | 859 | */ |
ganlikun | 0:13413ea9a877 | 860 | |
ganlikun | 0:13413ea9a877 | 861 | /** @addtogroup RTCEx_Exported_Functions_Group3 |
ganlikun | 0:13413ea9a877 | 862 | * @{ |
ganlikun | 0:13413ea9a877 | 863 | */ |
ganlikun | 0:13413ea9a877 | 864 | /* Extension Control functions ************************************************/ |
ganlikun | 0:13413ea9a877 | 865 | void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); |
ganlikun | 0:13413ea9a877 | 866 | uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); |
ganlikun | 0:13413ea9a877 | 867 | |
ganlikun | 0:13413ea9a877 | 868 | HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value); |
ganlikun | 0:13413ea9a877 | 869 | HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 870 | HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue); |
ganlikun | 0:13413ea9a877 | 871 | HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS); |
ganlikun | 0:13413ea9a877 | 872 | HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput); |
ganlikun | 0:13413ea9a877 | 873 | HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 874 | HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 875 | HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 876 | HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 877 | HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 878 | /** |
ganlikun | 0:13413ea9a877 | 879 | * @} |
ganlikun | 0:13413ea9a877 | 880 | */ |
ganlikun | 0:13413ea9a877 | 881 | |
ganlikun | 0:13413ea9a877 | 882 | /** @addtogroup RTCEx_Exported_Functions_Group4 |
ganlikun | 0:13413ea9a877 | 883 | * @{ |
ganlikun | 0:13413ea9a877 | 884 | */ |
ganlikun | 0:13413ea9a877 | 885 | /* Extension RTC features functions *******************************************/ |
ganlikun | 0:13413ea9a877 | 886 | void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc); |
ganlikun | 0:13413ea9a877 | 887 | HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
ganlikun | 0:13413ea9a877 | 888 | /** |
ganlikun | 0:13413ea9a877 | 889 | * @} |
ganlikun | 0:13413ea9a877 | 890 | */ |
ganlikun | 0:13413ea9a877 | 891 | |
ganlikun | 0:13413ea9a877 | 892 | /** |
ganlikun | 0:13413ea9a877 | 893 | * @} |
ganlikun | 0:13413ea9a877 | 894 | */ |
ganlikun | 0:13413ea9a877 | 895 | |
ganlikun | 0:13413ea9a877 | 896 | /* Private types -------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 897 | /* Private variables ---------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 898 | /* Private constants ---------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 899 | /** @defgroup RTCEx_Private_Constants RTCEx Private Constants |
ganlikun | 0:13413ea9a877 | 900 | * @{ |
ganlikun | 0:13413ea9a877 | 901 | */ |
ganlikun | 0:13413ea9a877 | 902 | #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)EXTI_IMR_MR21) /*!< External interrupt line 21 Connected to the RTC Tamper and Time Stamp events */ |
ganlikun | 0:13413ea9a877 | 903 | #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)EXTI_IMR_MR22) /*!< External interrupt line 22 Connected to the RTC Wake-up event */ |
ganlikun | 0:13413ea9a877 | 904 | /** |
ganlikun | 0:13413ea9a877 | 905 | * @} |
ganlikun | 0:13413ea9a877 | 906 | */ |
ganlikun | 0:13413ea9a877 | 907 | |
ganlikun | 0:13413ea9a877 | 908 | /* Private macros ------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 909 | /** @defgroup RTCEx_Private_Macros RTCEx Private Macros |
ganlikun | 0:13413ea9a877 | 910 | * @{ |
ganlikun | 0:13413ea9a877 | 911 | */ |
ganlikun | 0:13413ea9a877 | 912 | |
ganlikun | 0:13413ea9a877 | 913 | /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters |
ganlikun | 0:13413ea9a877 | 914 | * @{ |
ganlikun | 0:13413ea9a877 | 915 | */ |
ganlikun | 0:13413ea9a877 | 916 | #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \ |
ganlikun | 0:13413ea9a877 | 917 | ((BKP) == RTC_BKP_DR1) || \ |
ganlikun | 0:13413ea9a877 | 918 | ((BKP) == RTC_BKP_DR2) || \ |
ganlikun | 0:13413ea9a877 | 919 | ((BKP) == RTC_BKP_DR3) || \ |
ganlikun | 0:13413ea9a877 | 920 | ((BKP) == RTC_BKP_DR4) || \ |
ganlikun | 0:13413ea9a877 | 921 | ((BKP) == RTC_BKP_DR5) || \ |
ganlikun | 0:13413ea9a877 | 922 | ((BKP) == RTC_BKP_DR6) || \ |
ganlikun | 0:13413ea9a877 | 923 | ((BKP) == RTC_BKP_DR7) || \ |
ganlikun | 0:13413ea9a877 | 924 | ((BKP) == RTC_BKP_DR8) || \ |
ganlikun | 0:13413ea9a877 | 925 | ((BKP) == RTC_BKP_DR9) || \ |
ganlikun | 0:13413ea9a877 | 926 | ((BKP) == RTC_BKP_DR10) || \ |
ganlikun | 0:13413ea9a877 | 927 | ((BKP) == RTC_BKP_DR11) || \ |
ganlikun | 0:13413ea9a877 | 928 | ((BKP) == RTC_BKP_DR12) || \ |
ganlikun | 0:13413ea9a877 | 929 | ((BKP) == RTC_BKP_DR13) || \ |
ganlikun | 0:13413ea9a877 | 930 | ((BKP) == RTC_BKP_DR14) || \ |
ganlikun | 0:13413ea9a877 | 931 | ((BKP) == RTC_BKP_DR15) || \ |
ganlikun | 0:13413ea9a877 | 932 | ((BKP) == RTC_BKP_DR16) || \ |
ganlikun | 0:13413ea9a877 | 933 | ((BKP) == RTC_BKP_DR17) || \ |
ganlikun | 0:13413ea9a877 | 934 | ((BKP) == RTC_BKP_DR18) || \ |
ganlikun | 0:13413ea9a877 | 935 | ((BKP) == RTC_BKP_DR19)) |
ganlikun | 0:13413ea9a877 | 936 | #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \ |
ganlikun | 0:13413ea9a877 | 937 | ((EDGE) == RTC_TIMESTAMPEDGE_FALLING)) |
ganlikun | 0:13413ea9a877 | 938 | |
ganlikun | 0:13413ea9a877 | 939 | #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 940 | #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & ((uint32_t)!(RTC_TAFCR_TAMP1E ))) == 0x00U) && ((TAMPER) != (uint32_t)RESET)) |
ganlikun | 0:13413ea9a877 | 941 | #else |
ganlikun | 0:13413ea9a877 | 942 | #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & ((uint32_t)!(RTC_TAFCR_TAMP1E | RTC_TAFCR_TAMP2E))) == 0x00U) && ((TAMPER) != (uint32_t)RESET)) |
ganlikun | 0:13413ea9a877 | 943 | #endif |
ganlikun | 0:13413ea9a877 | 944 | |
ganlikun | 0:13413ea9a877 | 945 | #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 946 | #define IS_RTC_TAMPER_PIN(PIN) ((PIN) == RTC_TAMPERPIN_DEFAULT) |
ganlikun | 0:13413ea9a877 | 947 | #else |
ganlikun | 0:13413ea9a877 | 948 | #define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_DEFAULT) || \ |
ganlikun | 0:13413ea9a877 | 949 | ((PIN) == RTC_TAMPERPIN_POS1)) |
ganlikun | 0:13413ea9a877 | 950 | #endif |
ganlikun | 0:13413ea9a877 | 951 | |
ganlikun | 0:13413ea9a877 | 952 | #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 953 | #define IS_RTC_TIMESTAMP_PIN(PIN) ((PIN) == RTC_TIMESTAMPPIN_DEFAULT) |
ganlikun | 0:13413ea9a877 | 954 | #else |
ganlikun | 0:13413ea9a877 | 955 | #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT) || \ |
ganlikun | 0:13413ea9a877 | 956 | ((PIN) == RTC_TIMESTAMPPIN_POS1)) |
ganlikun | 0:13413ea9a877 | 957 | #endif |
ganlikun | 0:13413ea9a877 | 958 | #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \ |
ganlikun | 0:13413ea9a877 | 959 | ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \ |
ganlikun | 0:13413ea9a877 | 960 | ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ |
ganlikun | 0:13413ea9a877 | 961 | ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL)) |
ganlikun | 0:13413ea9a877 | 962 | #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \ |
ganlikun | 0:13413ea9a877 | 963 | ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \ |
ganlikun | 0:13413ea9a877 | 964 | ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \ |
ganlikun | 0:13413ea9a877 | 965 | ((FILTER) == RTC_TAMPERFILTER_8SAMPLE)) |
ganlikun | 0:13413ea9a877 | 966 | #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \ |
ganlikun | 0:13413ea9a877 | 967 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \ |
ganlikun | 0:13413ea9a877 | 968 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \ |
ganlikun | 0:13413ea9a877 | 969 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \ |
ganlikun | 0:13413ea9a877 | 970 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \ |
ganlikun | 0:13413ea9a877 | 971 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \ |
ganlikun | 0:13413ea9a877 | 972 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \ |
ganlikun | 0:13413ea9a877 | 973 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256)) |
ganlikun | 0:13413ea9a877 | 974 | #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \ |
ganlikun | 0:13413ea9a877 | 975 | ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \ |
ganlikun | 0:13413ea9a877 | 976 | ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \ |
ganlikun | 0:13413ea9a877 | 977 | ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK)) |
ganlikun | 0:13413ea9a877 | 978 | #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \ |
ganlikun | 0:13413ea9a877 | 979 | ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE)) |
ganlikun | 0:13413ea9a877 | 980 | #define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \ |
ganlikun | 0:13413ea9a877 | 981 | ((STATE) == RTC_TAMPER_PULLUP_DISABLE)) |
ganlikun | 0:13413ea9a877 | 982 | #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \ |
ganlikun | 0:13413ea9a877 | 983 | ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \ |
ganlikun | 0:13413ea9a877 | 984 | ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \ |
ganlikun | 0:13413ea9a877 | 985 | ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \ |
ganlikun | 0:13413ea9a877 | 986 | ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \ |
ganlikun | 0:13413ea9a877 | 987 | ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS)) |
ganlikun | 0:13413ea9a877 | 988 | |
ganlikun | 0:13413ea9a877 | 989 | #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFFU) |
ganlikun | 0:13413ea9a877 | 990 | #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \ |
ganlikun | 0:13413ea9a877 | 991 | ((SIGN) == RTC_CALIBSIGN_NEGATIVE)) |
ganlikun | 0:13413ea9a877 | 992 | |
ganlikun | 0:13413ea9a877 | 993 | #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20U) |
ganlikun | 0:13413ea9a877 | 994 | |
ganlikun | 0:13413ea9a877 | 995 | #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \ |
ganlikun | 0:13413ea9a877 | 996 | ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \ |
ganlikun | 0:13413ea9a877 | 997 | ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC)) |
ganlikun | 0:13413ea9a877 | 998 | #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \ |
ganlikun | 0:13413ea9a877 | 999 | ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET)) |
ganlikun | 0:13413ea9a877 | 1000 | |
ganlikun | 0:13413ea9a877 | 1001 | #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FFU) |
ganlikun | 0:13413ea9a877 | 1002 | #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \ |
ganlikun | 0:13413ea9a877 | 1003 | ((SEL) == RTC_SHIFTADD1S_SET)) |
ganlikun | 0:13413ea9a877 | 1004 | #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFFU) |
ganlikun | 0:13413ea9a877 | 1005 | #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \ |
ganlikun | 0:13413ea9a877 | 1006 | ((OUTPUT) == RTC_CALIBOUTPUT_1HZ)) |
ganlikun | 0:13413ea9a877 | 1007 | /** |
ganlikun | 0:13413ea9a877 | 1008 | * @} |
ganlikun | 0:13413ea9a877 | 1009 | */ |
ganlikun | 0:13413ea9a877 | 1010 | |
ganlikun | 0:13413ea9a877 | 1011 | /** |
ganlikun | 0:13413ea9a877 | 1012 | * @} |
ganlikun | 0:13413ea9a877 | 1013 | */ |
ganlikun | 0:13413ea9a877 | 1014 | |
ganlikun | 0:13413ea9a877 | 1015 | /** |
ganlikun | 0:13413ea9a877 | 1016 | * @} |
ganlikun | 0:13413ea9a877 | 1017 | */ |
ganlikun | 0:13413ea9a877 | 1018 | |
ganlikun | 0:13413ea9a877 | 1019 | /** |
ganlikun | 0:13413ea9a877 | 1020 | * @} |
ganlikun | 0:13413ea9a877 | 1021 | */ |
ganlikun | 0:13413ea9a877 | 1022 | |
ganlikun | 0:13413ea9a877 | 1023 | #ifdef __cplusplus |
ganlikun | 0:13413ea9a877 | 1024 | } |
ganlikun | 0:13413ea9a877 | 1025 | #endif |
ganlikun | 0:13413ea9a877 | 1026 | |
ganlikun | 0:13413ea9a877 | 1027 | #endif /* __STM32F4xx_HAL_RTC_EX_H */ |
ganlikun | 0:13413ea9a877 | 1028 | |
ganlikun | 0:13413ea9a877 | 1029 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
ganlikun | 0:13413ea9a877 | 1030 |