mbed library with additional peripherals for ST F401 board

Fork of mbed-src by mbed official

This mbed LIB has additional peripherals for ST F401 board

  • UART2 : PA_3 rx, PA_2 tx
  • UART3 : PC_7 rx, PC_6 tx
  • I2C2 : PB_3 SDA, PB_10 SCL
  • I2C3 : PB_4 SDA, PA_8 SCL
Committer:
mbed_official
Date:
Wed Feb 26 09:45:12 2014 +0000
Revision:
106:ced8cbb51063
Parent:
87:085cde657901
Synchronized with git revision 4222735eff5868389433f0e9271976b39c8115cd

Full URL: https://github.com/mbedmicro/mbed/commit/4222735eff5868389433f0e9271976b39c8115cd/

[NUCLEO_xxx] Update STM32CubeF4 driver V1.0.0 + update license

Who changed what in which revision?

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