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