Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Sep 02 14:17:43 2015 +0100
Revision:
106:ba1f97679dad
Parent:
99:dbbf35b96557
Child:
110:165afa46840b
Release 106  of the mbed library

Changes:
- new platform - Nucleo F446RE
- STM32F4 Cube driver update v2.3.2
- ST cmsis driver v2.3.2
- nordic bugfix gcc linker start address
- lpc11u68 - bugfix for serial ports

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 86:04dd9b1680ae 1 /**
bogdanm 86:04dd9b1680ae 2 ******************************************************************************
bogdanm 86:04dd9b1680ae 3 * @file stm32f4xx_hal_rtc_ex.h
bogdanm 86:04dd9b1680ae 4 * @author MCD Application Team
Kojto 106:ba1f97679dad 5 * @version V1.3.2
Kojto 106:ba1f97679dad 6 * @date 26-June-2015
bogdanm 86:04dd9b1680ae 7 * @brief Header file of RTC HAL Extension module.
bogdanm 86:04dd9b1680ae 8 ******************************************************************************
bogdanm 86:04dd9b1680ae 9 * @attention
bogdanm 86:04dd9b1680ae 10 *
Kojto 99:dbbf35b96557 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 86:04dd9b1680ae 12 *
bogdanm 86:04dd9b1680ae 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 86:04dd9b1680ae 14 * are permitted provided that the following conditions are met:
bogdanm 86:04dd9b1680ae 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 86:04dd9b1680ae 16 * this list of conditions and the following disclaimer.
bogdanm 86:04dd9b1680ae 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 86:04dd9b1680ae 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 86:04dd9b1680ae 19 * and/or other materials provided with the distribution.
bogdanm 86:04dd9b1680ae 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 86:04dd9b1680ae 21 * may be used to endorse or promote products derived from this software
bogdanm 86:04dd9b1680ae 22 * without specific prior written permission.
bogdanm 86:04dd9b1680ae 23 *
bogdanm 86:04dd9b1680ae 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 86:04dd9b1680ae 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 86:04dd9b1680ae 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 86:04dd9b1680ae 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 86:04dd9b1680ae 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 86:04dd9b1680ae 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 86:04dd9b1680ae 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 86:04dd9b1680ae 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 86:04dd9b1680ae 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 86:04dd9b1680ae 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 86:04dd9b1680ae 34 *
bogdanm 86:04dd9b1680ae 35 ******************************************************************************
bogdanm 86:04dd9b1680ae 36 */
bogdanm 86:04dd9b1680ae 37
bogdanm 86:04dd9b1680ae 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 86:04dd9b1680ae 39 #ifndef __STM32F4xx_HAL_RTC_EX_H
bogdanm 86:04dd9b1680ae 40 #define __STM32F4xx_HAL_RTC_EX_H
bogdanm 86:04dd9b1680ae 41
bogdanm 86:04dd9b1680ae 42 #ifdef __cplusplus
bogdanm 86:04dd9b1680ae 43 extern "C" {
bogdanm 86:04dd9b1680ae 44 #endif
bogdanm 86:04dd9b1680ae 45
bogdanm 86:04dd9b1680ae 46 /* Includes ------------------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 47 #include "stm32f4xx_hal_def.h"
bogdanm 86:04dd9b1680ae 48
bogdanm 86:04dd9b1680ae 49 /** @addtogroup STM32F4xx_HAL_Driver
bogdanm 86:04dd9b1680ae 50 * @{
bogdanm 86:04dd9b1680ae 51 */
bogdanm 86:04dd9b1680ae 52
bogdanm 86:04dd9b1680ae 53 /** @addtogroup RTCEx
bogdanm 86:04dd9b1680ae 54 * @{
bogdanm 86:04dd9b1680ae 55 */
bogdanm 86:04dd9b1680ae 56
bogdanm 86:04dd9b1680ae 57 /* Exported types ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 58 /** @defgroup RTCEx_Exported_Types RTCEx Exported Types
Kojto 99:dbbf35b96557 59 * @{
Kojto 99:dbbf35b96557 60 */
bogdanm 86:04dd9b1680ae 61
bogdanm 86:04dd9b1680ae 62 /**
bogdanm 86:04dd9b1680ae 63 * @brief RTC Tamper structure definition
bogdanm 86:04dd9b1680ae 64 */
bogdanm 86:04dd9b1680ae 65 typedef struct
bogdanm 86:04dd9b1680ae 66 {
bogdanm 86:04dd9b1680ae 67 uint32_t Tamper; /*!< Specifies the Tamper Pin.
bogdanm 86:04dd9b1680ae 68 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
bogdanm 86:04dd9b1680ae 69
bogdanm 86:04dd9b1680ae 70 uint32_t PinSelection; /*!< Specifies the Tamper Pin.
Kojto 106:ba1f97679dad 71 This parameter can be a value of @ref RTCEx_Tamper_Pins_Selection */
bogdanm 86:04dd9b1680ae 72
bogdanm 86:04dd9b1680ae 73 uint32_t Trigger; /*!< Specifies the Tamper Trigger.
bogdanm 86:04dd9b1680ae 74 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
bogdanm 86:04dd9b1680ae 75
bogdanm 86:04dd9b1680ae 76 uint32_t Filter; /*!< Specifies the RTC Filter Tamper.
bogdanm 86:04dd9b1680ae 77 This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */
bogdanm 86:04dd9b1680ae 78
bogdanm 86:04dd9b1680ae 79 uint32_t SamplingFrequency; /*!< Specifies the sampling frequency.
bogdanm 86:04dd9b1680ae 80 This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */
bogdanm 86:04dd9b1680ae 81
bogdanm 86:04dd9b1680ae 82 uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration .
bogdanm 86:04dd9b1680ae 83 This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */
bogdanm 86:04dd9b1680ae 84
bogdanm 86:04dd9b1680ae 85 uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp .
bogdanm 86:04dd9b1680ae 86 This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */
bogdanm 86:04dd9b1680ae 87
bogdanm 86:04dd9b1680ae 88 uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection.
bogdanm 86:04dd9b1680ae 89 This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */
bogdanm 86:04dd9b1680ae 90 }RTC_TamperTypeDef;
Kojto 99:dbbf35b96557 91 /**
Kojto 99:dbbf35b96557 92 * @}
Kojto 99:dbbf35b96557 93 */
bogdanm 86:04dd9b1680ae 94
bogdanm 86:04dd9b1680ae 95 /* Exported constants --------------------------------------------------------*/
Kojto 99:dbbf35b96557 96 /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants
bogdanm 86:04dd9b1680ae 97 * @{
bogdanm 86:04dd9b1680ae 98 */
bogdanm 86:04dd9b1680ae 99
Kojto 99:dbbf35b96557 100 /** @defgroup RTCEx_Backup_Registers_Definitions RTC Backup Registers Definitions
bogdanm 86:04dd9b1680ae 101 * @{
bogdanm 86:04dd9b1680ae 102 */
bogdanm 86:04dd9b1680ae 103 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 104 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
bogdanm 86:04dd9b1680ae 105 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
bogdanm 86:04dd9b1680ae 106 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
bogdanm 86:04dd9b1680ae 107 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
bogdanm 86:04dd9b1680ae 108 #define RTC_BKP_DR5 ((uint32_t)0x00000005)
bogdanm 86:04dd9b1680ae 109 #define RTC_BKP_DR6 ((uint32_t)0x00000006)
bogdanm 86:04dd9b1680ae 110 #define RTC_BKP_DR7 ((uint32_t)0x00000007)
bogdanm 86:04dd9b1680ae 111 #define RTC_BKP_DR8 ((uint32_t)0x00000008)
bogdanm 86:04dd9b1680ae 112 #define RTC_BKP_DR9 ((uint32_t)0x00000009)
bogdanm 86:04dd9b1680ae 113 #define RTC_BKP_DR10 ((uint32_t)0x0000000A)
bogdanm 86:04dd9b1680ae 114 #define RTC_BKP_DR11 ((uint32_t)0x0000000B)
bogdanm 86:04dd9b1680ae 115 #define RTC_BKP_DR12 ((uint32_t)0x0000000C)
bogdanm 86:04dd9b1680ae 116 #define RTC_BKP_DR13 ((uint32_t)0x0000000D)
bogdanm 86:04dd9b1680ae 117 #define RTC_BKP_DR14 ((uint32_t)0x0000000E)
bogdanm 86:04dd9b1680ae 118 #define RTC_BKP_DR15 ((uint32_t)0x0000000F)
bogdanm 86:04dd9b1680ae 119 #define RTC_BKP_DR16 ((uint32_t)0x00000010)
bogdanm 86:04dd9b1680ae 120 #define RTC_BKP_DR17 ((uint32_t)0x00000011)
bogdanm 86:04dd9b1680ae 121 #define RTC_BKP_DR18 ((uint32_t)0x00000012)
bogdanm 86:04dd9b1680ae 122 #define RTC_BKP_DR19 ((uint32_t)0x00000013)
bogdanm 86:04dd9b1680ae 123 /**
bogdanm 86:04dd9b1680ae 124 * @}
bogdanm 86:04dd9b1680ae 125 */
bogdanm 86:04dd9b1680ae 126
Kojto 99:dbbf35b96557 127 /** @defgroup RTCEx_Time_Stamp_Edges_definitions RTC TimeStamp Edges Definitions
bogdanm 86:04dd9b1680ae 128 * @{
bogdanm 86:04dd9b1680ae 129 */
bogdanm 86:04dd9b1680ae 130 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 131 #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008)
bogdanm 86:04dd9b1680ae 132 /**
bogdanm 86:04dd9b1680ae 133 * @}
bogdanm 86:04dd9b1680ae 134 */
bogdanm 86:04dd9b1680ae 135
Kojto 99:dbbf35b96557 136 /** @defgroup RTCEx_Tamper_Pins_Definitions RTC Tamper Pins Definitions
bogdanm 86:04dd9b1680ae 137 * @{
bogdanm 86:04dd9b1680ae 138 */
bogdanm 86:04dd9b1680ae 139 #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E
bogdanm 86:04dd9b1680ae 140 #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E
bogdanm 86:04dd9b1680ae 141 /**
bogdanm 86:04dd9b1680ae 142 * @}
bogdanm 86:04dd9b1680ae 143 */
bogdanm 86:04dd9b1680ae 144
Kojto 99:dbbf35b96557 145 /** @defgroup RTCEx_Tamper_Pins_Selection RTC tamper Pins Selection
bogdanm 86:04dd9b1680ae 146 * @{
bogdanm 86:04dd9b1680ae 147 */
Kojto 106:ba1f97679dad 148 #define RTC_TAMPERPIN_DEFAULT ((uint32_t)0x00000000)
Kojto 106:ba1f97679dad 149 #define RTC_TAMPERPIN_POS1 ((uint32_t)0x00010000)
Kojto 106:ba1f97679dad 150
bogdanm 86:04dd9b1680ae 151 /**
bogdanm 86:04dd9b1680ae 152 * @}
bogdanm 86:04dd9b1680ae 153 */
bogdanm 86:04dd9b1680ae 154
Kojto 99:dbbf35b96557 155 /** @defgroup RTCEx_TimeStamp_Pin_Selection RTC TimeStamp Pins Selection
bogdanm 86:04dd9b1680ae 156 * @{
bogdanm 86:04dd9b1680ae 157 */
Kojto 106:ba1f97679dad 158 #define RTC_TIMESTAMPPIN_DEFAULT ((uint32_t)0x00000000)
Kojto 106:ba1f97679dad 159 #define RTC_TIMESTAMPPIN_POS1 ((uint32_t)0x00020000)
Kojto 106:ba1f97679dad 160
bogdanm 86:04dd9b1680ae 161 /**
bogdanm 86:04dd9b1680ae 162 * @}
bogdanm 86:04dd9b1680ae 163 */
bogdanm 86:04dd9b1680ae 164
Kojto 99:dbbf35b96557 165 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTC Tamper Triggers Definitions
bogdanm 86:04dd9b1680ae 166 * @{
bogdanm 86:04dd9b1680ae 167 */
bogdanm 86:04dd9b1680ae 168 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 169 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002)
bogdanm 86:04dd9b1680ae 170 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
bogdanm 86:04dd9b1680ae 171 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
bogdanm 86:04dd9b1680ae 172 /**
bogdanm 86:04dd9b1680ae 173 * @}
bogdanm 86:04dd9b1680ae 174 */
bogdanm 86:04dd9b1680ae 175
Kojto 99:dbbf35b96557 176 /** @defgroup RTCEx_Tamper_Filter_Definitions RTC Tamper Filter Definitions
bogdanm 86:04dd9b1680ae 177 * @{
bogdanm 86:04dd9b1680ae 178 */
bogdanm 86:04dd9b1680ae 179 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
bogdanm 86:04dd9b1680ae 180
bogdanm 86:04dd9b1680ae 181 #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2
bogdanm 86:04dd9b1680ae 182 consecutive samples at the active level */
bogdanm 86:04dd9b1680ae 183 #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4
bogdanm 86:04dd9b1680ae 184 consecutive samples at the active level */
bogdanm 86:04dd9b1680ae 185 #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8
Kojto 99:dbbf35b96557 186 consecutive samples at the active level. */
bogdanm 86:04dd9b1680ae 187 /**
bogdanm 86:04dd9b1680ae 188 * @}
bogdanm 86:04dd9b1680ae 189 */
bogdanm 86:04dd9b1680ae 190
Kojto 99:dbbf35b96557 191 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTC Tamper Sampling Frequencies Definitions
bogdanm 86:04dd9b1680ae 192 * @{
bogdanm 86:04dd9b1680ae 193 */
bogdanm 86:04dd9b1680ae 194 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
bogdanm 86:04dd9b1680ae 195 with a frequency = RTCCLK / 32768 */
bogdanm 86:04dd9b1680ae 196 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled
bogdanm 86:04dd9b1680ae 197 with a frequency = RTCCLK / 16384 */
bogdanm 86:04dd9b1680ae 198 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
bogdanm 86:04dd9b1680ae 199 with a frequency = RTCCLK / 8192 */
bogdanm 86:04dd9b1680ae 200 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
bogdanm 86:04dd9b1680ae 201 with a frequency = RTCCLK / 4096 */
bogdanm 86:04dd9b1680ae 202 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
bogdanm 86:04dd9b1680ae 203 with a frequency = RTCCLK / 2048 */
bogdanm 86:04dd9b1680ae 204 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
bogdanm 86:04dd9b1680ae 205 with a frequency = RTCCLK / 1024 */
bogdanm 86:04dd9b1680ae 206 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
bogdanm 86:04dd9b1680ae 207 with a frequency = RTCCLK / 512 */
bogdanm 86:04dd9b1680ae 208 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
bogdanm 86:04dd9b1680ae 209 with a frequency = RTCCLK / 256 */
bogdanm 86:04dd9b1680ae 210 /**
bogdanm 86:04dd9b1680ae 211 * @}
bogdanm 86:04dd9b1680ae 212 */
bogdanm 86:04dd9b1680ae 213
Kojto 99:dbbf35b96557 214 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTC Tamper Pin Precharge Duration Definitions
bogdanm 86:04dd9b1680ae 215 * @{
bogdanm 86:04dd9b1680ae 216 */
bogdanm 86:04dd9b1680ae 217 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
bogdanm 86:04dd9b1680ae 218 sampling during 1 RTCCLK cycle */
bogdanm 86:04dd9b1680ae 219 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
bogdanm 86:04dd9b1680ae 220 sampling during 2 RTCCLK cycles */
bogdanm 86:04dd9b1680ae 221 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
bogdanm 86:04dd9b1680ae 222 sampling during 4 RTCCLK cycles */
bogdanm 86:04dd9b1680ae 223 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
bogdanm 86:04dd9b1680ae 224 sampling during 8 RTCCLK cycles */
bogdanm 86:04dd9b1680ae 225 /**
bogdanm 86:04dd9b1680ae 226 * @}
bogdanm 86:04dd9b1680ae 227 */
bogdanm 86:04dd9b1680ae 228
Kojto 99:dbbf35b96557 229 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTC Tamper TimeStamp On Tamper Detection Definitions
bogdanm 86:04dd9b1680ae 230 * @{
bogdanm 86:04dd9b1680ae 231 */
bogdanm 86:04dd9b1680ae 232 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */
bogdanm 86:04dd9b1680ae 233 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
bogdanm 86:04dd9b1680ae 234 /**
bogdanm 86:04dd9b1680ae 235 * @}
bogdanm 86:04dd9b1680ae 236 */
bogdanm 86:04dd9b1680ae 237
Kojto 99:dbbf35b96557 238 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTC Tamper Pull Up Definitions
bogdanm 86:04dd9b1680ae 239 * @{
bogdanm 86:04dd9b1680ae 240 */
bogdanm 86:04dd9b1680ae 241 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event saved */
bogdanm 86:04dd9b1680ae 242 #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */
bogdanm 86:04dd9b1680ae 243 /**
bogdanm 86:04dd9b1680ae 244 * @}
bogdanm 86:04dd9b1680ae 245 */
bogdanm 86:04dd9b1680ae 246
Kojto 99:dbbf35b96557 247 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTC Wake-up Timer Definitions
bogdanm 86:04dd9b1680ae 248 * @{
bogdanm 86:04dd9b1680ae 249 */
bogdanm 86:04dd9b1680ae 250 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 251 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001)
bogdanm 86:04dd9b1680ae 252 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002)
bogdanm 86:04dd9b1680ae 253 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003)
bogdanm 86:04dd9b1680ae 254 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004)
bogdanm 86:04dd9b1680ae 255 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006)
bogdanm 86:04dd9b1680ae 256 /**
bogdanm 86:04dd9b1680ae 257 * @}
bogdanm 86:04dd9b1680ae 258 */
bogdanm 86:04dd9b1680ae 259
Kojto 99:dbbf35b96557 260 /** @defgroup RTCEx_Digital_Calibration_Definitions RTC Digital Calib Definitions
bogdanm 86:04dd9b1680ae 261 * @{
bogdanm 86:04dd9b1680ae 262 */
bogdanm 86:04dd9b1680ae 263 #define RTC_CALIBSIGN_POSITIVE ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 264 #define RTC_CALIBSIGN_NEGATIVE ((uint32_t)0x00000080)
bogdanm 86:04dd9b1680ae 265 /**
bogdanm 86:04dd9b1680ae 266 * @}
bogdanm 86:04dd9b1680ae 267 */
bogdanm 86:04dd9b1680ae 268
Kojto 99:dbbf35b96557 269 /** @defgroup RTCEx_Smooth_calib_period_Definitions RTC Smooth Calib Period Definitions
bogdanm 86:04dd9b1680ae 270 * @{
bogdanm 86:04dd9b1680ae 271 */
Kojto 99:dbbf35b96557 272 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibration
bogdanm 86:04dd9b1680ae 273 period is 32s, else 2exp20 RTCCLK seconds */
Kojto 99:dbbf35b96557 274 #define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibration
bogdanm 86:04dd9b1680ae 275 period is 16s, else 2exp19 RTCCLK seconds */
Kojto 99:dbbf35b96557 276 #define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibration
bogdanm 86:04dd9b1680ae 277 period is 8s, else 2exp18 RTCCLK seconds */
bogdanm 86:04dd9b1680ae 278 /**
bogdanm 86:04dd9b1680ae 279 * @}
bogdanm 86:04dd9b1680ae 280 */
bogdanm 86:04dd9b1680ae 281
Kojto 99:dbbf35b96557 282 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTC Smooth Calib Plus Pulses Definitions
bogdanm 86:04dd9b1680ae 283 * @{
bogdanm 86:04dd9b1680ae 284 */
bogdanm 86:04dd9b1680ae 285 #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added
bogdanm 86:04dd9b1680ae 286 during a X -second window = Y - CALM[8:0]
bogdanm 86:04dd9b1680ae 287 with Y = 512, 256, 128 when X = 32, 16, 8 */
bogdanm 86:04dd9b1680ae 288 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
bogdanm 86:04dd9b1680ae 289 during a 32-second window = CALM[8:0] */
bogdanm 86:04dd9b1680ae 290 /**
bogdanm 86:04dd9b1680ae 291 * @}
bogdanm 86:04dd9b1680ae 292 */
bogdanm 86:04dd9b1680ae 293
Kojto 99:dbbf35b96557 294 /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions RTC Add 1 Second Parameter Definitions
bogdanm 86:04dd9b1680ae 295 * @{
bogdanm 86:04dd9b1680ae 296 */
bogdanm 86:04dd9b1680ae 297 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 298 #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000)
bogdanm 86:04dd9b1680ae 299 /**
bogdanm 86:04dd9b1680ae 300 * @}
bogdanm 86:04dd9b1680ae 301 */
bogdanm 86:04dd9b1680ae 302
bogdanm 86:04dd9b1680ae 303
Kojto 99:dbbf35b96557 304 /** @defgroup RTCEx_Calib_Output_selection_Definitions RTC Calib Output Selection Definitions
bogdanm 86:04dd9b1680ae 305 * @{
bogdanm 86:04dd9b1680ae 306 */
bogdanm 86:04dd9b1680ae 307 #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000)
bogdanm 86:04dd9b1680ae 308 #define RTC_CALIBOUTPUT_1HZ ((uint32_t)0x00080000)
bogdanm 86:04dd9b1680ae 309 /**
bogdanm 86:04dd9b1680ae 310 * @}
bogdanm 86:04dd9b1680ae 311 */
bogdanm 86:04dd9b1680ae 312
bogdanm 86:04dd9b1680ae 313 /**
bogdanm 86:04dd9b1680ae 314 * @}
bogdanm 86:04dd9b1680ae 315 */
bogdanm 86:04dd9b1680ae 316
bogdanm 86:04dd9b1680ae 317 /* Exported macro ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 318 /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros
Kojto 99:dbbf35b96557 319 * @{
Kojto 99:dbbf35b96557 320 */
Kojto 99:dbbf35b96557 321
Kojto 99:dbbf35b96557 322 /* ---------------------------------WAKEUPTIMER---------------------------------*/
Kojto 99:dbbf35b96557 323 /** @defgroup RTCEx_WakeUp_Timer RTC WakeUp Timer
Kojto 99:dbbf35b96557 324 * @{
Kojto 99:dbbf35b96557 325 */
bogdanm 86:04dd9b1680ae 326
bogdanm 86:04dd9b1680ae 327 /**
bogdanm 86:04dd9b1680ae 328 * @brief Enable the RTC WakeUp Timer peripheral.
bogdanm 86:04dd9b1680ae 329 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 330 * @retval None
bogdanm 86:04dd9b1680ae 331 */
bogdanm 86:04dd9b1680ae 332 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
bogdanm 86:04dd9b1680ae 333
bogdanm 86:04dd9b1680ae 334 /**
Kojto 99:dbbf35b96557 335 * @brief Disable the RTC Wake-up Timer peripheral.
Kojto 99:dbbf35b96557 336 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 337 * @retval None
Kojto 99:dbbf35b96557 338 */
Kojto 99:dbbf35b96557 339 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
Kojto 99:dbbf35b96557 340
Kojto 99:dbbf35b96557 341 /**
Kojto 99:dbbf35b96557 342 * @brief Enable the RTC WakeUpTimer interrupt.
Kojto 99:dbbf35b96557 343 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 344 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
Kojto 99:dbbf35b96557 345 * This parameter can be:
Kojto 99:dbbf35b96557 346 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
Kojto 99:dbbf35b96557 347 * @retval None
Kojto 99:dbbf35b96557 348 */
Kojto 99:dbbf35b96557 349 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
Kojto 99:dbbf35b96557 350
Kojto 99:dbbf35b96557 351 /**
Kojto 99:dbbf35b96557 352 * @brief Disable the RTC WakeUpTimer interrupt.
Kojto 99:dbbf35b96557 353 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 354 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
Kojto 99:dbbf35b96557 355 * This parameter can be:
Kojto 99:dbbf35b96557 356 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
Kojto 99:dbbf35b96557 357 * @retval None
Kojto 99:dbbf35b96557 358 */
Kojto 99:dbbf35b96557 359 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
Kojto 99:dbbf35b96557 360
Kojto 99:dbbf35b96557 361 /**
Kojto 99:dbbf35b96557 362 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
Kojto 99:dbbf35b96557 363 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 364 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt to check.
Kojto 99:dbbf35b96557 365 * This parameter can be:
Kojto 99:dbbf35b96557 366 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
Kojto 99:dbbf35b96557 367 * @retval None
Kojto 99:dbbf35b96557 368 */
Kojto 99:dbbf35b96557 369 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 370
Kojto 99:dbbf35b96557 371 /**
Kojto 99:dbbf35b96557 372 * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not.
Kojto 99:dbbf35b96557 373 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 374 * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check.
Kojto 99:dbbf35b96557 375 * This parameter can be:
Kojto 99:dbbf35b96557 376 * @arg RTC_IT_WUT: WakeUpTimer interrupt
Kojto 99:dbbf35b96557 377 * @retval None
Kojto 99:dbbf35b96557 378 */
Kojto 99:dbbf35b96557 379 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 99:dbbf35b96557 380
Kojto 99:dbbf35b96557 381 /**
Kojto 99:dbbf35b96557 382 * @brief Get the selected RTC WakeUpTimer's flag status.
Kojto 99:dbbf35b96557 383 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 384 * @param __FLAG__: specifies the RTC WakeUpTimer Flag to check.
Kojto 99:dbbf35b96557 385 * This parameter can be:
Kojto 99:dbbf35b96557 386 * @arg RTC_FLAG_WUTF
Kojto 99:dbbf35b96557 387 * @arg RTC_FLAG_WUTWF
Kojto 99:dbbf35b96557 388 * @retval None
Kojto 99:dbbf35b96557 389 */
Kojto 99:dbbf35b96557 390 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 391
Kojto 99:dbbf35b96557 392 /**
Kojto 99:dbbf35b96557 393 * @brief Clear the RTC Wake Up timer's pending flags.
Kojto 99:dbbf35b96557 394 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 395 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
Kojto 99:dbbf35b96557 396 * This parameter can be:
Kojto 99:dbbf35b96557 397 * @arg RTC_FLAG_WUTF
Kojto 99:dbbf35b96557 398 * @retval None
Kojto 99:dbbf35b96557 399 */
Kojto 106:ba1f97679dad 400 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 99:dbbf35b96557 401
Kojto 99:dbbf35b96557 402 /**
Kojto 99:dbbf35b96557 403 * @brief Enable interrupt on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 404 * @retval None
Kojto 99:dbbf35b96557 405 */
Kojto 99:dbbf35b96557 406 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 407
Kojto 99:dbbf35b96557 408 /**
Kojto 99:dbbf35b96557 409 * @brief Disable interrupt on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 410 * @retval None
Kojto 99:dbbf35b96557 411 */
Kojto 99:dbbf35b96557 412 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 99:dbbf35b96557 413
Kojto 99:dbbf35b96557 414 /**
Kojto 99:dbbf35b96557 415 * @brief Enable event on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 416 * @retval None.
Kojto 99:dbbf35b96557 417 */
Kojto 99:dbbf35b96557 418 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 419
Kojto 99:dbbf35b96557 420 /**
Kojto 99:dbbf35b96557 421 * @brief Disable event on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 422 * @retval None.
Kojto 99:dbbf35b96557 423 */
Kojto 99:dbbf35b96557 424 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 99:dbbf35b96557 425
Kojto 99:dbbf35b96557 426 /**
Kojto 99:dbbf35b96557 427 * @brief Enable falling edge trigger on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 428 * @retval None.
Kojto 99:dbbf35b96557 429 */
Kojto 99:dbbf35b96557 430 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 431
Kojto 99:dbbf35b96557 432 /**
Kojto 99:dbbf35b96557 433 * @brief Disable falling edge trigger on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 434 * @retval None.
Kojto 99:dbbf35b96557 435 */
Kojto 99:dbbf35b96557 436 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 99:dbbf35b96557 437
Kojto 99:dbbf35b96557 438 /**
Kojto 99:dbbf35b96557 439 * @brief Enable rising edge trigger on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 440 * @retval None.
Kojto 99:dbbf35b96557 441 */
Kojto 99:dbbf35b96557 442 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 443
Kojto 99:dbbf35b96557 444 /**
Kojto 99:dbbf35b96557 445 * @brief Disable rising edge trigger on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 446 * @retval None.
Kojto 99:dbbf35b96557 447 */
Kojto 99:dbbf35b96557 448 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
Kojto 99:dbbf35b96557 449
Kojto 99:dbbf35b96557 450 /**
Kojto 99:dbbf35b96557 451 * @brief Enable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 452 * @retval None.
Kojto 99:dbbf35b96557 453 */
Kojto 99:dbbf35b96557 454 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE();
Kojto 99:dbbf35b96557 455
Kojto 99:dbbf35b96557 456 /**
Kojto 99:dbbf35b96557 457 * @brief Disable rising & falling edge trigger on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 458 * This parameter can be:
Kojto 99:dbbf35b96557 459 * @retval None.
Kojto 99:dbbf35b96557 460 */
Kojto 99:dbbf35b96557 461 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE();
Kojto 99:dbbf35b96557 462
Kojto 99:dbbf35b96557 463 /**
Kojto 99:dbbf35b96557 464 * @brief Check whether the RTC Wake-up Timer associated Exti line interrupt flag is set or not.
Kojto 99:dbbf35b96557 465 * @retval Line Status.
Kojto 99:dbbf35b96557 466 */
Kojto 99:dbbf35b96557 467 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 468
Kojto 99:dbbf35b96557 469 /**
Kojto 99:dbbf35b96557 470 * @brief Clear the RTC Wake-up Timer associated Exti line flag.
Kojto 99:dbbf35b96557 471 * @retval None.
Kojto 99:dbbf35b96557 472 */
Kojto 99:dbbf35b96557 473 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 474
Kojto 99:dbbf35b96557 475 /**
Kojto 99:dbbf35b96557 476 * @brief Generate a Software interrupt on the RTC Wake-up Timer associated Exti line.
Kojto 99:dbbf35b96557 477 * @retval None.
Kojto 99:dbbf35b96557 478 */
Kojto 99:dbbf35b96557 479 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
Kojto 99:dbbf35b96557 480
Kojto 99:dbbf35b96557 481 /**
Kojto 99:dbbf35b96557 482 * @}
Kojto 99:dbbf35b96557 483 */
Kojto 99:dbbf35b96557 484
Kojto 99:dbbf35b96557 485 /* ---------------------------------TIMESTAMP---------------------------------*/
Kojto 99:dbbf35b96557 486 /** @defgroup RTCEx_Timestamp RTC Timestamp
Kojto 99:dbbf35b96557 487 * @{
Kojto 99:dbbf35b96557 488 */
Kojto 99:dbbf35b96557 489
Kojto 99:dbbf35b96557 490 /**
bogdanm 86:04dd9b1680ae 491 * @brief Enable the RTC TimeStamp peripheral.
bogdanm 86:04dd9b1680ae 492 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 493 * @retval None
bogdanm 86:04dd9b1680ae 494 */
bogdanm 86:04dd9b1680ae 495 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
bogdanm 86:04dd9b1680ae 496
bogdanm 86:04dd9b1680ae 497 /**
bogdanm 86:04dd9b1680ae 498 * @brief Disable the RTC TimeStamp peripheral.
bogdanm 86:04dd9b1680ae 499 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 500 * @retval None
bogdanm 86:04dd9b1680ae 501 */
bogdanm 86:04dd9b1680ae 502 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
bogdanm 86:04dd9b1680ae 503
bogdanm 86:04dd9b1680ae 504 /**
Kojto 99:dbbf35b96557 505 * @brief Enable the RTC TimeStamp interrupt.
Kojto 99:dbbf35b96557 506 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 507 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
Kojto 99:dbbf35b96557 508 * This parameter can be:
Kojto 99:dbbf35b96557 509 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 99:dbbf35b96557 510 * @retval None
Kojto 99:dbbf35b96557 511 */
Kojto 99:dbbf35b96557 512 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
Kojto 99:dbbf35b96557 513
Kojto 99:dbbf35b96557 514 /**
Kojto 99:dbbf35b96557 515 * @brief Disable the RTC TimeStamp interrupt.
Kojto 99:dbbf35b96557 516 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 517 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
Kojto 99:dbbf35b96557 518 * This parameter can be:
Kojto 99:dbbf35b96557 519 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 99:dbbf35b96557 520 * @retval None
Kojto 99:dbbf35b96557 521 */
Kojto 99:dbbf35b96557 522 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
Kojto 99:dbbf35b96557 523
Kojto 99:dbbf35b96557 524 /**
Kojto 99:dbbf35b96557 525 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
Kojto 99:dbbf35b96557 526 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 527 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt to check.
Kojto 99:dbbf35b96557 528 * This parameter can be:
Kojto 99:dbbf35b96557 529 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 99:dbbf35b96557 530 * @retval None
Kojto 99:dbbf35b96557 531 */
Kojto 99:dbbf35b96557 532 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 533
Kojto 99:dbbf35b96557 534 /**
Kojto 99:dbbf35b96557 535 * @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not.
Kojto 99:dbbf35b96557 536 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 537 * @param __INTERRUPT__: specifies the RTC Time Stamp interrupt source to check.
Kojto 99:dbbf35b96557 538 * This parameter can be:
Kojto 99:dbbf35b96557 539 * @arg RTC_IT_TS: TimeStamp interrupt
Kojto 99:dbbf35b96557 540 * @retval None
Kojto 99:dbbf35b96557 541 */
Kojto 99:dbbf35b96557 542 #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 99:dbbf35b96557 543
Kojto 99:dbbf35b96557 544 /**
Kojto 99:dbbf35b96557 545 * @brief Get the selected RTC TimeStamp's flag status.
Kojto 99:dbbf35b96557 546 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 547 * @param __FLAG__: specifies the RTC TimeStamp flag to check.
Kojto 99:dbbf35b96557 548 * This parameter can be:
Kojto 99:dbbf35b96557 549 * @arg RTC_FLAG_TSF
Kojto 99:dbbf35b96557 550 * @arg RTC_FLAG_TSOVF
Kojto 99:dbbf35b96557 551 * @retval None
Kojto 99:dbbf35b96557 552 */
Kojto 99:dbbf35b96557 553 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 554
Kojto 99:dbbf35b96557 555 /**
Kojto 99:dbbf35b96557 556 * @brief Clear the RTC Time Stamp's pending flags.
Kojto 99:dbbf35b96557 557 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 558 * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
Kojto 99:dbbf35b96557 559 * This parameter can be:
Kojto 99:dbbf35b96557 560 * @arg RTC_FLAG_TSF
Kojto 99:dbbf35b96557 561 * @retval None
Kojto 99:dbbf35b96557 562 */
Kojto 106:ba1f97679dad 563 #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 99:dbbf35b96557 564
Kojto 99:dbbf35b96557 565 /**
Kojto 99:dbbf35b96557 566 * @}
Kojto 99:dbbf35b96557 567 */
Kojto 99:dbbf35b96557 568
Kojto 99:dbbf35b96557 569 /* ---------------------------------TAMPER------------------------------------*/
Kojto 99:dbbf35b96557 570 /** @defgroup RTCEx_Tamper RTC Tamper
Kojto 99:dbbf35b96557 571 * @{
Kojto 99:dbbf35b96557 572 */
Kojto 99:dbbf35b96557 573
Kojto 99:dbbf35b96557 574 /**
Kojto 99:dbbf35b96557 575 * @brief Enable the RTC Tamper1 input detection.
Kojto 99:dbbf35b96557 576 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 577 * @retval None
Kojto 99:dbbf35b96557 578 */
Kojto 99:dbbf35b96557 579 #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP1E))
Kojto 99:dbbf35b96557 580
Kojto 99:dbbf35b96557 581 /**
Kojto 99:dbbf35b96557 582 * @brief Disable the RTC Tamper1 input detection.
Kojto 99:dbbf35b96557 583 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 584 * @retval None
Kojto 99:dbbf35b96557 585 */
Kojto 99:dbbf35b96557 586 #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP1E))
Kojto 99:dbbf35b96557 587
Kojto 99:dbbf35b96557 588 /**
Kojto 99:dbbf35b96557 589 * @brief Enable the RTC Tamper2 input detection.
Kojto 99:dbbf35b96557 590 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 591 * @retval None
Kojto 99:dbbf35b96557 592 */
Kojto 99:dbbf35b96557 593 #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR |= (RTC_TAFCR_TAMP2E))
Kojto 99:dbbf35b96557 594
Kojto 99:dbbf35b96557 595 /**
Kojto 99:dbbf35b96557 596 * @brief Disable the RTC Tamper2 input detection.
Kojto 99:dbbf35b96557 597 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 598 * @retval None
Kojto 99:dbbf35b96557 599 */
Kojto 99:dbbf35b96557 600 #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAFCR &= ~(RTC_TAFCR_TAMP2E))
Kojto 99:dbbf35b96557 601
Kojto 99:dbbf35b96557 602 /**
Kojto 99:dbbf35b96557 603 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
Kojto 99:dbbf35b96557 604 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 605 * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check.
Kojto 99:dbbf35b96557 606 * This parameter can be:
Kojto 99:dbbf35b96557 607 * @arg RTC_IT_TAMP1
Kojto 99:dbbf35b96557 608 * @arg RTC_IT_TAMP2
Kojto 99:dbbf35b96557 609 * @retval None
Kojto 99:dbbf35b96557 610 */
Kojto 99:dbbf35b96557 611 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 612
Kojto 99:dbbf35b96557 613 /**
Kojto 99:dbbf35b96557 614 * @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
Kojto 99:dbbf35b96557 615 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 616 * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check.
Kojto 99:dbbf35b96557 617 * This parameter can be:
Kojto 99:dbbf35b96557 618 * @arg RTC_IT_TAMP: Tamper interrupt
Kojto 99:dbbf35b96557 619 * @retval None
Kojto 99:dbbf35b96557 620 */
Kojto 99:dbbf35b96557 621 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAFCR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
Kojto 99:dbbf35b96557 622
Kojto 99:dbbf35b96557 623 /**
Kojto 99:dbbf35b96557 624 * @brief Get the selected RTC Tamper's flag status.
Kojto 99:dbbf35b96557 625 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 626 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
Kojto 99:dbbf35b96557 627 * This parameter can be:
Kojto 99:dbbf35b96557 628 * @arg RTC_FLAG_TAMP1F
Kojto 99:dbbf35b96557 629 * @arg RTC_FLAG_TAMP2F
Kojto 99:dbbf35b96557 630 * @retval None
Kojto 99:dbbf35b96557 631 */
Kojto 99:dbbf35b96557 632 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
Kojto 99:dbbf35b96557 633
Kojto 99:dbbf35b96557 634 /**
Kojto 99:dbbf35b96557 635 * @brief Clear the RTC Tamper's pending flags.
Kojto 99:dbbf35b96557 636 * @param __HANDLE__: specifies the RTC handle.
Kojto 99:dbbf35b96557 637 * @param __FLAG__: specifies the RTC Tamper Flag to clear.
Kojto 99:dbbf35b96557 638 * This parameter can be:
Kojto 99:dbbf35b96557 639 * @arg RTC_FLAG_TAMP1F
Kojto 99:dbbf35b96557 640 * @arg RTC_FLAG_TAMP2F
Kojto 99:dbbf35b96557 641 * @retval None
Kojto 99:dbbf35b96557 642 */
Kojto 106:ba1f97679dad 643 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
Kojto 99:dbbf35b96557 644 /**
Kojto 99:dbbf35b96557 645 * @}
Kojto 99:dbbf35b96557 646 */
Kojto 99:dbbf35b96557 647
Kojto 99:dbbf35b96557 648 /* --------------------------TAMPER/TIMESTAMP---------------------------------*/
Kojto 99:dbbf35b96557 649 /** @defgroup RTCEx_Tamper_Timestamp EXTI RTC Tamper Timestamp EXTI
Kojto 99:dbbf35b96557 650 * @{
Kojto 99:dbbf35b96557 651 */
Kojto 99:dbbf35b96557 652
Kojto 99:dbbf35b96557 653 /**
Kojto 99:dbbf35b96557 654 * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 655 * @retval None
Kojto 99:dbbf35b96557 656 */
Kojto 99:dbbf35b96557 657 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 658
Kojto 99:dbbf35b96557 659 /**
Kojto 99:dbbf35b96557 660 * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 661 * @retval None
Kojto 99:dbbf35b96557 662 */
Kojto 99:dbbf35b96557 663 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 99:dbbf35b96557 664
Kojto 99:dbbf35b96557 665 /**
Kojto 99:dbbf35b96557 666 * @brief Enable event on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 667 * @retval None.
Kojto 99:dbbf35b96557 668 */
Kojto 99:dbbf35b96557 669 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 670
Kojto 99:dbbf35b96557 671 /**
Kojto 99:dbbf35b96557 672 * @brief Disable event on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 673 * @retval None.
Kojto 99:dbbf35b96557 674 */
Kojto 99:dbbf35b96557 675 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 99:dbbf35b96557 676
Kojto 99:dbbf35b96557 677 /**
Kojto 99:dbbf35b96557 678 * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 679 * @retval None.
Kojto 99:dbbf35b96557 680 */
Kojto 99:dbbf35b96557 681 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 682
Kojto 99:dbbf35b96557 683 /**
Kojto 99:dbbf35b96557 684 * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 685 * @retval None.
Kojto 99:dbbf35b96557 686 */
Kojto 99:dbbf35b96557 687 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 99:dbbf35b96557 688
Kojto 99:dbbf35b96557 689 /**
Kojto 99:dbbf35b96557 690 * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 691 * @retval None.
Kojto 99:dbbf35b96557 692 */
Kojto 99:dbbf35b96557 693 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 694
Kojto 99:dbbf35b96557 695 /**
Kojto 99:dbbf35b96557 696 * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 697 * @retval None.
Kojto 99:dbbf35b96557 698 */
Kojto 99:dbbf35b96557 699 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
Kojto 99:dbbf35b96557 700
Kojto 99:dbbf35b96557 701 /**
Kojto 99:dbbf35b96557 702 * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 703 * @retval None.
Kojto 99:dbbf35b96557 704 */
Kojto 99:dbbf35b96557 705 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE();
Kojto 99:dbbf35b96557 706
Kojto 99:dbbf35b96557 707 /**
Kojto 99:dbbf35b96557 708 * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
Kojto 99:dbbf35b96557 709 * This parameter can be:
Kojto 99:dbbf35b96557 710 * @retval None.
Kojto 99:dbbf35b96557 711 */
Kojto 99:dbbf35b96557 712 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE();
Kojto 99:dbbf35b96557 713
Kojto 99:dbbf35b96557 714 /**
Kojto 99:dbbf35b96557 715 * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not.
Kojto 99:dbbf35b96557 716 * @retval Line Status.
Kojto 99:dbbf35b96557 717 */
Kojto 106:ba1f97679dad 718 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 719
Kojto 99:dbbf35b96557 720 /**
Kojto 99:dbbf35b96557 721 * @brief Clear the RTC Tamper and Timestamp associated Exti line flag.
Kojto 99:dbbf35b96557 722 * @retval None.
Kojto 99:dbbf35b96557 723 */
Kojto 99:dbbf35b96557 724 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 725
Kojto 99:dbbf35b96557 726 /**
Kojto 99:dbbf35b96557 727 * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line
Kojto 99:dbbf35b96557 728 * @retval None.
Kojto 99:dbbf35b96557 729 */
Kojto 99:dbbf35b96557 730 #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
Kojto 99:dbbf35b96557 731 /**
Kojto 99:dbbf35b96557 732 * @}
Kojto 99:dbbf35b96557 733 */
Kojto 99:dbbf35b96557 734
Kojto 99:dbbf35b96557 735 /* ------------------------------Calibration----------------------------------*/
Kojto 99:dbbf35b96557 736 /** @defgroup RTCEx_Calibration RTC Calibration
Kojto 99:dbbf35b96557 737 * @{
Kojto 99:dbbf35b96557 738 */
Kojto 99:dbbf35b96557 739
Kojto 99:dbbf35b96557 740 /**
bogdanm 86:04dd9b1680ae 741 * @brief Enable the Coarse calibration process.
bogdanm 86:04dd9b1680ae 742 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 743 * @retval None
bogdanm 86:04dd9b1680ae 744 */
bogdanm 86:04dd9b1680ae 745 #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE))
bogdanm 86:04dd9b1680ae 746
bogdanm 86:04dd9b1680ae 747 /**
bogdanm 86:04dd9b1680ae 748 * @brief Disable the Coarse calibration process.
bogdanm 86:04dd9b1680ae 749 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 750 * @retval None
bogdanm 86:04dd9b1680ae 751 */
bogdanm 86:04dd9b1680ae 752 #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE))
bogdanm 86:04dd9b1680ae 753
bogdanm 86:04dd9b1680ae 754 /**
bogdanm 86:04dd9b1680ae 755 * @brief Enable the RTC calibration output.
bogdanm 86:04dd9b1680ae 756 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 757 * @retval None
bogdanm 86:04dd9b1680ae 758 */
bogdanm 86:04dd9b1680ae 759 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
bogdanm 86:04dd9b1680ae 760
bogdanm 86:04dd9b1680ae 761 /**
bogdanm 86:04dd9b1680ae 762 * @brief Disable the calibration output.
bogdanm 86:04dd9b1680ae 763 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 764 * @retval None
bogdanm 86:04dd9b1680ae 765 */
bogdanm 86:04dd9b1680ae 766 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
bogdanm 86:04dd9b1680ae 767
bogdanm 86:04dd9b1680ae 768 /**
bogdanm 86:04dd9b1680ae 769 * @brief Enable the clock reference detection.
bogdanm 86:04dd9b1680ae 770 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 771 * @retval None
bogdanm 86:04dd9b1680ae 772 */
bogdanm 86:04dd9b1680ae 773 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
bogdanm 86:04dd9b1680ae 774
bogdanm 86:04dd9b1680ae 775 /**
bogdanm 86:04dd9b1680ae 776 * @brief Disable the clock reference detection.
bogdanm 86:04dd9b1680ae 777 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 778 * @retval None
bogdanm 86:04dd9b1680ae 779 */
bogdanm 86:04dd9b1680ae 780 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
bogdanm 86:04dd9b1680ae 781
bogdanm 86:04dd9b1680ae 782 /**
bogdanm 86:04dd9b1680ae 783 * @brief Get the selected RTC shift operation's flag status.
bogdanm 86:04dd9b1680ae 784 * @param __HANDLE__: specifies the RTC handle.
bogdanm 86:04dd9b1680ae 785 * @param __FLAG__: specifies the RTC shift operation Flag is pending or not.
bogdanm 86:04dd9b1680ae 786 * This parameter can be:
bogdanm 86:04dd9b1680ae 787 * @arg RTC_FLAG_SHPF
bogdanm 86:04dd9b1680ae 788 * @retval None
bogdanm 86:04dd9b1680ae 789 */
bogdanm 86:04dd9b1680ae 790 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
bogdanm 86:04dd9b1680ae 791 /**
Kojto 99:dbbf35b96557 792 * @}
bogdanm 86:04dd9b1680ae 793 */
bogdanm 86:04dd9b1680ae 794
bogdanm 86:04dd9b1680ae 795 /**
Kojto 99:dbbf35b96557 796 * @}
bogdanm 86:04dd9b1680ae 797 */
bogdanm 86:04dd9b1680ae 798
bogdanm 86:04dd9b1680ae 799 /* Exported functions --------------------------------------------------------*/
Kojto 99:dbbf35b96557 800 /** @defgroup RTCEx_Exported_Functions RTCEx Exported Functions
Kojto 99:dbbf35b96557 801 * @{
Kojto 99:dbbf35b96557 802 */
bogdanm 86:04dd9b1680ae 803
Kojto 99:dbbf35b96557 804 /** @addtogroup RTCEx_Exported_Functions_Group1
Kojto 99:dbbf35b96557 805 * @{
Kojto 99:dbbf35b96557 806 */
bogdanm 86:04dd9b1680ae 807 /* RTC TimeStamp and Tamper functions *****************************************/
bogdanm 86:04dd9b1680ae 808 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
bogdanm 86:04dd9b1680ae 809 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
bogdanm 86:04dd9b1680ae 810 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 811 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
bogdanm 86:04dd9b1680ae 812
bogdanm 86:04dd9b1680ae 813 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
bogdanm 86:04dd9b1680ae 814 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
bogdanm 86:04dd9b1680ae 815 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
Kojto 99:dbbf35b96557 816 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 817
Kojto 99:dbbf35b96557 818 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 819 void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 820 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 821 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
bogdanm 86:04dd9b1680ae 822 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
bogdanm 86:04dd9b1680ae 823 HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 99:dbbf35b96557 824 /**
Kojto 99:dbbf35b96557 825 * @}
Kojto 99:dbbf35b96557 826 */
bogdanm 86:04dd9b1680ae 827
Kojto 99:dbbf35b96557 828 /** @addtogroup RTCEx_Exported_Functions_Group2
Kojto 99:dbbf35b96557 829 * @{
Kojto 99:dbbf35b96557 830 */
bogdanm 86:04dd9b1680ae 831 /* RTC Wake-up functions ******************************************************/
bogdanm 86:04dd9b1680ae 832 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
bogdanm 86:04dd9b1680ae 833 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
Kojto 99:dbbf35b96557 834 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 835 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 836 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 837 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 838 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 99:dbbf35b96557 839 /**
Kojto 99:dbbf35b96557 840 * @}
Kojto 99:dbbf35b96557 841 */
bogdanm 86:04dd9b1680ae 842
Kojto 99:dbbf35b96557 843 /** @addtogroup RTCEx_Exported_Functions_Group3
Kojto 99:dbbf35b96557 844 * @{
Kojto 99:dbbf35b96557 845 */
bogdanm 86:04dd9b1680ae 846 /* Extension Control functions ************************************************/
Kojto 99:dbbf35b96557 847 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
Kojto 99:dbbf35b96557 848 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
bogdanm 86:04dd9b1680ae 849
bogdanm 86:04dd9b1680ae 850 HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value);
bogdanm 86:04dd9b1680ae 851 HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 852 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue);
bogdanm 86:04dd9b1680ae 853 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
bogdanm 86:04dd9b1680ae 854 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
bogdanm 86:04dd9b1680ae 855 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 856 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 857 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 858 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 859 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
Kojto 99:dbbf35b96557 860 /**
Kojto 99:dbbf35b96557 861 * @}
Kojto 99:dbbf35b96557 862 */
bogdanm 86:04dd9b1680ae 863
Kojto 99:dbbf35b96557 864 /** @addtogroup RTCEx_Exported_Functions_Group4
Kojto 99:dbbf35b96557 865 * @{
Kojto 99:dbbf35b96557 866 */
bogdanm 86:04dd9b1680ae 867 /* Extension RTC features functions *******************************************/
Kojto 99:dbbf35b96557 868 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
bogdanm 86:04dd9b1680ae 869 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
Kojto 99:dbbf35b96557 870 /**
Kojto 99:dbbf35b96557 871 * @}
Kojto 99:dbbf35b96557 872 */
bogdanm 86:04dd9b1680ae 873
Kojto 99:dbbf35b96557 874 /**
Kojto 99:dbbf35b96557 875 * @}
Kojto 99:dbbf35b96557 876 */
Kojto 99:dbbf35b96557 877
Kojto 99:dbbf35b96557 878 /* Private types -------------------------------------------------------------*/
Kojto 99:dbbf35b96557 879 /* Private variables ---------------------------------------------------------*/
Kojto 99:dbbf35b96557 880 /* Private constants ---------------------------------------------------------*/
Kojto 99:dbbf35b96557 881 /** @defgroup RTCEx_Private_Constants RTCEx Private Constants
Kojto 99:dbbf35b96557 882 * @{
Kojto 99:dbbf35b96557 883 */
Kojto 99:dbbf35b96557 884 #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT ((uint32_t)EXTI_IMR_MR21) /*!< External interrupt line 21 Connected to the RTC Tamper and Time Stamp events */
Kojto 99:dbbf35b96557 885 #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT ((uint32_t)EXTI_IMR_MR22) /*!< External interrupt line 22 Connected to the RTC Wake-up event */
Kojto 99:dbbf35b96557 886 /**
Kojto 99:dbbf35b96557 887 * @}
Kojto 99:dbbf35b96557 888 */
Kojto 99:dbbf35b96557 889
Kojto 99:dbbf35b96557 890 /* Private macros ------------------------------------------------------------*/
Kojto 99:dbbf35b96557 891 /** @defgroup RTCEx_Private_Macros RTCEx Private Macros
Kojto 99:dbbf35b96557 892 * @{
Kojto 99:dbbf35b96557 893 */
Kojto 99:dbbf35b96557 894
Kojto 99:dbbf35b96557 895 /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters
Kojto 99:dbbf35b96557 896 * @{
Kojto 99:dbbf35b96557 897 */
Kojto 99:dbbf35b96557 898 #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
Kojto 99:dbbf35b96557 899 ((BKP) == RTC_BKP_DR1) || \
Kojto 99:dbbf35b96557 900 ((BKP) == RTC_BKP_DR2) || \
Kojto 99:dbbf35b96557 901 ((BKP) == RTC_BKP_DR3) || \
Kojto 99:dbbf35b96557 902 ((BKP) == RTC_BKP_DR4) || \
Kojto 99:dbbf35b96557 903 ((BKP) == RTC_BKP_DR5) || \
Kojto 99:dbbf35b96557 904 ((BKP) == RTC_BKP_DR6) || \
Kojto 99:dbbf35b96557 905 ((BKP) == RTC_BKP_DR7) || \
Kojto 99:dbbf35b96557 906 ((BKP) == RTC_BKP_DR8) || \
Kojto 99:dbbf35b96557 907 ((BKP) == RTC_BKP_DR9) || \
Kojto 99:dbbf35b96557 908 ((BKP) == RTC_BKP_DR10) || \
Kojto 99:dbbf35b96557 909 ((BKP) == RTC_BKP_DR11) || \
Kojto 99:dbbf35b96557 910 ((BKP) == RTC_BKP_DR12) || \
Kojto 99:dbbf35b96557 911 ((BKP) == RTC_BKP_DR13) || \
Kojto 99:dbbf35b96557 912 ((BKP) == RTC_BKP_DR14) || \
Kojto 99:dbbf35b96557 913 ((BKP) == RTC_BKP_DR15) || \
Kojto 99:dbbf35b96557 914 ((BKP) == RTC_BKP_DR16) || \
Kojto 99:dbbf35b96557 915 ((BKP) == RTC_BKP_DR17) || \
Kojto 99:dbbf35b96557 916 ((BKP) == RTC_BKP_DR18) || \
Kojto 99:dbbf35b96557 917 ((BKP) == RTC_BKP_DR19))
Kojto 99:dbbf35b96557 918 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
Kojto 99:dbbf35b96557 919 ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
Kojto 106:ba1f97679dad 920 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & ((uint32_t)!(RTC_TAFCR_TAMP1E | RTC_TAFCR_TAMP2E))) == 0x00) && ((TAMPER) != (uint32_t)RESET))
Kojto 99:dbbf35b96557 921
Kojto 106:ba1f97679dad 922 #define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_DEFAULT) || \
Kojto 106:ba1f97679dad 923 ((PIN) == RTC_TAMPERPIN_POS1))
Kojto 99:dbbf35b96557 924
Kojto 106:ba1f97679dad 925 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT) || \
Kojto 106:ba1f97679dad 926 ((PIN) == RTC_TIMESTAMPPIN_POS1))
Kojto 106:ba1f97679dad 927
Kojto 99:dbbf35b96557 928 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
Kojto 99:dbbf35b96557 929 ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
Kojto 99:dbbf35b96557 930 ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
Kojto 99:dbbf35b96557 931 ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))
Kojto 99:dbbf35b96557 932 #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \
Kojto 99:dbbf35b96557 933 ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \
Kojto 99:dbbf35b96557 934 ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \
Kojto 99:dbbf35b96557 935 ((FILTER) == RTC_TAMPERFILTER_8SAMPLE))
Kojto 99:dbbf35b96557 936 #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
Kojto 99:dbbf35b96557 937 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
Kojto 99:dbbf35b96557 938 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
Kojto 99:dbbf35b96557 939 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
Kojto 99:dbbf35b96557 940 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
Kojto 99:dbbf35b96557 941 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
Kojto 99:dbbf35b96557 942 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
Kojto 99:dbbf35b96557 943 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
Kojto 99:dbbf35b96557 944 #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
Kojto 99:dbbf35b96557 945 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
Kojto 99:dbbf35b96557 946 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
Kojto 99:dbbf35b96557 947 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
Kojto 99:dbbf35b96557 948 #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
Kojto 99:dbbf35b96557 949 ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
Kojto 99:dbbf35b96557 950 #define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \
Kojto 99:dbbf35b96557 951 ((STATE) == RTC_TAMPER_PULLUP_DISABLE))
Kojto 99:dbbf35b96557 952 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
Kojto 99:dbbf35b96557 953 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
Kojto 99:dbbf35b96557 954 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
Kojto 99:dbbf35b96557 955 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
Kojto 99:dbbf35b96557 956 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
Kojto 99:dbbf35b96557 957 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
Kojto 99:dbbf35b96557 958
Kojto 99:dbbf35b96557 959 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
Kojto 99:dbbf35b96557 960 #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \
Kojto 99:dbbf35b96557 961 ((SIGN) == RTC_CALIBSIGN_NEGATIVE))
Kojto 99:dbbf35b96557 962
Kojto 99:dbbf35b96557 963 #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20)
Kojto 99:dbbf35b96557 964
Kojto 99:dbbf35b96557 965 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
Kojto 99:dbbf35b96557 966 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
Kojto 99:dbbf35b96557 967 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC))
Kojto 99:dbbf35b96557 968 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
Kojto 99:dbbf35b96557 969 ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
Kojto 99:dbbf35b96557 970
Kojto 99:dbbf35b96557 971
Kojto 99:dbbf35b96557 972 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF)
Kojto 99:dbbf35b96557 973 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \
Kojto 99:dbbf35b96557 974 ((SEL) == RTC_SHIFTADD1S_SET))
Kojto 99:dbbf35b96557 975 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF)
Kojto 99:dbbf35b96557 976 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \
Kojto 99:dbbf35b96557 977 ((OUTPUT) == RTC_CALIBOUTPUT_1HZ))
Kojto 99:dbbf35b96557 978 /**
Kojto 99:dbbf35b96557 979 * @}
Kojto 99:dbbf35b96557 980 */
Kojto 99:dbbf35b96557 981
Kojto 99:dbbf35b96557 982 /**
Kojto 99:dbbf35b96557 983 * @}
Kojto 99:dbbf35b96557 984 */
bogdanm 86:04dd9b1680ae 985
bogdanm 86:04dd9b1680ae 986 /**
bogdanm 86:04dd9b1680ae 987 * @}
bogdanm 86:04dd9b1680ae 988 */
bogdanm 86:04dd9b1680ae 989
bogdanm 86:04dd9b1680ae 990 /**
bogdanm 86:04dd9b1680ae 991 * @}
bogdanm 86:04dd9b1680ae 992 */
bogdanm 86:04dd9b1680ae 993
bogdanm 86:04dd9b1680ae 994 #ifdef __cplusplus
bogdanm 86:04dd9b1680ae 995 }
bogdanm 86:04dd9b1680ae 996 #endif
bogdanm 86:04dd9b1680ae 997
bogdanm 86:04dd9b1680ae 998 #endif /* __STM32F4xx_HAL_RTC_EX_H */
bogdanm 86:04dd9b1680ae 999
bogdanm 86:04dd9b1680ae 1000 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/