A simple 128x32 graphical LCD program to quickstart with LCD on ARM mbed IoT Starter Kit. This requires mbed Applciation Shield with FRDM-K64F platform.

Dependencies:   C12832

Committer:
tushki7
Date:
Sun Apr 12 15:45:52 2015 +0000
Revision:
1:eb68c94a8ee5
Parent:
0:60d829a0353a
A simple 128x32 LCD program with ARM mbed IoT Starter Kit;

Who changed what in which revision?

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