mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Jul 02 16:30:08 2015 +0100
Revision:
581:39197bcd20f2
Parent:
489:119543c9f674
Synchronized with git revision ae2d3cdffe70184eb8736d94f76c45c93f4b7724

Full URL: https://github.com/mbedmicro/mbed/commit/ae2d3cdffe70184eb8736d94f76c45c93f4b7724/

Make it possible to build the core mbed library with yotta

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 489:119543c9f674 1 /**
mbed_official 489:119543c9f674 2 ******************************************************************************
mbed_official 489:119543c9f674 3 * @file stm32f1xx_hal_rtc_ex.h
mbed_official 489:119543c9f674 4 * @author MCD Application Team
mbed_official 489:119543c9f674 5 * @version V1.0.0
mbed_official 489:119543c9f674 6 * @date 15-December-2014
mbed_official 489:119543c9f674 7 * @brief Header file of RTC HAL Extension module.
mbed_official 489:119543c9f674 8 ******************************************************************************
mbed_official 489:119543c9f674 9 * @attention
mbed_official 489:119543c9f674 10 *
mbed_official 489:119543c9f674 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 489:119543c9f674 12 *
mbed_official 489:119543c9f674 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 489:119543c9f674 14 * are permitted provided that the following conditions are met:
mbed_official 489:119543c9f674 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 489:119543c9f674 16 * this list of conditions and the following disclaimer.
mbed_official 489:119543c9f674 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 489:119543c9f674 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 489:119543c9f674 19 * and/or other materials provided with the distribution.
mbed_official 489:119543c9f674 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 489:119543c9f674 21 * may be used to endorse or promote products derived from this software
mbed_official 489:119543c9f674 22 * without specific prior written permission.
mbed_official 489:119543c9f674 23 *
mbed_official 489:119543c9f674 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 489:119543c9f674 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 489:119543c9f674 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 489:119543c9f674 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 489:119543c9f674 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 489:119543c9f674 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 489:119543c9f674 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 489:119543c9f674 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 489:119543c9f674 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 489:119543c9f674 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 489:119543c9f674 34 *
mbed_official 489:119543c9f674 35 ******************************************************************************
mbed_official 489:119543c9f674 36 */
mbed_official 489:119543c9f674 37
mbed_official 489:119543c9f674 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 489:119543c9f674 39 #ifndef __STM32F1xx_HAL_RTC_EX_H
mbed_official 489:119543c9f674 40 #define __STM32F1xx_HAL_RTC_EX_H
mbed_official 489:119543c9f674 41
mbed_official 489:119543c9f674 42 #ifdef __cplusplus
mbed_official 489:119543c9f674 43 extern "C" {
mbed_official 489:119543c9f674 44 #endif
mbed_official 489:119543c9f674 45
mbed_official 489:119543c9f674 46 /* Includes ------------------------------------------------------------------*/
mbed_official 489:119543c9f674 47 #include "stm32f1xx_hal_def.h"
mbed_official 489:119543c9f674 48
mbed_official 489:119543c9f674 49 /** @addtogroup STM32F1xx_HAL_Driver
mbed_official 489:119543c9f674 50 * @{
mbed_official 489:119543c9f674 51 */
mbed_official 489:119543c9f674 52
mbed_official 489:119543c9f674 53 /** @addtogroup RTCEx
mbed_official 489:119543c9f674 54 * @{
mbed_official 489:119543c9f674 55 */
mbed_official 489:119543c9f674 56
mbed_official 489:119543c9f674 57 /** @addtogroup RTCEx_Private_Macros
mbed_official 489:119543c9f674 58 * @{
mbed_official 489:119543c9f674 59 */
mbed_official 489:119543c9f674 60
mbed_official 489:119543c9f674 61 /** @defgroup RTCEx_Alias_For_Legacy Alias define maintained for legacy
mbed_official 489:119543c9f674 62 * @{
mbed_official 489:119543c9f674 63 */
mbed_official 489:119543c9f674 64 #define HAL_RTCEx_TamperTimeStampIRQHandler HAL_RTCEx_TamperIRQHandler
mbed_official 489:119543c9f674 65
mbed_official 489:119543c9f674 66 /**
mbed_official 489:119543c9f674 67 * @}
mbed_official 489:119543c9f674 68 */
mbed_official 489:119543c9f674 69
mbed_official 489:119543c9f674 70 /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters
mbed_official 489:119543c9f674 71 * @{
mbed_official 489:119543c9f674 72 */
mbed_official 489:119543c9f674 73 #define IS_RTC_TAMPER(__TAMPER__) ((__TAMPER__) == RTC_TAMPER_1)
mbed_official 489:119543c9f674 74
mbed_official 489:119543c9f674 75 #define IS_RTC_TAMPER_TRIGGER(__TRIGGER__) (((__TRIGGER__) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
mbed_official 489:119543c9f674 76 ((__TRIGGER__) == RTC_TAMPERTRIGGER_HIGHLEVEL))
mbed_official 489:119543c9f674 77
mbed_official 489:119543c9f674 78 #if RTC_BKP_NUMBER > 10
mbed_official 489:119543c9f674 79 #define IS_RTC_BKP(BKP) (((BKP) <= (uint32_t) RTC_BKP_DR10) || (((BKP) >= (uint32_t) RTC_BKP_DR11) && ((BKP) <= (uint32_t) RTC_BKP_DR42)))
mbed_official 489:119543c9f674 80 #else
mbed_official 489:119543c9f674 81 #define IS_RTC_BKP(BKP) ((BKP) <= (uint32_t) RTC_BKP_NUMBER)
mbed_official 489:119543c9f674 82 #endif
mbed_official 489:119543c9f674 83 #define IS_RTC_SMOOTH_CALIB_MINUS(__VALUE__) ((__VALUE__) <= 0x0000007F)
mbed_official 489:119543c9f674 84
mbed_official 489:119543c9f674 85 /**
mbed_official 489:119543c9f674 86 * @}
mbed_official 489:119543c9f674 87 */
mbed_official 489:119543c9f674 88
mbed_official 489:119543c9f674 89 /**
mbed_official 489:119543c9f674 90 * @}
mbed_official 489:119543c9f674 91 */
mbed_official 489:119543c9f674 92
mbed_official 489:119543c9f674 93 /* Exported types ------------------------------------------------------------*/
mbed_official 489:119543c9f674 94 /** @defgroup RTCEx_Exported_Types RTCEx Exported Types
mbed_official 489:119543c9f674 95 * @{
mbed_official 489:119543c9f674 96 */
mbed_official 489:119543c9f674 97 /**
mbed_official 489:119543c9f674 98 * @brief RTC Tamper structure definition
mbed_official 489:119543c9f674 99 */
mbed_official 489:119543c9f674 100 typedef struct
mbed_official 489:119543c9f674 101 {
mbed_official 489:119543c9f674 102 uint32_t Tamper; /*!< Specifies the Tamper Pin.
mbed_official 489:119543c9f674 103 This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
mbed_official 489:119543c9f674 104
mbed_official 489:119543c9f674 105 uint32_t Trigger; /*!< Specifies the Tamper Trigger.
mbed_official 489:119543c9f674 106 This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
mbed_official 489:119543c9f674 107
mbed_official 489:119543c9f674 108 }RTC_TamperTypeDef;
mbed_official 489:119543c9f674 109
mbed_official 489:119543c9f674 110 /**
mbed_official 489:119543c9f674 111 * @}
mbed_official 489:119543c9f674 112 */
mbed_official 489:119543c9f674 113
mbed_official 489:119543c9f674 114 /* Exported constants --------------------------------------------------------*/
mbed_official 489:119543c9f674 115 /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants
mbed_official 489:119543c9f674 116 * @{
mbed_official 489:119543c9f674 117 */
mbed_official 489:119543c9f674 118
mbed_official 489:119543c9f674 119 /** @defgroup RTCEx_Tamper_Pins_Definitions Tamper Pins Definitions
mbed_official 489:119543c9f674 120 * @{
mbed_official 489:119543c9f674 121 */
mbed_official 489:119543c9f674 122 #define RTC_TAMPER_1 BKP_CR_TPE /*!< Select tamper to be enabled (mainly for legacy purposes) */
mbed_official 489:119543c9f674 123
mbed_official 489:119543c9f674 124 /**
mbed_official 489:119543c9f674 125 * @}
mbed_official 489:119543c9f674 126 */
mbed_official 489:119543c9f674 127
mbed_official 489:119543c9f674 128 /** @defgroup RTCEx_Tamper_Trigger_Definitions Tamper Trigger Definitions
mbed_official 489:119543c9f674 129 * @{
mbed_official 489:119543c9f674 130 */
mbed_official 489:119543c9f674 131 #define RTC_TAMPERTRIGGER_LOWLEVEL BKP_CR_TPAL /*!< A high level on the TAMPER pin resets all data backup registers (if TPE bit is set) */
mbed_official 489:119543c9f674 132 #define RTC_TAMPERTRIGGER_HIGHLEVEL ((uint32_t)0x00000000) /*!< A low level on the TAMPER pin resets all data backup registers (if TPE bit is set) */
mbed_official 489:119543c9f674 133
mbed_official 489:119543c9f674 134 /**
mbed_official 489:119543c9f674 135 * @}
mbed_official 489:119543c9f674 136 */
mbed_official 489:119543c9f674 137
mbed_official 489:119543c9f674 138 /** @defgroup RTCEx_Backup_Registers_Definitions Backup Registers Definitions
mbed_official 489:119543c9f674 139 * @{
mbed_official 489:119543c9f674 140 */
mbed_official 489:119543c9f674 141 #if RTC_BKP_NUMBER > 0
mbed_official 489:119543c9f674 142 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
mbed_official 489:119543c9f674 143 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
mbed_official 489:119543c9f674 144 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
mbed_official 489:119543c9f674 145 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
mbed_official 489:119543c9f674 146 #define RTC_BKP_DR5 ((uint32_t)0x00000005)
mbed_official 489:119543c9f674 147 #define RTC_BKP_DR6 ((uint32_t)0x00000006)
mbed_official 489:119543c9f674 148 #define RTC_BKP_DR7 ((uint32_t)0x00000007)
mbed_official 489:119543c9f674 149 #define RTC_BKP_DR8 ((uint32_t)0x00000008)
mbed_official 489:119543c9f674 150 #define RTC_BKP_DR9 ((uint32_t)0x00000009)
mbed_official 489:119543c9f674 151 #define RTC_BKP_DR10 ((uint32_t)0x0000000A)
mbed_official 489:119543c9f674 152 #endif /* RTC_BKP_NUMBER > 0 */
mbed_official 489:119543c9f674 153
mbed_official 489:119543c9f674 154 #if RTC_BKP_NUMBER > 10
mbed_official 489:119543c9f674 155 #define RTC_BKP_DR11 ((uint32_t)0x00000010)
mbed_official 489:119543c9f674 156 #define RTC_BKP_DR12 ((uint32_t)0x00000011)
mbed_official 489:119543c9f674 157 #define RTC_BKP_DR13 ((uint32_t)0x00000012)
mbed_official 489:119543c9f674 158 #define RTC_BKP_DR14 ((uint32_t)0x00000013)
mbed_official 489:119543c9f674 159 #define RTC_BKP_DR15 ((uint32_t)0x00000014)
mbed_official 489:119543c9f674 160 #define RTC_BKP_DR16 ((uint32_t)0x00000015)
mbed_official 489:119543c9f674 161 #define RTC_BKP_DR17 ((uint32_t)0x00000016)
mbed_official 489:119543c9f674 162 #define RTC_BKP_DR18 ((uint32_t)0x00000017)
mbed_official 489:119543c9f674 163 #define RTC_BKP_DR19 ((uint32_t)0x00000018)
mbed_official 489:119543c9f674 164 #define RTC_BKP_DR20 ((uint32_t)0x00000019)
mbed_official 489:119543c9f674 165 #define RTC_BKP_DR21 ((uint32_t)0x0000001A)
mbed_official 489:119543c9f674 166 #define RTC_BKP_DR22 ((uint32_t)0x0000001B)
mbed_official 489:119543c9f674 167 #define RTC_BKP_DR23 ((uint32_t)0x0000001C)
mbed_official 489:119543c9f674 168 #define RTC_BKP_DR24 ((uint32_t)0x0000001D)
mbed_official 489:119543c9f674 169 #define RTC_BKP_DR25 ((uint32_t)0x0000001E)
mbed_official 489:119543c9f674 170 #define RTC_BKP_DR26 ((uint32_t)0x0000001F)
mbed_official 489:119543c9f674 171 #define RTC_BKP_DR27 ((uint32_t)0x00000020)
mbed_official 489:119543c9f674 172 #define RTC_BKP_DR28 ((uint32_t)0x00000021)
mbed_official 489:119543c9f674 173 #define RTC_BKP_DR29 ((uint32_t)0x00000022)
mbed_official 489:119543c9f674 174 #define RTC_BKP_DR30 ((uint32_t)0x00000023)
mbed_official 489:119543c9f674 175 #define RTC_BKP_DR31 ((uint32_t)0x00000024)
mbed_official 489:119543c9f674 176 #define RTC_BKP_DR32 ((uint32_t)0x00000025)
mbed_official 489:119543c9f674 177 #define RTC_BKP_DR33 ((uint32_t)0x00000026)
mbed_official 489:119543c9f674 178 #define RTC_BKP_DR34 ((uint32_t)0x00000027)
mbed_official 489:119543c9f674 179 #define RTC_BKP_DR35 ((uint32_t)0x00000028)
mbed_official 489:119543c9f674 180 #define RTC_BKP_DR36 ((uint32_t)0x00000029)
mbed_official 489:119543c9f674 181 #define RTC_BKP_DR37 ((uint32_t)0x0000002A)
mbed_official 489:119543c9f674 182 #define RTC_BKP_DR38 ((uint32_t)0x0000002B)
mbed_official 489:119543c9f674 183 #define RTC_BKP_DR39 ((uint32_t)0x0000002C)
mbed_official 489:119543c9f674 184 #define RTC_BKP_DR40 ((uint32_t)0x0000002D)
mbed_official 489:119543c9f674 185 #define RTC_BKP_DR41 ((uint32_t)0x0000002E)
mbed_official 489:119543c9f674 186 #define RTC_BKP_DR42 ((uint32_t)0x0000002F)
mbed_official 489:119543c9f674 187 #endif /* RTC_BKP_NUMBER > 10 */
mbed_official 489:119543c9f674 188
mbed_official 489:119543c9f674 189 /**
mbed_official 489:119543c9f674 190 * @}
mbed_official 489:119543c9f674 191 */
mbed_official 489:119543c9f674 192
mbed_official 489:119543c9f674 193 /**
mbed_official 489:119543c9f674 194 * @}
mbed_official 489:119543c9f674 195 */
mbed_official 489:119543c9f674 196
mbed_official 489:119543c9f674 197 /* Exported macro ------------------------------------------------------------*/
mbed_official 489:119543c9f674 198 /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros
mbed_official 489:119543c9f674 199 * @{
mbed_official 489:119543c9f674 200 */
mbed_official 489:119543c9f674 201
mbed_official 489:119543c9f674 202 /**
mbed_official 489:119543c9f674 203 * @brief Enable the RTC Tamper interrupt.
mbed_official 489:119543c9f674 204 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 205 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be enabled
mbed_official 489:119543c9f674 206 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 207 * @arg RTC_IT_TAMP1: Tamper A interrupt
mbed_official 489:119543c9f674 208 * @retval None
mbed_official 489:119543c9f674 209 */
mbed_official 489:119543c9f674 210 #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT(BKP->CSR, (__INTERRUPT__))
mbed_official 489:119543c9f674 211
mbed_official 489:119543c9f674 212 /**
mbed_official 489:119543c9f674 213 * @brief Disable the RTC Tamper interrupt.
mbed_official 489:119543c9f674 214 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 215 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be disabled.
mbed_official 489:119543c9f674 216 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 217 * @arg RTC_IT_TAMP1: Tamper A interrupt
mbed_official 489:119543c9f674 218 * @retval None
mbed_official 489:119543c9f674 219 */
mbed_official 489:119543c9f674 220 #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT(BKP->CSR, (__INTERRUPT__))
mbed_official 489:119543c9f674 221
mbed_official 489:119543c9f674 222 /**
mbed_official 489:119543c9f674 223 * @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
mbed_official 489:119543c9f674 224 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 225 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be checked.
mbed_official 489:119543c9f674 226 * This parameter can be:
mbed_official 489:119543c9f674 227 * @arg RTC_IT_TAMP1
mbed_official 489:119543c9f674 228 * @retval None
mbed_official 489:119543c9f674 229 */
mbed_official 489:119543c9f674 230 #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((BKP->CSR) & ((__INTERRUPT__))) != RESET)? SET : RESET)
mbed_official 489:119543c9f674 231
mbed_official 489:119543c9f674 232 /**
mbed_official 489:119543c9f674 233 * @brief Get the selected RTC Tamper's flag status.
mbed_official 489:119543c9f674 234 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 235 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
mbed_official 489:119543c9f674 236 * This parameter can be:
mbed_official 489:119543c9f674 237 * @arg RTC_FLAG_TAMP1F
mbed_official 489:119543c9f674 238 * @retval None
mbed_official 489:119543c9f674 239 */
mbed_official 489:119543c9f674 240 #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) ((((BKP->CSR) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 489:119543c9f674 241
mbed_official 489:119543c9f674 242 /**
mbed_official 489:119543c9f674 243 * @brief Get the selected RTC Tamper's flag status.
mbed_official 489:119543c9f674 244 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 245 * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be checked.
mbed_official 489:119543c9f674 246 * This parameter can be:
mbed_official 489:119543c9f674 247 * @arg RTC_IT_TAMP1
mbed_official 489:119543c9f674 248 * @retval None
mbed_official 489:119543c9f674 249 */
mbed_official 489:119543c9f674 250 #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) ((((BKP->CSR) & (BKP_CSR_TEF)) != RESET)? SET : RESET)
mbed_official 489:119543c9f674 251
mbed_official 489:119543c9f674 252 /**
mbed_official 489:119543c9f674 253 * @brief Clear the RTC Tamper's pending flags.
mbed_official 489:119543c9f674 254 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 255 * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
mbed_official 489:119543c9f674 256 * This parameter can be:
mbed_official 489:119543c9f674 257 * @arg RTC_FLAG_TAMP1F
mbed_official 489:119543c9f674 258 * @retval None
mbed_official 489:119543c9f674 259 */
mbed_official 489:119543c9f674 260 #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) SET_BIT(BKP->CSR, BKP_CSR_CTE | BKP_CSR_CTI)
mbed_official 489:119543c9f674 261
mbed_official 489:119543c9f674 262 /**
mbed_official 489:119543c9f674 263 * @brief Enable the RTC Second interrupt.
mbed_official 489:119543c9f674 264 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 265 * @param __INTERRUPT__: specifies the RTC Second interrupt sources to be enabled
mbed_official 489:119543c9f674 266 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 267 * @arg RTC_IT_SEC: Second A interrupt
mbed_official 489:119543c9f674 268 * @retval None
mbed_official 489:119543c9f674 269 */
mbed_official 489:119543c9f674 270 #define __HAL_RTC_SECOND_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__))
mbed_official 489:119543c9f674 271
mbed_official 489:119543c9f674 272 /**
mbed_official 489:119543c9f674 273 * @brief Disable the RTC Second interrupt.
mbed_official 489:119543c9f674 274 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 275 * @param __INTERRUPT__: specifies the RTC Second interrupt sources to be disabled.
mbed_official 489:119543c9f674 276 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 277 * @arg RTC_IT_SEC: Second A interrupt
mbed_official 489:119543c9f674 278 * @retval None
mbed_official 489:119543c9f674 279 */
mbed_official 489:119543c9f674 280 #define __HAL_RTC_SECOND_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__))
mbed_official 489:119543c9f674 281
mbed_official 489:119543c9f674 282 /**
mbed_official 489:119543c9f674 283 * @brief Check whether the specified RTC Second interrupt has occurred or not.
mbed_official 489:119543c9f674 284 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 285 * @param __INTERRUPT__: specifies the RTC Second interrupt sources to be enabled or disabled.
mbed_official 489:119543c9f674 286 * This parameter can be:
mbed_official 489:119543c9f674 287 * @arg RTC_IT_SEC: Second A interrupt
mbed_official 489:119543c9f674 288 * @retval None
mbed_official 489:119543c9f674 289 */
mbed_official 489:119543c9f674 290 #define __HAL_RTC_SECOND_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((__HANDLE__)->Instance->CRH)& ((__INTERRUPT__)))) != RESET)? SET : RESET)
mbed_official 489:119543c9f674 291
mbed_official 489:119543c9f674 292 /**
mbed_official 489:119543c9f674 293 * @brief Get the selected RTC Second's flag status.
mbed_official 489:119543c9f674 294 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 295 * @param __FLAG__: specifies the RTC Second Flag sources to be enabled or disabled.
mbed_official 489:119543c9f674 296 * This parameter can be:
mbed_official 489:119543c9f674 297 * @arg RTC_FLAG_SEC
mbed_official 489:119543c9f674 298 * @retval None
mbed_official 489:119543c9f674 299 */
mbed_official 489:119543c9f674 300 #define __HAL_RTC_SECOND_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->CRL) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 489:119543c9f674 301
mbed_official 489:119543c9f674 302 /**
mbed_official 489:119543c9f674 303 * @brief Clear the RTC Second's pending flags.
mbed_official 489:119543c9f674 304 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 305 * @param __FLAG__: specifies the RTC Second Flag sources to be enabled or disabled.
mbed_official 489:119543c9f674 306 * This parameter can be:
mbed_official 489:119543c9f674 307 * @arg RTC_FLAG_SEC
mbed_official 489:119543c9f674 308 * @retval None
mbed_official 489:119543c9f674 309 */
mbed_official 489:119543c9f674 310 #define __HAL_RTC_SECOND_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CRL) = ~(__FLAG__)
mbed_official 489:119543c9f674 311
mbed_official 489:119543c9f674 312 /**
mbed_official 489:119543c9f674 313 * @brief Enable the RTC Overflow interrupt.
mbed_official 489:119543c9f674 314 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 315 * @param __INTERRUPT__: specifies the RTC Overflow interrupt sources to be enabled
mbed_official 489:119543c9f674 316 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 317 * @arg RTC_IT_OW: Overflow A interrupt
mbed_official 489:119543c9f674 318 * @retval None
mbed_official 489:119543c9f674 319 */
mbed_official 489:119543c9f674 320 #define __HAL_RTC_OVERFLOW_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__))
mbed_official 489:119543c9f674 321
mbed_official 489:119543c9f674 322 /**
mbed_official 489:119543c9f674 323 * @brief Disable the RTC Overflow interrupt.
mbed_official 489:119543c9f674 324 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 325 * @param __INTERRUPT__: specifies the RTC Overflow interrupt sources to be disabled.
mbed_official 489:119543c9f674 326 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 327 * @arg RTC_IT_OW: Overflow A interrupt
mbed_official 489:119543c9f674 328 * @retval None
mbed_official 489:119543c9f674 329 */
mbed_official 489:119543c9f674 330 #define __HAL_RTC_OVERFLOW_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__))
mbed_official 489:119543c9f674 331
mbed_official 489:119543c9f674 332 /**
mbed_official 489:119543c9f674 333 * @brief Check whether the specified RTC Overflow interrupt has occurred or not.
mbed_official 489:119543c9f674 334 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 335 * @param __INTERRUPT__: specifies the RTC Overflow interrupt sources to be enabled or disabled.
mbed_official 489:119543c9f674 336 * This parameter can be:
mbed_official 489:119543c9f674 337 * @arg RTC_IT_OW: Overflow A interrupt
mbed_official 489:119543c9f674 338 * @retval None
mbed_official 489:119543c9f674 339 */
mbed_official 489:119543c9f674 340 #define __HAL_RTC_OVERFLOW_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((__HANDLE__)->Instance->CRH)& ((__INTERRUPT__))) ) != RESET)? SET : RESET)
mbed_official 489:119543c9f674 341
mbed_official 489:119543c9f674 342 /**
mbed_official 489:119543c9f674 343 * @brief Get the selected RTC Overflow's flag status.
mbed_official 489:119543c9f674 344 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 345 * @param __FLAG__: specifies the RTC Overflow Flag sources to be enabled or disabled.
mbed_official 489:119543c9f674 346 * This parameter can be:
mbed_official 489:119543c9f674 347 * @arg RTC_FLAG_OW
mbed_official 489:119543c9f674 348 * @retval None
mbed_official 489:119543c9f674 349 */
mbed_official 489:119543c9f674 350 #define __HAL_RTC_OVERFLOW_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->CRL) & (__FLAG__)) != RESET)? SET : RESET)
mbed_official 489:119543c9f674 351
mbed_official 489:119543c9f674 352 /**
mbed_official 489:119543c9f674 353 * @brief Clear the RTC Overflow's pending flags.
mbed_official 489:119543c9f674 354 * @param __HANDLE__: specifies the RTC handle.
mbed_official 489:119543c9f674 355 * @param __FLAG__: specifies the RTC Overflow Flag sources to be enabled or disabled.
mbed_official 489:119543c9f674 356 * This parameter can be:
mbed_official 489:119543c9f674 357 * @arg RTC_FLAG_OW
mbed_official 489:119543c9f674 358 * @retval None
mbed_official 489:119543c9f674 359 */
mbed_official 489:119543c9f674 360 #define __HAL_RTC_OVERFLOW_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CRL) = ~(__FLAG__)
mbed_official 489:119543c9f674 361
mbed_official 489:119543c9f674 362 /**
mbed_official 489:119543c9f674 363 * @}
mbed_official 489:119543c9f674 364 */
mbed_official 489:119543c9f674 365
mbed_official 489:119543c9f674 366 /* Exported functions --------------------------------------------------------*/
mbed_official 489:119543c9f674 367 /** @addtogroup RTCEx_Exported_Functions
mbed_official 489:119543c9f674 368 * @{
mbed_official 489:119543c9f674 369 */
mbed_official 489:119543c9f674 370
mbed_official 489:119543c9f674 371 /* RTC Tamper functions *****************************************/
mbed_official 489:119543c9f674 372 /** @addtogroup RTCEx_Exported_Functions_Group1
mbed_official 489:119543c9f674 373 * @{
mbed_official 489:119543c9f674 374 */
mbed_official 489:119543c9f674 375 HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
mbed_official 489:119543c9f674 376 HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
mbed_official 489:119543c9f674 377 HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
mbed_official 489:119543c9f674 378 void HAL_RTCEx_TamperIRQHandler(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 379 void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 380 HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
mbed_official 489:119543c9f674 381
mbed_official 489:119543c9f674 382 /**
mbed_official 489:119543c9f674 383 * @}
mbed_official 489:119543c9f674 384 */
mbed_official 489:119543c9f674 385
mbed_official 489:119543c9f674 386 /* RTC Second functions *****************************************/
mbed_official 489:119543c9f674 387 /** @addtogroup RTCEx_Exported_Functions_Group2
mbed_official 489:119543c9f674 388 * @{
mbed_official 489:119543c9f674 389 */
mbed_official 489:119543c9f674 390 HAL_StatusTypeDef HAL_RTCEx_SetSecond_IT(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 391 HAL_StatusTypeDef HAL_RTCEx_DeactivateSecond(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 392 void HAL_RTCEx_RTCIRQHandler(RTC_HandleTypeDef* hrtc);
mbed_official 489:119543c9f674 393 void HAL_RTCEx_RTCEventCallback(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 394 void HAL_RTCEx_RTCEventErrorCallback(RTC_HandleTypeDef *hrtc);
mbed_official 489:119543c9f674 395
mbed_official 489:119543c9f674 396 /**
mbed_official 489:119543c9f674 397 * @}
mbed_official 489:119543c9f674 398 */
mbed_official 489:119543c9f674 399
mbed_official 489:119543c9f674 400 /* Extension Control functions ************************************************/
mbed_official 489:119543c9f674 401 /** @addtogroup RTCEx_Exported_Functions_Group3
mbed_official 489:119543c9f674 402 * @{
mbed_official 489:119543c9f674 403 */
mbed_official 489:119543c9f674 404 void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
mbed_official 489:119543c9f674 405 uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
mbed_official 489:119543c9f674 406
mbed_official 489:119543c9f674 407 HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef* hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue);
mbed_official 489:119543c9f674 408 /**
mbed_official 489:119543c9f674 409 * @}
mbed_official 489:119543c9f674 410 */
mbed_official 489:119543c9f674 411
mbed_official 489:119543c9f674 412 /**
mbed_official 489:119543c9f674 413 * @}
mbed_official 489:119543c9f674 414 */
mbed_official 489:119543c9f674 415
mbed_official 489:119543c9f674 416 /**
mbed_official 489:119543c9f674 417 * @}
mbed_official 489:119543c9f674 418 */
mbed_official 489:119543c9f674 419
mbed_official 489:119543c9f674 420 /**
mbed_official 489:119543c9f674 421 * @}
mbed_official 489:119543c9f674 422 */
mbed_official 489:119543c9f674 423
mbed_official 489:119543c9f674 424 #ifdef __cplusplus
mbed_official 489:119543c9f674 425 }
mbed_official 489:119543c9f674 426 #endif
mbed_official 489:119543c9f674 427
mbed_official 489:119543c9f674 428 #endif /* __STM32F1xx_HAL_RTC_EX_H */
mbed_official 489:119543c9f674 429
mbed_official 489:119543c9f674 430 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/