Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
100:cbbeb26dbd92
.

Who changed what in which revision?

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