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 stm32f4xx_hal_rtc_ex.h
tushki7 0:60d829a0353a 4 * @author MCD Application Team
tushki7 0:60d829a0353a 5 * @version V1.1.0
tushki7 0:60d829a0353a 6 * @date 19-June-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 __STM32F4xx_HAL_RTC_EX_H
tushki7 0:60d829a0353a 40 #define __STM32F4xx_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 "stm32f4xx_hal_def.h"
tushki7 0:60d829a0353a 48
tushki7 0:60d829a0353a 49 /** @addtogroup STM32F4xx_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
tushki7 0:60d829a0353a 59 /**
tushki7 0:60d829a0353a 60 * @brief RTC Tamper structure definition
tushki7 0:60d829a0353a 61 */
tushki7 0:60d829a0353a 62 typedef struct
tushki7 0:60d829a0353a 63 {
tushki7 0:60d829a0353a 64 uint32_t Tamper; /*!< Specifies the Tamper Pin.
tushki7 0:60d829a0353a 65 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
tushki7 0:60d829a0353a 66
tushki7 0:60d829a0353a 67 uint32_t PinSelection; /*!< Specifies the Tamper Pin.
tushki7 0:60d829a0353a 68 This parameter can be a value of @ref RTCEx_Tamper_Pins_Selection */
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 uint32_t Filter; /*!< Specifies the RTC Filter Tamper.
tushki7 0:60d829a0353a 74 This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */
tushki7 0:60d829a0353a 75
tushki7 0:60d829a0353a 76 uint32_t SamplingFrequency; /*!< Specifies the sampling frequency.
tushki7 0:60d829a0353a 77 This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */
tushki7 0:60d829a0353a 78
tushki7 0:60d829a0353a 79 uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration .
tushki7 0:60d829a0353a 80 This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */
tushki7 0:60d829a0353a 81
tushki7 0:60d829a0353a 82 uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp .
tushki7 0:60d829a0353a 83 This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */
tushki7 0:60d829a0353a 84
tushki7 0:60d829a0353a 85 uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection.
tushki7 0:60d829a0353a 86 This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */
tushki7 0:60d829a0353a 87 }RTC_TamperTypeDef;
tushki7 0:60d829a0353a 88
tushki7 0:60d829a0353a 89 /* Exported constants --------------------------------------------------------*/
tushki7 0:60d829a0353a 90 /** @defgroup RTCEx_Exported_Constants
tushki7 0:60d829a0353a 91 * @{
tushki7 0:60d829a0353a 92 */
tushki7 0:60d829a0353a 93
tushki7 0:60d829a0353a 94 /** @defgroup RTCEx_Backup_Registers_Definitions
tushki7 0:60d829a0353a 95 * @{
tushki7 0:60d829a0353a 96 */
tushki7 0:60d829a0353a 97 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
tushki7 0:60d829a0353a 98 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
tushki7 0:60d829a0353a 99 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
tushki7 0:60d829a0353a 100 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
tushki7 0:60d829a0353a 101 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
tushki7 0:60d829a0353a 102 #define RTC_BKP_DR5 ((uint32_t)0x00000005)
tushki7 0:60d829a0353a 103 #define RTC_BKP_DR6 ((uint32_t)0x00000006)
tushki7 0:60d829a0353a 104 #define RTC_BKP_DR7 ((uint32_t)0x00000007)
tushki7 0:60d829a0353a 105 #define RTC_BKP_DR8 ((uint32_t)0x00000008)
tushki7 0:60d829a0353a 106 #define RTC_BKP_DR9 ((uint32_t)0x00000009)
tushki7 0:60d829a0353a 107 #define RTC_BKP_DR10 ((uint32_t)0x0000000A)
tushki7 0:60d829a0353a 108 #define RTC_BKP_DR11 ((uint32_t)0x0000000B)
tushki7 0:60d829a0353a 109 #define RTC_BKP_DR12 ((uint32_t)0x0000000C)
tushki7 0:60d829a0353a 110 #define RTC_BKP_DR13 ((uint32_t)0x0000000D)
tushki7 0:60d829a0353a 111 #define RTC_BKP_DR14 ((uint32_t)0x0000000E)
tushki7 0:60d829a0353a 112 #define RTC_BKP_DR15 ((uint32_t)0x0000000F)
tushki7 0:60d829a0353a 113 #define RTC_BKP_DR16 ((uint32_t)0x00000010)
tushki7 0:60d829a0353a 114 #define RTC_BKP_DR17 ((uint32_t)0x00000011)
tushki7 0:60d829a0353a 115 #define RTC_BKP_DR18 ((uint32_t)0x00000012)
tushki7 0:60d829a0353a 116 #define RTC_BKP_DR19 ((uint32_t)0x00000013)
tushki7 0:60d829a0353a 117
tushki7 0:60d829a0353a 118 #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
tushki7 0:60d829a0353a 119 ((BKP) == RTC_BKP_DR1) || \
tushki7 0:60d829a0353a 120 ((BKP) == RTC_BKP_DR2) || \
tushki7 0:60d829a0353a 121 ((BKP) == RTC_BKP_DR3) || \
tushki7 0:60d829a0353a 122 ((BKP) == RTC_BKP_DR4) || \
tushki7 0:60d829a0353a 123 ((BKP) == RTC_BKP_DR5) || \
tushki7 0:60d829a0353a 124 ((BKP) == RTC_BKP_DR6) || \
tushki7 0:60d829a0353a 125 ((BKP) == RTC_BKP_DR7) || \
tushki7 0:60d829a0353a 126 ((BKP) == RTC_BKP_DR8) || \
tushki7 0:60d829a0353a 127 ((BKP) == RTC_BKP_DR9) || \
tushki7 0:60d829a0353a 128 ((BKP) == RTC_BKP_DR10) || \
tushki7 0:60d829a0353a 129 ((BKP) == RTC_BKP_DR11) || \
tushki7 0:60d829a0353a 130 ((BKP) == RTC_BKP_DR12) || \
tushki7 0:60d829a0353a 131 ((BKP) == RTC_BKP_DR13) || \
tushki7 0:60d829a0353a 132 ((BKP) == RTC_BKP_DR14) || \
tushki7 0:60d829a0353a 133 ((BKP) == RTC_BKP_DR15) || \
tushki7 0:60d829a0353a 134 ((BKP) == RTC_BKP_DR16) || \
tushki7 0:60d829a0353a 135 ((BKP) == RTC_BKP_DR17) || \
tushki7 0:60d829a0353a 136 ((BKP) == RTC_BKP_DR18) || \
tushki7 0:60d829a0353a 137 ((BKP) == RTC_BKP_DR19))
tushki7 0:60d829a0353a 138 /**
tushki7 0:60d829a0353a 139 * @}
tushki7 0:60d829a0353a 140 */
tushki7 0:60d829a0353a 141
tushki7 0:60d829a0353a 142 /** @defgroup RTCEx_Time_Stamp_Edges_definitions
tushki7 0:60d829a0353a 143 * @{
tushki7 0:60d829a0353a 144 */
tushki7 0:60d829a0353a 145 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000)
tushki7 0:60d829a0353a 146 #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008)
tushki7 0:60d829a0353a 147
tushki7 0:60d829a0353a 148 #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
tushki7 0:60d829a0353a 149 ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
tushki7 0:60d829a0353a 150 /**
tushki7 0:60d829a0353a 151 * @}
tushki7 0:60d829a0353a 152 */
tushki7 0:60d829a0353a 153
tushki7 0:60d829a0353a 154 /** @defgroup RTCEx_Tamper_Pins_Definitions
tushki7 0:60d829a0353a 155 * @{
tushki7 0:60d829a0353a 156 */
tushki7 0:60d829a0353a 157 #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E
tushki7 0:60d829a0353a 158 #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E
tushki7 0:60d829a0353a 159
tushki7 0:60d829a0353a 160 #define IS_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFF6) == 0x00) && ((TAMPER) != (uint32_t)RESET))
tushki7 0:60d829a0353a 161 /**
tushki7 0:60d829a0353a 162 * @}
tushki7 0:60d829a0353a 163 */
tushki7 0:60d829a0353a 164
tushki7 0:60d829a0353a 165 /** @defgroup RTCEx_Tamper_Pins_Selection
tushki7 0:60d829a0353a 166 * @{
tushki7 0:60d829a0353a 167 */
tushki7 0:60d829a0353a 168 #define RTC_TAMPERPIN_PC13 ((uint32_t)0x00000000)
tushki7 0:60d829a0353a 169 #define RTC_TAMPERPIN_PI8 ((uint32_t)0x00010000)
tushki7 0:60d829a0353a 170
tushki7 0:60d829a0353a 171 #define IS_RTC_TAMPER_PIN(PIN) (((PIN) == RTC_TAMPERPIN_PC13) || \
tushki7 0:60d829a0353a 172 ((PIN) == RTC_TAMPERPIN_PI8))
tushki7 0:60d829a0353a 173 /**
tushki7 0:60d829a0353a 174 * @}
tushki7 0:60d829a0353a 175 */
tushki7 0:60d829a0353a 176
tushki7 0:60d829a0353a 177 /** @defgroup RTCEx_TimeStamp_Pin_Selection
tushki7 0:60d829a0353a 178 * @{
tushki7 0:60d829a0353a 179 */
tushki7 0:60d829a0353a 180 #define RTC_TIMESTAMPPIN_PC13 ((uint32_t)0x00000000)
tushki7 0:60d829a0353a 181 #define RTC_TIMESTAMPPIN_PI8 ((uint32_t)0x00020000)
tushki7 0:60d829a0353a 182
tushki7 0:60d829a0353a 183 #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_PC13) || \
tushki7 0:60d829a0353a 184 ((PIN) == RTC_TIMESTAMPPIN_PI8))
tushki7 0:60d829a0353a 185 /**
tushki7 0:60d829a0353a 186 * @}
tushki7 0:60d829a0353a 187 */
tushki7 0:60d829a0353a 188
tushki7 0:60d829a0353a 189 /** @defgroup RTCEx_Tamper_Trigger_Definitions
tushki7 0:60d829a0353a 190 * @{
tushki7 0:60d829a0353a 191 */
tushki7 0:60d829a0353a 192 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
tushki7 0:60d829a0353a 193 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002)
tushki7 0:60d829a0353a 194 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
tushki7 0:60d829a0353a 195 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
tushki7 0:60d829a0353a 196
tushki7 0:60d829a0353a 197 #define IS_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
tushki7 0:60d829a0353a 198 ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
tushki7 0:60d829a0353a 199 ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
tushki7 0:60d829a0353a 200 ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))
tushki7 0:60d829a0353a 201
tushki7 0:60d829a0353a 202 /**
tushki7 0:60d829a0353a 203 * @}
tushki7 0:60d829a0353a 204 */
tushki7 0:60d829a0353a 205
tushki7 0:60d829a0353a 206 /** @defgroup RTCEx_Tamper_Filter_Definitions
tushki7 0:60d829a0353a 207 * @{
tushki7 0:60d829a0353a 208 */
tushki7 0:60d829a0353a 209 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
tushki7 0:60d829a0353a 210
tushki7 0:60d829a0353a 211 #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2
tushki7 0:60d829a0353a 212 consecutive samples at the active level */
tushki7 0:60d829a0353a 213 #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4
tushki7 0:60d829a0353a 214 consecutive samples at the active level */
tushki7 0:60d829a0353a 215 #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8
tushki7 0:60d829a0353a 216 consecutive samples at the active leve. */
tushki7 0:60d829a0353a 217
tushki7 0:60d829a0353a 218 #define IS_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \
tushki7 0:60d829a0353a 219 ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \
tushki7 0:60d829a0353a 220 ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \
tushki7 0:60d829a0353a 221 ((FILTER) == RTC_TAMPERFILTER_8SAMPLE))
tushki7 0:60d829a0353a 222 /**
tushki7 0:60d829a0353a 223 * @}
tushki7 0:60d829a0353a 224 */
tushki7 0:60d829a0353a 225
tushki7 0:60d829a0353a 226 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions
tushki7 0:60d829a0353a 227 * @{
tushki7 0:60d829a0353a 228 */
tushki7 0:60d829a0353a 229 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
tushki7 0:60d829a0353a 230 with a frequency = RTCCLK / 32768 */
tushki7 0:60d829a0353a 231 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled
tushki7 0:60d829a0353a 232 with a frequency = RTCCLK / 16384 */
tushki7 0:60d829a0353a 233 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
tushki7 0:60d829a0353a 234 with a frequency = RTCCLK / 8192 */
tushki7 0:60d829a0353a 235 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
tushki7 0:60d829a0353a 236 with a frequency = RTCCLK / 4096 */
tushki7 0:60d829a0353a 237 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
tushki7 0:60d829a0353a 238 with a frequency = RTCCLK / 2048 */
tushki7 0:60d829a0353a 239 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
tushki7 0:60d829a0353a 240 with a frequency = RTCCLK / 1024 */
tushki7 0:60d829a0353a 241 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
tushki7 0:60d829a0353a 242 with a frequency = RTCCLK / 512 */
tushki7 0:60d829a0353a 243 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
tushki7 0:60d829a0353a 244 with a frequency = RTCCLK / 256 */
tushki7 0:60d829a0353a 245
tushki7 0:60d829a0353a 246 #define IS_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
tushki7 0:60d829a0353a 247 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
tushki7 0:60d829a0353a 248 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
tushki7 0:60d829a0353a 249 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
tushki7 0:60d829a0353a 250 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
tushki7 0:60d829a0353a 251 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
tushki7 0:60d829a0353a 252 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
tushki7 0:60d829a0353a 253 ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
tushki7 0:60d829a0353a 254 /**
tushki7 0:60d829a0353a 255 * @}
tushki7 0:60d829a0353a 256 */
tushki7 0:60d829a0353a 257
tushki7 0:60d829a0353a 258 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions
tushki7 0:60d829a0353a 259 * @{
tushki7 0:60d829a0353a 260 */
tushki7 0:60d829a0353a 261 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
tushki7 0:60d829a0353a 262 sampling during 1 RTCCLK cycle */
tushki7 0:60d829a0353a 263 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
tushki7 0:60d829a0353a 264 sampling during 2 RTCCLK cycles */
tushki7 0:60d829a0353a 265 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
tushki7 0:60d829a0353a 266 sampling during 4 RTCCLK cycles */
tushki7 0:60d829a0353a 267 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
tushki7 0:60d829a0353a 268 sampling during 8 RTCCLK cycles */
tushki7 0:60d829a0353a 269
tushki7 0:60d829a0353a 270 #define IS_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
tushki7 0:60d829a0353a 271 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
tushki7 0:60d829a0353a 272 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
tushki7 0:60d829a0353a 273 ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
tushki7 0:60d829a0353a 274 /**
tushki7 0:60d829a0353a 275 * @}
tushki7 0:60d829a0353a 276 */
tushki7 0:60d829a0353a 277
tushki7 0:60d829a0353a 278 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions
tushki7 0:60d829a0353a 279 * @{
tushki7 0:60d829a0353a 280 */
tushki7 0:60d829a0353a 281 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */
tushki7 0:60d829a0353a 282 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
tushki7 0:60d829a0353a 283
tushki7 0:60d829a0353a 284 #define IS_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
tushki7 0:60d829a0353a 285 ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
tushki7 0:60d829a0353a 286 /**
tushki7 0:60d829a0353a 287 * @}
tushki7 0:60d829a0353a 288 */
tushki7 0:60d829a0353a 289
tushki7 0:60d829a0353a 290 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions
tushki7 0:60d829a0353a 291 * @{
tushki7 0:60d829a0353a 292 */
tushki7 0:60d829a0353a 293 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event saved */
tushki7 0:60d829a0353a 294 #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */
tushki7 0:60d829a0353a 295
tushki7 0:60d829a0353a 296 #define IS_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \
tushki7 0:60d829a0353a 297 ((STATE) == RTC_TAMPER_PULLUP_DISABLE))
tushki7 0:60d829a0353a 298 /**
tushki7 0:60d829a0353a 299 * @}
tushki7 0:60d829a0353a 300 */
tushki7 0:60d829a0353a 301
tushki7 0:60d829a0353a 302 /** @defgroup RTCEx_Wakeup_Timer_Definitions
tushki7 0:60d829a0353a 303 * @{
tushki7 0:60d829a0353a 304 */
tushki7 0:60d829a0353a 305 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
tushki7 0:60d829a0353a 306 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001)
tushki7 0:60d829a0353a 307 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002)
tushki7 0:60d829a0353a 308 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003)
tushki7 0:60d829a0353a 309 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004)
tushki7 0:60d829a0353a 310 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006)
tushki7 0:60d829a0353a 311
tushki7 0:60d829a0353a 312 #define IS_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
tushki7 0:60d829a0353a 313 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
tushki7 0:60d829a0353a 314 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
tushki7 0:60d829a0353a 315 ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
tushki7 0:60d829a0353a 316 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
tushki7 0:60d829a0353a 317 ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
tushki7 0:60d829a0353a 318
tushki7 0:60d829a0353a 319 #define IS_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
tushki7 0:60d829a0353a 320 /**
tushki7 0:60d829a0353a 321 * @}
tushki7 0:60d829a0353a 322 */
tushki7 0:60d829a0353a 323
tushki7 0:60d829a0353a 324 /** @defgroup RTCEx_Digital_Calibration_Definitions
tushki7 0:60d829a0353a 325 * @{
tushki7 0:60d829a0353a 326 */
tushki7 0:60d829a0353a 327 #define RTC_CALIBSIGN_POSITIVE ((uint32_t)0x00000000)
tushki7 0:60d829a0353a 328 #define RTC_CALIBSIGN_NEGATIVE ((uint32_t)0x00000080)
tushki7 0:60d829a0353a 329
tushki7 0:60d829a0353a 330 #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \
tushki7 0:60d829a0353a 331 ((SIGN) == RTC_CALIBSIGN_NEGATIVE))
tushki7 0:60d829a0353a 332
tushki7 0:60d829a0353a 333 #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20)
tushki7 0:60d829a0353a 334 /**
tushki7 0:60d829a0353a 335 * @}
tushki7 0:60d829a0353a 336 */
tushki7 0:60d829a0353a 337
tushki7 0:60d829a0353a 338 /** @defgroup RTCEx_Smooth_calib_period_Definitions
tushki7 0:60d829a0353a 339 * @{
tushki7 0:60d829a0353a 340 */
tushki7 0:60d829a0353a 341 #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
tushki7 0:60d829a0353a 342 period is 32s, else 2exp20 RTCCLK seconds */
tushki7 0:60d829a0353a 343 #define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
tushki7 0:60d829a0353a 344 period is 16s, else 2exp19 RTCCLK seconds */
tushki7 0:60d829a0353a 345 #define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
tushki7 0:60d829a0353a 346 period is 8s, else 2exp18 RTCCLK seconds */
tushki7 0:60d829a0353a 347
tushki7 0:60d829a0353a 348 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
tushki7 0:60d829a0353a 349 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
tushki7 0:60d829a0353a 350 ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC))
tushki7 0:60d829a0353a 351 /**
tushki7 0:60d829a0353a 352 * @}
tushki7 0:60d829a0353a 353 */
tushki7 0:60d829a0353a 354
tushki7 0:60d829a0353a 355 /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions
tushki7 0:60d829a0353a 356 * @{
tushki7 0:60d829a0353a 357 */
tushki7 0:60d829a0353a 358 #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added
tushki7 0:60d829a0353a 359 during a X -second window = Y - CALM[8:0]
tushki7 0:60d829a0353a 360 with Y = 512, 256, 128 when X = 32, 16, 8 */
tushki7 0:60d829a0353a 361 #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
tushki7 0:60d829a0353a 362 during a 32-second window = CALM[8:0] */
tushki7 0:60d829a0353a 363
tushki7 0:60d829a0353a 364 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
tushki7 0:60d829a0353a 365 ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
tushki7 0:60d829a0353a 366 /**
tushki7 0:60d829a0353a 367 * @}
tushki7 0:60d829a0353a 368 */
tushki7 0:60d829a0353a 369
tushki7 0:60d829a0353a 370 /** @defgroup RTCEx_Smooth_calib_Minus_pulses_Definitions
tushki7 0:60d829a0353a 371 * @{
tushki7 0:60d829a0353a 372 */
tushki7 0:60d829a0353a 373 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF)
tushki7 0:60d829a0353a 374 /**
tushki7 0:60d829a0353a 375 * @}
tushki7 0:60d829a0353a 376 */
tushki7 0:60d829a0353a 377
tushki7 0:60d829a0353a 378 /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions
tushki7 0:60d829a0353a 379 * @{
tushki7 0:60d829a0353a 380 */
tushki7 0:60d829a0353a 381 #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000)
tushki7 0:60d829a0353a 382 #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000)
tushki7 0:60d829a0353a 383
tushki7 0:60d829a0353a 384 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \
tushki7 0:60d829a0353a 385 ((SEL) == RTC_SHIFTADD1S_SET))
tushki7 0:60d829a0353a 386 /**
tushki7 0:60d829a0353a 387 * @}
tushki7 0:60d829a0353a 388 */
tushki7 0:60d829a0353a 389
tushki7 0:60d829a0353a 390 /** @defgroup RTCEx_Substract_Fraction_Of_Second_Value
tushki7 0:60d829a0353a 391 * @{
tushki7 0:60d829a0353a 392 */
tushki7 0:60d829a0353a 393 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF)
tushki7 0:60d829a0353a 394 /**
tushki7 0:60d829a0353a 395 * @}
tushki7 0:60d829a0353a 396 */
tushki7 0:60d829a0353a 397
tushki7 0:60d829a0353a 398 /** @defgroup RTCEx_Calib_Output_selection_Definitions
tushki7 0:60d829a0353a 399 * @{
tushki7 0:60d829a0353a 400 */
tushki7 0:60d829a0353a 401 #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000)
tushki7 0:60d829a0353a 402 #define RTC_CALIBOUTPUT_1HZ ((uint32_t)0x00080000)
tushki7 0:60d829a0353a 403
tushki7 0:60d829a0353a 404 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \
tushki7 0:60d829a0353a 405 ((OUTPUT) == RTC_CALIBOUTPUT_1HZ))
tushki7 0:60d829a0353a 406 /**
tushki7 0:60d829a0353a 407 * @}
tushki7 0:60d829a0353a 408 */
tushki7 0:60d829a0353a 409
tushki7 0:60d829a0353a 410 /**
tushki7 0:60d829a0353a 411 * @}
tushki7 0:60d829a0353a 412 */
tushki7 0:60d829a0353a 413
tushki7 0:60d829a0353a 414 /* Exported macro ------------------------------------------------------------*/
tushki7 0:60d829a0353a 415
tushki7 0:60d829a0353a 416 /**
tushki7 0:60d829a0353a 417 * @brief Enable the RTC WakeUp Timer peripheral.
tushki7 0:60d829a0353a 418 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 419 * @retval None
tushki7 0:60d829a0353a 420 */
tushki7 0:60d829a0353a 421 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
tushki7 0:60d829a0353a 422
tushki7 0:60d829a0353a 423 /**
tushki7 0:60d829a0353a 424 * @brief Enable the RTC TimeStamp peripheral.
tushki7 0:60d829a0353a 425 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 426 * @retval None
tushki7 0:60d829a0353a 427 */
tushki7 0:60d829a0353a 428 #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
tushki7 0:60d829a0353a 429
tushki7 0:60d829a0353a 430 /**
tushki7 0:60d829a0353a 431 * @brief Disable the RTC WakeUp Timer peripheral.
tushki7 0:60d829a0353a 432 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 433 * @retval None
tushki7 0:60d829a0353a 434 */
tushki7 0:60d829a0353a 435 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
tushki7 0:60d829a0353a 436
tushki7 0:60d829a0353a 437 /**
tushki7 0:60d829a0353a 438 * @brief Disable the RTC TimeStamp peripheral.
tushki7 0:60d829a0353a 439 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 440 * @retval None
tushki7 0:60d829a0353a 441 */
tushki7 0:60d829a0353a 442 #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
tushki7 0:60d829a0353a 443
tushki7 0:60d829a0353a 444 /**
tushki7 0:60d829a0353a 445 * @brief Enable the Coarse calibration process.
tushki7 0:60d829a0353a 446 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 447 * @retval None
tushki7 0:60d829a0353a 448 */
tushki7 0:60d829a0353a 449 #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE))
tushki7 0:60d829a0353a 450
tushki7 0:60d829a0353a 451 /**
tushki7 0:60d829a0353a 452 * @brief Disable the Coarse calibration process.
tushki7 0:60d829a0353a 453 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 454 * @retval None
tushki7 0:60d829a0353a 455 */
tushki7 0:60d829a0353a 456 #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE))
tushki7 0:60d829a0353a 457
tushki7 0:60d829a0353a 458 /**
tushki7 0:60d829a0353a 459 * @brief Enable the RTC calibration output.
tushki7 0:60d829a0353a 460 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 461 * @retval None
tushki7 0:60d829a0353a 462 */
tushki7 0:60d829a0353a 463 #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
tushki7 0:60d829a0353a 464
tushki7 0:60d829a0353a 465 /**
tushki7 0:60d829a0353a 466 * @brief Disable the calibration output.
tushki7 0:60d829a0353a 467 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 468 * @retval None
tushki7 0:60d829a0353a 469 */
tushki7 0:60d829a0353a 470 #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
tushki7 0:60d829a0353a 471
tushki7 0:60d829a0353a 472 /**
tushki7 0:60d829a0353a 473 * @brief Enable the clock reference detection.
tushki7 0:60d829a0353a 474 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 475 * @retval None
tushki7 0:60d829a0353a 476 */
tushki7 0:60d829a0353a 477 #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
tushki7 0:60d829a0353a 478
tushki7 0:60d829a0353a 479 /**
tushki7 0:60d829a0353a 480 * @brief Disable the clock reference detection.
tushki7 0:60d829a0353a 481 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 482 * @retval None
tushki7 0:60d829a0353a 483 */
tushki7 0:60d829a0353a 484 #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
tushki7 0:60d829a0353a 485
tushki7 0:60d829a0353a 486 /**
tushki7 0:60d829a0353a 487 * @brief Enable the RTC TimeStamp interrupt.
tushki7 0:60d829a0353a 488 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 489 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
tushki7 0:60d829a0353a 490 * This parameter can be:
tushki7 0:60d829a0353a 491 * @arg RTC_IT_TS: TimeStamp interrupt
tushki7 0:60d829a0353a 492 * @retval None
tushki7 0:60d829a0353a 493 */
tushki7 0:60d829a0353a 494 #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
tushki7 0:60d829a0353a 495
tushki7 0:60d829a0353a 496 /**
tushki7 0:60d829a0353a 497 * @brief Enable the RTC WakeUpTimer interrupt.
tushki7 0:60d829a0353a 498 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 499 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
tushki7 0:60d829a0353a 500 * This parameter can be:
tushki7 0:60d829a0353a 501 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
tushki7 0:60d829a0353a 502 * @retval None
tushki7 0:60d829a0353a 503 */
tushki7 0:60d829a0353a 504 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
tushki7 0:60d829a0353a 505
tushki7 0:60d829a0353a 506 /**
tushki7 0:60d829a0353a 507 * @brief Disable the RTC TimeStamp interrupt.
tushki7 0:60d829a0353a 508 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 509 * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
tushki7 0:60d829a0353a 510 * This parameter can be:
tushki7 0:60d829a0353a 511 * @arg RTC_IT_TS: TimeStamp interrupt
tushki7 0:60d829a0353a 512 * @retval None
tushki7 0:60d829a0353a 513 */
tushki7 0:60d829a0353a 514 #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
tushki7 0:60d829a0353a 515
tushki7 0:60d829a0353a 516 /**
tushki7 0:60d829a0353a 517 * @brief Disable the RTC WakeUpTimer interrupt.
tushki7 0:60d829a0353a 518 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 519 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
tushki7 0:60d829a0353a 520 * This parameter can be:
tushki7 0:60d829a0353a 521 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
tushki7 0:60d829a0353a 522 * @retval None
tushki7 0:60d829a0353a 523 */
tushki7 0:60d829a0353a 524 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
tushki7 0:60d829a0353a 525
tushki7 0:60d829a0353a 526 /**
tushki7 0:60d829a0353a 527 * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
tushki7 0:60d829a0353a 528 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 529 * @param __FLAG__: specifies the RTC Tamper interrupt sources to be enabled or disabled.
tushki7 0:60d829a0353a 530 * This parameter can be:
tushki7 0:60d829a0353a 531 * @arg RTC_IT_TAMP1
tushki7 0:60d829a0353a 532 * @retval None
tushki7 0:60d829a0353a 533 */
tushki7 0:60d829a0353a 534 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
tushki7 0:60d829a0353a 535
tushki7 0:60d829a0353a 536 /**
tushki7 0:60d829a0353a 537 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
tushki7 0:60d829a0353a 538 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 539 * @param __FLAG__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
tushki7 0:60d829a0353a 540 * This parameter can be:
tushki7 0:60d829a0353a 541 * @arg RTC_IT_WUT: WakeUpTimer A interrupt
tushki7 0:60d829a0353a 542 * @retval None
tushki7 0:60d829a0353a 543 */
tushki7 0:60d829a0353a 544 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
tushki7 0:60d829a0353a 545
tushki7 0:60d829a0353a 546 /**
tushki7 0:60d829a0353a 547 * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
tushki7 0:60d829a0353a 548 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 549 * @param __FLAG__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
tushki7 0:60d829a0353a 550 * This parameter can be:
tushki7 0:60d829a0353a 551 * @arg RTC_IT_TS: TimeStamp interrupt
tushki7 0:60d829a0353a 552 * @retval None
tushki7 0:60d829a0353a 553 */
tushki7 0:60d829a0353a 554 #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
tushki7 0:60d829a0353a 555
tushki7 0:60d829a0353a 556 /**
tushki7 0:60d829a0353a 557 * @brief Get the selected RTC TimeStamp's flag status.
tushki7 0:60d829a0353a 558 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 559 * @param __FLAG__: specifies the RTC TimeStamp Flag sources to be enabled or disabled.
tushki7 0:60d829a0353a 560 * This parameter can be:
tushki7 0:60d829a0353a 561 * @arg RTC_FLAG_TSF
tushki7 0:60d829a0353a 562 * @arg RTC_FLAG_TSOVF
tushki7 0:60d829a0353a 563 * @retval None
tushki7 0:60d829a0353a 564 */
tushki7 0:60d829a0353a 565 #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
tushki7 0:60d829a0353a 566
tushki7 0:60d829a0353a 567 /**
tushki7 0:60d829a0353a 568 * @brief Get the selected RTC WakeUpTimer's flag status.
tushki7 0:60d829a0353a 569 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 570 * @param __FLAG__: specifies the RTC WakeUpTimer Flag sources to be enabled or disabled.
tushki7 0:60d829a0353a 571 * This parameter can be:
tushki7 0:60d829a0353a 572 * @arg RTC_FLAG_WUTF
tushki7 0:60d829a0353a 573 * @arg RTC_FLAG_WUTWF
tushki7 0:60d829a0353a 574 * @retval None
tushki7 0:60d829a0353a 575 */
tushki7 0:60d829a0353a 576 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
tushki7 0:60d829a0353a 577
tushki7 0:60d829a0353a 578 /**
tushki7 0:60d829a0353a 579 * @brief Get the selected RTC Tamper's flag status.
tushki7 0:60d829a0353a 580 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 581 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
tushki7 0:60d829a0353a 582 * This parameter can be:
tushki7 0:60d829a0353a 583 * @arg RTC_FLAG_TAMP1F
tushki7 0:60d829a0353a 584 * @retval None
tushki7 0:60d829a0353a 585 */
tushki7 0:60d829a0353a 586 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
tushki7 0:60d829a0353a 587
tushki7 0:60d829a0353a 588 /**
tushki7 0:60d829a0353a 589 * @brief Get the selected RTC shift operation's flag status.
tushki7 0:60d829a0353a 590 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 591 * @param __FLAG__: specifies the RTC shift operation Flag is pending or not.
tushki7 0:60d829a0353a 592 * This parameter can be:
tushki7 0:60d829a0353a 593 * @arg RTC_FLAG_SHPF
tushki7 0:60d829a0353a 594 * @retval None
tushki7 0:60d829a0353a 595 */
tushki7 0:60d829a0353a 596 #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
tushki7 0:60d829a0353a 597
tushki7 0:60d829a0353a 598 /**
tushki7 0:60d829a0353a 599 * @brief Clear the RTC Time Stamp's pending flags.
tushki7 0:60d829a0353a 600 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 601 * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
tushki7 0:60d829a0353a 602 * This parameter can be:
tushki7 0:60d829a0353a 603 * @arg RTC_FLAG_TSF
tushki7 0:60d829a0353a 604 * @retval None
tushki7 0:60d829a0353a 605 */
tushki7 0:60d829a0353a 606 #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 607
tushki7 0:60d829a0353a 608 /**
tushki7 0:60d829a0353a 609 * @brief Clear the RTC Tamper's pending flags.
tushki7 0:60d829a0353a 610 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 611 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
tushki7 0:60d829a0353a 612 * This parameter can be:
tushki7 0:60d829a0353a 613 * @arg RTC_FLAG_TAMP1F
tushki7 0:60d829a0353a 614 * @retval None
tushki7 0:60d829a0353a 615 */
tushki7 0:60d829a0353a 616 #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 617
tushki7 0:60d829a0353a 618 /**
tushki7 0:60d829a0353a 619 * @brief Clear the RTC Wake Up timer's pending flags.
tushki7 0:60d829a0353a 620 * @param __HANDLE__: specifies the RTC handle.
tushki7 0:60d829a0353a 621 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
tushki7 0:60d829a0353a 622 * This parameter can be:
tushki7 0:60d829a0353a 623 * @arg RTC_FLAG_WUTF
tushki7 0:60d829a0353a 624 * @retval None
tushki7 0:60d829a0353a 625 */
tushki7 0:60d829a0353a 626 #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 627
tushki7 0:60d829a0353a 628 /* Exported functions --------------------------------------------------------*/
tushki7 0:60d829a0353a 629
tushki7 0:60d829a0353a 630 /* RTC TimeStamp and Tamper functions *****************************************/
tushki7 0:60d829a0353a 631 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
tushki7 0:60d829a0353a 632 HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin);
tushki7 0:60d829a0353a 633 HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 634 HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
tushki7 0:60d829a0353a 635
tushki7 0:60d829a0353a 636 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
tushki7 0:60d829a0353a 637 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
tushki7 0:60d829a0353a 638 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
tushki7 0:60d829a0353a 639 void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 640
tushki7 0:60d829a0353a 641 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 642 void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 643 void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 644 HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
tushki7 0:60d829a0353a 645 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
tushki7 0:60d829a0353a 646 HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
tushki7 0:60d829a0353a 647
tushki7 0:60d829a0353a 648 /* RTC Wake-up functions ******************************************************/
tushki7 0:60d829a0353a 649 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
tushki7 0:60d829a0353a 650 HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
tushki7 0:60d829a0353a 651 uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 652 uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 653 void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 654 void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 655 HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
tushki7 0:60d829a0353a 656
tushki7 0:60d829a0353a 657 /* Extension Control functions ************************************************/
tushki7 0:60d829a0353a 658 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
tushki7 0:60d829a0353a 659 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
tushki7 0:60d829a0353a 660
tushki7 0:60d829a0353a 661 HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value);
tushki7 0:60d829a0353a 662 HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 663 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue);
tushki7 0:60d829a0353a 664 HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
tushki7 0:60d829a0353a 665 HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
tushki7 0:60d829a0353a 666 HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 667 HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 668 HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 669 HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 670 HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 671
tushki7 0:60d829a0353a 672 /* Extension RTC features functions *******************************************/
tushki7 0:60d829a0353a 673 void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
tushki7 0:60d829a0353a 674 HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
tushki7 0:60d829a0353a 675
tushki7 0:60d829a0353a 676
tushki7 0:60d829a0353a 677 /**
tushki7 0:60d829a0353a 678 * @}
tushki7 0:60d829a0353a 679 */
tushki7 0:60d829a0353a 680
tushki7 0:60d829a0353a 681 /**
tushki7 0:60d829a0353a 682 * @}
tushki7 0:60d829a0353a 683 */
tushki7 0:60d829a0353a 684
tushki7 0:60d829a0353a 685 #ifdef __cplusplus
tushki7 0:60d829a0353a 686 }
tushki7 0:60d829a0353a 687 #endif
tushki7 0:60d829a0353a 688
tushki7 0:60d829a0353a 689 #endif /* __STM32F4xx_HAL_RTC_EX_H */
tushki7 0:60d829a0353a 690
tushki7 0:60d829a0353a 691 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/