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