meh
Fork of mbed by
TARGET_NUCLEO_L152RE/stm32l1xx_hal_rtc_ex.h@90:cb3d968589d8, 2014-10-28 (annotated)
- Committer:
- Kojto
- Date:
- Tue Oct 28 16:40:41 2014 +0000
- Revision:
- 90:cb3d968589d8
Release 90 of the mbed library
Changes:
- Freescale KSDK update (v1.0)
- K22 - new target addition
- KL43Z - new target addition
- Nucleo F091RC - new target addition
- Nucleo L152RE - STM32Cube driver
- Nordic - Softdevice v7.1.0
- Nvic files - BSD License
- LPC824 - various HAL fixes
- Nucleo F411RE - CMSIS - IAR files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 90:cb3d968589d8 | 1 | /** |
Kojto | 90:cb3d968589d8 | 2 | ****************************************************************************** |
Kojto | 90:cb3d968589d8 | 3 | * @file stm32l1xx_hal_rtc_ex.h |
Kojto | 90:cb3d968589d8 | 4 | * @author MCD Application Team |
Kojto | 90:cb3d968589d8 | 5 | * @version V1.0.0 |
Kojto | 90:cb3d968589d8 | 6 | * @date 5-September-2014 |
Kojto | 90:cb3d968589d8 | 7 | * @brief Header file of RTC HAL Extension module. |
Kojto | 90:cb3d968589d8 | 8 | ****************************************************************************** |
Kojto | 90:cb3d968589d8 | 9 | * @attention |
Kojto | 90:cb3d968589d8 | 10 | * |
Kojto | 90:cb3d968589d8 | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
Kojto | 90:cb3d968589d8 | 12 | * |
Kojto | 90:cb3d968589d8 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 90:cb3d968589d8 | 14 | * are permitted provided that the following conditions are met: |
Kojto | 90:cb3d968589d8 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 90:cb3d968589d8 | 16 | * this list of conditions and the following disclaimer. |
Kojto | 90:cb3d968589d8 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 90:cb3d968589d8 | 18 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 90:cb3d968589d8 | 19 | * and/or other materials provided with the distribution. |
Kojto | 90:cb3d968589d8 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 90:cb3d968589d8 | 21 | * may be used to endorse or promote products derived from this software |
Kojto | 90:cb3d968589d8 | 22 | * without specific prior written permission. |
Kojto | 90:cb3d968589d8 | 23 | * |
Kojto | 90:cb3d968589d8 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 90:cb3d968589d8 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 90:cb3d968589d8 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 90:cb3d968589d8 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 90:cb3d968589d8 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 90:cb3d968589d8 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 90:cb3d968589d8 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 90:cb3d968589d8 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 90:cb3d968589d8 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 90:cb3d968589d8 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 90:cb3d968589d8 | 34 | * |
Kojto | 90:cb3d968589d8 | 35 | ****************************************************************************** |
Kojto | 90:cb3d968589d8 | 36 | */ |
Kojto | 90:cb3d968589d8 | 37 | |
Kojto | 90:cb3d968589d8 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Kojto | 90:cb3d968589d8 | 39 | #ifndef __STM32L1xx_HAL_RTC_EX_H |
Kojto | 90:cb3d968589d8 | 40 | #define __STM32L1xx_HAL_RTC_EX_H |
Kojto | 90:cb3d968589d8 | 41 | |
Kojto | 90:cb3d968589d8 | 42 | #ifdef __cplusplus |
Kojto | 90:cb3d968589d8 | 43 | extern "C" { |
Kojto | 90:cb3d968589d8 | 44 | #endif |
Kojto | 90:cb3d968589d8 | 45 | |
Kojto | 90:cb3d968589d8 | 46 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 90:cb3d968589d8 | 47 | #include "stm32l1xx_hal_def.h" |
Kojto | 90:cb3d968589d8 | 48 | |
Kojto | 90:cb3d968589d8 | 49 | /** @addtogroup STM32L1xx_HAL_Driver |
Kojto | 90:cb3d968589d8 | 50 | * @{ |
Kojto | 90:cb3d968589d8 | 51 | */ |
Kojto | 90:cb3d968589d8 | 52 | |
Kojto | 90:cb3d968589d8 | 53 | /** @addtogroup RTCEx |
Kojto | 90:cb3d968589d8 | 54 | * @{ |
Kojto | 90:cb3d968589d8 | 55 | */ |
Kojto | 90:cb3d968589d8 | 56 | |
Kojto | 90:cb3d968589d8 | 57 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 90:cb3d968589d8 | 58 | /** @defgroup RTCEx_Exported_Types RTCEx Exported Types |
Kojto | 90:cb3d968589d8 | 59 | * @{ |
Kojto | 90:cb3d968589d8 | 60 | */ |
Kojto | 90:cb3d968589d8 | 61 | |
Kojto | 90:cb3d968589d8 | 62 | /** |
Kojto | 90:cb3d968589d8 | 63 | * @brief RTC Tamper structure definition |
Kojto | 90:cb3d968589d8 | 64 | */ |
Kojto | 90:cb3d968589d8 | 65 | typedef struct |
Kojto | 90:cb3d968589d8 | 66 | { |
Kojto | 90:cb3d968589d8 | 67 | uint32_t Tamper; /*!< Specifies the Tamper Pin. |
Kojto | 90:cb3d968589d8 | 68 | This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */ |
Kojto | 90:cb3d968589d8 | 69 | |
Kojto | 90:cb3d968589d8 | 70 | uint32_t Trigger; /*!< Specifies the Tamper Trigger. |
Kojto | 90:cb3d968589d8 | 71 | This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */ |
Kojto | 90:cb3d968589d8 | 72 | |
Kojto | 90:cb3d968589d8 | 73 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 74 | uint32_t Filter; /*!< Specifies the RTC Filter Tamper. |
Kojto | 90:cb3d968589d8 | 75 | This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */ |
Kojto | 90:cb3d968589d8 | 76 | |
Kojto | 90:cb3d968589d8 | 77 | uint32_t SamplingFrequency; /*!< Specifies the sampling frequency. |
Kojto | 90:cb3d968589d8 | 78 | This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */ |
Kojto | 90:cb3d968589d8 | 79 | |
Kojto | 90:cb3d968589d8 | 80 | uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration . |
Kojto | 90:cb3d968589d8 | 81 | This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */ |
Kojto | 90:cb3d968589d8 | 82 | |
Kojto | 90:cb3d968589d8 | 83 | uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp . |
Kojto | 90:cb3d968589d8 | 84 | This parameter can be a value of @ref RTCEx_Tamper_Pull_Up_Definitions */ |
Kojto | 90:cb3d968589d8 | 85 | |
Kojto | 90:cb3d968589d8 | 86 | uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection. |
Kojto | 90:cb3d968589d8 | 87 | This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */ |
Kojto | 90:cb3d968589d8 | 88 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 89 | }RTC_TamperTypeDef; |
Kojto | 90:cb3d968589d8 | 90 | |
Kojto | 90:cb3d968589d8 | 91 | /** |
Kojto | 90:cb3d968589d8 | 92 | * @brief RTC Time structure definition |
Kojto | 90:cb3d968589d8 | 93 | */ |
Kojto | 90:cb3d968589d8 | 94 | typedef struct |
Kojto | 90:cb3d968589d8 | 95 | { |
Kojto | 90:cb3d968589d8 | 96 | uint8_t Hours; /*!< Specifies the RTC Time Hour. |
Kojto | 90:cb3d968589d8 | 97 | This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the RTC_HourFormat_12 is selected |
Kojto | 90:cb3d968589d8 | 98 | This parameter must be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HourFormat_24 is selected */ |
Kojto | 90:cb3d968589d8 | 99 | |
Kojto | 90:cb3d968589d8 | 100 | uint8_t Minutes; /*!< Specifies the RTC Time Minutes. |
Kojto | 90:cb3d968589d8 | 101 | This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
Kojto | 90:cb3d968589d8 | 102 | |
Kojto | 90:cb3d968589d8 | 103 | uint8_t Seconds; /*!< Specifies the RTC Time Seconds. |
Kojto | 90:cb3d968589d8 | 104 | This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
Kojto | 90:cb3d968589d8 | 105 | |
Kojto | 90:cb3d968589d8 | 106 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 107 | uint32_t SubSeconds; /*!< Specifies the RTC Time SubSeconds. |
Kojto | 90:cb3d968589d8 | 108 | This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
Kojto | 90:cb3d968589d8 | 109 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 110 | |
Kojto | 90:cb3d968589d8 | 111 | uint8_t TimeFormat; /*!< Specifies the RTC AM/PM Time. |
Kojto | 90:cb3d968589d8 | 112 | This parameter can be a value of @ref RTC_AM_PM_Definitions */ |
Kojto | 90:cb3d968589d8 | 113 | |
Kojto | 90:cb3d968589d8 | 114 | uint32_t DayLightSaving; /*!< Specifies RTC_DayLightSaveOperation: the value of hour adjustment. |
Kojto | 90:cb3d968589d8 | 115 | This parameter can be a value of @ref RTC_DayLightSaving_Definitions */ |
Kojto | 90:cb3d968589d8 | 116 | |
Kojto | 90:cb3d968589d8 | 117 | uint32_t StoreOperation; /*!< Specifies RTC_StoreOperation value to be written in the BCK bit |
Kojto | 90:cb3d968589d8 | 118 | in CR register to store the operation. |
Kojto | 90:cb3d968589d8 | 119 | This parameter can be a value of @ref RTC_StoreOperation_Definitions */ |
Kojto | 90:cb3d968589d8 | 120 | }RTC_TimeTypeDef; |
Kojto | 90:cb3d968589d8 | 121 | |
Kojto | 90:cb3d968589d8 | 122 | /** |
Kojto | 90:cb3d968589d8 | 123 | * @brief RTC Alarm structure definition |
Kojto | 90:cb3d968589d8 | 124 | */ |
Kojto | 90:cb3d968589d8 | 125 | typedef struct |
Kojto | 90:cb3d968589d8 | 126 | { |
Kojto | 90:cb3d968589d8 | 127 | RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members */ |
Kojto | 90:cb3d968589d8 | 128 | |
Kojto | 90:cb3d968589d8 | 129 | uint32_t AlarmMask; /*!< Specifies the RTC Alarm Masks. |
Kojto | 90:cb3d968589d8 | 130 | This parameter can be a value of @ref RTC_AlarmMask_Definitions */ |
Kojto | 90:cb3d968589d8 | 131 | |
Kojto | 90:cb3d968589d8 | 132 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 133 | uint32_t AlarmSubSecondMask; /*!< Specifies the RTC Alarm SubSeconds Masks. |
Kojto | 90:cb3d968589d8 | 134 | This parameter can be a value of @ref RTC_Alarm_Sub_Seconds_Masks_Definitions */ |
Kojto | 90:cb3d968589d8 | 135 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 136 | |
Kojto | 90:cb3d968589d8 | 137 | uint32_t AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on Date or WeekDay. |
Kojto | 90:cb3d968589d8 | 138 | This parameter can be a value of @ref RTC_AlarmDateWeekDay_Definitions */ |
Kojto | 90:cb3d968589d8 | 139 | |
Kojto | 90:cb3d968589d8 | 140 | uint8_t AlarmDateWeekDay; /*!< Specifies the RTC Alarm Date/WeekDay. |
Kojto | 90:cb3d968589d8 | 141 | If the Alarm Date is selected, this parameter must be set to a value in the 1-31 range. |
Kojto | 90:cb3d968589d8 | 142 | If the Alarm WeekDay is selected, this parameter can be a value of @ref RTC_WeekDay_Definitions */ |
Kojto | 90:cb3d968589d8 | 143 | |
Kojto | 90:cb3d968589d8 | 144 | uint32_t Alarm; /*!< Specifies the alarm . |
Kojto | 90:cb3d968589d8 | 145 | This parameter can be a value of @ref RTC_Alarms_Definitions */ |
Kojto | 90:cb3d968589d8 | 146 | }RTC_AlarmTypeDef; |
Kojto | 90:cb3d968589d8 | 147 | /** |
Kojto | 90:cb3d968589d8 | 148 | * @} |
Kojto | 90:cb3d968589d8 | 149 | */ |
Kojto | 90:cb3d968589d8 | 150 | |
Kojto | 90:cb3d968589d8 | 151 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 90:cb3d968589d8 | 152 | /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants |
Kojto | 90:cb3d968589d8 | 153 | * @{ |
Kojto | 90:cb3d968589d8 | 154 | */ |
Kojto | 90:cb3d968589d8 | 155 | |
Kojto | 90:cb3d968589d8 | 156 | /** @defgroup RTC_Masks_Definitions Masks Definitions |
Kojto | 90:cb3d968589d8 | 157 | * @{ |
Kojto | 90:cb3d968589d8 | 158 | */ |
Kojto | 90:cb3d968589d8 | 159 | #define RTC_TR_RESERVED_MASK ((uint32_t)0x007F7F7F) |
Kojto | 90:cb3d968589d8 | 160 | #define RTC_DR_RESERVED_MASK ((uint32_t)0x00FFFF3F) |
Kojto | 90:cb3d968589d8 | 161 | #define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF) |
Kojto | 90:cb3d968589d8 | 162 | #define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F) |
Kojto | 90:cb3d968589d8 | 163 | |
Kojto | 90:cb3d968589d8 | 164 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 165 | #define RTC_FLAGS_MASK ((uint32_t)(RTC_FLAG_ALRAWF | RTC_FLAG_ALRBWF | RTC_FLAG_WUTWF | \ |
Kojto | 90:cb3d968589d8 | 166 | RTC_FLAG_SHPF | RTC_FLAG_INITS | RTC_FLAG_RSF | \ |
Kojto | 90:cb3d968589d8 | 167 | RTC_FLAG_INITF | RTC_FLAG_ALRAF | RTC_FLAG_ALRBF | \ |
Kojto | 90:cb3d968589d8 | 168 | RTC_FLAG_WUTF | RTC_FLAG_TSF | RTC_FLAG_TSOVF | \ |
Kojto | 90:cb3d968589d8 | 169 | RTC_FLAG_TAMP1F | RTC_FLAG_TAMP2F | RTC_FLAG_TAMP3F | \ |
Kojto | 90:cb3d968589d8 | 170 | RTC_FLAG_RECALPF)) |
Kojto | 90:cb3d968589d8 | 171 | #else |
Kojto | 90:cb3d968589d8 | 172 | #define RTC_FLAGS_MASK ((uint32_t)(RTC_FLAG_ALRAWF | RTC_FLAG_ALRBWF | RTC_FLAG_WUTWF | \ |
Kojto | 90:cb3d968589d8 | 173 | RTC_FLAG_SHPF | RTC_FLAG_INITS | RTC_FLAG_RSF | \ |
Kojto | 90:cb3d968589d8 | 174 | RTC_FLAG_INITF | RTC_FLAG_ALRAF | RTC_FLAG_ALRBF | \ |
Kojto | 90:cb3d968589d8 | 175 | RTC_FLAG_WUTF | RTC_FLAG_TSF | RTC_FLAG_TSOVF | \ |
Kojto | 90:cb3d968589d8 | 176 | RTC_FLAG_TAMP1F | \ |
Kojto | 90:cb3d968589d8 | 177 | RTC_FLAG_RECALPF)) |
Kojto | 90:cb3d968589d8 | 178 | |
Kojto | 90:cb3d968589d8 | 179 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 180 | /** |
Kojto | 90:cb3d968589d8 | 181 | * @} |
Kojto | 90:cb3d968589d8 | 182 | */ |
Kojto | 90:cb3d968589d8 | 183 | |
Kojto | 90:cb3d968589d8 | 184 | /** @defgroup RTC_Synchronous_Predivider Synchronous Predivider |
Kojto | 90:cb3d968589d8 | 185 | * @{ |
Kojto | 90:cb3d968589d8 | 186 | */ |
Kojto | 90:cb3d968589d8 | 187 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 188 | #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x7FFF) |
Kojto | 90:cb3d968589d8 | 189 | #elif defined(STM32L100xB) || defined (STM32L151xB) || defined (STM32L152xB) |
Kojto | 90:cb3d968589d8 | 190 | #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x1FFF) |
Kojto | 90:cb3d968589d8 | 191 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 192 | /** |
Kojto | 90:cb3d968589d8 | 193 | * @} |
Kojto | 90:cb3d968589d8 | 194 | */ |
Kojto | 90:cb3d968589d8 | 195 | |
Kojto | 90:cb3d968589d8 | 196 | /** @defgroup RTC_Interrupts_Definitions Interrupts Definitions |
Kojto | 90:cb3d968589d8 | 197 | * @{ |
Kojto | 90:cb3d968589d8 | 198 | */ |
Kojto | 90:cb3d968589d8 | 199 | #define RTC_IT_TS ((uint32_t)0x00008000) |
Kojto | 90:cb3d968589d8 | 200 | #define RTC_IT_WUT ((uint32_t)0x00004000) |
Kojto | 90:cb3d968589d8 | 201 | #define RTC_IT_ALRB ((uint32_t)0x00002000) |
Kojto | 90:cb3d968589d8 | 202 | #define RTC_IT_ALRA ((uint32_t)0x00001000) |
Kojto | 90:cb3d968589d8 | 203 | #define RTC_IT_TAMP1 ((uint32_t)0x00020000) |
Kojto | 90:cb3d968589d8 | 204 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 205 | #define RTC_IT_TAMP2 ((uint32_t)0x00040000) |
Kojto | 90:cb3d968589d8 | 206 | #define RTC_IT_TAMP3 ((uint32_t)0x00080000) |
Kojto | 90:cb3d968589d8 | 207 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 208 | /** |
Kojto | 90:cb3d968589d8 | 209 | * @} |
Kojto | 90:cb3d968589d8 | 210 | */ |
Kojto | 90:cb3d968589d8 | 211 | |
Kojto | 90:cb3d968589d8 | 212 | /** @defgroup RTC_Flags_Definitions Flags Definitions |
Kojto | 90:cb3d968589d8 | 213 | * @{ |
Kojto | 90:cb3d968589d8 | 214 | */ |
Kojto | 90:cb3d968589d8 | 215 | #define RTC_FLAG_RECALPF ((uint32_t)0x00010000) |
Kojto | 90:cb3d968589d8 | 216 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 217 | #define RTC_FLAG_TAMP3F ((uint32_t)0x00008000) |
Kojto | 90:cb3d968589d8 | 218 | #define RTC_FLAG_TAMP2F ((uint32_t)0x00004000) |
Kojto | 90:cb3d968589d8 | 219 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 220 | #define RTC_FLAG_TAMP1F ((uint32_t)0x00002000) |
Kojto | 90:cb3d968589d8 | 221 | #define RTC_FLAG_TSOVF ((uint32_t)0x00001000) |
Kojto | 90:cb3d968589d8 | 222 | #define RTC_FLAG_TSF ((uint32_t)0x00000800) |
Kojto | 90:cb3d968589d8 | 223 | #define RTC_FLAG_WUTF ((uint32_t)0x00000400) |
Kojto | 90:cb3d968589d8 | 224 | #define RTC_FLAG_ALRBF ((uint32_t)0x00000200) |
Kojto | 90:cb3d968589d8 | 225 | #define RTC_FLAG_ALRAF ((uint32_t)0x00000100) |
Kojto | 90:cb3d968589d8 | 226 | #define RTC_FLAG_INITF ((uint32_t)0x00000040) |
Kojto | 90:cb3d968589d8 | 227 | #define RTC_FLAG_RSF ((uint32_t)0x00000020) |
Kojto | 90:cb3d968589d8 | 228 | #define RTC_FLAG_INITS ((uint32_t)0x00000010) |
Kojto | 90:cb3d968589d8 | 229 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 230 | #define RTC_FLAG_SHPF ((uint32_t)0x00000008) |
Kojto | 90:cb3d968589d8 | 231 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 232 | #define RTC_FLAG_WUTWF ((uint32_t)0x00000004) |
Kojto | 90:cb3d968589d8 | 233 | #define RTC_FLAG_ALRBWF ((uint32_t)0x00000002) |
Kojto | 90:cb3d968589d8 | 234 | #define RTC_FLAG_ALRAWF ((uint32_t)0x00000001) |
Kojto | 90:cb3d968589d8 | 235 | /** |
Kojto | 90:cb3d968589d8 | 236 | * @} |
Kojto | 90:cb3d968589d8 | 237 | */ |
Kojto | 90:cb3d968589d8 | 238 | |
Kojto | 90:cb3d968589d8 | 239 | /** @defgroup RTCEx_Output_selection_Definitions Output selection Definitions |
Kojto | 90:cb3d968589d8 | 240 | * @{ |
Kojto | 90:cb3d968589d8 | 241 | */ |
Kojto | 90:cb3d968589d8 | 242 | #define RTC_OUTPUT_DISABLE ((uint32_t)0x00000000) |
Kojto | 90:cb3d968589d8 | 243 | #define RTC_OUTPUT_ALARMA ((uint32_t)0x00200000) |
Kojto | 90:cb3d968589d8 | 244 | #define RTC_OUTPUT_ALARMB ((uint32_t)0x00400000) |
Kojto | 90:cb3d968589d8 | 245 | #define RTC_OUTPUT_WAKEUP ((uint32_t)0x00600000) |
Kojto | 90:cb3d968589d8 | 246 | |
Kojto | 90:cb3d968589d8 | 247 | #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \ |
Kojto | 90:cb3d968589d8 | 248 | ((OUTPUT) == RTC_OUTPUT_ALARMA) || \ |
Kojto | 90:cb3d968589d8 | 249 | ((OUTPUT) == RTC_OUTPUT_ALARMB) || \ |
Kojto | 90:cb3d968589d8 | 250 | ((OUTPUT) == RTC_OUTPUT_WAKEUP)) |
Kojto | 90:cb3d968589d8 | 251 | /** |
Kojto | 90:cb3d968589d8 | 252 | * @} |
Kojto | 90:cb3d968589d8 | 253 | */ |
Kojto | 90:cb3d968589d8 | 254 | |
Kojto | 90:cb3d968589d8 | 255 | /** @defgroup RTCEx_Backup_Registers_Definitions Backup Registers Definitions |
Kojto | 90:cb3d968589d8 | 256 | * @{ |
Kojto | 90:cb3d968589d8 | 257 | */ |
Kojto | 90:cb3d968589d8 | 258 | #if RTC_BKP_NUMBER > 0 |
Kojto | 90:cb3d968589d8 | 259 | #define RTC_BKP_DR0 ((uint32_t)0x00000000) |
Kojto | 90:cb3d968589d8 | 260 | #define RTC_BKP_DR1 ((uint32_t)0x00000001) |
Kojto | 90:cb3d968589d8 | 261 | #define RTC_BKP_DR2 ((uint32_t)0x00000002) |
Kojto | 90:cb3d968589d8 | 262 | #define RTC_BKP_DR3 ((uint32_t)0x00000003) |
Kojto | 90:cb3d968589d8 | 263 | #define RTC_BKP_DR4 ((uint32_t)0x00000004) |
Kojto | 90:cb3d968589d8 | 264 | #endif /* RTC_BKP_NUMBER > 0 */ |
Kojto | 90:cb3d968589d8 | 265 | |
Kojto | 90:cb3d968589d8 | 266 | #if RTC_BKP_NUMBER > 5 |
Kojto | 90:cb3d968589d8 | 267 | #define RTC_BKP_DR5 ((uint32_t)0x00000005) |
Kojto | 90:cb3d968589d8 | 268 | #define RTC_BKP_DR6 ((uint32_t)0x00000006) |
Kojto | 90:cb3d968589d8 | 269 | #define RTC_BKP_DR7 ((uint32_t)0x00000007) |
Kojto | 90:cb3d968589d8 | 270 | #define RTC_BKP_DR8 ((uint32_t)0x00000008) |
Kojto | 90:cb3d968589d8 | 271 | #define RTC_BKP_DR9 ((uint32_t)0x00000009) |
Kojto | 90:cb3d968589d8 | 272 | #define RTC_BKP_DR10 ((uint32_t)0x0000000A) |
Kojto | 90:cb3d968589d8 | 273 | #define RTC_BKP_DR11 ((uint32_t)0x0000000B) |
Kojto | 90:cb3d968589d8 | 274 | #define RTC_BKP_DR12 ((uint32_t)0x0000000C) |
Kojto | 90:cb3d968589d8 | 275 | #define RTC_BKP_DR13 ((uint32_t)0x0000000D) |
Kojto | 90:cb3d968589d8 | 276 | #define RTC_BKP_DR14 ((uint32_t)0x0000000E) |
Kojto | 90:cb3d968589d8 | 277 | #define RTC_BKP_DR15 ((uint32_t)0x0000000F) |
Kojto | 90:cb3d968589d8 | 278 | #define RTC_BKP_DR16 ((uint32_t)0x00000010) |
Kojto | 90:cb3d968589d8 | 279 | #define RTC_BKP_DR17 ((uint32_t)0x00000011) |
Kojto | 90:cb3d968589d8 | 280 | #define RTC_BKP_DR18 ((uint32_t)0x00000012) |
Kojto | 90:cb3d968589d8 | 281 | #define RTC_BKP_DR19 ((uint32_t)0x00000013) |
Kojto | 90:cb3d968589d8 | 282 | #endif /* RTC_BKP_NUMBER > 5 */ |
Kojto | 90:cb3d968589d8 | 283 | |
Kojto | 90:cb3d968589d8 | 284 | #if RTC_BKP_NUMBER > 20 |
Kojto | 90:cb3d968589d8 | 285 | #define RTC_BKP_DR20 ((uint32_t)0x00000014) |
Kojto | 90:cb3d968589d8 | 286 | #define RTC_BKP_DR21 ((uint32_t)0x00000015) |
Kojto | 90:cb3d968589d8 | 287 | #define RTC_BKP_DR22 ((uint32_t)0x00000016) |
Kojto | 90:cb3d968589d8 | 288 | #define RTC_BKP_DR23 ((uint32_t)0x00000017) |
Kojto | 90:cb3d968589d8 | 289 | #define RTC_BKP_DR24 ((uint32_t)0x00000018) |
Kojto | 90:cb3d968589d8 | 290 | #define RTC_BKP_DR25 ((uint32_t)0x00000019) |
Kojto | 90:cb3d968589d8 | 291 | #define RTC_BKP_DR26 ((uint32_t)0x0000001A) |
Kojto | 90:cb3d968589d8 | 292 | #define RTC_BKP_DR27 ((uint32_t)0x0000001B) |
Kojto | 90:cb3d968589d8 | 293 | #define RTC_BKP_DR28 ((uint32_t)0x0000001C) |
Kojto | 90:cb3d968589d8 | 294 | #define RTC_BKP_DR29 ((uint32_t)0x0000001D) |
Kojto | 90:cb3d968589d8 | 295 | #define RTC_BKP_DR30 ((uint32_t)0x0000001E) |
Kojto | 90:cb3d968589d8 | 296 | #define RTC_BKP_DR31 ((uint32_t)0x0000001F) |
Kojto | 90:cb3d968589d8 | 297 | #endif /* RTC_BKP_NUMBER > 20 */ |
Kojto | 90:cb3d968589d8 | 298 | |
Kojto | 90:cb3d968589d8 | 299 | #define IS_RTC_BKP(BKP) ((BKP) < (uint32_t) RTC_BKP_NUMBER) |
Kojto | 90:cb3d968589d8 | 300 | /** |
Kojto | 90:cb3d968589d8 | 301 | * @} |
Kojto | 90:cb3d968589d8 | 302 | */ |
Kojto | 90:cb3d968589d8 | 303 | |
Kojto | 90:cb3d968589d8 | 304 | /** @defgroup RTCEx_Time_Stamp_Edges_Definitions Time Stamp Edges Definitions |
Kojto | 90:cb3d968589d8 | 305 | * @{ |
Kojto | 90:cb3d968589d8 | 306 | */ |
Kojto | 90:cb3d968589d8 | 307 | #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000) |
Kojto | 90:cb3d968589d8 | 308 | #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008) |
Kojto | 90:cb3d968589d8 | 309 | |
Kojto | 90:cb3d968589d8 | 310 | #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \ |
Kojto | 90:cb3d968589d8 | 311 | ((EDGE) == RTC_TIMESTAMPEDGE_FALLING)) |
Kojto | 90:cb3d968589d8 | 312 | /** |
Kojto | 90:cb3d968589d8 | 313 | * @} |
Kojto | 90:cb3d968589d8 | 314 | */ |
Kojto | 90:cb3d968589d8 | 315 | |
Kojto | 90:cb3d968589d8 | 316 | /** @defgroup RTCEx_Tamper_Pins_Definitions Tamper Pins Definitions |
Kojto | 90:cb3d968589d8 | 317 | * @{ |
Kojto | 90:cb3d968589d8 | 318 | */ |
Kojto | 90:cb3d968589d8 | 319 | #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E |
Kojto | 90:cb3d968589d8 | 320 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 321 | #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E |
Kojto | 90:cb3d968589d8 | 322 | #define RTC_TAMPER_3 RTC_TAFCR_TAMP3E |
Kojto | 90:cb3d968589d8 | 323 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 324 | |
Kojto | 90:cb3d968589d8 | 325 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 326 | #define IS_TAMPER(TAMPER) (((~(RTC_TAMPER_1|RTC_TAMPER_2|RTC_TAMPER_3) & (TAMPER)) == (uint32_t)RESET) && ((TAMPER) != (uint32_t)RESET)) |
Kojto | 90:cb3d968589d8 | 327 | #else |
Kojto | 90:cb3d968589d8 | 328 | #define IS_TAMPER(TAMPER) ((TAMPER) == RTC_TAMPER_1) |
Kojto | 90:cb3d968589d8 | 329 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 330 | /** |
Kojto | 90:cb3d968589d8 | 331 | * @} |
Kojto | 90:cb3d968589d8 | 332 | */ |
Kojto | 90:cb3d968589d8 | 333 | |
Kojto | 90:cb3d968589d8 | 334 | /** @defgroup RTCEx_Tamper_Trigger_Definitions Tamper Trigger Definitions |
Kojto | 90:cb3d968589d8 | 335 | * @{ |
Kojto | 90:cb3d968589d8 | 336 | */ |
Kojto | 90:cb3d968589d8 | 337 | #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000) |
Kojto | 90:cb3d968589d8 | 338 | #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002) |
Kojto | 90:cb3d968589d8 | 339 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 340 | #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE |
Kojto | 90:cb3d968589d8 | 341 | #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE |
Kojto | 90:cb3d968589d8 | 342 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 343 | |
Kojto | 90:cb3d968589d8 | 344 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 345 | #define IS_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \ |
Kojto | 90:cb3d968589d8 | 346 | ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \ |
Kojto | 90:cb3d968589d8 | 347 | ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ |
Kojto | 90:cb3d968589d8 | 348 | ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL)) |
Kojto | 90:cb3d968589d8 | 349 | #elif defined(STM32L100xB) || defined (STM32L151xB) || defined (STM32L152xB) |
Kojto | 90:cb3d968589d8 | 350 | #define IS_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \ |
Kojto | 90:cb3d968589d8 | 351 | ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE)) |
Kojto | 90:cb3d968589d8 | 352 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 353 | /** |
Kojto | 90:cb3d968589d8 | 354 | * @} |
Kojto | 90:cb3d968589d8 | 355 | */ |
Kojto | 90:cb3d968589d8 | 356 | |
Kojto | 90:cb3d968589d8 | 357 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 358 | /** @defgroup RTCEx_Tamper_Filter_Definitions Tamper Filter Definitions |
Kojto | 90:cb3d968589d8 | 359 | * @{ |
Kojto | 90:cb3d968589d8 | 360 | */ |
Kojto | 90:cb3d968589d8 | 361 | #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */ |
Kojto | 90:cb3d968589d8 | 362 | |
Kojto | 90:cb3d968589d8 | 363 | #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2 |
Kojto | 90:cb3d968589d8 | 364 | consecutive samples at the active level */ |
Kojto | 90:cb3d968589d8 | 365 | #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4 |
Kojto | 90:cb3d968589d8 | 366 | consecutive samples at the active level */ |
Kojto | 90:cb3d968589d8 | 367 | #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8 |
Kojto | 90:cb3d968589d8 | 368 | consecutive samples at the active level. */ |
Kojto | 90:cb3d968589d8 | 369 | |
Kojto | 90:cb3d968589d8 | 370 | #define IS_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \ |
Kojto | 90:cb3d968589d8 | 371 | ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \ |
Kojto | 90:cb3d968589d8 | 372 | ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \ |
Kojto | 90:cb3d968589d8 | 373 | ((FILTER) == RTC_TAMPERFILTER_8SAMPLE)) |
Kojto | 90:cb3d968589d8 | 374 | /** |
Kojto | 90:cb3d968589d8 | 375 | * @} |
Kojto | 90:cb3d968589d8 | 376 | */ |
Kojto | 90:cb3d968589d8 | 377 | |
Kojto | 90:cb3d968589d8 | 378 | /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions Tamper Sampling Frequencies |
Kojto | 90:cb3d968589d8 | 379 | * @{ |
Kojto | 90:cb3d968589d8 | 380 | */ |
Kojto | 90:cb3d968589d8 | 381 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled |
Kojto | 90:cb3d968589d8 | 382 | with a frequency = RTCCLK / 32768 */ |
Kojto | 90:cb3d968589d8 | 383 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled |
Kojto | 90:cb3d968589d8 | 384 | with a frequency = RTCCLK / 16384 */ |
Kojto | 90:cb3d968589d8 | 385 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled |
Kojto | 90:cb3d968589d8 | 386 | with a frequency = RTCCLK / 8192 */ |
Kojto | 90:cb3d968589d8 | 387 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled |
Kojto | 90:cb3d968589d8 | 388 | with a frequency = RTCCLK / 4096 */ |
Kojto | 90:cb3d968589d8 | 389 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled |
Kojto | 90:cb3d968589d8 | 390 | with a frequency = RTCCLK / 2048 */ |
Kojto | 90:cb3d968589d8 | 391 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled |
Kojto | 90:cb3d968589d8 | 392 | with a frequency = RTCCLK / 1024 */ |
Kojto | 90:cb3d968589d8 | 393 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled |
Kojto | 90:cb3d968589d8 | 394 | with a frequency = RTCCLK / 512 */ |
Kojto | 90:cb3d968589d8 | 395 | #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled |
Kojto | 90:cb3d968589d8 | 396 | with a frequency = RTCCLK / 256 */ |
Kojto | 90:cb3d968589d8 | 397 | |
Kojto | 90:cb3d968589d8 | 398 | #define IS_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \ |
Kojto | 90:cb3d968589d8 | 399 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \ |
Kojto | 90:cb3d968589d8 | 400 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \ |
Kojto | 90:cb3d968589d8 | 401 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \ |
Kojto | 90:cb3d968589d8 | 402 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \ |
Kojto | 90:cb3d968589d8 | 403 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \ |
Kojto | 90:cb3d968589d8 | 404 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \ |
Kojto | 90:cb3d968589d8 | 405 | ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256)) |
Kojto | 90:cb3d968589d8 | 406 | /** |
Kojto | 90:cb3d968589d8 | 407 | * @} |
Kojto | 90:cb3d968589d8 | 408 | */ |
Kojto | 90:cb3d968589d8 | 409 | |
Kojto | 90:cb3d968589d8 | 410 | /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions Tamper Pin Precharge Duration |
Kojto | 90:cb3d968589d8 | 411 | * @{ |
Kojto | 90:cb3d968589d8 | 412 | */ |
Kojto | 90:cb3d968589d8 | 413 | #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before |
Kojto | 90:cb3d968589d8 | 414 | sampling during 1 RTCCLK cycle */ |
Kojto | 90:cb3d968589d8 | 415 | #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before |
Kojto | 90:cb3d968589d8 | 416 | sampling during 2 RTCCLK cycles */ |
Kojto | 90:cb3d968589d8 | 417 | #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before |
Kojto | 90:cb3d968589d8 | 418 | sampling during 4 RTCCLK cycles */ |
Kojto | 90:cb3d968589d8 | 419 | #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before |
Kojto | 90:cb3d968589d8 | 420 | sampling during 8 RTCCLK cycles */ |
Kojto | 90:cb3d968589d8 | 421 | |
Kojto | 90:cb3d968589d8 | 422 | #define IS_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \ |
Kojto | 90:cb3d968589d8 | 423 | ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \ |
Kojto | 90:cb3d968589d8 | 424 | ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \ |
Kojto | 90:cb3d968589d8 | 425 | ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK)) |
Kojto | 90:cb3d968589d8 | 426 | /** |
Kojto | 90:cb3d968589d8 | 427 | * @} |
Kojto | 90:cb3d968589d8 | 428 | */ |
Kojto | 90:cb3d968589d8 | 429 | |
Kojto | 90:cb3d968589d8 | 430 | /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions TimeStampOnTamperDetection Definitions |
Kojto | 90:cb3d968589d8 | 431 | * @{ |
Kojto | 90:cb3d968589d8 | 432 | */ |
Kojto | 90:cb3d968589d8 | 433 | #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */ |
Kojto | 90:cb3d968589d8 | 434 | #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */ |
Kojto | 90:cb3d968589d8 | 435 | |
Kojto | 90:cb3d968589d8 | 436 | #define IS_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \ |
Kojto | 90:cb3d968589d8 | 437 | ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE)) |
Kojto | 90:cb3d968589d8 | 438 | /** |
Kojto | 90:cb3d968589d8 | 439 | * @} |
Kojto | 90:cb3d968589d8 | 440 | */ |
Kojto | 90:cb3d968589d8 | 441 | |
Kojto | 90:cb3d968589d8 | 442 | /** @defgroup RTCEx_Tamper_Pull_Up_Definitions Tamper Pull-Up Definitions |
Kojto | 90:cb3d968589d8 | 443 | * @{ |
Kojto | 90:cb3d968589d8 | 444 | */ |
Kojto | 90:cb3d968589d8 | 445 | #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event saved */ |
Kojto | 90:cb3d968589d8 | 446 | #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */ |
Kojto | 90:cb3d968589d8 | 447 | |
Kojto | 90:cb3d968589d8 | 448 | #define IS_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \ |
Kojto | 90:cb3d968589d8 | 449 | ((STATE) == RTC_TAMPER_PULLUP_DISABLE)) |
Kojto | 90:cb3d968589d8 | 450 | /** |
Kojto | 90:cb3d968589d8 | 451 | * @} |
Kojto | 90:cb3d968589d8 | 452 | */ |
Kojto | 90:cb3d968589d8 | 453 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 454 | |
Kojto | 90:cb3d968589d8 | 455 | /** @defgroup RTCEx_Wakeup_Timer_Definitions Wakeup Timer Definitions |
Kojto | 90:cb3d968589d8 | 456 | * @{ |
Kojto | 90:cb3d968589d8 | 457 | */ |
Kojto | 90:cb3d968589d8 | 458 | #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000) |
Kojto | 90:cb3d968589d8 | 459 | #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001) |
Kojto | 90:cb3d968589d8 | 460 | #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002) |
Kojto | 90:cb3d968589d8 | 461 | #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003) |
Kojto | 90:cb3d968589d8 | 462 | #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004) |
Kojto | 90:cb3d968589d8 | 463 | #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006) |
Kojto | 90:cb3d968589d8 | 464 | |
Kojto | 90:cb3d968589d8 | 465 | #define IS_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \ |
Kojto | 90:cb3d968589d8 | 466 | ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \ |
Kojto | 90:cb3d968589d8 | 467 | ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \ |
Kojto | 90:cb3d968589d8 | 468 | ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \ |
Kojto | 90:cb3d968589d8 | 469 | ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \ |
Kojto | 90:cb3d968589d8 | 470 | ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS)) |
Kojto | 90:cb3d968589d8 | 471 | |
Kojto | 90:cb3d968589d8 | 472 | #define IS_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF) |
Kojto | 90:cb3d968589d8 | 473 | /** |
Kojto | 90:cb3d968589d8 | 474 | * @} |
Kojto | 90:cb3d968589d8 | 475 | */ |
Kojto | 90:cb3d968589d8 | 476 | |
Kojto | 90:cb3d968589d8 | 477 | /** @defgroup RTCEx_Digital_Calibration_Definitions Digital Calibration Definitions |
Kojto | 90:cb3d968589d8 | 478 | * @{ |
Kojto | 90:cb3d968589d8 | 479 | */ |
Kojto | 90:cb3d968589d8 | 480 | #define RTC_CALIBSIGN_POSITIVE ((uint32_t)0x00000000) |
Kojto | 90:cb3d968589d8 | 481 | #define RTC_CALIBSIGN_NEGATIVE ((uint32_t)0x00000080) |
Kojto | 90:cb3d968589d8 | 482 | |
Kojto | 90:cb3d968589d8 | 483 | #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \ |
Kojto | 90:cb3d968589d8 | 484 | ((SIGN) == RTC_CALIBSIGN_NEGATIVE)) |
Kojto | 90:cb3d968589d8 | 485 | |
Kojto | 90:cb3d968589d8 | 486 | #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20) |
Kojto | 90:cb3d968589d8 | 487 | /** |
Kojto | 90:cb3d968589d8 | 488 | * @} |
Kojto | 90:cb3d968589d8 | 489 | */ |
Kojto | 90:cb3d968589d8 | 490 | |
Kojto | 90:cb3d968589d8 | 491 | /** @defgroup RTCEx_Smooth_Calib_Period_Definitions Smooth Calib Period Definitions |
Kojto | 90:cb3d968589d8 | 492 | * @{ |
Kojto | 90:cb3d968589d8 | 493 | */ |
Kojto | 90:cb3d968589d8 | 494 | #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibation |
Kojto | 90:cb3d968589d8 | 495 | period is 32s, else 2exp20 RTCCLK seconds */ |
Kojto | 90:cb3d968589d8 | 496 | #define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibation |
Kojto | 90:cb3d968589d8 | 497 | period is 16s, else 2exp19 RTCCLK seconds */ |
Kojto | 90:cb3d968589d8 | 498 | #define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibation |
Kojto | 90:cb3d968589d8 | 499 | period is 8s, else 2exp18 RTCCLK seconds */ |
Kojto | 90:cb3d968589d8 | 500 | |
Kojto | 90:cb3d968589d8 | 501 | #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \ |
Kojto | 90:cb3d968589d8 | 502 | ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \ |
Kojto | 90:cb3d968589d8 | 503 | ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC)) |
Kojto | 90:cb3d968589d8 | 504 | /** |
Kojto | 90:cb3d968589d8 | 505 | * @} |
Kojto | 90:cb3d968589d8 | 506 | */ |
Kojto | 90:cb3d968589d8 | 507 | |
Kojto | 90:cb3d968589d8 | 508 | /** @defgroup RTCEx_Smooth_Calib_Plus_Pulses_Definitions Smooth Calib Plus Pulses Definitions |
Kojto | 90:cb3d968589d8 | 509 | * @{ |
Kojto | 90:cb3d968589d8 | 510 | */ |
Kojto | 90:cb3d968589d8 | 511 | #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added |
Kojto | 90:cb3d968589d8 | 512 | during a X -second window = Y - CALM[8:0] |
Kojto | 90:cb3d968589d8 | 513 | with Y = 512, 256, 128 when X = 32, 16, 8 */ |
Kojto | 90:cb3d968589d8 | 514 | #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited |
Kojto | 90:cb3d968589d8 | 515 | during a 32-second window = CALM[8:0] */ |
Kojto | 90:cb3d968589d8 | 516 | |
Kojto | 90:cb3d968589d8 | 517 | #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \ |
Kojto | 90:cb3d968589d8 | 518 | ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET)) |
Kojto | 90:cb3d968589d8 | 519 | /** |
Kojto | 90:cb3d968589d8 | 520 | * @} |
Kojto | 90:cb3d968589d8 | 521 | */ |
Kojto | 90:cb3d968589d8 | 522 | |
Kojto | 90:cb3d968589d8 | 523 | /** @defgroup RTCEx_Smooth_Calib_Minus_Pulses_Definitions Smooth Calib Minus Pulses Definitions |
Kojto | 90:cb3d968589d8 | 524 | * @{ |
Kojto | 90:cb3d968589d8 | 525 | */ |
Kojto | 90:cb3d968589d8 | 526 | #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF) |
Kojto | 90:cb3d968589d8 | 527 | /** |
Kojto | 90:cb3d968589d8 | 528 | * @} |
Kojto | 90:cb3d968589d8 | 529 | */ |
Kojto | 90:cb3d968589d8 | 530 | |
Kojto | 90:cb3d968589d8 | 531 | /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions Add 1 Second Parameter Definitions |
Kojto | 90:cb3d968589d8 | 532 | * @{ |
Kojto | 90:cb3d968589d8 | 533 | */ |
Kojto | 90:cb3d968589d8 | 534 | #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000) |
Kojto | 90:cb3d968589d8 | 535 | #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000) |
Kojto | 90:cb3d968589d8 | 536 | |
Kojto | 90:cb3d968589d8 | 537 | #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \ |
Kojto | 90:cb3d968589d8 | 538 | ((SEL) == RTC_SHIFTADD1S_SET)) |
Kojto | 90:cb3d968589d8 | 539 | /** |
Kojto | 90:cb3d968589d8 | 540 | * @} |
Kojto | 90:cb3d968589d8 | 541 | */ |
Kojto | 90:cb3d968589d8 | 542 | |
Kojto | 90:cb3d968589d8 | 543 | /** @defgroup RTCEx_Substract_Fraction_Of_Second_Value Substract Fraction Of Second Value |
Kojto | 90:cb3d968589d8 | 544 | * @{ |
Kojto | 90:cb3d968589d8 | 545 | */ |
Kojto | 90:cb3d968589d8 | 546 | #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF) |
Kojto | 90:cb3d968589d8 | 547 | /** |
Kojto | 90:cb3d968589d8 | 548 | * @} |
Kojto | 90:cb3d968589d8 | 549 | */ |
Kojto | 90:cb3d968589d8 | 550 | |
Kojto | 90:cb3d968589d8 | 551 | /** @defgroup RTCEx_Calib_Output_Selection_Definitions Calib Output Selection Definitions |
Kojto | 90:cb3d968589d8 | 552 | * @{ |
Kojto | 90:cb3d968589d8 | 553 | */ |
Kojto | 90:cb3d968589d8 | 554 | #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000) |
Kojto | 90:cb3d968589d8 | 555 | #define RTC_CALIBOUTPUT_1HZ ((uint32_t)0x00080000) |
Kojto | 90:cb3d968589d8 | 556 | |
Kojto | 90:cb3d968589d8 | 557 | #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \ |
Kojto | 90:cb3d968589d8 | 558 | ((OUTPUT) == RTC_CALIBOUTPUT_1HZ)) |
Kojto | 90:cb3d968589d8 | 559 | /** |
Kojto | 90:cb3d968589d8 | 560 | * @} |
Kojto | 90:cb3d968589d8 | 561 | */ |
Kojto | 90:cb3d968589d8 | 562 | |
Kojto | 90:cb3d968589d8 | 563 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 564 | /** @defgroup RTC_Alarm_Sub_Seconds_Value Alarm Sub Seconds Value |
Kojto | 90:cb3d968589d8 | 565 | * @{ |
Kojto | 90:cb3d968589d8 | 566 | */ |
Kojto | 90:cb3d968589d8 | 567 | #define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= (uint32_t)0x00007FFF) |
Kojto | 90:cb3d968589d8 | 568 | /** |
Kojto | 90:cb3d968589d8 | 569 | * @} |
Kojto | 90:cb3d968589d8 | 570 | */ |
Kojto | 90:cb3d968589d8 | 571 | |
Kojto | 90:cb3d968589d8 | 572 | /** @defgroup RTC_Alarm_Sub_Seconds_Masks_Definitions Alarm Sub Seconds Masks Definitions |
Kojto | 90:cb3d968589d8 | 573 | * @{ |
Kojto | 90:cb3d968589d8 | 574 | */ |
Kojto | 90:cb3d968589d8 | 575 | #define RTC_ALARMSUBSECONDMASK_ALL ((uint32_t)0x00000000) /*!< All Alarm SS fields are masked. |
Kojto | 90:cb3d968589d8 | 576 | There is no comparison on sub seconds |
Kojto | 90:cb3d968589d8 | 577 | for Alarm */ |
Kojto | 90:cb3d968589d8 | 578 | #define RTC_ALARMSUBSECONDMASK_SS14_1 ((uint32_t)0x01000000) /*!< SS[14:1] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 579 | comparison. Only SS[0] is compared. */ |
Kojto | 90:cb3d968589d8 | 580 | #define RTC_ALARMSUBSECONDMASK_SS14_2 ((uint32_t)0x02000000) /*!< SS[14:2] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 581 | comparison. Only SS[1:0] are compared */ |
Kojto | 90:cb3d968589d8 | 582 | #define RTC_ALARMSUBSECONDMASK_SS14_3 ((uint32_t)0x03000000) /*!< SS[14:3] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 583 | comparison. Only SS[2:0] are compared */ |
Kojto | 90:cb3d968589d8 | 584 | #define RTC_ALARMSUBSECONDMASK_SS14_4 ((uint32_t)0x04000000) /*!< SS[14:4] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 585 | comparison. Only SS[3:0] are compared */ |
Kojto | 90:cb3d968589d8 | 586 | #define RTC_ALARMSUBSECONDMASK_SS14_5 ((uint32_t)0x05000000) /*!< SS[14:5] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 587 | comparison. Only SS[4:0] are compared */ |
Kojto | 90:cb3d968589d8 | 588 | #define RTC_ALARMSUBSECONDMASK_SS14_6 ((uint32_t)0x06000000) /*!< SS[14:6] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 589 | comparison. Only SS[5:0] are compared */ |
Kojto | 90:cb3d968589d8 | 590 | #define RTC_ALARMSUBSECONDMASK_SS14_7 ((uint32_t)0x07000000) /*!< SS[14:7] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 591 | comparison. Only SS[6:0] are compared */ |
Kojto | 90:cb3d968589d8 | 592 | #define RTC_ALARMSUBSECONDMASK_SS14_8 ((uint32_t)0x08000000) /*!< SS[14:8] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 593 | comparison. Only SS[7:0] are compared */ |
Kojto | 90:cb3d968589d8 | 594 | #define RTC_ALARMSUBSECONDMASK_SS14_9 ((uint32_t)0x09000000) /*!< SS[14:9] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 595 | comparison. Only SS[8:0] are compared */ |
Kojto | 90:cb3d968589d8 | 596 | #define RTC_ALARMSUBSECONDMASK_SS14_10 ((uint32_t)0x0A000000) /*!< SS[14:10] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 597 | comparison. Only SS[9:0] are compared */ |
Kojto | 90:cb3d968589d8 | 598 | #define RTC_ALARMSUBSECONDMASK_SS14_11 ((uint32_t)0x0B000000) /*!< SS[14:11] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 599 | comparison. Only SS[10:0] are compared */ |
Kojto | 90:cb3d968589d8 | 600 | #define RTC_ALARMSUBSECONDMASK_SS14_12 ((uint32_t)0x0C000000) /*!< SS[14:12] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 601 | comparison.Only SS[11:0] are compared */ |
Kojto | 90:cb3d968589d8 | 602 | #define RTC_ALARMSUBSECONDMASK_SS14_13 ((uint32_t)0x0D000000) /*!< SS[14:13] are don't care in Alarm |
Kojto | 90:cb3d968589d8 | 603 | comparison. Only SS[12:0] are compared */ |
Kojto | 90:cb3d968589d8 | 604 | #define RTC_ALARMSUBSECONDMASK_SS14 ((uint32_t)0x0E000000) /*!< SS[14] is don't care in Alarm |
Kojto | 90:cb3d968589d8 | 605 | comparison.Only SS[13:0] are compared */ |
Kojto | 90:cb3d968589d8 | 606 | #define RTC_ALARMSUBSECONDMASK_NONE ((uint32_t)0x0F000000) /*!< SS[14:0] are compared and must match |
Kojto | 90:cb3d968589d8 | 607 | to activate alarm. */ |
Kojto | 90:cb3d968589d8 | 608 | |
Kojto | 90:cb3d968589d8 | 609 | #define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_ALARMSUBSECONDMASK_ALL) || \ |
Kojto | 90:cb3d968589d8 | 610 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_1) || \ |
Kojto | 90:cb3d968589d8 | 611 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_2) || \ |
Kojto | 90:cb3d968589d8 | 612 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_3) || \ |
Kojto | 90:cb3d968589d8 | 613 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_4) || \ |
Kojto | 90:cb3d968589d8 | 614 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_5) || \ |
Kojto | 90:cb3d968589d8 | 615 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_6) || \ |
Kojto | 90:cb3d968589d8 | 616 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_7) || \ |
Kojto | 90:cb3d968589d8 | 617 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_8) || \ |
Kojto | 90:cb3d968589d8 | 618 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_9) || \ |
Kojto | 90:cb3d968589d8 | 619 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_10) || \ |
Kojto | 90:cb3d968589d8 | 620 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_11) || \ |
Kojto | 90:cb3d968589d8 | 621 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_12) || \ |
Kojto | 90:cb3d968589d8 | 622 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_13) || \ |
Kojto | 90:cb3d968589d8 | 623 | ((MASK) == RTC_ALARMSUBSECONDMASK_SS14) || \ |
Kojto | 90:cb3d968589d8 | 624 | ((MASK) == RTC_ALARMSUBSECONDMASK_NONE)) |
Kojto | 90:cb3d968589d8 | 625 | /** |
Kojto | 90:cb3d968589d8 | 626 | * @} |
Kojto | 90:cb3d968589d8 | 627 | */ |
Kojto | 90:cb3d968589d8 | 628 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 629 | |
Kojto | 90:cb3d968589d8 | 630 | /** |
Kojto | 90:cb3d968589d8 | 631 | * @} |
Kojto | 90:cb3d968589d8 | 632 | */ |
Kojto | 90:cb3d968589d8 | 633 | |
Kojto | 90:cb3d968589d8 | 634 | /* Exported macro ------------------------------------------------------------*/ |
Kojto | 90:cb3d968589d8 | 635 | /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros |
Kojto | 90:cb3d968589d8 | 636 | * @{ |
Kojto | 90:cb3d968589d8 | 637 | */ |
Kojto | 90:cb3d968589d8 | 638 | |
Kojto | 90:cb3d968589d8 | 639 | /** |
Kojto | 90:cb3d968589d8 | 640 | * @brief Enable the RTC WakeUp Timer peripheral. |
Kojto | 90:cb3d968589d8 | 641 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 642 | * @retval None |
Kojto | 90:cb3d968589d8 | 643 | */ |
Kojto | 90:cb3d968589d8 | 644 | #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE)) |
Kojto | 90:cb3d968589d8 | 645 | |
Kojto | 90:cb3d968589d8 | 646 | /** |
Kojto | 90:cb3d968589d8 | 647 | * @brief Enable the RTC TimeStamp peripheral. |
Kojto | 90:cb3d968589d8 | 648 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 649 | * @retval None |
Kojto | 90:cb3d968589d8 | 650 | */ |
Kojto | 90:cb3d968589d8 | 651 | #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE)) |
Kojto | 90:cb3d968589d8 | 652 | |
Kojto | 90:cb3d968589d8 | 653 | /** |
Kojto | 90:cb3d968589d8 | 654 | * @brief Disable the RTC WakeUp Timer peripheral. |
Kojto | 90:cb3d968589d8 | 655 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 656 | * @retval None |
Kojto | 90:cb3d968589d8 | 657 | */ |
Kojto | 90:cb3d968589d8 | 658 | #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE)) |
Kojto | 90:cb3d968589d8 | 659 | |
Kojto | 90:cb3d968589d8 | 660 | /** |
Kojto | 90:cb3d968589d8 | 661 | * @brief Disable the RTC TimeStamp peripheral. |
Kojto | 90:cb3d968589d8 | 662 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 663 | * @retval None |
Kojto | 90:cb3d968589d8 | 664 | */ |
Kojto | 90:cb3d968589d8 | 665 | #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE)) |
Kojto | 90:cb3d968589d8 | 666 | |
Kojto | 90:cb3d968589d8 | 667 | /** |
Kojto | 90:cb3d968589d8 | 668 | * @brief Enable the Coarse calibration process. |
Kojto | 90:cb3d968589d8 | 669 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 670 | * @retval None |
Kojto | 90:cb3d968589d8 | 671 | */ |
Kojto | 90:cb3d968589d8 | 672 | #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE)) |
Kojto | 90:cb3d968589d8 | 673 | |
Kojto | 90:cb3d968589d8 | 674 | /** |
Kojto | 90:cb3d968589d8 | 675 | * @brief Disable the Coarse calibration process. |
Kojto | 90:cb3d968589d8 | 676 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 677 | * @retval None |
Kojto | 90:cb3d968589d8 | 678 | */ |
Kojto | 90:cb3d968589d8 | 679 | #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE)) |
Kojto | 90:cb3d968589d8 | 680 | |
Kojto | 90:cb3d968589d8 | 681 | /** |
Kojto | 90:cb3d968589d8 | 682 | * @brief Enable the RTC calibration output. |
Kojto | 90:cb3d968589d8 | 683 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 684 | * @retval None |
Kojto | 90:cb3d968589d8 | 685 | */ |
Kojto | 90:cb3d968589d8 | 686 | #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE)) |
Kojto | 90:cb3d968589d8 | 687 | |
Kojto | 90:cb3d968589d8 | 688 | /** |
Kojto | 90:cb3d968589d8 | 689 | * @brief Disable the calibration output. |
Kojto | 90:cb3d968589d8 | 690 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 691 | * @retval None |
Kojto | 90:cb3d968589d8 | 692 | */ |
Kojto | 90:cb3d968589d8 | 693 | #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE)) |
Kojto | 90:cb3d968589d8 | 694 | |
Kojto | 90:cb3d968589d8 | 695 | /** |
Kojto | 90:cb3d968589d8 | 696 | * @brief Enable the clock reference detection. |
Kojto | 90:cb3d968589d8 | 697 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 698 | * @retval None |
Kojto | 90:cb3d968589d8 | 699 | */ |
Kojto | 90:cb3d968589d8 | 700 | #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON)) |
Kojto | 90:cb3d968589d8 | 701 | |
Kojto | 90:cb3d968589d8 | 702 | /** |
Kojto | 90:cb3d968589d8 | 703 | * @brief Disable the clock reference detection. |
Kojto | 90:cb3d968589d8 | 704 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 705 | * @retval None |
Kojto | 90:cb3d968589d8 | 706 | */ |
Kojto | 90:cb3d968589d8 | 707 | #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON)) |
Kojto | 90:cb3d968589d8 | 708 | |
Kojto | 90:cb3d968589d8 | 709 | /** |
Kojto | 90:cb3d968589d8 | 710 | * @brief Enable the RTC TimeStamp interrupt. |
Kojto | 90:cb3d968589d8 | 711 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 712 | * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 713 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 714 | * @arg RTC_IT_TS: TimeStamp interrupt |
Kojto | 90:cb3d968589d8 | 715 | * @retval None |
Kojto | 90:cb3d968589d8 | 716 | */ |
Kojto | 90:cb3d968589d8 | 717 | #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) |
Kojto | 90:cb3d968589d8 | 718 | |
Kojto | 90:cb3d968589d8 | 719 | /** |
Kojto | 90:cb3d968589d8 | 720 | * @brief Enable the RTC WakeUpTimer interrupt. |
Kojto | 90:cb3d968589d8 | 721 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 722 | * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 723 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 724 | * @arg RTC_IT_WUT: WakeUpTimer A interrupt |
Kojto | 90:cb3d968589d8 | 725 | * @retval None |
Kojto | 90:cb3d968589d8 | 726 | */ |
Kojto | 90:cb3d968589d8 | 727 | #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) |
Kojto | 90:cb3d968589d8 | 728 | |
Kojto | 90:cb3d968589d8 | 729 | /** |
Kojto | 90:cb3d968589d8 | 730 | * @brief Disable the RTC TimeStamp interrupt. |
Kojto | 90:cb3d968589d8 | 731 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 732 | * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 733 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 734 | * @arg RTC_IT_TS: TimeStamp interrupt |
Kojto | 90:cb3d968589d8 | 735 | * @retval None |
Kojto | 90:cb3d968589d8 | 736 | */ |
Kojto | 90:cb3d968589d8 | 737 | #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) |
Kojto | 90:cb3d968589d8 | 738 | |
Kojto | 90:cb3d968589d8 | 739 | /** |
Kojto | 90:cb3d968589d8 | 740 | * @brief Disable the RTC WakeUpTimer interrupt. |
Kojto | 90:cb3d968589d8 | 741 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 742 | * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 743 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 744 | * @arg RTC_IT_WUT: WakeUpTimer A interrupt |
Kojto | 90:cb3d968589d8 | 745 | * @retval None |
Kojto | 90:cb3d968589d8 | 746 | */ |
Kojto | 90:cb3d968589d8 | 747 | #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) |
Kojto | 90:cb3d968589d8 | 748 | |
Kojto | 90:cb3d968589d8 | 749 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 750 | /** |
Kojto | 90:cb3d968589d8 | 751 | * @brief Check whether the specified RTC Tamper interrupt has occurred or not. |
Kojto | 90:cb3d968589d8 | 752 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 753 | * @param __FLAG__: specifies the RTC Tamper interrupt sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 754 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 755 | * @arg RTC_IT_TAMP1 |
Kojto | 90:cb3d968589d8 | 756 | * @arg RTC_IT_TAMP2 |
Kojto | 90:cb3d968589d8 | 757 | * @arg RTC_IT_TAMP3 |
Kojto | 90:cb3d968589d8 | 758 | * @retval None |
Kojto | 90:cb3d968589d8 | 759 | */ |
Kojto | 90:cb3d968589d8 | 760 | #else |
Kojto | 90:cb3d968589d8 | 761 | /** |
Kojto | 90:cb3d968589d8 | 762 | * @brief Check whether the specified RTC Tamper interrupt has occurred or not. |
Kojto | 90:cb3d968589d8 | 763 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 764 | * @param __FLAG__: specifies the RTC Tamper interrupt sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 765 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 766 | * @arg RTC_IT_TAMP1 |
Kojto | 90:cb3d968589d8 | 767 | * @retval None |
Kojto | 90:cb3d968589d8 | 768 | */ |
Kojto | 90:cb3d968589d8 | 769 | #endif |
Kojto | 90:cb3d968589d8 | 770 | #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET) |
Kojto | 90:cb3d968589d8 | 771 | |
Kojto | 90:cb3d968589d8 | 772 | /** |
Kojto | 90:cb3d968589d8 | 773 | * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not. |
Kojto | 90:cb3d968589d8 | 774 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 775 | * @param __FLAG__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 776 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 777 | * @arg RTC_IT_WUT: WakeUpTimer A interrupt |
Kojto | 90:cb3d968589d8 | 778 | * @retval None |
Kojto | 90:cb3d968589d8 | 779 | */ |
Kojto | 90:cb3d968589d8 | 780 | #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET) |
Kojto | 90:cb3d968589d8 | 781 | |
Kojto | 90:cb3d968589d8 | 782 | /** |
Kojto | 90:cb3d968589d8 | 783 | * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not. |
Kojto | 90:cb3d968589d8 | 784 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 785 | * @param __FLAG__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 786 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 787 | * @arg RTC_IT_TS: TimeStamp interrupt |
Kojto | 90:cb3d968589d8 | 788 | * @retval None |
Kojto | 90:cb3d968589d8 | 789 | */ |
Kojto | 90:cb3d968589d8 | 790 | #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET) |
Kojto | 90:cb3d968589d8 | 791 | |
Kojto | 90:cb3d968589d8 | 792 | /** |
Kojto | 90:cb3d968589d8 | 793 | * @brief Get the selected RTC TimeStamp's flag status. |
Kojto | 90:cb3d968589d8 | 794 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 795 | * @param __FLAG__: specifies the RTC TimeStamp Flag sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 796 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 797 | * @arg RTC_FLAG_TSF |
Kojto | 90:cb3d968589d8 | 798 | * @arg RTC_FLAG_TSOVF |
Kojto | 90:cb3d968589d8 | 799 | * @retval None |
Kojto | 90:cb3d968589d8 | 800 | */ |
Kojto | 90:cb3d968589d8 | 801 | #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
Kojto | 90:cb3d968589d8 | 802 | |
Kojto | 90:cb3d968589d8 | 803 | /** |
Kojto | 90:cb3d968589d8 | 804 | * @brief Get the selected RTC WakeUpTimer's flag status. |
Kojto | 90:cb3d968589d8 | 805 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 806 | * @param __FLAG__: specifies the RTC WakeUpTimer Flag sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 807 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 808 | * @arg RTC_FLAG_WUTF |
Kojto | 90:cb3d968589d8 | 809 | * @arg RTC_FLAG_WUTWF |
Kojto | 90:cb3d968589d8 | 810 | * @retval None |
Kojto | 90:cb3d968589d8 | 811 | */ |
Kojto | 90:cb3d968589d8 | 812 | #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
Kojto | 90:cb3d968589d8 | 813 | |
Kojto | 90:cb3d968589d8 | 814 | /** |
Kojto | 90:cb3d968589d8 | 815 | * @brief Get the selected RTC Tamper's flag status. |
Kojto | 90:cb3d968589d8 | 816 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 817 | * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 818 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 819 | * @arg RTC_FLAG_TAMP1F |
Kojto | 90:cb3d968589d8 | 820 | * @retval None |
Kojto | 90:cb3d968589d8 | 821 | */ |
Kojto | 90:cb3d968589d8 | 822 | #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
Kojto | 90:cb3d968589d8 | 823 | |
Kojto | 90:cb3d968589d8 | 824 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 825 | /** |
Kojto | 90:cb3d968589d8 | 826 | * @brief Get the selected RTC shift operation's flag status. |
Kojto | 90:cb3d968589d8 | 827 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 828 | * @param __FLAG__: specifies the RTC shift operation Flag is pending or not. |
Kojto | 90:cb3d968589d8 | 829 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 830 | * @arg RTC_FLAG_SHPF |
Kojto | 90:cb3d968589d8 | 831 | * @retval None |
Kojto | 90:cb3d968589d8 | 832 | */ |
Kojto | 90:cb3d968589d8 | 833 | #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
Kojto | 90:cb3d968589d8 | 834 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 835 | |
Kojto | 90:cb3d968589d8 | 836 | /** |
Kojto | 90:cb3d968589d8 | 837 | * @brief Clear the RTC Time Stamp's pending flags. |
Kojto | 90:cb3d968589d8 | 838 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 839 | * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 840 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 841 | * @arg RTC_FLAG_TSF |
Kojto | 90:cb3d968589d8 | 842 | * @retval None |
Kojto | 90:cb3d968589d8 | 843 | */ |
Kojto | 90:cb3d968589d8 | 844 | #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
Kojto | 90:cb3d968589d8 | 845 | |
Kojto | 90:cb3d968589d8 | 846 | /** |
Kojto | 90:cb3d968589d8 | 847 | * @brief Clear the RTC Tamper's pending flags. |
Kojto | 90:cb3d968589d8 | 848 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 849 | * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 850 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 851 | * @arg RTC_FLAG_TAMP1F |
Kojto | 90:cb3d968589d8 | 852 | * @retval None |
Kojto | 90:cb3d968589d8 | 853 | */ |
Kojto | 90:cb3d968589d8 | 854 | #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
Kojto | 90:cb3d968589d8 | 855 | |
Kojto | 90:cb3d968589d8 | 856 | /** |
Kojto | 90:cb3d968589d8 | 857 | * @brief Clear the RTC Wake Up timer's pending flags. |
Kojto | 90:cb3d968589d8 | 858 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 90:cb3d968589d8 | 859 | * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled. |
Kojto | 90:cb3d968589d8 | 860 | * This parameter can be: |
Kojto | 90:cb3d968589d8 | 861 | * @arg RTC_FLAG_WUTF |
Kojto | 90:cb3d968589d8 | 862 | * @retval None |
Kojto | 90:cb3d968589d8 | 863 | */ |
Kojto | 90:cb3d968589d8 | 864 | #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
Kojto | 90:cb3d968589d8 | 865 | |
Kojto | 90:cb3d968589d8 | 866 | /** |
Kojto | 90:cb3d968589d8 | 867 | * @} |
Kojto | 90:cb3d968589d8 | 868 | */ |
Kojto | 90:cb3d968589d8 | 869 | |
Kojto | 90:cb3d968589d8 | 870 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 90:cb3d968589d8 | 871 | /** @addtogroup RTCEx_Exported_Functions |
Kojto | 90:cb3d968589d8 | 872 | * @{ |
Kojto | 90:cb3d968589d8 | 873 | */ |
Kojto | 90:cb3d968589d8 | 874 | |
Kojto | 90:cb3d968589d8 | 875 | /* RTC TimeStamp and Tamper functions *****************************************/ |
Kojto | 90:cb3d968589d8 | 876 | /** @addtogroup RTCEx_Exported_Functions_Group4 |
Kojto | 90:cb3d968589d8 | 877 | * @{ |
Kojto | 90:cb3d968589d8 | 878 | */ |
Kojto | 90:cb3d968589d8 | 879 | HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge); |
Kojto | 90:cb3d968589d8 | 880 | HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge); |
Kojto | 90:cb3d968589d8 | 881 | HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 882 | HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format); |
Kojto | 90:cb3d968589d8 | 883 | |
Kojto | 90:cb3d968589d8 | 884 | HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); |
Kojto | 90:cb3d968589d8 | 885 | HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper); |
Kojto | 90:cb3d968589d8 | 886 | HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper); |
Kojto | 90:cb3d968589d8 | 887 | void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 888 | |
Kojto | 90:cb3d968589d8 | 889 | void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 890 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 891 | void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 892 | void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 893 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 894 | void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 895 | HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
Kojto | 90:cb3d968589d8 | 896 | HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
Kojto | 90:cb3d968589d8 | 897 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 898 | HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
Kojto | 90:cb3d968589d8 | 899 | HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
Kojto | 90:cb3d968589d8 | 900 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 901 | /** |
Kojto | 90:cb3d968589d8 | 902 | * @} |
Kojto | 90:cb3d968589d8 | 903 | */ |
Kojto | 90:cb3d968589d8 | 904 | |
Kojto | 90:cb3d968589d8 | 905 | /* RTC Wake-up functions ******************************************************/ |
Kojto | 90:cb3d968589d8 | 906 | /** @addtogroup RTCEx_Exported_Functions_Group5 |
Kojto | 90:cb3d968589d8 | 907 | * @{ |
Kojto | 90:cb3d968589d8 | 908 | */ |
Kojto | 90:cb3d968589d8 | 909 | HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); |
Kojto | 90:cb3d968589d8 | 910 | HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); |
Kojto | 90:cb3d968589d8 | 911 | uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 912 | uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 913 | void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 914 | void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 915 | HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
Kojto | 90:cb3d968589d8 | 916 | /** |
Kojto | 90:cb3d968589d8 | 917 | * @} |
Kojto | 90:cb3d968589d8 | 918 | */ |
Kojto | 90:cb3d968589d8 | 919 | |
Kojto | 90:cb3d968589d8 | 920 | /* Extension Control functions ************************************************/ |
Kojto | 90:cb3d968589d8 | 921 | /** @addtogroup RTCEx_Exported_Functions_Group7 |
Kojto | 90:cb3d968589d8 | 922 | * @{ |
Kojto | 90:cb3d968589d8 | 923 | */ |
Kojto | 90:cb3d968589d8 | 924 | void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); |
Kojto | 90:cb3d968589d8 | 925 | uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); |
Kojto | 90:cb3d968589d8 | 926 | |
Kojto | 90:cb3d968589d8 | 927 | HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value); |
Kojto | 90:cb3d968589d8 | 928 | HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 929 | #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) |
Kojto | 90:cb3d968589d8 | 930 | HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue); |
Kojto | 90:cb3d968589d8 | 931 | HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS); |
Kojto | 90:cb3d968589d8 | 932 | HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput); |
Kojto | 90:cb3d968589d8 | 933 | #else |
Kojto | 90:cb3d968589d8 | 934 | HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 935 | #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */ |
Kojto | 90:cb3d968589d8 | 936 | HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 937 | HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 938 | HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 939 | HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 940 | HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 941 | /** |
Kojto | 90:cb3d968589d8 | 942 | * @} |
Kojto | 90:cb3d968589d8 | 943 | */ |
Kojto | 90:cb3d968589d8 | 944 | |
Kojto | 90:cb3d968589d8 | 945 | /* Extension RTC features functions *******************************************/ |
Kojto | 90:cb3d968589d8 | 946 | /** @addtogroup RTCEx_Exported_Functions_Group8 |
Kojto | 90:cb3d968589d8 | 947 | * @{ |
Kojto | 90:cb3d968589d8 | 948 | */ |
Kojto | 90:cb3d968589d8 | 949 | void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc); |
Kojto | 90:cb3d968589d8 | 950 | HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
Kojto | 90:cb3d968589d8 | 951 | /** |
Kojto | 90:cb3d968589d8 | 952 | * @} |
Kojto | 90:cb3d968589d8 | 953 | */ |
Kojto | 90:cb3d968589d8 | 954 | |
Kojto | 90:cb3d968589d8 | 955 | /** |
Kojto | 90:cb3d968589d8 | 956 | * @} |
Kojto | 90:cb3d968589d8 | 957 | */ |
Kojto | 90:cb3d968589d8 | 958 | |
Kojto | 90:cb3d968589d8 | 959 | /** |
Kojto | 90:cb3d968589d8 | 960 | * @} |
Kojto | 90:cb3d968589d8 | 961 | */ |
Kojto | 90:cb3d968589d8 | 962 | |
Kojto | 90:cb3d968589d8 | 963 | /** |
Kojto | 90:cb3d968589d8 | 964 | * @} |
Kojto | 90:cb3d968589d8 | 965 | */ |
Kojto | 90:cb3d968589d8 | 966 | |
Kojto | 90:cb3d968589d8 | 967 | #ifdef __cplusplus |
Kojto | 90:cb3d968589d8 | 968 | } |
Kojto | 90:cb3d968589d8 | 969 | #endif |
Kojto | 90:cb3d968589d8 | 970 | |
Kojto | 90:cb3d968589d8 | 971 | #endif /* __STM32L1xx_HAL_RTC_EX_H */ |
Kojto | 90:cb3d968589d8 | 972 | |
Kojto | 90:cb3d968589d8 | 973 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |