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


