cc y / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Apr 27 12:10:56 2016 -0500
Revision:
119:aae6fcc7d9bb
Parent:
96:487b796308b0
Release 119 of the mbed library

Changes:
- new targets - EFM32PG_STK3401, NUCLEO_L031K6
- ST - hwflwctl support for NUCLEO_L476RG
- Update STM32CUBE_L0 from v1.2 to v1.5
- STM32F7 - bugfix - The weak function HAL_Delay is overwritten to use us ticker API.
- Maxim - Fixing the send break for the MAXWSNENV and MAX32600MBED

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 84:0b3ab51c8877 1 /**
bogdanm 84:0b3ab51c8877 2 ******************************************************************************
bogdanm 84:0b3ab51c8877 3 * @file stm32l0xx_hal_rtc_ex.h
bogdanm 84:0b3ab51c8877 4 * @author MCD Application Team
Kojto 119:aae6fcc7d9bb 5 * @version V1.5.0
Kojto 119:aae6fcc7d9bb 6 * @date 8-January-2016
Kojto 96:487b796308b0 7 * @brief Header file of RTC HAL Extended module.
bogdanm 84:0b3ab51c8877 8 ******************************************************************************
bogdanm 84:0b3ab51c8877 9 * @attention
bogdanm 84:0b3ab51c8877 10 *
Kojto 119:aae6fcc7d9bb 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
bogdanm 84:0b3ab51c8877 12 *
bogdanm 84:0b3ab51c8877 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 84:0b3ab51c8877 14 * are permitted provided that the following conditions are met:
bogdanm 84:0b3ab51c8877 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 84:0b3ab51c8877 16 * this list of conditions and the following disclaimer.
bogdanm 84:0b3ab51c8877 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 84:0b3ab51c8877 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 84:0b3ab51c8877 19 * and/or other materials provided with the distribution.
bogdanm 84:0b3ab51c8877 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 84:0b3ab51c8877 21 * may be used to endorse or promote products derived from this software
bogdanm 84:0b3ab51c8877 22 * without specific prior written permission.
bogdanm 84:0b3ab51c8877 23 *
bogdanm 84:0b3ab51c8877 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 84:0b3ab51c8877 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 84:0b3ab51c8877 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 84:0b3ab51c8877 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 84:0b3ab51c8877 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 84:0b3ab51c8877 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 84:0b3ab51c8877 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 84:0b3ab51c8877 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 84:0b3ab51c8877 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 84:0b3ab51c8877 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 84:0b3ab51c8877 34 *
bogdanm 84:0b3ab51c8877 35 ******************************************************************************
bogdanm 84:0b3ab51c8877 36 */
bogdanm 84:0b3ab51c8877 37
bogdanm 84:0b3ab51c8877 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 84:0b3ab51c8877 39 #ifndef __STM32L0xx_HAL_RTC_EX_H
bogdanm 84:0b3ab51c8877 40 #define __STM32L0xx_HAL_RTC_EX_H
bogdanm 84:0b3ab51c8877 41
bogdanm 84:0b3ab51c8877 42 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 43 extern "C" {
bogdanm 84:0b3ab51c8877 44 #endif
bogdanm 84:0b3ab51c8877 45
bogdanm 84:0b3ab51c8877 46 /* Includes ------------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 47 #include "stm32l0xx_hal_def.h"
bogdanm 84:0b3ab51c8877 48
bogdanm 84:0b3ab51c8877 49 /** @addtogroup STM32L0xx_HAL_Driver
bogdanm 84:0b3ab51c8877 50 * @{
bogdanm 84:0b3ab51c8877 51 */
bogdanm 84:0b3ab51c8877 52
Kojto 96:487b796308b0 53 /** @defgroup RTCEx RTCEx
bogdanm 84:0b3ab51c8877 54 * @{
bogdanm 84:0b3ab51c8877 55 */
bogdanm 84:0b3ab51c8877 56
Kojto 96:487b796308b0 57 /* Exported types ------------------------------------------------------------*/
Kojto 96:487b796308b0 58
Kojto 119:aae6fcc7d9bb 59 /** @defgroup RTCEx_Exported_Types RTCEx Exported Types
Kojto 96:487b796308b0 60 * @{
Kojto 96:487b796308b0 61 */
Kojto 96:487b796308b0 62
bogdanm 84:0b3ab51c8877 63 /**
bogdanm 84:0b3ab51c8877 64 * @brief RTC Tamper structure definition
bogdanm 84:0b3ab51c8877 65 */
bogdanm 84:0b3ab51c8877 66 typedef struct
bogdanm 84:0b3ab51c8877 67 {
bogdanm 84:0b3ab51c8877 68 uint32_t Tamper; /*!< Specifies the Tamper Pin.
bogdanm 84:0b3ab51c8877 69 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
bogdanm 84:0b3ab51c8877 70
bogdanm 84:0b3ab51c8877 71 uint32_t Interrupt; /*!< Specifies the Tamper Interrupt.
bogdanm 84:0b3ab51c8877 72 This parameter can be a value of @ref RTCEx_Tamper_Interrupt_Definitions */
bogdanm 84:0b3ab51c8877 73
bogdanm 84:0b3ab51c8877 74 uint32_t Trigger; /*!< Specifies the Tamper Trigger.
bogdanm 84:0b3ab51c8877 75 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
bogdanm 84:0b3ab51c8877 76
bogdanm 84:0b3ab51c8877 77 uint32_t NoErase; /*!< Specifies the Tamper no erase mode.
bogdanm 84:0b3ab51c8877 78 This parameter can be a value of @ref RTCEx_Tamper_EraseBackUp_Definitions */
bogdanm 84:0b3ab51c8877 79
bogdanm 84:0b3ab51c8877 80 uint32_t MaskFlag; /*!< Specifies the Tamper Flag masking.
bogdanm 84:0b3ab51c8877 81 This parameter can be a value of @ref RTCEx_Tamper_MaskFlag_Definitions */
bogdanm 84:0b3ab51c8877 82
bogdanm 84:0b3ab51c8877 83 uint32_t Filter; /*!< Specifies the RTC Filter Tamper.
bogdanm 84:0b3ab51c8877 84 This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */
bogdanm 84:0b3ab51c8877 85
bogdanm 84:0b3ab51c8877 86 uint32_t SamplingFrequency; /*!< Specifies the sampling frequency.
bogdanm 92:4fc01daae5a5 87 This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */
bogdanm 84:0b3ab51c8877 88
bogdanm 84:0b3ab51c8877 89 uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration .
bogdanm 92:4fc01daae5a5 90 This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */
bogdanm 84:0b3ab51c8877 91
bogdanm 84:0b3ab51c8877 92 uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp .
Kojto 96:487b796308b0 93 This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */
bogdanm 84:0b3ab51c8877 94
bogdanm 84:0b3ab51c8877 95 uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection.
bogdanm 84:0b3ab51c8877 96 This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */
bogdanm 84:0b3ab51c8877 97 }RTC_TamperTypeDef;
Kojto 96:487b796308b0 98 /**
Kojto 96:487b796308b0 99 * @}
Kojto 96:487b796308b0 100 */
bogdanm 84:0b3ab51c8877 101
bogdanm 84:0b3ab51c8877 102 /* Exported constants --------------------------------------------------------*/
Kojto 119:aae6fcc7d9bb 103 /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants
bogdanm 84:0b3ab51c8877 104 * @{
bogdanm 84:0b3ab51c8877 105 */
bogdanm 84:0b3ab51c8877 106
Kojto 119:aae6fcc7d9bb 107 /** @defgroup RTCEx_Output_selection_Definitions RTCEx Output Selection Definition
Kojto 96:487b796308b0 108 * @{
Kojto 96:487b796308b0 109 */
Kojto 119:aae6fcc7d9bb 110 #define RTC_OUTPUT_DISABLE ((uint32_t)0x00000000)
Kojto 119:aae6fcc7d9bb 111 #define RTC_OUTPUT_ALARMA ((uint32_t)RTC_CR_OSEL_0)
Kojto 119:aae6fcc7d9bb 112 #define RTC_OUTPUT_ALARMB ((uint32_t)RTC_CR_OSEL_1)
Kojto 119:aae6fcc7d9bb 113 #define RTC_OUTPUT_WAKEUP ((uint32_t)RTC_CR_OSEL)
Kojto 119:aae6fcc7d9bb 114
Kojto 96:487b796308b0 115 /**
Kojto 96:487b796308b0 116 * @}
Kojto 96:487b796308b0 117 */
Kojto 119:aae6fcc7d9bb 118
Kojto 119:aae6fcc7d9bb 119 /** @defgroup RTCEx_Backup_Registers_Definitions RTCEx Backup Registers Definition
bogdanm 84:0b3ab51c8877 120 * @{
bogdanm 84:0b3ab51c8877 121 */
bogdanm 84:0b3ab51c8877 122 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
bogdanm 84:0b3ab51c8877 123 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
bogdanm 84:0b3ab51c8877 124 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
bogdanm 84:0b3ab51c8877 125 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
bogdanm 84:0b3ab51c8877 126 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
bogdanm 84:0b3ab51c8877 127 /**
bogdanm 84:0b3ab51c8877 128 * @}
bogdanm 84:0b3ab51c8877 129 */
Kojto 96:487b796308b0 130
Kojto 96:487b796308b0 131
Kojto 119:aae6fcc7d9bb 132 /** @defgroup RTCEx_Time_Stamp_Edges_definitions RTCEx Time Stamp Edges definition
bogdanm 84:0b3ab51c8877 133 * @{
Kojto 96:487b796308b0 134 */
Kojto 96:487b796308b0 135 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000)
Kojto 96:487b796308b0 136 #define RTC_TIMESTAMPEDGE_FALLING RTC_CR_TSEDGE
bogdanm 84:0b3ab51c8877 137
Kojto 119:aae6fcc7d9bb 138 /**
Kojto 119:aae6fcc7d9bb 139 * @}
Kojto 119:aae6fcc7d9bb 140 */
Kojto 119:aae6fcc7d9bb 141
Kojto 119:aae6fcc7d9bb 142 /** @defgroup RTCEx_TimeStamp_Pin_Selections RTCEx TimeStamp Pin Selection
Kojto 119:aae6fcc7d9bb 143 * @{
Kojto 119:aae6fcc7d9bb 144 */
Kojto 119:aae6fcc7d9bb 145 #define RTC_TIMESTAMPPIN_DEFAULT ((uint32_t)0x00000000)
Kojto 119:aae6fcc7d9bb 146
bogdanm 84:0b3ab51c8877 147 /**
bogdanm 84:0b3ab51c8877 148 * @}
bogdanm 84:0b3ab51c8877 149 */
bogdanm 84:0b3ab51c8877 150
Kojto 119:aae6fcc7d9bb 151
Kojto 119:aae6fcc7d9bb 152 /** @defgroup RTCEx_Tamper_Pins_Definitions RTCEx Tamper Pins Definition
bogdanm 84:0b3ab51c8877 153 * @{
bogdanm 84:0b3ab51c8877 154 */
Kojto 119:aae6fcc7d9bb 155 #if defined (STM32L063xx) || defined (STM32L062xx) || defined (STM32L061xx) || \
Kojto 119:aae6fcc7d9bb 156 defined (STM32L053xx) || defined (STM32L052xx) || defined (STM32L051xx) ||\
Kojto 119:aae6fcc7d9bb 157 defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 158 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 159 defined (STM32L031xx) || defined (STM32L041xx)
Kojto 119:aae6fcc7d9bb 160
Kojto 119:aae6fcc7d9bb 161 #define RTC_TAMPER_1 RTC_TAMPCR_TAMP1E
Kojto 96:487b796308b0 162
Kojto 119:aae6fcc7d9bb 163 #endif /* (STM32L063xx) || (STM32L062xx) || (STM32L061xx) ||
Kojto 119:aae6fcc7d9bb 164 * (STM32L053xx) || (STM32L052xx) || (STM32L051xx) ||
Kojto 119:aae6fcc7d9bb 165 * (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 166 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) ||
Kojto 119:aae6fcc7d9bb 167 * (STM32L031xx) || (STM32L041xx)
Kojto 119:aae6fcc7d9bb 168 */
Kojto 119:aae6fcc7d9bb 169
Kojto 96:487b796308b0 170 #define RTC_TAMPER_2 RTC_TAMPCR_TAMP2E
Kojto 96:487b796308b0 171
Kojto 96:487b796308b0 172 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 173 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 174 defined (STM32L031xx) || defined (STM32L041xx) || defined (STM32L011xx) || defined (STM32L021xx)
Kojto 119:aae6fcc7d9bb 175
Kojto 96:487b796308b0 176 #define RTC_TAMPER_3 RTC_TAMPCR_TAMP3E
Kojto 96:487b796308b0 177
Kojto 96:487b796308b0 178 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 179 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) || (STM32L031xx) || (STM32L041xx) ||
Kojto 119:aae6fcc7d9bb 180 * (STM32L011xx) || (STM32L021xx)
Kojto 96:487b796308b0 181 */
Kojto 96:487b796308b0 182
bogdanm 84:0b3ab51c8877 183 /**
bogdanm 84:0b3ab51c8877 184 * @}
bogdanm 84:0b3ab51c8877 185 */
bogdanm 84:0b3ab51c8877 186
Kojto 96:487b796308b0 187
Kojto 119:aae6fcc7d9bb 188 /** @defgroup RTCEx_Tamper_Interrupt_Definitions RTCEx Tamper Interrupt Definitions
bogdanm 84:0b3ab51c8877 189 * @{
bogdanm 84:0b3ab51c8877 190 */
Kojto 119:aae6fcc7d9bb 191 #if defined (STM32L063xx) || defined (STM32L062xx) || defined (STM32L061xx) || \
Kojto 119:aae6fcc7d9bb 192 defined (STM32L053xx) || defined (STM32L052xx) || defined (STM32L051xx) ||\
Kojto 119:aae6fcc7d9bb 193 defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 194 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 195 defined (STM32L031xx) || defined (STM32L041xx)
Kojto 96:487b796308b0 196
Kojto 96:487b796308b0 197 #define RTC_TAMPER1_INTERRUPT RTC_TAMPCR_TAMP1IE
Kojto 96:487b796308b0 198
Kojto 119:aae6fcc7d9bb 199 #endif /* (STM32L063xx) || (STM32L062xx) || (STM32L061xx) ||
Kojto 119:aae6fcc7d9bb 200 * (STM32L053xx) || (STM32L052xx) || (STM32L051xx) ||
Kojto 119:aae6fcc7d9bb 201 * (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 202 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) ||
Kojto 119:aae6fcc7d9bb 203 * (STM32L031xx) || (STM32L041xx)
Kojto 119:aae6fcc7d9bb 204 */
Kojto 119:aae6fcc7d9bb 205
Kojto 119:aae6fcc7d9bb 206 #define RTC_TAMPER2_INTERRUPT RTC_TAMPCR_TAMP2IE
Kojto 96:487b796308b0 207 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 208 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 209 defined (STM32L031xx) || defined (STM32L041xx) || defined (STM32L011xx) || defined (STM32L021xx)
Kojto 119:aae6fcc7d9bb 210
Kojto 96:487b796308b0 211 #define RTC_TAMPER3_INTERRUPT RTC_TAMPCR_TAMP3IE
Kojto 96:487b796308b0 212
Kojto 96:487b796308b0 213 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 214 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) || (STM32L031xx) || (STM32L041xx) ||
Kojto 119:aae6fcc7d9bb 215 * (STM32L011xx) || (STM32L021xx)
Kojto 96:487b796308b0 216 */
Kojto 119:aae6fcc7d9bb 217 #define RTC_ALL_TAMPER_INTERRUPT RTC_TAMPCR_TAMPIE
Kojto 119:aae6fcc7d9bb 218 /**
Kojto 119:aae6fcc7d9bb 219 * @}
Kojto 119:aae6fcc7d9bb 220 */
Kojto 119:aae6fcc7d9bb 221
Kojto 119:aae6fcc7d9bb 222 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTCEx Tamper Trigger Definitions
Kojto 119:aae6fcc7d9bb 223 * @{
Kojto 119:aae6fcc7d9bb 224 */
Kojto 119:aae6fcc7d9bb 225 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
Kojto 119:aae6fcc7d9bb 226 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002)
Kojto 119:aae6fcc7d9bb 227 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
Kojto 119:aae6fcc7d9bb 228 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
Kojto 96:487b796308b0 229
bogdanm 84:0b3ab51c8877 230 /**
bogdanm 84:0b3ab51c8877 231 * @}
bogdanm 84:0b3ab51c8877 232 */
bogdanm 84:0b3ab51c8877 233
Kojto 119:aae6fcc7d9bb 234 /** @defgroup RTCEx_Tamper_EraseBackUp_Definitions RTCEx Tamper EraseBackUp Definitions
Kojto 119:aae6fcc7d9bb 235 * @{
Kojto 119:aae6fcc7d9bb 236 */
Kojto 119:aae6fcc7d9bb 237 #define RTC_TAMPER_ERASE_BACKUP_ENABLE ((uint32_t)0x00000000)
Kojto 119:aae6fcc7d9bb 238 #define RTC_TAMPER_ERASE_BACKUP_DISABLE ((uint32_t)0x00020000)
Kojto 96:487b796308b0 239 /**
Kojto 96:487b796308b0 240 * @}
Kojto 96:487b796308b0 241 */
Kojto 96:487b796308b0 242
Kojto 119:aae6fcc7d9bb 243 /** @defgroup RTCEx_Tamper_MaskFlag_Definitions RTCEx Tamper MaskFlag Definitions
Kojto 119:aae6fcc7d9bb 244 * @{
Kojto 119:aae6fcc7d9bb 245 */
Kojto 119:aae6fcc7d9bb 246 #define RTC_TAMPERMASK_FLAG_DISABLE ((uint32_t)0x00000000)
Kojto 119:aae6fcc7d9bb 247 #define RTC_TAMPERMASK_FLAG_ENABLE ((uint32_t)0x00040000)
bogdanm 84:0b3ab51c8877 248
bogdanm 84:0b3ab51c8877 249 /**
bogdanm 84:0b3ab51c8877 250 * @}
bogdanm 84:0b3ab51c8877 251 */
bogdanm 84:0b3ab51c8877 252
Kojto 119:aae6fcc7d9bb 253 /** @defgroup RTCEx_Tamper_Filter_Definitions RTCEx Tamper Filter Definitions
bogdanm 84:0b3ab51c8877 254 * @{
bogdanm 84:0b3ab51c8877 255 */
bogdanm 84:0b3ab51c8877 256 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
bogdanm 84:0b3ab51c8877 257
Kojto 96:487b796308b0 258 #define RTC_TAMPERFILTER_2SAMPLE RTC_TAMPCR_TAMPFLT_0 /*!< Tamper is activated after 2
bogdanm 84:0b3ab51c8877 259 consecutive samples at the active level */
Kojto 96:487b796308b0 260 #define RTC_TAMPERFILTER_4SAMPLE RTC_TAMPCR_TAMPFLT_1 /*!< Tamper is activated after 4
bogdanm 84:0b3ab51c8877 261 consecutive samples at the active level */
Kojto 96:487b796308b0 262 #define RTC_TAMPERFILTER_8SAMPLE RTC_TAMPCR_TAMPFLT /*!< Tamper is activated after 8
bogdanm 84:0b3ab51c8877 263 consecutive samples at the active leve. */
bogdanm 84:0b3ab51c8877 264
bogdanm 84:0b3ab51c8877 265 /**
bogdanm 84:0b3ab51c8877 266 * @}
bogdanm 84:0b3ab51c8877 267 */
bogdanm 84:0b3ab51c8877 268
Kojto 119:aae6fcc7d9bb 269 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTCEx Tamper Sampling Frequencies Definitions
bogdanm 84:0b3ab51c8877 270 * @{
bogdanm 84:0b3ab51c8877 271 */
Kojto 96:487b796308b0 272 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
Kojto 96:487b796308b0 273 with a frequency = RTCCLK / 32768 */
Kojto 96:487b796308b0 274 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 RTC_TAMPCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled
Kojto 96:487b796308b0 275 with a frequency = RTCCLK / 16384 */
Kojto 96:487b796308b0 276 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 RTC_TAMPCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled
Kojto 96:487b796308b0 277 with a frequency = RTCCLK / 8192 */
Kojto 96:487b796308b0 278 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_1)) /*!< Each of the tamper inputs are sampled
Kojto 96:487b796308b0 279 with a frequency = RTCCLK / 4096 */
Kojto 96:487b796308b0 280 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 RTC_TAMPCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled
Kojto 96:487b796308b0 281 with a frequency = RTCCLK / 2048 */
Kojto 96:487b796308b0 282 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_2)) /*!< Each of the tamper inputs are sampled
Kojto 96:487b796308b0 283 with a frequency = RTCCLK / 1024 */
Kojto 96:487b796308b0 284 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_1 | RTC_TAMPCR_TAMPFREQ_2)) /*!< Each of the tamper inputs are sampled
Kojto 96:487b796308b0 285 with a frequency = RTCCLK / 512 */
Kojto 96:487b796308b0 286 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t) (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_1 | \
Kojto 96:487b796308b0 287 RTC_TAMPCR_TAMPFREQ_2)) /*!< Each of the tamper inputs are sampled
Kojto 96:487b796308b0 288 with a frequency = RTCCLK / 256 */
bogdanm 84:0b3ab51c8877 289
bogdanm 84:0b3ab51c8877 290 /**
bogdanm 84:0b3ab51c8877 291 * @}
bogdanm 84:0b3ab51c8877 292 */
bogdanm 84:0b3ab51c8877 293
Kojto 119:aae6fcc7d9bb 294 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTCEx Tamper Pin Precharge Duration Definitions
bogdanm 84:0b3ab51c8877 295 * @{
bogdanm 84:0b3ab51c8877 296 */
Kojto 96:487b796308b0 297 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
Kojto 96:487b796308b0 298 sampling during 1 RTCCLK cycle */
Kojto 96:487b796308b0 299 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK RTC_TAMPCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before
Kojto 96:487b796308b0 300 sampling during 2 RTCCLK cycles */
Kojto 96:487b796308b0 301 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK RTC_TAMPCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before
Kojto 96:487b796308b0 302 sampling during 4 RTCCLK cycles */
Kojto 96:487b796308b0 303 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)(RTC_TAMPCR_TAMPPRCH_0 | RTC_TAMPCR_TAMPPRCH_1)) /*!< Tamper pins are pre-charged before
Kojto 96:487b796308b0 304 sampling during 8 RTCCLK cycles */
bogdanm 84:0b3ab51c8877 305
bogdanm 84:0b3ab51c8877 306 /**
bogdanm 84:0b3ab51c8877 307 * @}
bogdanm 84:0b3ab51c8877 308 */
bogdanm 84:0b3ab51c8877 309
Kojto 119:aae6fcc7d9bb 310 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTCEx Tamper TimeStampOnTamperDetection Definitions
bogdanm 84:0b3ab51c8877 311 * @{
bogdanm 84:0b3ab51c8877 312 */
Kojto 96:487b796308b0 313 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE RTC_TAMPCR_TAMPTS /*!< TimeStamp on Tamper Detection event saved */
Kojto 96:487b796308b0 314 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
bogdanm 84:0b3ab51c8877 315
bogdanm 84:0b3ab51c8877 316 /**
bogdanm 84:0b3ab51c8877 317 * @}
bogdanm 84:0b3ab51c8877 318 */
bogdanm 84:0b3ab51c8877 319
Kojto 119:aae6fcc7d9bb 320 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTCEx Tamper Pull UP Definitions
bogdanm 84:0b3ab51c8877 321 * @{
bogdanm 84:0b3ab51c8877 322 */
Kojto 96:487b796308b0 323 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before sampling */
Kojto 96:487b796308b0 324 #define RTC_TAMPER_PULLUP_DISABLE RTC_TAMPCR_TAMPPUDIS /*!< Tamper pins pre-charge is disabled */
bogdanm 84:0b3ab51c8877 325
bogdanm 84:0b3ab51c8877 326 /**
bogdanm 84:0b3ab51c8877 327 * @}
bogdanm 84:0b3ab51c8877 328 */
bogdanm 84:0b3ab51c8877 329
Kojto 119:aae6fcc7d9bb 330 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTCEx Wakeup Timer Definitions
bogdanm 84:0b3ab51c8877 331 * @{
bogdanm 84:0b3ab51c8877 332 */
bogdanm 84:0b3ab51c8877 333 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
Kojto 96:487b796308b0 334 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 RTC_CR_WUCKSEL_0
Kojto 96:487b796308b0 335 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 RTC_CR_WUCKSEL_1
Kojto 96:487b796308b0 336 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t) (RTC_CR_WUCKSEL_0 | RTC_CR_WUCKSEL_1))
Kojto 96:487b796308b0 337 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS RTC_CR_WUCKSEL_2
Kojto 96:487b796308b0 338 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t) (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_2))
bogdanm 84:0b3ab51c8877 339 /**
bogdanm 84:0b3ab51c8877 340 * @}
bogdanm 84:0b3ab51c8877 341 */
bogdanm 84:0b3ab51c8877 342
Kojto 119:aae6fcc7d9bb 343 /** @defgroup RTCEx_Smooth_calib_period_Definitions RTCEx Smooth calib period Definitions
bogdanm 84:0b3ab51c8877 344 * @{
bogdanm 84:0b3ab51c8877 345 */
Kojto 119:aae6fcc7d9bb 346 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
Kojto 119:aae6fcc7d9bb 347 period is 32s, else 2exp20 RTCCLK pulses */
Kojto 119:aae6fcc7d9bb 348 #define RTC_SMOOTHCALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< If RTCCLK = 32768 Hz, Smooth calibation
Kojto 119:aae6fcc7d9bb 349 period is 16s, else 2exp19 RTCCLK pulses */
Kojto 119:aae6fcc7d9bb 350 #define RTC_SMOOTHCALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< If RTCCLK = 32768 Hz, Smooth calibation
Kojto 119:aae6fcc7d9bb 351 period is 8s, else 2exp18 RTCCLK pulses */
bogdanm 84:0b3ab51c8877 352
bogdanm 84:0b3ab51c8877 353 /**
bogdanm 84:0b3ab51c8877 354 * @}
bogdanm 84:0b3ab51c8877 355 */
bogdanm 84:0b3ab51c8877 356
Kojto 119:aae6fcc7d9bb 357 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTCEx Smooth calib Plus pulses Definitions
bogdanm 84:0b3ab51c8877 358 * @{
bogdanm 84:0b3ab51c8877 359 */
Kojto 119:aae6fcc7d9bb 360 #define RTC_SMOOTHCALIB_PLUSPULSES_SET RTC_CALR_CALP /*!< The number of RTCCLK pulses added
Kojto 119:aae6fcc7d9bb 361 during a X -second window = Y - CALM[8:0]
Kojto 119:aae6fcc7d9bb 362 with Y = 512, 256, 128 when X = 32, 16, 8 */
Kojto 119:aae6fcc7d9bb 363 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
Kojto 119:aae6fcc7d9bb 364 during a 32-second window = CALM[8:0] */
Kojto 119:aae6fcc7d9bb 365
bogdanm 84:0b3ab51c8877 366 /**
bogdanm 84:0b3ab51c8877 367 * @}
bogdanm 84:0b3ab51c8877 368 */
Kojto 119:aae6fcc7d9bb 369 /** @defgroup RTCEx_Calib_Output_selection_Definitions RTCEx Calib Output selection Definitions
bogdanm 84:0b3ab51c8877 370 * @{
bogdanm 84:0b3ab51c8877 371 */
bogdanm 84:0b3ab51c8877 372 #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000)
Kojto 96:487b796308b0 373 #define RTC_CALIBOUTPUT_1HZ RTC_CR_COSEL
bogdanm 84:0b3ab51c8877 374
Kojto 119:aae6fcc7d9bb 375 /**
Kojto 119:aae6fcc7d9bb 376 * @}
Kojto 119:aae6fcc7d9bb 377 */
Kojto 119:aae6fcc7d9bb 378
Kojto 119:aae6fcc7d9bb 379
Kojto 119:aae6fcc7d9bb 380 /** @defgroup RTCEx_Add_1_Second_Parameter_Definition RTCEx Add 1 Second Parameter Definitions
Kojto 119:aae6fcc7d9bb 381 * @{
Kojto 119:aae6fcc7d9bb 382 */
Kojto 119:aae6fcc7d9bb 383 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000)
Kojto 119:aae6fcc7d9bb 384 #define RTC_SHIFTADD1S_SET RTC_SHIFTR_ADD1S
bogdanm 84:0b3ab51c8877 385 /**
bogdanm 84:0b3ab51c8877 386 * @}
bogdanm 84:0b3ab51c8877 387 */
bogdanm 84:0b3ab51c8877 388
Kojto 119:aae6fcc7d9bb 389 /** @defgroup RTCEx_Interrupts_Definitions RTCEx Interrupts Definitions
Kojto 119:aae6fcc7d9bb 390 * @{
Kojto 119:aae6fcc7d9bb 391 */
Kojto 119:aae6fcc7d9bb 392 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 393 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 394 defined (STM32L031xx) || defined (STM32L041xx) || defined (STM32L011xx) || defined (STM32L021xx)
Kojto 119:aae6fcc7d9bb 395
Kojto 119:aae6fcc7d9bb 396 #define RTC_IT_TAMP3 ((uint32_t)RTC_TAMPCR_TAMP3IE)
Kojto 119:aae6fcc7d9bb 397
Kojto 119:aae6fcc7d9bb 398 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 399 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) || (STM32L031xx) || (STM32L041xx) ||
Kojto 119:aae6fcc7d9bb 400 * (STM32L011xx) || (STM32L021xx)
Kojto 119:aae6fcc7d9bb 401 */
Kojto 119:aae6fcc7d9bb 402 /**
Kojto 119:aae6fcc7d9bb 403 * @}
Kojto 119:aae6fcc7d9bb 404 */
Kojto 119:aae6fcc7d9bb 405
Kojto 119:aae6fcc7d9bb 406 /** @defgroup RTCEx_Flags_Definitions RTCEx Flags Definitions
Kojto 119:aae6fcc7d9bb 407 * @{
Kojto 119:aae6fcc7d9bb 408 */
Kojto 119:aae6fcc7d9bb 409 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 410 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 411 defined (STM32L031xx) || defined (STM32L041xx) || defined (STM32L011xx) || defined (STM32L021xx)
Kojto 119:aae6fcc7d9bb 412
Kojto 119:aae6fcc7d9bb 413 #define RTC_FLAG_TAMP3F ((uint32_t)RTC_ISR_TAMP3F)
Kojto 119:aae6fcc7d9bb 414
Kojto 119:aae6fcc7d9bb 415 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 416 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) || (STM32L031xx) || (STM32L041xx) ||
Kojto 119:aae6fcc7d9bb 417 * (STM32L011xx) || (STM32L021xx)
Kojto 119:aae6fcc7d9bb 418 */
Kojto 119:aae6fcc7d9bb 419 /**
Kojto 119:aae6fcc7d9bb 420 * @}
Kojto 119:aae6fcc7d9bb 421 */
Kojto 119:aae6fcc7d9bb 422
bogdanm 84:0b3ab51c8877 423 /**
bogdanm 84:0b3ab51c8877 424 * @}
bogdanm 84:0b3ab51c8877 425 */
bogdanm 84:0b3ab51c8877 426
Kojto 119:aae6fcc7d9bb 427 /* Exported macros -----------------------------------------------------------*/
Kojto 119:aae6fcc7d9bb 428 /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros
Kojto 96:487b796308b0 429 * @{
Kojto 96:487b796308b0 430 */
bogdanm 84:0b3ab51c8877 431
Kojto 119:aae6fcc7d9bb 432 /* ---------------------------------WAKEUPTIMER---------------------------------*/
Kojto 119:aae6fcc7d9bb 433 /** @defgroup RTCEx_WakeUp_Timer RTC WakeUp Timer
Kojto 119:aae6fcc7d9bb 434 * @{
Kojto 119:aae6fcc7d9bb 435 */
bogdanm 84:0b3ab51c8877 436 /**
bogdanm 84:0b3ab51c8877 437 * @brief Enable the RTC WakeUp Timer peripheral.
bogdanm 84:0b3ab51c8877 438 * @param __HANDLE__: specifies the RTC handle.
bogdanm 84:0b3ab51c8877 439 * @retval None
bogdanm 84:0b3ab51c8877 440 */
bogdanm 84:0b3ab51c8877 441 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
bogdanm 84:0b3ab51c8877 442
bogdanm 84:0b3ab51c8877 443 /**
bogdanm 84:0b3ab51c8877 444 * @brief Disable the RTC WakeUp Timer peripheral.
bogdanm 84:0b3ab51c8877 445 * @param __HANDLE__: specifies the RTC handle.
bogdanm 84:0b3ab51c8877 446 * @retval None
bogdanm 84:0b3ab51c8877 447 */
bogdanm 84:0b3ab51c8877 448 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
bogdanm 84:0b3ab51c8877 449
bogdanm 84:0b3ab51c8877 450 /**
Kojto 96:487b796308b0 451 * @brief Enable the RTC WakeUpTimer interrupt.
Kojto 96:487b796308b0 452 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 453 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled.
Kojto 96:487b796308b0 454 * This parameter can be:
Kojto 119:aae6fcc7d9bb 455 * @arg RTC_IT_WUT: WakeUpTimer interrupt
Kojto 96:487b796308b0 456 * @retval None
Kojto 96:487b796308b0 457 */
Kojto 96:487b796308b0 458 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
Kojto 96:487b796308b0 459
Kojto 96:487b796308b0 460 /**
bogdanm 84:0b3ab51c8877 461 * @brief Disable the RTC WakeUpTimer interrupt.
bogdanm 84:0b3ab51c8877 462 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 463 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be disabled.
bogdanm 84:0b3ab51c8877 464 * This parameter can be:
Kojto 119:aae6fcc7d9bb 465 * @arg RTC_IT_WUT: WakeUpTimer interrupt
bogdanm 84:0b3ab51c8877 466 * @retval None
bogdanm 84:0b3ab51c8877 467 */
bogdanm 84:0b3ab51c8877 468 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
bogdanm 84:0b3ab51c8877 469
bogdanm 84:0b3ab51c8877 470 /**
Kojto 119:aae6fcc7d9bb 471 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
bogdanm 84:0b3ab51c8877 472 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 473 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt to check.
bogdanm 84:0b3ab51c8877 474 * This parameter can be:
Kojto 119:aae6fcc7d9bb 475 * @arg RTC_IT_WUT: WakeUpTimer interrupt
bogdanm 84:0b3ab51c8877 476 * @retval None
bogdanm 84:0b3ab51c8877 477 */
Kojto 119:aae6fcc7d9bb 478 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET) ? SET : RESET)
bogdanm 84:0b3ab51c8877 479
bogdanm 84:0b3ab51c8877 480 /**
Kojto 119:aae6fcc7d9bb 481 * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not.
bogdanm 84:0b3ab51c8877 482 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 483 * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check.
bogdanm 84:0b3ab51c8877 484 * This parameter can be:
Kojto 119:aae6fcc7d9bb 485 * @arg RTC_IT_WUT: WakeUpTimer interrupt
bogdanm 84:0b3ab51c8877 486 * @retval None
bogdanm 84:0b3ab51c8877 487 */
Kojto 119:aae6fcc7d9bb 488 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
bogdanm 84:0b3ab51c8877 489
bogdanm 84:0b3ab51c8877 490 /**
bogdanm 84:0b3ab51c8877 491 * @brief Get the selected RTC WakeUpTimer's flag status.
bogdanm 84:0b3ab51c8877 492 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 493 * @param __FLAG__: specifies the RTC WakeUpTimer Flag is pending or not.
bogdanm 84:0b3ab51c8877 494 * This parameter can be:
bogdanm 84:0b3ab51c8877 495 * @arg RTC_FLAG_WUTF
bogdanm 84:0b3ab51c8877 496 * @arg RTC_FLAG_WUTWF
bogdanm 84:0b3ab51c8877 497 * @retval None
bogdanm 84:0b3ab51c8877 498 */
Kojto 119:aae6fcc7d9bb 499 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
bogdanm 84:0b3ab51c8877 500
bogdanm 84:0b3ab51c8877 501 /**
bogdanm 84:0b3ab51c8877 502 * @brief Clear the RTC Wake Up timer's pending flags.
bogdanm 84:0b3ab51c8877 503 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 504 * @param __FLAG__: specifies the RTC WakeUpTimer Flag to clear.
bogdanm 84:0b3ab51c8877 505 * This parameter can be:
bogdanm 84:0b3ab51c8877 506 * @arg RTC_FLAG_WUTF
bogdanm 84:0b3ab51c8877 507 * @retval None
bogdanm 84:0b3ab51c8877 508 */
Kojto 119:aae6fcc7d9bb 509 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 96:487b796308b0 510
Kojto 96:487b796308b0 511 /* WAKE-UP TIMER EXTI */
Kojto 96:487b796308b0 512 /* ------------------ */
Kojto 96:487b796308b0 513 /**
Kojto 96:487b796308b0 514 * @brief Enable interrupt on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 515 * @retval None
Kojto 96:487b796308b0 516 */
Kojto 96:487b796308b0 517 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 96:487b796308b0 518
Kojto 96:487b796308b0 519 /**
Kojto 96:487b796308b0 520 * @brief Disable interrupt on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 521 * @retval None
Kojto 96:487b796308b0 522 */
Kojto 96:487b796308b0 523 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 96:487b796308b0 524
Kojto 96:487b796308b0 525 /**
Kojto 96:487b796308b0 526 * @brief Enable event on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 527 * @retval None.
Kojto 96:487b796308b0 528 */
Kojto 96:487b796308b0 529 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 96:487b796308b0 530
Kojto 96:487b796308b0 531 /**
Kojto 96:487b796308b0 532 * @brief Disable event on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 533 * @retval None.
Kojto 96:487b796308b0 534 */
Kojto 96:487b796308b0 535 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 96:487b796308b0 536
Kojto 96:487b796308b0 537 /**
Kojto 96:487b796308b0 538 * @brief Enable falling edge trigger on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 539 * @retval None.
Kojto 96:487b796308b0 540 */
Kojto 96:487b796308b0 541 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 96:487b796308b0 542
Kojto 96:487b796308b0 543 /**
Kojto 96:487b796308b0 544 * @brief Disable falling edge trigger on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 545 * @retval None.
Kojto 96:487b796308b0 546 */
Kojto 96:487b796308b0 547 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 96:487b796308b0 548
Kojto 96:487b796308b0 549 /**
Kojto 96:487b796308b0 550 * @brief Enable rising edge trigger on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 551 * @retval None.
Kojto 96:487b796308b0 552 */
Kojto 96:487b796308b0 553 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 96:487b796308b0 554
Kojto 96:487b796308b0 555 /**
Kojto 96:487b796308b0 556 * @brief Disable rising edge trigger on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 557 * @retval None.
Kojto 96:487b796308b0 558 */
Kojto 96:487b796308b0 559 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 96:487b796308b0 560
Kojto 96:487b796308b0 561 /**
Kojto 96:487b796308b0 562 * @brief Enable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 563 * @retval None.
Kojto 96:487b796308b0 564 */
Kojto 119:aae6fcc7d9bb 565 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do { __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE(); } while(0);
Kojto 96:487b796308b0 566
Kojto 96:487b796308b0 567 /**
Kojto 96:487b796308b0 568 * @brief Disable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 569 * This parameter can be:
Kojto 96:487b796308b0 570 * @retval None.
Kojto 96:487b796308b0 571 */
Kojto 119:aae6fcc7d9bb 572 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do { __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE(); } while(0);
Kojto 96:487b796308b0 573
Kojto 96:487b796308b0 574 /**
Kojto 96:487b796308b0 575 * @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not.
Kojto 96:487b796308b0 576 * @retval Line Status.
Kojto 96:487b796308b0 577 */
Kojto 96:487b796308b0 578 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 96:487b796308b0 579
Kojto 96:487b796308b0 580 /**
Kojto 96:487b796308b0 581 * @brief Clear the RTC WakeUp Timer associated Exti line flag.
Kojto 96:487b796308b0 582 * @retval None.
Kojto 96:487b796308b0 583 */
Kojto 96:487b796308b0 584 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 96:487b796308b0 585
Kojto 96:487b796308b0 586 /**
Kojto 96:487b796308b0 587 * @brief Generate a Software interrupt on the RTC WakeUp Timer associated Exti line.
Kojto 96:487b796308b0 588 * @retval None.
Kojto 96:487b796308b0 589 */
Kojto 96:487b796308b0 590 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 119:aae6fcc7d9bb 591 /**
Kojto 119:aae6fcc7d9bb 592 * @}
Kojto 119:aae6fcc7d9bb 593 */
Kojto 119:aae6fcc7d9bb 594
Kojto 119:aae6fcc7d9bb 595 /* ---------------------------------TIMESTAMP---------------------------------*/
Kojto 119:aae6fcc7d9bb 596 /** @defgroup RTCEx_Timestamp RTC Timestamp
Kojto 119:aae6fcc7d9bb 597 * @{
Kojto 119:aae6fcc7d9bb 598 */
Kojto 119:aae6fcc7d9bb 599 /**
Kojto 119:aae6fcc7d9bb 600 * @brief Enable the RTC TimeStamp peripheral.
Kojto 119:aae6fcc7d9bb 601 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 602 * @retval None
Kojto 119:aae6fcc7d9bb 603 */
Kojto 119:aae6fcc7d9bb 604 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
Kojto 119:aae6fcc7d9bb 605
Kojto 119:aae6fcc7d9bb 606 /**
Kojto 119:aae6fcc7d9bb 607 * @brief Disable the RTC TimeStamp peripheral.
Kojto 119:aae6fcc7d9bb 608 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 609 * @retval None
Kojto 119:aae6fcc7d9bb 610 */
Kojto 119:aae6fcc7d9bb 611 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
Kojto 119:aae6fcc7d9bb 612
Kojto 119:aae6fcc7d9bb 613 /**
Kojto 119:aae6fcc7d9bb 614 * @brief Enable the RTC TimeStamp interrupt.
Kojto 119:aae6fcc7d9bb 615 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 616 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt source to be enabled.
Kojto 119:aae6fcc7d9bb 617 * This parameter can be:
Kojto 119:aae6fcc7d9bb 618 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 119:aae6fcc7d9bb 619 * @retval None
Kojto 119:aae6fcc7d9bb 620 */
Kojto 119:aae6fcc7d9bb 621 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
Kojto 119:aae6fcc7d9bb 622
Kojto 119:aae6fcc7d9bb 623 /**
Kojto 119:aae6fcc7d9bb 624 * @brief Disable the RTC TimeStamp interrupt.
Kojto 119:aae6fcc7d9bb 625 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 626 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt source to be disabled.
Kojto 119:aae6fcc7d9bb 627 * This parameter can be:
Kojto 119:aae6fcc7d9bb 628 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 119:aae6fcc7d9bb 629 * @retval None
Kojto 119:aae6fcc7d9bb 630 */
Kojto 119:aae6fcc7d9bb 631 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
Kojto 119:aae6fcc7d9bb 632
Kojto 119:aae6fcc7d9bb 633 /**
Kojto 119:aae6fcc7d9bb 634 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
Kojto 119:aae6fcc7d9bb 635 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 636 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt to check.
Kojto 119:aae6fcc7d9bb 637 * This parameter can be:
Kojto 119:aae6fcc7d9bb 638 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 119:aae6fcc7d9bb 639 * @retval None
Kojto 119:aae6fcc7d9bb 640 */
Kojto 119:aae6fcc7d9bb 641 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET) ? SET : RESET)
Kojto 119:aae6fcc7d9bb 642
Kojto 119:aae6fcc7d9bb 643 /**
Kojto 119:aae6fcc7d9bb 644 * @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not.
Kojto 119:aae6fcc7d9bb 645 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 646 * @param __INTERRUPT__: specifies the RTC Time Stamp interrupt source to check.
Kojto 119:aae6fcc7d9bb 647 * This parameter can be:
Kojto 119:aae6fcc7d9bb 648 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 119:aae6fcc7d9bb 649 * @retval None
Kojto 119:aae6fcc7d9bb 650 */
Kojto 119:aae6fcc7d9bb 651 #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 119:aae6fcc7d9bb 652
Kojto 119:aae6fcc7d9bb 653 /**
Kojto 119:aae6fcc7d9bb 654 * @brief Get the selected RTC TimeStamp's flag status.
Kojto 119:aae6fcc7d9bb 655 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 656 * @param __FLAG__: specifies the RTC TimeStamp Flag is pending or not.
Kojto 119:aae6fcc7d9bb 657 * This parameter can be:
Kojto 119:aae6fcc7d9bb 658 * @arg RTC_FLAG_TSF
Kojto 119:aae6fcc7d9bb 659 * @arg RTC_FLAG_TSOVF
Kojto 119:aae6fcc7d9bb 660 * @retval None
Kojto 119:aae6fcc7d9bb 661 */
Kojto 119:aae6fcc7d9bb 662 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
Kojto 119:aae6fcc7d9bb 663
Kojto 119:aae6fcc7d9bb 664 /**
Kojto 119:aae6fcc7d9bb 665 * @brief Clear the RTC Time Stamp's pending flags.
Kojto 119:aae6fcc7d9bb 666 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 667 * @param __FLAG__: specifies the RTC Alarm Flag to clear.
Kojto 119:aae6fcc7d9bb 668 * This parameter can be:
Kojto 119:aae6fcc7d9bb 669 * @arg RTC_FLAG_TSF
Kojto 119:aae6fcc7d9bb 670 * @retval None
Kojto 119:aae6fcc7d9bb 671 */
Kojto 119:aae6fcc7d9bb 672 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 119:aae6fcc7d9bb 673
Kojto 119:aae6fcc7d9bb 674 /**
Kojto 119:aae6fcc7d9bb 675 * @}
Kojto 119:aae6fcc7d9bb 676 */
Kojto 119:aae6fcc7d9bb 677
Kojto 119:aae6fcc7d9bb 678 /* ---------------------------------TAMPER------------------------------------*/
Kojto 119:aae6fcc7d9bb 679 /** @defgroup RTCEx_Tamper RTC Tamper
Kojto 119:aae6fcc7d9bb 680 * @{
Kojto 119:aae6fcc7d9bb 681 */
Kojto 119:aae6fcc7d9bb 682
Kojto 119:aae6fcc7d9bb 683 #if defined (STM32L063xx) || defined (STM32L062xx) || defined (STM32L061xx) || \
Kojto 119:aae6fcc7d9bb 684 defined (STM32L053xx) || defined (STM32L052xx) || defined (STM32L051xx) ||\
Kojto 119:aae6fcc7d9bb 685 defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 686 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 687 defined (STM32L031xx) || defined (STM32L041xx)
Kojto 119:aae6fcc7d9bb 688 /**
Kojto 119:aae6fcc7d9bb 689 * @brief Enable the RTC Tamper1 input detection.
Kojto 119:aae6fcc7d9bb 690 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 691 * @retval None
Kojto 119:aae6fcc7d9bb 692 */
Kojto 119:aae6fcc7d9bb 693 #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP1E))
Kojto 119:aae6fcc7d9bb 694
Kojto 119:aae6fcc7d9bb 695 /**
Kojto 119:aae6fcc7d9bb 696 * @brief Disable the RTC Tamper1 input detection.
Kojto 119:aae6fcc7d9bb 697 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 698 * @retval None
Kojto 119:aae6fcc7d9bb 699 */
Kojto 119:aae6fcc7d9bb 700 #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP1E))
Kojto 119:aae6fcc7d9bb 701
Kojto 119:aae6fcc7d9bb 702 #endif /* (STM32L063xx) || (STM32L062xx) || (STM32L061xx) ||
Kojto 119:aae6fcc7d9bb 703 * (STM32L053xx) || (STM32L052xx) || (STM32L051xx) ||
Kojto 119:aae6fcc7d9bb 704 * (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 705 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) ||
Kojto 119:aae6fcc7d9bb 706 * (STM32L031xx) || (STM32L041xx)
Kojto 119:aae6fcc7d9bb 707 */
Kojto 119:aae6fcc7d9bb 708
Kojto 119:aae6fcc7d9bb 709 /**
Kojto 119:aae6fcc7d9bb 710 * @brief Enable the RTC Tamper2 input detection.
Kojto 119:aae6fcc7d9bb 711 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 712 * @retval None
Kojto 119:aae6fcc7d9bb 713 */
Kojto 119:aae6fcc7d9bb 714 #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP2E))
Kojto 119:aae6fcc7d9bb 715
Kojto 119:aae6fcc7d9bb 716 /**
Kojto 119:aae6fcc7d9bb 717 * @brief Disable the RTC Tamper2 input detection.
Kojto 119:aae6fcc7d9bb 718 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 719 * @retval None
Kojto 119:aae6fcc7d9bb 720 */
Kojto 119:aae6fcc7d9bb 721 #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP2E))
Kojto 119:aae6fcc7d9bb 722
Kojto 119:aae6fcc7d9bb 723
Kojto 119:aae6fcc7d9bb 724 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 725 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 726 defined (STM32L031xx) || defined (STM32L041xx) || defined (STM32L011xx) || defined (STM32L021xx)
Kojto 119:aae6fcc7d9bb 727
Kojto 119:aae6fcc7d9bb 728 /**
Kojto 119:aae6fcc7d9bb 729 * @brief Enable the RTC Tamper3 input detection.
Kojto 119:aae6fcc7d9bb 730 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 731 * @retval None
Kojto 119:aae6fcc7d9bb 732 */
Kojto 119:aae6fcc7d9bb 733 #define __HAL_RTC_TAMPER3_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP3E))
Kojto 119:aae6fcc7d9bb 734
Kojto 119:aae6fcc7d9bb 735 /**
Kojto 119:aae6fcc7d9bb 736 * @brief Disable the RTC Tamper3 input detection.
Kojto 119:aae6fcc7d9bb 737 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 738 * @retval None
Kojto 119:aae6fcc7d9bb 739 */
Kojto 119:aae6fcc7d9bb 740 #define __HAL_RTC_TAMPER3_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP3E))
Kojto 119:aae6fcc7d9bb 741
Kojto 119:aae6fcc7d9bb 742 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 743 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) || (STM32L031xx) || (STM32L041xx) ||
Kojto 119:aae6fcc7d9bb 744 * (STM32L011xx) || (STM32L021xx)
Kojto 119:aae6fcc7d9bb 745 */
Kojto 96:487b796308b0 746
Kojto 96:487b796308b0 747
Kojto 119:aae6fcc7d9bb 748 /**************************************************************************************************/
Kojto 119:aae6fcc7d9bb 749
Kojto 119:aae6fcc7d9bb 750 #if defined (STM32L063xx) || defined (STM32L062xx) || defined (STM32L061xx) || \
Kojto 119:aae6fcc7d9bb 751 defined (STM32L053xx) || defined (STM32L052xx) || defined (STM32L051xx)
Kojto 119:aae6fcc7d9bb 752
Kojto 119:aae6fcc7d9bb 753 /**
Kojto 119:aae6fcc7d9bb 754 * @brief Enable the RTC Tamper interrupt.
Kojto 119:aae6fcc7d9bb 755 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 756 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be enabled.
Kojto 119:aae6fcc7d9bb 757 * This parameter can be any combination of the following values:
Kojto 119:aae6fcc7d9bb 758 * @arg RTC_IT_TAMP: All tampers interrupts
Kojto 119:aae6fcc7d9bb 759 * @arg RTC_IT_TAMP1: Tamper1 interrupt
Kojto 119:aae6fcc7d9bb 760 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 761 * @retval None
Kojto 119:aae6fcc7d9bb 762 */
Kojto 119:aae6fcc7d9bb 763 #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__))
Kojto 119:aae6fcc7d9bb 764
Kojto 119:aae6fcc7d9bb 765 /**
Kojto 119:aae6fcc7d9bb 766 * @brief Disable the RTC Tamper interrupt.
Kojto 119:aae6fcc7d9bb 767 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 768 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be disabled.
Kojto 119:aae6fcc7d9bb 769 * This parameter can be any combination of the following values:
Kojto 119:aae6fcc7d9bb 770 * @arg RTC_IT_TAMP: All tampers interrupts
Kojto 119:aae6fcc7d9bb 771 * @arg RTC_IT_TAMP1: Tamper1 interrupt
Kojto 119:aae6fcc7d9bb 772 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 773 * @retval None
Kojto 119:aae6fcc7d9bb 774 */
Kojto 119:aae6fcc7d9bb 775 #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR &= ~(__INTERRUPT__))
Kojto 119:aae6fcc7d9bb 776
Kojto 119:aae6fcc7d9bb 777 #elif defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 778 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 779 defined (STM32L031xx) || defined (STM32L041xx)
Kojto 119:aae6fcc7d9bb 780
Kojto 119:aae6fcc7d9bb 781 /**
Kojto 119:aae6fcc7d9bb 782 * @brief Enable the RTC Tamper interrupt.
Kojto 119:aae6fcc7d9bb 783 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 784 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be enabled.
Kojto 119:aae6fcc7d9bb 785 * This parameter can be any combination of the following values:
Kojto 119:aae6fcc7d9bb 786 * @arg RTC_IT_TAMP: All tampers interrupts
Kojto 119:aae6fcc7d9bb 787 * @arg RTC_IT_TAMP1: Tamper1 interrupt
Kojto 119:aae6fcc7d9bb 788 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 789 * @arg RTC_IT_TAMP3: Tamper3 interrupt
Kojto 119:aae6fcc7d9bb 790 * @retval None
Kojto 119:aae6fcc7d9bb 791 */
Kojto 119:aae6fcc7d9bb 792 #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__))
Kojto 119:aae6fcc7d9bb 793
Kojto 119:aae6fcc7d9bb 794 /**
Kojto 119:aae6fcc7d9bb 795 * @brief Disable the RTC Tamper interrupt.
Kojto 119:aae6fcc7d9bb 796 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 797 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be disabled.
Kojto 119:aae6fcc7d9bb 798 * This parameter can be any combination of the following values:
Kojto 119:aae6fcc7d9bb 799 * @arg RTC_IT_TAMP: All tampers interrupts
Kojto 119:aae6fcc7d9bb 800 * @arg RTC_IT_TAMP1: Tamper1 interrupt
Kojto 119:aae6fcc7d9bb 801 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 802 * @arg RTC_IT_TAMP3: Tamper3 interrupt
Kojto 119:aae6fcc7d9bb 803 * @retval None
Kojto 119:aae6fcc7d9bb 804 */
Kojto 119:aae6fcc7d9bb 805 #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR &= ~(__INTERRUPT__))
Kojto 119:aae6fcc7d9bb 806
Kojto 119:aae6fcc7d9bb 807 #elif defined (STM32L011xx) || defined (STM32L021xx)
Kojto 119:aae6fcc7d9bb 808
Kojto 119:aae6fcc7d9bb 809 /**
Kojto 119:aae6fcc7d9bb 810 * @brief Enable the RTC Tamper interrupt.
Kojto 119:aae6fcc7d9bb 811 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 812 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be enabled.
Kojto 119:aae6fcc7d9bb 813 * This parameter can be any combination of the following values:
Kojto 119:aae6fcc7d9bb 814 * @arg RTC_IT_TAMP: All tampers interrupts
Kojto 119:aae6fcc7d9bb 815 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 816 * @arg RTC_IT_TAMP3: Tamper3 interrupt
Kojto 119:aae6fcc7d9bb 817 * @retval None
Kojto 119:aae6fcc7d9bb 818 */
Kojto 119:aae6fcc7d9bb 819 #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__))
Kojto 119:aae6fcc7d9bb 820
Kojto 119:aae6fcc7d9bb 821 /**
Kojto 119:aae6fcc7d9bb 822 * @brief Disable the RTC Tamper interrupt.
Kojto 119:aae6fcc7d9bb 823 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 824 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be disabled.
Kojto 119:aae6fcc7d9bb 825 * This parameter can be any combination of the following values:
Kojto 119:aae6fcc7d9bb 826 * @arg RTC_IT_TAMP: All tampers interrupts
Kojto 119:aae6fcc7d9bb 827 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 828 * @arg RTC_IT_TAMP3: Tamper3 interrupt
Kojto 119:aae6fcc7d9bb 829 * @retval None
Kojto 119:aae6fcc7d9bb 830 */
Kojto 119:aae6fcc7d9bb 831 #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR &= ~(__INTERRUPT__))
Kojto 119:aae6fcc7d9bb 832
Kojto 119:aae6fcc7d9bb 833 #endif /* (STM32L011xx) || (STM32L021xx)
Kojto 119:aae6fcc7d9bb 834 */
Kojto 119:aae6fcc7d9bb 835
Kojto 119:aae6fcc7d9bb 836 /**************************************************************************************************/
Kojto 119:aae6fcc7d9bb 837
Kojto 119:aae6fcc7d9bb 838 #if defined (STM32L063xx) || defined (STM32L062xx) || defined (STM32L061xx) || \
Kojto 119:aae6fcc7d9bb 839 defined (STM32L053xx) || defined (STM32L052xx) || defined (STM32L051xx)
Kojto 119:aae6fcc7d9bb 840
Kojto 119:aae6fcc7d9bb 841 /**
Kojto 119:aae6fcc7d9bb 842 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
Kojto 119:aae6fcc7d9bb 843 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 844 * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check.
Kojto 119:aae6fcc7d9bb 845 * This parameter can be:
Kojto 119:aae6fcc7d9bb 846 * @arg RTC_IT_TAMP1: Tamper1 interrupt
Kojto 119:aae6fcc7d9bb 847 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 848 * @retval None
Kojto 119:aae6fcc7d9bb 849 */
Kojto 119:aae6fcc7d9bb 850 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP1) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 3)) != RESET) ? SET : RESET) : \
Kojto 119:aae6fcc7d9bb 851 ((__INTERRUPT__) == RTC_IT_TAMP2) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5)) != RESET) ? SET : RESET))
Kojto 119:aae6fcc7d9bb 852
Kojto 119:aae6fcc7d9bb 853 #elif defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 854 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 855 defined (STM32L031xx) || defined (STM32L041xx)
Kojto 119:aae6fcc7d9bb 856
Kojto 119:aae6fcc7d9bb 857 /**
Kojto 119:aae6fcc7d9bb 858 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
Kojto 119:aae6fcc7d9bb 859 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 860 * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check.
Kojto 119:aae6fcc7d9bb 861 * This parameter can be:
Kojto 119:aae6fcc7d9bb 862 * @arg RTC_IT_TAMP1: Tamper1 interrupt
Kojto 119:aae6fcc7d9bb 863 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 864 * @arg RTC_IT_TAMP3: Tamper3 interrupt
Kojto 119:aae6fcc7d9bb 865 * @retval None
Kojto 119:aae6fcc7d9bb 866 */
Kojto 119:aae6fcc7d9bb 867 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP1) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 3)) != RESET) ? SET : RESET) : \
Kojto 119:aae6fcc7d9bb 868 ((__INTERRUPT__) == RTC_IT_TAMP2) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5)) != RESET) ? SET : RESET) : \
Kojto 119:aae6fcc7d9bb 869 ((__INTERRUPT__) == RTC_IT_TAMP3) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 7)) != RESET) ? SET : RESET))
Kojto 119:aae6fcc7d9bb 870
Kojto 119:aae6fcc7d9bb 871 #elif defined (STM32L011xx) || defined (STM32L021xx)
Kojto 119:aae6fcc7d9bb 872
Kojto 119:aae6fcc7d9bb 873 /**
Kojto 119:aae6fcc7d9bb 874 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
Kojto 119:aae6fcc7d9bb 875 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 876 * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check.
Kojto 119:aae6fcc7d9bb 877 * This parameter can be:
Kojto 119:aae6fcc7d9bb 878 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 879 * @arg RTC_IT_TAMP3: Tamper3 interrupt
Kojto 119:aae6fcc7d9bb 880 * @retval None
Kojto 119:aae6fcc7d9bb 881 */
Kojto 119:aae6fcc7d9bb 882 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP2) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5)) != RESET) ? SET : RESET) : \
Kojto 119:aae6fcc7d9bb 883 ((__INTERRUPT__) == RTC_IT_TAMP3) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 7)) != RESET) ? SET : RESET))
Kojto 119:aae6fcc7d9bb 884
Kojto 119:aae6fcc7d9bb 885
Kojto 119:aae6fcc7d9bb 886 #endif /* (STM32L011xx) || (STM32L021xx)
Kojto 119:aae6fcc7d9bb 887 */
Kojto 119:aae6fcc7d9bb 888
Kojto 119:aae6fcc7d9bb 889 /**************************************************************************************************/
Kojto 119:aae6fcc7d9bb 890
Kojto 119:aae6fcc7d9bb 891 #if defined (STM32L063xx) || defined (STM32L062xx) || defined (STM32L061xx) || \
Kojto 119:aae6fcc7d9bb 892 defined (STM32L053xx) || defined (STM32L052xx) || defined (STM32L051xx)
Kojto 119:aae6fcc7d9bb 893
Kojto 119:aae6fcc7d9bb 894 /**
Kojto 119:aae6fcc7d9bb 895 * @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
Kojto 119:aae6fcc7d9bb 896 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 897 * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check.
Kojto 119:aae6fcc7d9bb 898 * This parameter can be:
Kojto 119:aae6fcc7d9bb 899 * @arg RTC_IT_TAMP: All tampers interrupts
Kojto 119:aae6fcc7d9bb 900 * @arg RTC_IT_TAMP1: Tamper1 interrupt
Kojto 119:aae6fcc7d9bb 901 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 902 * @retval None
Kojto 119:aae6fcc7d9bb 903 */
Kojto 119:aae6fcc7d9bb 904 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 119:aae6fcc7d9bb 905
Kojto 119:aae6fcc7d9bb 906
Kojto 119:aae6fcc7d9bb 907 /**
Kojto 119:aae6fcc7d9bb 908 * @brief Get the selected RTC Tamper's flag status.
Kojto 119:aae6fcc7d9bb 909 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 910 * @param __FLAG__: specifies the RTC Tamper Flag is pending or not.
Kojto 119:aae6fcc7d9bb 911 * This parameter can be:
Kojto 119:aae6fcc7d9bb 912 * @arg RTC_FLAG_TAMP1F: Tamper1 flag
Kojto 119:aae6fcc7d9bb 913 * @arg RTC_FLAG_TAMP2F: Tamper2 flag
Kojto 119:aae6fcc7d9bb 914 * @retval None
Kojto 119:aae6fcc7d9bb 915 */
Kojto 119:aae6fcc7d9bb 916 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
Kojto 119:aae6fcc7d9bb 917
Kojto 119:aae6fcc7d9bb 918 /**
Kojto 119:aae6fcc7d9bb 919 * @brief Clear the RTC Tamper's pending flags.
Kojto 119:aae6fcc7d9bb 920 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 921 * @param __FLAG__: specifies the RTC Tamper Flag to clear.
Kojto 119:aae6fcc7d9bb 922 * This parameter can be:
Kojto 119:aae6fcc7d9bb 923 * @arg RTC_FLAG_TAMP1F: Tamper1 flag
Kojto 119:aae6fcc7d9bb 924 * @arg RTC_FLAG_TAMP2F: Tamper2 flag
Kojto 119:aae6fcc7d9bb 925 * @retval None
Kojto 119:aae6fcc7d9bb 926 */
Kojto 119:aae6fcc7d9bb 927 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 119:aae6fcc7d9bb 928
Kojto 119:aae6fcc7d9bb 929
Kojto 119:aae6fcc7d9bb 930 #elif defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 931 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 932 defined (STM32L031xx) || defined (STM32L041xx)
Kojto 119:aae6fcc7d9bb 933
Kojto 119:aae6fcc7d9bb 934 /**
Kojto 119:aae6fcc7d9bb 935 * @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
Kojto 119:aae6fcc7d9bb 936 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 937 * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check.
Kojto 119:aae6fcc7d9bb 938 * This parameter can be:
Kojto 119:aae6fcc7d9bb 939 * @arg RTC_IT_TAMP: All tampers interrupts
Kojto 119:aae6fcc7d9bb 940 * @arg RTC_IT_TAMP1: Tamper1 interrupt
Kojto 119:aae6fcc7d9bb 941 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 942 * @arg RTC_IT_TAMP3: Tamper3 interrupt
Kojto 119:aae6fcc7d9bb 943 * @retval None
Kojto 119:aae6fcc7d9bb 944 */
Kojto 119:aae6fcc7d9bb 945 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 119:aae6fcc7d9bb 946
Kojto 119:aae6fcc7d9bb 947
Kojto 119:aae6fcc7d9bb 948 /**
Kojto 119:aae6fcc7d9bb 949 * @brief Get the selected RTC Tamper's flag status.
Kojto 119:aae6fcc7d9bb 950 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 951 * @param __FLAG__: specifies the RTC Tamper Flag is pending or not.
Kojto 119:aae6fcc7d9bb 952 * This parameter can be:
Kojto 119:aae6fcc7d9bb 953 * @arg RTC_FLAG_TAMP1F: Tamper1 flag
Kojto 119:aae6fcc7d9bb 954 * @arg RTC_FLAG_TAMP2F: Tamper2 flag
Kojto 119:aae6fcc7d9bb 955 * @arg RTC_FLAG_TAMP3F: Tamper3 flag
Kojto 119:aae6fcc7d9bb 956 * @retval None
Kojto 119:aae6fcc7d9bb 957 */
Kojto 119:aae6fcc7d9bb 958 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
Kojto 119:aae6fcc7d9bb 959
Kojto 119:aae6fcc7d9bb 960 /**
Kojto 119:aae6fcc7d9bb 961 * @brief Clear the RTC Tamper's pending flags.
Kojto 119:aae6fcc7d9bb 962 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 963 * @param __FLAG__: specifies the RTC Tamper Flag to clear.
Kojto 119:aae6fcc7d9bb 964 * This parameter can be:
Kojto 119:aae6fcc7d9bb 965 * @arg RTC_FLAG_TAMP1F: Tamper1 flag
Kojto 119:aae6fcc7d9bb 966 * @arg RTC_FLAG_TAMP2F: Tamper2 flag
Kojto 119:aae6fcc7d9bb 967 * @arg RTC_FLAG_TAMP3F: Tamper3 flag
Kojto 119:aae6fcc7d9bb 968 * @retval None
Kojto 119:aae6fcc7d9bb 969 */
Kojto 119:aae6fcc7d9bb 970 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 119:aae6fcc7d9bb 971
Kojto 119:aae6fcc7d9bb 972 #elif defined (STM32L011xx) || defined (STM32L021xx)
Kojto 119:aae6fcc7d9bb 973
Kojto 119:aae6fcc7d9bb 974 /**
Kojto 119:aae6fcc7d9bb 975 * @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
Kojto 119:aae6fcc7d9bb 976 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 977 * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check.
Kojto 119:aae6fcc7d9bb 978 * This parameter can be:
Kojto 119:aae6fcc7d9bb 979 * @arg RTC_IT_TAMP: All tampers interrupts
Kojto 119:aae6fcc7d9bb 980 * @arg RTC_IT_TAMP2: Tamper2 interrupt
Kojto 119:aae6fcc7d9bb 981 * @arg RTC_IT_TAMP3: Tamper3 interrupt
Kojto 119:aae6fcc7d9bb 982 * @retval None
Kojto 119:aae6fcc7d9bb 983 */
Kojto 119:aae6fcc7d9bb 984 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 119:aae6fcc7d9bb 985
Kojto 119:aae6fcc7d9bb 986
Kojto 119:aae6fcc7d9bb 987 /**
Kojto 119:aae6fcc7d9bb 988 * @brief Get the selected RTC Tamper's flag status.
Kojto 119:aae6fcc7d9bb 989 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 990 * @param __FLAG__: specifies the RTC Tamper Flag is pending or not.
Kojto 119:aae6fcc7d9bb 991 * This parameter can be:
Kojto 119:aae6fcc7d9bb 992 * @arg RTC_FLAG_TAMP2F: Tamper2 flag
Kojto 119:aae6fcc7d9bb 993 * @arg RTC_FLAG_TAMP3F: Tamper3 flag
Kojto 119:aae6fcc7d9bb 994 * @retval None
Kojto 119:aae6fcc7d9bb 995 */
Kojto 119:aae6fcc7d9bb 996 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
Kojto 119:aae6fcc7d9bb 997
Kojto 119:aae6fcc7d9bb 998 /**
Kojto 119:aae6fcc7d9bb 999 * @brief Clear the RTC Tamper's pending flags.
Kojto 119:aae6fcc7d9bb 1000 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 1001 * @param __FLAG__: specifies the RTC Tamper Flag to clear.
Kojto 119:aae6fcc7d9bb 1002 * This parameter can be:
Kojto 119:aae6fcc7d9bb 1003 * @arg RTC_FLAG_TAMP2F: Tamper2 flag
Kojto 119:aae6fcc7d9bb 1004 * @arg RTC_FLAG_TAMP3F: Tamper3 flag
Kojto 119:aae6fcc7d9bb 1005 * @retval None
Kojto 119:aae6fcc7d9bb 1006 */
Kojto 119:aae6fcc7d9bb 1007 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 119:aae6fcc7d9bb 1008
Kojto 119:aae6fcc7d9bb 1009 #endif /* (STM32L011xx) || (STM32L021xx)
Kojto 119:aae6fcc7d9bb 1010 */
Kojto 119:aae6fcc7d9bb 1011
Kojto 119:aae6fcc7d9bb 1012
Kojto 119:aae6fcc7d9bb 1013 /**************************************************************************************************/
Kojto 119:aae6fcc7d9bb 1014
Kojto 119:aae6fcc7d9bb 1015 /**
Kojto 119:aae6fcc7d9bb 1016 * @}
Kojto 119:aae6fcc7d9bb 1017 */
Kojto 119:aae6fcc7d9bb 1018
Kojto 119:aae6fcc7d9bb 1019 /* --------------------------TAMPER/TIMESTAMP---------------------------------*/
Kojto 119:aae6fcc7d9bb 1020 /** @defgroup RTCEx_Tamper_Timestamp EXTI RTC Tamper Timestamp EXTI
Kojto 119:aae6fcc7d9bb 1021 * @{
Kojto 119:aae6fcc7d9bb 1022 */
Kojto 119:aae6fcc7d9bb 1023
Kojto 96:487b796308b0 1024 /* TAMPER TIMESTAMP EXTI */
Kojto 96:487b796308b0 1025 /* --------------------- */
Kojto 96:487b796308b0 1026 /**
Kojto 96:487b796308b0 1027 * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1028 * @retval None
Kojto 96:487b796308b0 1029 */
Kojto 96:487b796308b0 1030 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 96:487b796308b0 1031
Kojto 96:487b796308b0 1032 /**
Kojto 96:487b796308b0 1033 * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1034 * @retval None
Kojto 96:487b796308b0 1035 */
Kojto 96:487b796308b0 1036 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 96:487b796308b0 1037
Kojto 96:487b796308b0 1038 /**
Kojto 96:487b796308b0 1039 * @brief Enable event on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1040 * @retval None.
Kojto 96:487b796308b0 1041 */
Kojto 96:487b796308b0 1042 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 96:487b796308b0 1043
Kojto 96:487b796308b0 1044 /**
Kojto 96:487b796308b0 1045 * @brief Disable event on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1046 * @retval None.
Kojto 96:487b796308b0 1047 */
Kojto 96:487b796308b0 1048 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 96:487b796308b0 1049
Kojto 96:487b796308b0 1050 /**
Kojto 96:487b796308b0 1051 * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1052 * @retval None.
Kojto 96:487b796308b0 1053 */
Kojto 96:487b796308b0 1054 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 96:487b796308b0 1055
Kojto 96:487b796308b0 1056 /**
Kojto 96:487b796308b0 1057 * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1058 * @retval None.
Kojto 96:487b796308b0 1059 */
Kojto 96:487b796308b0 1060 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 96:487b796308b0 1061
Kojto 96:487b796308b0 1062 /**
Kojto 96:487b796308b0 1063 * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1064 * @retval None.
Kojto 96:487b796308b0 1065 */
Kojto 96:487b796308b0 1066 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 96:487b796308b0 1067
Kojto 96:487b796308b0 1068 /**
Kojto 96:487b796308b0 1069 * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1070 * @retval None.
Kojto 96:487b796308b0 1071 */
Kojto 96:487b796308b0 1072 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 96:487b796308b0 1073
Kojto 96:487b796308b0 1074 /**
Kojto 96:487b796308b0 1075 * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1076 * @retval None.
Kojto 96:487b796308b0 1077 */
Kojto 119:aae6fcc7d9bb 1078 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() do { __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); } while(0);
Kojto 96:487b796308b0 1079
Kojto 96:487b796308b0 1080 /**
Kojto 96:487b796308b0 1081 * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 96:487b796308b0 1082 * This parameter can be:
Kojto 96:487b796308b0 1083 * @retval None.
Kojto 96:487b796308b0 1084 */
Kojto 119:aae6fcc7d9bb 1085 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() do { __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE(); } while(0);
Kojto 96:487b796308b0 1086
Kojto 96:487b796308b0 1087 /**
Kojto 96:487b796308b0 1088 * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not.
Kojto 96:487b796308b0 1089 * @retval Line Status.
Kojto 96:487b796308b0 1090 */
Kojto 119:aae6fcc7d9bb 1091 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 96:487b796308b0 1092
Kojto 96:487b796308b0 1093 /**
Kojto 96:487b796308b0 1094 * @brief Clear the RTC Tamper and Timestamp associated Exti line flag.
Kojto 96:487b796308b0 1095 * @retval None.
Kojto 96:487b796308b0 1096 */
Kojto 96:487b796308b0 1097 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 96:487b796308b0 1098
Kojto 96:487b796308b0 1099 /**
Kojto 96:487b796308b0 1100 * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line
Kojto 96:487b796308b0 1101 * @retval None.
Kojto 96:487b796308b0 1102 */
Kojto 96:487b796308b0 1103 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 119:aae6fcc7d9bb 1104 /**
Kojto 119:aae6fcc7d9bb 1105 * @}
Kojto 119:aae6fcc7d9bb 1106 */
Kojto 96:487b796308b0 1107
Kojto 119:aae6fcc7d9bb 1108 /* ------------------------------Calibration----------------------------------*/
Kojto 119:aae6fcc7d9bb 1109 /** @defgroup RTCEx_Calibration RTC Calibration
Kojto 119:aae6fcc7d9bb 1110 * @{
Kojto 119:aae6fcc7d9bb 1111 */
Kojto 119:aae6fcc7d9bb 1112
Kojto 119:aae6fcc7d9bb 1113 /**
Kojto 119:aae6fcc7d9bb 1114 * @brief Enable the RTC calibration output.
Kojto 119:aae6fcc7d9bb 1115 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 1116 * @retval None
Kojto 119:aae6fcc7d9bb 1117 */
Kojto 119:aae6fcc7d9bb 1118 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
Kojto 119:aae6fcc7d9bb 1119
Kojto 119:aae6fcc7d9bb 1120 /**
Kojto 119:aae6fcc7d9bb 1121 * @brief Disable the calibration output.
Kojto 119:aae6fcc7d9bb 1122 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 1123 * @retval None
Kojto 119:aae6fcc7d9bb 1124 */
Kojto 119:aae6fcc7d9bb 1125 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
Kojto 119:aae6fcc7d9bb 1126
Kojto 119:aae6fcc7d9bb 1127 /**
Kojto 119:aae6fcc7d9bb 1128 * @brief Enable the clock reference detection.
Kojto 119:aae6fcc7d9bb 1129 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 1130 * @retval None
Kojto 119:aae6fcc7d9bb 1131 */
Kojto 119:aae6fcc7d9bb 1132 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
Kojto 119:aae6fcc7d9bb 1133
Kojto 119:aae6fcc7d9bb 1134 /**
Kojto 119:aae6fcc7d9bb 1135 * @brief Disable the clock reference detection.
Kojto 119:aae6fcc7d9bb 1136 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 1137 * @retval None
Kojto 119:aae6fcc7d9bb 1138 */
Kojto 119:aae6fcc7d9bb 1139 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
Kojto 119:aae6fcc7d9bb 1140
Kojto 119:aae6fcc7d9bb 1141 /**
Kojto 119:aae6fcc7d9bb 1142 * @brief Get the selected RTC shift operation's flag status.
Kojto 119:aae6fcc7d9bb 1143 * @param __HANDLE__: specifies the RTC handle.
Kojto 119:aae6fcc7d9bb 1144 * @param __FLAG__: specifies the RTC shift operation Flag is pending or not.
Kojto 119:aae6fcc7d9bb 1145 * This parameter can be:
Kojto 119:aae6fcc7d9bb 1146 * @arg RTC_FLAG_SHPF
Kojto 119:aae6fcc7d9bb 1147 * @retval None
Kojto 119:aae6fcc7d9bb 1148 */
Kojto 119:aae6fcc7d9bb 1149 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
Kojto 119:aae6fcc7d9bb 1150 /**
Kojto 119:aae6fcc7d9bb 1151 * @}
Kojto 119:aae6fcc7d9bb 1152 */
bogdanm 84:0b3ab51c8877 1153
bogdanm 84:0b3ab51c8877 1154 /**
bogdanm 84:0b3ab51c8877 1155 * @}
bogdanm 84:0b3ab51c8877 1156 */
bogdanm 84:0b3ab51c8877 1157
bogdanm 84:0b3ab51c8877 1158 /* Exported functions --------------------------------------------------------*/
Kojto 119:aae6fcc7d9bb 1159 /** @defgroup RTCEx_Exported_Functions RTCEx Exported Functions
Kojto 96:487b796308b0 1160 * @{
Kojto 96:487b796308b0 1161 */
Kojto 96:487b796308b0 1162
Kojto 119:aae6fcc7d9bb 1163 /* RTC TimeStamp and Tamper functions *****************************************/
Kojto 96:487b796308b0 1164 /** @defgroup RTCEx_Exported_Functions_Group1 Extended RTC TimeStamp and Tamper functions
Kojto 96:487b796308b0 1165 * @{
Kojto 96:487b796308b0 1166 */
bogdanm 84:0b3ab51c8877 1167
bogdanm 84:0b3ab51c8877 1168 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
bogdanm 84:0b3ab51c8877 1169 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
bogdanm 84:0b3ab51c8877 1170 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
bogdanm 84:0b3ab51c8877 1171 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
bogdanm 84:0b3ab51c8877 1172
bogdanm 84:0b3ab51c8877 1173 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
bogdanm 84:0b3ab51c8877 1174 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
bogdanm 84:0b3ab51c8877 1175 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
Kojto 96:487b796308b0 1176 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
bogdanm 84:0b3ab51c8877 1177
Kojto 96:487b796308b0 1178 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
Kojto 96:487b796308b0 1179 void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
Kojto 96:487b796308b0 1180
Kojto 96:487b796308b0 1181 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 1182 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 1183 defined (STM32L031xx) || defined (STM32L041xx) || defined (STM32L011xx) || defined (STM32L021xx)
Kojto 96:487b796308b0 1184
Kojto 96:487b796308b0 1185 void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc);
Kojto 96:487b796308b0 1186
Kojto 96:487b796308b0 1187 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 1188 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) || (STM32L031xx) || (STM32L041xx) ||
Kojto 119:aae6fcc7d9bb 1189 * (STM32L011xx) || (STM32L021xx)
Kojto 96:487b796308b0 1190 */
Kojto 96:487b796308b0 1191
Kojto 96:487b796308b0 1192 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
Kojto 96:487b796308b0 1193 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 96:487b796308b0 1194 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 96:487b796308b0 1195 HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 96:487b796308b0 1196
Kojto 96:487b796308b0 1197 #if defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 1198 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 1199 defined (STM32L031xx) || defined (STM32L041xx) || defined (STM32L011xx) || defined (STM32L021xx)
Kojto 96:487b796308b0 1200
Kojto 96:487b796308b0 1201 HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 96:487b796308b0 1202
Kojto 96:487b796308b0 1203 #endif /* (STM32L083xx) || (STM32L082xx) || (STM32L081xx) ||
Kojto 119:aae6fcc7d9bb 1204 * (STM32L073xx) || (STM32L072xx) || (STM32L071xx) || (STM32L031xx) || (STM32L041xx) ||
Kojto 119:aae6fcc7d9bb 1205 * (STM32L011xx) || (STM32L021xx)
Kojto 96:487b796308b0 1206 */
Kojto 96:487b796308b0 1207
Kojto 96:487b796308b0 1208 /**
Kojto 96:487b796308b0 1209 * @}
Kojto 96:487b796308b0 1210 */
Kojto 96:487b796308b0 1211
Kojto 119:aae6fcc7d9bb 1212 /* RTC Wake-up functions ******************************************************/
Kojto 96:487b796308b0 1213 /** @defgroup RTCEx_Exported_Functions_Group2 Extended RTC Wake-up functions
Kojto 96:487b796308b0 1214 * @{
Kojto 96:487b796308b0 1215 */
Kojto 96:487b796308b0 1216
bogdanm 84:0b3ab51c8877 1217 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
bogdanm 84:0b3ab51c8877 1218 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
Kojto 119:aae6fcc7d9bb 1219 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
Kojto 119:aae6fcc7d9bb 1220 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
Kojto 96:487b796308b0 1221 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
Kojto 96:487b796308b0 1222 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
Kojto 96:487b796308b0 1223 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 96:487b796308b0 1224 /**
Kojto 96:487b796308b0 1225 * @}
Kojto 96:487b796308b0 1226 */
bogdanm 84:0b3ab51c8877 1227
Kojto 119:aae6fcc7d9bb 1228 /* Extended Control functions ************************************************/
Kojto 96:487b796308b0 1229 /** @defgroup RTCEx_Exported_Functions_Group3 Extended Peripheral Control functions
Kojto 96:487b796308b0 1230 * @{
Kojto 96:487b796308b0 1231 */
Kojto 96:487b796308b0 1232
bogdanm 84:0b3ab51c8877 1233 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
bogdanm 84:0b3ab51c8877 1234 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
bogdanm 84:0b3ab51c8877 1235
Kojto 119:aae6fcc7d9bb 1236 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue);
bogdanm 84:0b3ab51c8877 1237 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
bogdanm 84:0b3ab51c8877 1238 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
bogdanm 84:0b3ab51c8877 1239 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
bogdanm 84:0b3ab51c8877 1240 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
bogdanm 84:0b3ab51c8877 1241 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
bogdanm 84:0b3ab51c8877 1242 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
bogdanm 84:0b3ab51c8877 1243 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
Kojto 96:487b796308b0 1244 /**
Kojto 96:487b796308b0 1245 * @}
Kojto 96:487b796308b0 1246 */
bogdanm 84:0b3ab51c8877 1247
Kojto 96:487b796308b0 1248 /* Extended RTC features functions *******************************************/
Kojto 96:487b796308b0 1249 /** @defgroup RTCEx_Exported_Functions_Group4 Extended features functions
Kojto 96:487b796308b0 1250 * @{
Kojto 96:487b796308b0 1251 */
Kojto 96:487b796308b0 1252 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
Kojto 96:487b796308b0 1253 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 119:aae6fcc7d9bb 1254 /**
Kojto 119:aae6fcc7d9bb 1255 * @}
Kojto 119:aae6fcc7d9bb 1256 */
Kojto 119:aae6fcc7d9bb 1257
Kojto 119:aae6fcc7d9bb 1258 /**
Kojto 119:aae6fcc7d9bb 1259 * @}
Kojto 119:aae6fcc7d9bb 1260 */
Kojto 119:aae6fcc7d9bb 1261
Kojto 119:aae6fcc7d9bb 1262 /* Private types -------------------------------------------------------------*/
Kojto 119:aae6fcc7d9bb 1263 /* Private variables ---------------------------------------------------------*/
Kojto 119:aae6fcc7d9bb 1264 /* Private constants ---------------------------------------------------------*/
Kojto 119:aae6fcc7d9bb 1265 /** @defgroup RTCEx_Private_Constants RTCEx Private Constants
Kojto 119:aae6fcc7d9bb 1266 * @{
Kojto 119:aae6fcc7d9bb 1267 */
Kojto 119:aae6fcc7d9bb 1268
Kojto 119:aae6fcc7d9bb 1269 /* Masks Definition */
Kojto 119:aae6fcc7d9bb 1270
Kojto 119:aae6fcc7d9bb 1271 #if defined (STM32L063xx) || defined (STM32L062xx) || defined (STM32L061xx) || \
Kojto 119:aae6fcc7d9bb 1272 defined (STM32L053xx) || defined (STM32L052xx) || defined (STM32L051xx)
Kojto 119:aae6fcc7d9bb 1273
Kojto 119:aae6fcc7d9bb 1274 #define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP2F | RTC_FLAG_TAMP1F| \
Kojto 119:aae6fcc7d9bb 1275 RTC_FLAG_TSOVF | RTC_FLAG_TSF | RTC_FLAG_WUTF | \
Kojto 119:aae6fcc7d9bb 1276 RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | \
Kojto 119:aae6fcc7d9bb 1277 RTC_FLAG_INITF | RTC_FLAG_RSF | RTC_FLAG_INITS | \
Kojto 119:aae6fcc7d9bb 1278 RTC_FLAG_SHPF | RTC_FLAG_WUTWF |RTC_FLAG_ALRBWF | \
Kojto 119:aae6fcc7d9bb 1279 RTC_FLAG_ALRAWF))
Kojto 119:aae6fcc7d9bb 1280
Kojto 119:aae6fcc7d9bb 1281 #define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP2E | RTC_TAMPCR_TAMP1E))
Kojto 119:aae6fcc7d9bb 1282 #define RTC_TAMPCR_TAMPXIE ((uint32_t) (RTC_TAMPER1_INTERRUPT | RTC_TAMPER2_INTERRUPT | \
Kojto 119:aae6fcc7d9bb 1283 RTC_ALL_TAMPER_INTERRUPT))
Kojto 119:aae6fcc7d9bb 1284
Kojto 119:aae6fcc7d9bb 1285 #elif defined (STM32L083xx) || defined (STM32L082xx) || defined (STM32L081xx) || \
Kojto 119:aae6fcc7d9bb 1286 defined (STM32L073xx) || defined (STM32L072xx) || defined (STM32L071xx) || \
Kojto 119:aae6fcc7d9bb 1287 defined (STM32L031xx) || defined (STM32L041xx)
Kojto 119:aae6fcc7d9bb 1288
Kojto 119:aae6fcc7d9bb 1289 #define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP3F | RTC_FLAG_TAMP2F | \
Kojto 119:aae6fcc7d9bb 1290 RTC_FLAG_TAMP1F| RTC_FLAG_TSOVF | RTC_FLAG_TSF | \
Kojto 119:aae6fcc7d9bb 1291 RTC_FLAG_WUTF | RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | \
Kojto 119:aae6fcc7d9bb 1292 RTC_FLAG_INITF | RTC_FLAG_RSF | \
Kojto 119:aae6fcc7d9bb 1293 RTC_FLAG_INITS | RTC_FLAG_SHPF | RTC_FLAG_WUTWF | \
Kojto 119:aae6fcc7d9bb 1294 RTC_FLAG_ALRBWF | RTC_FLAG_ALRAWF))
Kojto 119:aae6fcc7d9bb 1295
Kojto 119:aae6fcc7d9bb 1296 #define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP3E | RTC_TAMPCR_TAMP2E | RTC_TAMPCR_TAMP1E))
Kojto 119:aae6fcc7d9bb 1297 #define RTC_TAMPCR_TAMPXIE ((uint32_t) (RTC_TAMPER1_INTERRUPT | RTC_TAMPER2_INTERRUPT | \
Kojto 119:aae6fcc7d9bb 1298 RTC_TAMPER3_INTERRUPT | RTC_ALL_TAMPER_INTERRUPT))
Kojto 119:aae6fcc7d9bb 1299
Kojto 119:aae6fcc7d9bb 1300 #elif defined (STM32L011xx) || defined (STM32L021xx)
Kojto 119:aae6fcc7d9bb 1301
Kojto 119:aae6fcc7d9bb 1302 #define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP3F | RTC_FLAG_TAMP2F | \
Kojto 119:aae6fcc7d9bb 1303 RTC_FLAG_TSOVF | RTC_FLAG_TSF | \
Kojto 119:aae6fcc7d9bb 1304 RTC_FLAG_WUTF | RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | \
Kojto 119:aae6fcc7d9bb 1305 RTC_FLAG_INITF | RTC_FLAG_RSF | \
Kojto 119:aae6fcc7d9bb 1306 RTC_FLAG_INITS | RTC_FLAG_SHPF | RTC_FLAG_WUTWF | \
Kojto 119:aae6fcc7d9bb 1307 RTC_FLAG_ALRBWF | RTC_FLAG_ALRAWF))
Kojto 119:aae6fcc7d9bb 1308
Kojto 119:aae6fcc7d9bb 1309 #define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP3E | RTC_TAMPCR_TAMP2E))
Kojto 119:aae6fcc7d9bb 1310 #define RTC_TAMPCR_TAMPXIE ((uint32_t) (RTC_TAMPER2_INTERRUPT | \
Kojto 119:aae6fcc7d9bb 1311 RTC_TAMPER3_INTERRUPT | RTC_ALL_TAMPER_INTERRUPT))
Kojto 119:aae6fcc7d9bb 1312 #endif /* (STM32L011xx) || (STM32L021xx)
Kojto 119:aae6fcc7d9bb 1313 */
Kojto 119:aae6fcc7d9bb 1314
Kojto 119:aae6fcc7d9bb 1315 #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)EXTI_IMR_IM19) /*!< External interrupt line 19 Connected to the RTC Tamper and Time Stamp events */
Kojto 119:aae6fcc7d9bb 1316 #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)EXTI_IMR_IM20) /*!< External interrupt line 20 Connected to the RTC Wakeup event */
Kojto 119:aae6fcc7d9bb 1317
Kojto 119:aae6fcc7d9bb 1318 /**
Kojto 119:aae6fcc7d9bb 1319 * @}
Kojto 119:aae6fcc7d9bb 1320 */
Kojto 119:aae6fcc7d9bb 1321
Kojto 119:aae6fcc7d9bb 1322 /* Private macros ------------------------------------------------------------*/
Kojto 119:aae6fcc7d9bb 1323 /** @defgroup RTCEx_Private_Macros RTCEx Private Macros
Kojto 119:aae6fcc7d9bb 1324 * @{
Kojto 119:aae6fcc7d9bb 1325 */
Kojto 119:aae6fcc7d9bb 1326
Kojto 119:aae6fcc7d9bb 1327 /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters
Kojto 119:aae6fcc7d9bb 1328 * @{
Kojto 119:aae6fcc7d9bb 1329 */
Kojto 119:aae6fcc7d9bb 1330
Kojto 119:aae6fcc7d9bb 1331 #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \
Kojto 119:aae6fcc7d9bb 1332 ((OUTPUT) == RTC_OUTPUT_ALARMA) || \
Kojto 119:aae6fcc7d9bb 1333 ((OUTPUT) == RTC_OUTPUT_ALARMB) || \
Kojto 119:aae6fcc7d9bb 1334 ((OUTPUT) == RTC_OUTPUT_WAKEUP))
Kojto 119:aae6fcc7d9bb 1335
Kojto 119:aae6fcc7d9bb 1336 #define IS_RTC_BKP(BKP) ((BKP) < (uint32_t) RTC_BKP_NUMBER)
Kojto 119:aae6fcc7d9bb 1337
Kojto 119:aae6fcc7d9bb 1338 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
Kojto 119:aae6fcc7d9bb 1339 ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
Kojto 119:aae6fcc7d9bb 1340
Kojto 119:aae6fcc7d9bb 1341 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & ((uint32_t)(0xFFFFFFFF ^ RTC_TAMPCR_TAMPXE))) == 0x00) && ((TAMPER) != (uint32_t)RESET))
Kojto 119:aae6fcc7d9bb 1342
Kojto 119:aae6fcc7d9bb 1343 #define IS_RTC_TAMPER_INTERRUPT(INTERRUPT) ((((INTERRUPT) & (uint32_t)(0xFFFFFFFF ^ RTC_TAMPCR_TAMPXIE)) == 0x00) && ((INTERRUPT) != (uint32_t)RESET))
Kojto 119:aae6fcc7d9bb 1344
Kojto 119:aae6fcc7d9bb 1345 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT))
Kojto 119:aae6fcc7d9bb 1346
Kojto 119:aae6fcc7d9bb 1347 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
Kojto 119:aae6fcc7d9bb 1348 ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
Kojto 119:aae6fcc7d9bb 1349 ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
Kojto 119:aae6fcc7d9bb 1350 ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))
Kojto 119:aae6fcc7d9bb 1351
Kojto 119:aae6fcc7d9bb 1352 #define IS_RTC_TAMPER_ERASE_MODE(MODE) (((MODE) == RTC_TAMPER_ERASE_BACKUP_ENABLE) || \
Kojto 119:aae6fcc7d9bb 1353 ((MODE) == RTC_TAMPER_ERASE_BACKUP_DISABLE))
Kojto 119:aae6fcc7d9bb 1354
Kojto 119:aae6fcc7d9bb 1355 #define IS_RTC_TAMPER_MASKFLAG_STATE(STATE) (((STATE) == RTC_TAMPERMASK_FLAG_ENABLE) || \
Kojto 119:aae6fcc7d9bb 1356 ((STATE) == RTC_TAMPERMASK_FLAG_DISABLE))
Kojto 119:aae6fcc7d9bb 1357
Kojto 119:aae6fcc7d9bb 1358 #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \
Kojto 119:aae6fcc7d9bb 1359 ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \
Kojto 119:aae6fcc7d9bb 1360 ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \
Kojto 119:aae6fcc7d9bb 1361 ((FILTER) == RTC_TAMPERFILTER_8SAMPLE))
Kojto 119:aae6fcc7d9bb 1362
Kojto 119:aae6fcc7d9bb 1363 #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
Kojto 119:aae6fcc7d9bb 1364 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
Kojto 119:aae6fcc7d9bb 1365 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
Kojto 119:aae6fcc7d9bb 1366 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
Kojto 119:aae6fcc7d9bb 1367 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
Kojto 119:aae6fcc7d9bb 1368 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
Kojto 119:aae6fcc7d9bb 1369 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
Kojto 119:aae6fcc7d9bb 1370 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
Kojto 119:aae6fcc7d9bb 1371
Kojto 119:aae6fcc7d9bb 1372 #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
Kojto 119:aae6fcc7d9bb 1373 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
Kojto 119:aae6fcc7d9bb 1374 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
Kojto 119:aae6fcc7d9bb 1375 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
Kojto 119:aae6fcc7d9bb 1376
Kojto 119:aae6fcc7d9bb 1377 #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
Kojto 119:aae6fcc7d9bb 1378 ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
Kojto 119:aae6fcc7d9bb 1379
Kojto 119:aae6fcc7d9bb 1380 #define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \
Kojto 119:aae6fcc7d9bb 1381 ((STATE) == RTC_TAMPER_PULLUP_DISABLE))
Kojto 119:aae6fcc7d9bb 1382
Kojto 119:aae6fcc7d9bb 1383 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
Kojto 119:aae6fcc7d9bb 1384 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
Kojto 119:aae6fcc7d9bb 1385 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
Kojto 119:aae6fcc7d9bb 1386 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
Kojto 119:aae6fcc7d9bb 1387 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
Kojto 119:aae6fcc7d9bb 1388 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
Kojto 119:aae6fcc7d9bb 1389
Kojto 119:aae6fcc7d9bb 1390 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= RTC_WUTR_WUT)
Kojto 119:aae6fcc7d9bb 1391
Kojto 119:aae6fcc7d9bb 1392 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
Kojto 119:aae6fcc7d9bb 1393 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
Kojto 119:aae6fcc7d9bb 1394 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC))
Kojto 119:aae6fcc7d9bb 1395
Kojto 119:aae6fcc7d9bb 1396 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
Kojto 119:aae6fcc7d9bb 1397 ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
Kojto 119:aae6fcc7d9bb 1398
Kojto 119:aae6fcc7d9bb 1399
Kojto 119:aae6fcc7d9bb 1400 /** @defgroup RTCEx_Smooth_calib_Minus_pulses_Definitions RTCEx Smooth calib Minus pulses Definitions
Kojto 119:aae6fcc7d9bb 1401 * @{
Kojto 119:aae6fcc7d9bb 1402 */
Kojto 119:aae6fcc7d9bb 1403 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= RTC_CALR_CALM)
Kojto 119:aae6fcc7d9bb 1404 /**
Kojto 119:aae6fcc7d9bb 1405 * @}
Kojto 119:aae6fcc7d9bb 1406 */
Kojto 119:aae6fcc7d9bb 1407
Kojto 119:aae6fcc7d9bb 1408
Kojto 119:aae6fcc7d9bb 1409 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \
Kojto 119:aae6fcc7d9bb 1410 ((SEL) == RTC_SHIFTADD1S_SET))
Kojto 119:aae6fcc7d9bb 1411
Kojto 119:aae6fcc7d9bb 1412
Kojto 119:aae6fcc7d9bb 1413
Kojto 119:aae6fcc7d9bb 1414 /** @defgroup RTCEx_Substract_Fraction_Of_Second_Value RTCEx Substract Fraction Of Second Value
Kojto 119:aae6fcc7d9bb 1415 * @{
Kojto 119:aae6fcc7d9bb 1416 */
Kojto 119:aae6fcc7d9bb 1417 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= RTC_SHIFTR_SUBFS)
Kojto 119:aae6fcc7d9bb 1418 /**
Kojto 119:aae6fcc7d9bb 1419 * @}
Kojto 119:aae6fcc7d9bb 1420 */
Kojto 119:aae6fcc7d9bb 1421 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \
Kojto 119:aae6fcc7d9bb 1422 ((OUTPUT) == RTC_CALIBOUTPUT_1HZ))
bogdanm 84:0b3ab51c8877 1423
Kojto 96:487b796308b0 1424 /**
Kojto 96:487b796308b0 1425 * @}
Kojto 96:487b796308b0 1426 */
bogdanm 84:0b3ab51c8877 1427
Kojto 96:487b796308b0 1428 /**
Kojto 96:487b796308b0 1429 * @}
Kojto 96:487b796308b0 1430 */
bogdanm 84:0b3ab51c8877 1431
Kojto 119:aae6fcc7d9bb 1432
Kojto 119:aae6fcc7d9bb 1433
bogdanm 84:0b3ab51c8877 1434 /**
bogdanm 84:0b3ab51c8877 1435 * @}
bogdanm 84:0b3ab51c8877 1436 */
bogdanm 84:0b3ab51c8877 1437
bogdanm 84:0b3ab51c8877 1438 /**
bogdanm 84:0b3ab51c8877 1439 * @}
bogdanm 84:0b3ab51c8877 1440 */
bogdanm 84:0b3ab51c8877 1441
bogdanm 84:0b3ab51c8877 1442 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 1443 }
bogdanm 84:0b3ab51c8877 1444 #endif
bogdanm 84:0b3ab51c8877 1445
Kojto 96:487b796308b0 1446 #endif /* __STM32L0xx_HAL_RTC_EX_H */
bogdanm 84:0b3ab51c8877 1447
bogdanm 84:0b3ab51c8877 1448 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Kojto 96:487b796308b0 1449