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_pwr.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 PWR HAL 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_PWR_H
mbed_official 489:119543c9f674 40 #define __STM32F1xx_HAL_PWR_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 PWR
mbed_official 489:119543c9f674 54 * @{
mbed_official 489:119543c9f674 55 */
mbed_official 489:119543c9f674 56
mbed_official 489:119543c9f674 57 /* Exported types ------------------------------------------------------------*/
mbed_official 489:119543c9f674 58
mbed_official 489:119543c9f674 59 /** @defgroup PWR_Exported_Types PWR Exported Types
mbed_official 489:119543c9f674 60 * @{
mbed_official 489:119543c9f674 61 */
mbed_official 489:119543c9f674 62
mbed_official 489:119543c9f674 63 /**
mbed_official 489:119543c9f674 64 * @brief PWR PVD configuration structure definition
mbed_official 489:119543c9f674 65 */
mbed_official 489:119543c9f674 66 typedef struct
mbed_official 489:119543c9f674 67 {
mbed_official 489:119543c9f674 68 uint32_t PVDLevel; /*!< PVDLevel: Specifies the PVD detection level.
mbed_official 489:119543c9f674 69 This parameter can be a value of @ref PWR_PVD_detection_level */
mbed_official 489:119543c9f674 70
mbed_official 489:119543c9f674 71 uint32_t Mode; /*!< Mode: Specifies the operating mode for the selected pins.
mbed_official 489:119543c9f674 72 This parameter can be a value of @ref PWR_PVD_Mode */
mbed_official 489:119543c9f674 73 }PWR_PVDTypeDef;
mbed_official 489:119543c9f674 74
mbed_official 489:119543c9f674 75
mbed_official 489:119543c9f674 76 /**
mbed_official 489:119543c9f674 77 * @}
mbed_official 489:119543c9f674 78 */
mbed_official 489:119543c9f674 79
mbed_official 489:119543c9f674 80
mbed_official 489:119543c9f674 81 /* Internal constants --------------------------------------------------------*/
mbed_official 489:119543c9f674 82
mbed_official 489:119543c9f674 83 /** @addtogroup PWR_Private_Constants
mbed_official 489:119543c9f674 84 * @{
mbed_official 489:119543c9f674 85 */
mbed_official 489:119543c9f674 86
mbed_official 489:119543c9f674 87 #define PWR_EXTI_LINE_PVD ((uint32_t)0x00010000) /*!< External interrupt line 16 Connected to the PVD EXTI Line */
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
mbed_official 489:119543c9f674 94 /* Exported constants --------------------------------------------------------*/
mbed_official 489:119543c9f674 95
mbed_official 489:119543c9f674 96 /** @defgroup PWR_Exported_Constants PWR Exported Constants
mbed_official 489:119543c9f674 97 * @{
mbed_official 489:119543c9f674 98 */
mbed_official 489:119543c9f674 99
mbed_official 489:119543c9f674 100 /** @defgroup PWR_PVD_detection_level PWR PVD detection level
mbed_official 489:119543c9f674 101 * @{
mbed_official 489:119543c9f674 102 */
mbed_official 489:119543c9f674 103 #define PWR_PVDLEVEL_0 PWR_CR_PLS_2V2
mbed_official 489:119543c9f674 104 #define PWR_PVDLEVEL_1 PWR_CR_PLS_2V3
mbed_official 489:119543c9f674 105 #define PWR_PVDLEVEL_2 PWR_CR_PLS_2V4
mbed_official 489:119543c9f674 106 #define PWR_PVDLEVEL_3 PWR_CR_PLS_2V5
mbed_official 489:119543c9f674 107 #define PWR_PVDLEVEL_4 PWR_CR_PLS_2V6
mbed_official 489:119543c9f674 108 #define PWR_PVDLEVEL_5 PWR_CR_PLS_2V7
mbed_official 489:119543c9f674 109 #define PWR_PVDLEVEL_6 PWR_CR_PLS_2V8
mbed_official 489:119543c9f674 110 #define PWR_PVDLEVEL_7 PWR_CR_PLS_2V9
mbed_official 489:119543c9f674 111
mbed_official 489:119543c9f674 112 /**
mbed_official 489:119543c9f674 113 * @}
mbed_official 489:119543c9f674 114 */
mbed_official 489:119543c9f674 115
mbed_official 489:119543c9f674 116 /** @defgroup PWR_PVD_Mode PWR PVD Mode
mbed_official 489:119543c9f674 117 * @{
mbed_official 489:119543c9f674 118 */
mbed_official 489:119543c9f674 119 #define PWR_PVD_MODE_NORMAL ((uint32_t)0x00000000) /*!< basic mode is used */
mbed_official 489:119543c9f674 120 #define PWR_PVD_MODE_IT_RISING ((uint32_t)0x00010001) /*!< External Interrupt Mode with Rising edge trigger detection */
mbed_official 489:119543c9f674 121 #define PWR_PVD_MODE_IT_FALLING ((uint32_t)0x00010002) /*!< External Interrupt Mode with Falling edge trigger detection */
mbed_official 489:119543c9f674 122 #define PWR_PVD_MODE_IT_RISING_FALLING ((uint32_t)0x00010003) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
mbed_official 489:119543c9f674 123 #define PWR_PVD_MODE_EVENT_RISING ((uint32_t)0x00020001) /*!< Event Mode with Rising edge trigger detection */
mbed_official 489:119543c9f674 124 #define PWR_PVD_MODE_EVENT_FALLING ((uint32_t)0x00020002) /*!< Event Mode with Falling edge trigger detection */
mbed_official 489:119543c9f674 125 #define PWR_PVD_MODE_EVENT_RISING_FALLING ((uint32_t)0x00020003) /*!< Event Mode with Rising/Falling edge trigger detection */
mbed_official 489:119543c9f674 126
mbed_official 489:119543c9f674 127 /**
mbed_official 489:119543c9f674 128 * @}
mbed_official 489:119543c9f674 129 */
mbed_official 489:119543c9f674 130
mbed_official 489:119543c9f674 131
mbed_official 489:119543c9f674 132 /** @defgroup PWR_WakeUp_Pins PWR WakeUp Pins
mbed_official 489:119543c9f674 133 * @{
mbed_official 489:119543c9f674 134 */
mbed_official 489:119543c9f674 135
mbed_official 489:119543c9f674 136 #define PWR_WAKEUP_PIN1 PWR_CSR_EWUP
mbed_official 489:119543c9f674 137
mbed_official 489:119543c9f674 138 /**
mbed_official 489:119543c9f674 139 * @}
mbed_official 489:119543c9f674 140 */
mbed_official 489:119543c9f674 141
mbed_official 489:119543c9f674 142 /** @defgroup PWR_Regulator_state_in_SLEEP_STOP_mode PWR Regulator state in SLEEP/STOP mode
mbed_official 489:119543c9f674 143 * @{
mbed_official 489:119543c9f674 144 */
mbed_official 489:119543c9f674 145 #define PWR_MAINREGULATOR_ON ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 146 #define PWR_LOWPOWERREGULATOR_ON PWR_CR_LPDS
mbed_official 489:119543c9f674 147
mbed_official 489:119543c9f674 148 /**
mbed_official 489:119543c9f674 149 * @}
mbed_official 489:119543c9f674 150 */
mbed_official 489:119543c9f674 151
mbed_official 489:119543c9f674 152 /** @defgroup PWR_SLEEP_mode_entry PWR SLEEP mode entry
mbed_official 489:119543c9f674 153 * @{
mbed_official 489:119543c9f674 154 */
mbed_official 489:119543c9f674 155 #define PWR_SLEEPENTRY_WFI ((uint8_t)0x01)
mbed_official 489:119543c9f674 156 #define PWR_SLEEPENTRY_WFE ((uint8_t)0x02)
mbed_official 489:119543c9f674 157
mbed_official 489:119543c9f674 158 /**
mbed_official 489:119543c9f674 159 * @}
mbed_official 489:119543c9f674 160 */
mbed_official 489:119543c9f674 161
mbed_official 489:119543c9f674 162 /** @defgroup PWR_STOP_mode_entry PWR STOP mode entry
mbed_official 489:119543c9f674 163 * @{
mbed_official 489:119543c9f674 164 */
mbed_official 489:119543c9f674 165 #define PWR_STOPENTRY_WFI ((uint8_t)0x01)
mbed_official 489:119543c9f674 166 #define PWR_STOPENTRY_WFE ((uint8_t)0x02)
mbed_official 489:119543c9f674 167
mbed_official 489:119543c9f674 168 /**
mbed_official 489:119543c9f674 169 * @}
mbed_official 489:119543c9f674 170 */
mbed_official 489:119543c9f674 171
mbed_official 489:119543c9f674 172 /** @defgroup PWR_Flag PWR Flag
mbed_official 489:119543c9f674 173 * @{
mbed_official 489:119543c9f674 174 */
mbed_official 489:119543c9f674 175 #define PWR_FLAG_WU PWR_CSR_WUF
mbed_official 489:119543c9f674 176 #define PWR_FLAG_SB PWR_CSR_SBF
mbed_official 489:119543c9f674 177 #define PWR_FLAG_PVDO PWR_CSR_PVDO
mbed_official 489:119543c9f674 178
mbed_official 489:119543c9f674 179
mbed_official 489:119543c9f674 180 /**
mbed_official 489:119543c9f674 181 * @}
mbed_official 489:119543c9f674 182 */
mbed_official 489:119543c9f674 183
mbed_official 489:119543c9f674 184 /**
mbed_official 489:119543c9f674 185 * @}
mbed_official 489:119543c9f674 186 */
mbed_official 489:119543c9f674 187
mbed_official 489:119543c9f674 188 /* Exported macro ------------------------------------------------------------*/
mbed_official 489:119543c9f674 189 /** @defgroup PWR_Exported_Macros PWR Exported Macros
mbed_official 489:119543c9f674 190 * @{
mbed_official 489:119543c9f674 191 */
mbed_official 489:119543c9f674 192
mbed_official 489:119543c9f674 193 /** @brief Check PWR flag is set or not.
mbed_official 489:119543c9f674 194 * @param __FLAG__: specifies the flag to check.
mbed_official 489:119543c9f674 195 * This parameter can be one of the following values:
mbed_official 489:119543c9f674 196 * @arg PWR_FLAG_WU: Wake Up flag. This flag indicates that a wakeup event
mbed_official 489:119543c9f674 197 * was received from the WKUP pin or from the RTC alarm
mbed_official 489:119543c9f674 198 * An additional wakeup event is detected if the WKUP pin is enabled
mbed_official 489:119543c9f674 199 * (by setting the EWUP bit) when the WKUP pin level is already high.
mbed_official 489:119543c9f674 200 * @arg PWR_FLAG_SB: StandBy flag. This flag indicates that the system was
mbed_official 489:119543c9f674 201 * resumed from StandBy mode.
mbed_official 489:119543c9f674 202 * @arg PWR_FLAG_PVDO: PVD Output. This flag is valid only if PVD is enabled
mbed_official 489:119543c9f674 203 * by the HAL_PWR_EnablePVD() function. The PVD is stopped by Standby mode
mbed_official 489:119543c9f674 204 * For this reason, this bit is equal to 0 after Standby or reset
mbed_official 489:119543c9f674 205 * until the PVDE bit is set.
mbed_official 489:119543c9f674 206 * @retval The new state of __FLAG__ (TRUE or FALSE).
mbed_official 489:119543c9f674 207 */
mbed_official 489:119543c9f674 208 #define __HAL_PWR_GET_FLAG(__FLAG__) ((PWR->CSR & (__FLAG__)) == (__FLAG__))
mbed_official 489:119543c9f674 209
mbed_official 489:119543c9f674 210 /** @brief Clear the PWR's pending flags.
mbed_official 489:119543c9f674 211 * @param __FLAG__: specifies the flag to clear.
mbed_official 489:119543c9f674 212 * This parameter can be one of the following values:
mbed_official 489:119543c9f674 213 * @arg PWR_FLAG_WU: Wake Up flag
mbed_official 489:119543c9f674 214 * @arg PWR_FLAG_SB: StandBy flag
mbed_official 489:119543c9f674 215 */
mbed_official 489:119543c9f674 216 #define __HAL_PWR_CLEAR_FLAG(__FLAG__) SET_BIT(PWR->CR, ((__FLAG__) << 2))
mbed_official 489:119543c9f674 217
mbed_official 489:119543c9f674 218 /**
mbed_official 489:119543c9f674 219 * @brief Enable interrupt on PVD Exti Line 16.
mbed_official 489:119543c9f674 220 * @retval None.
mbed_official 489:119543c9f674 221 */
mbed_official 489:119543c9f674 222 #define __HAL_PWR_PVD_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, PWR_EXTI_LINE_PVD)
mbed_official 489:119543c9f674 223
mbed_official 489:119543c9f674 224 /**
mbed_official 489:119543c9f674 225 * @brief Disable interrupt on PVD Exti Line 16.
mbed_official 489:119543c9f674 226 * @retval None.
mbed_official 489:119543c9f674 227 */
mbed_official 489:119543c9f674 228 #define __HAL_PWR_PVD_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, PWR_EXTI_LINE_PVD)
mbed_official 489:119543c9f674 229
mbed_official 489:119543c9f674 230 /**
mbed_official 489:119543c9f674 231 * @brief Enable event on PVD Exti Line 16.
mbed_official 489:119543c9f674 232 * @retval None.
mbed_official 489:119543c9f674 233 */
mbed_official 489:119543c9f674 234 #define __HAL_PWR_PVD_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, PWR_EXTI_LINE_PVD)
mbed_official 489:119543c9f674 235
mbed_official 489:119543c9f674 236 /**
mbed_official 489:119543c9f674 237 * @brief Disable event on PVD Exti Line 16.
mbed_official 489:119543c9f674 238 * @retval None.
mbed_official 489:119543c9f674 239 */
mbed_official 489:119543c9f674 240 #define __HAL_PWR_PVD_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, PWR_EXTI_LINE_PVD)
mbed_official 489:119543c9f674 241
mbed_official 489:119543c9f674 242
mbed_official 489:119543c9f674 243 /**
mbed_official 489:119543c9f674 244 * @brief PVD EXTI line configuration: set falling edge trigger.
mbed_official 489:119543c9f674 245 * @retval None.
mbed_official 489:119543c9f674 246 */
mbed_official 489:119543c9f674 247 #define __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD)
mbed_official 489:119543c9f674 248
mbed_official 489:119543c9f674 249
mbed_official 489:119543c9f674 250 /**
mbed_official 489:119543c9f674 251 * @brief Disable the PVD Extended Interrupt Falling Trigger.
mbed_official 489:119543c9f674 252 * @retval None.
mbed_official 489:119543c9f674 253 */
mbed_official 489:119543c9f674 254 #define __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD)
mbed_official 489:119543c9f674 255
mbed_official 489:119543c9f674 256
mbed_official 489:119543c9f674 257 /**
mbed_official 489:119543c9f674 258 * @brief PVD EXTI line configuration: set rising edge trigger.
mbed_official 489:119543c9f674 259 * @retval None.
mbed_official 489:119543c9f674 260 */
mbed_official 489:119543c9f674 261 #define __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD)
mbed_official 489:119543c9f674 262
mbed_official 489:119543c9f674 263 /**
mbed_official 489:119543c9f674 264 * @brief Disable the PVD Extended Interrupt Rising Trigger.
mbed_official 489:119543c9f674 265 * This parameter can be:
mbed_official 489:119543c9f674 266 * @retval None.
mbed_official 489:119543c9f674 267 */
mbed_official 489:119543c9f674 268 #define __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD)
mbed_official 489:119543c9f674 269
mbed_official 489:119543c9f674 270 /**
mbed_official 489:119543c9f674 271 * @brief PVD EXTI line configuration: set rising & falling edge trigger.
mbed_official 489:119543c9f674 272 * @retval None.
mbed_official 489:119543c9f674 273 */
mbed_official 489:119543c9f674 274 #define __HAL_PWR_PVD_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE();
mbed_official 489:119543c9f674 275
mbed_official 489:119543c9f674 276 /**
mbed_official 489:119543c9f674 277 * @brief Disable the PVD Extended Interrupt Rising & Falling Trigger.
mbed_official 489:119543c9f674 278 * This parameter can be:
mbed_official 489:119543c9f674 279 * @retval None.
mbed_official 489:119543c9f674 280 */
mbed_official 489:119543c9f674 281 #define __HAL_PWR_PVD_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE();
mbed_official 489:119543c9f674 282
mbed_official 489:119543c9f674 283
mbed_official 489:119543c9f674 284
mbed_official 489:119543c9f674 285 /**
mbed_official 489:119543c9f674 286 * @brief Check whether the specified PVD EXTI interrupt flag is set or not.
mbed_official 489:119543c9f674 287 * @retval EXTI PVD Line Status.
mbed_official 489:119543c9f674 288 */
mbed_official 489:119543c9f674 289 #define __HAL_PWR_PVD_EXTI_GET_FLAG() (EXTI->PR & (PWR_EXTI_LINE_PVD))
mbed_official 489:119543c9f674 290
mbed_official 489:119543c9f674 291 /**
mbed_official 489:119543c9f674 292 * @brief Clear the PVD EXTI flag.
mbed_official 489:119543c9f674 293 * @retval None.
mbed_official 489:119543c9f674 294 */
mbed_official 489:119543c9f674 295 #define __HAL_PWR_PVD_EXTI_CLEAR_FLAG() (EXTI->PR = (PWR_EXTI_LINE_PVD))
mbed_official 489:119543c9f674 296
mbed_official 489:119543c9f674 297 /**
mbed_official 489:119543c9f674 298 * @brief Generate a Software interrupt on selected EXTI line.
mbed_official 489:119543c9f674 299 * @retval None.
mbed_official 489:119543c9f674 300 */
mbed_official 489:119543c9f674 301 #define __HAL_PWR_PVD_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, PWR_EXTI_LINE_PVD)
mbed_official 489:119543c9f674 302 /**
mbed_official 489:119543c9f674 303 * @}
mbed_official 489:119543c9f674 304 */
mbed_official 489:119543c9f674 305
mbed_official 489:119543c9f674 306 /* Private macro -------------------------------------------------------------*/
mbed_official 489:119543c9f674 307 /** @defgroup PWR_Private_Macros PWR Private Macros
mbed_official 489:119543c9f674 308 * @{
mbed_official 489:119543c9f674 309 */
mbed_official 489:119543c9f674 310 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \
mbed_official 489:119543c9f674 311 ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \
mbed_official 489:119543c9f674 312 ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \
mbed_official 489:119543c9f674 313 ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7))
mbed_official 489:119543c9f674 314
mbed_official 489:119543c9f674 315
mbed_official 489:119543c9f674 316 #define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_PVD_MODE_IT_RISING)|| ((MODE) == PWR_PVD_MODE_IT_FALLING) || \
mbed_official 489:119543c9f674 317 ((MODE) == PWR_PVD_MODE_IT_RISING_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING) || \
mbed_official 489:119543c9f674 318 ((MODE) == PWR_PVD_MODE_EVENT_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING_FALLING) || \
mbed_official 489:119543c9f674 319 ((MODE) == PWR_PVD_MODE_NORMAL))
mbed_official 489:119543c9f674 320
mbed_official 489:119543c9f674 321 #define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1))
mbed_official 489:119543c9f674 322
mbed_official 489:119543c9f674 323 #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \
mbed_official 489:119543c9f674 324 ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON))
mbed_official 489:119543c9f674 325
mbed_official 489:119543c9f674 326 #define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE))
mbed_official 489:119543c9f674 327
mbed_official 489:119543c9f674 328 #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE))
mbed_official 489:119543c9f674 329
mbed_official 489:119543c9f674 330 /**
mbed_official 489:119543c9f674 331 * @}
mbed_official 489:119543c9f674 332 */
mbed_official 489:119543c9f674 333
mbed_official 489:119543c9f674 334
mbed_official 489:119543c9f674 335
mbed_official 489:119543c9f674 336 /* Exported functions --------------------------------------------------------*/
mbed_official 489:119543c9f674 337
mbed_official 489:119543c9f674 338 /** @addtogroup PWR_Exported_Functions PWR Exported Functions
mbed_official 489:119543c9f674 339 * @{
mbed_official 489:119543c9f674 340 */
mbed_official 489:119543c9f674 341
mbed_official 489:119543c9f674 342 /** @addtogroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions
mbed_official 489:119543c9f674 343 * @{
mbed_official 489:119543c9f674 344 */
mbed_official 489:119543c9f674 345
mbed_official 489:119543c9f674 346 /* Initialization and de-initialization functions *******************************/
mbed_official 489:119543c9f674 347 void HAL_PWR_DeInit(void);
mbed_official 489:119543c9f674 348 void HAL_PWR_EnableBkUpAccess(void);
mbed_official 489:119543c9f674 349 void HAL_PWR_DisableBkUpAccess(void);
mbed_official 489:119543c9f674 350
mbed_official 489:119543c9f674 351 /**
mbed_official 489:119543c9f674 352 * @}
mbed_official 489:119543c9f674 353 */
mbed_official 489:119543c9f674 354
mbed_official 489:119543c9f674 355 /** @addtogroup PWR_Exported_Functions_Group2 Peripheral Control functions
mbed_official 489:119543c9f674 356 * @{
mbed_official 489:119543c9f674 357 */
mbed_official 489:119543c9f674 358
mbed_official 489:119543c9f674 359 /* Peripheral Control functions ************************************************/
mbed_official 489:119543c9f674 360 void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD);
mbed_official 489:119543c9f674 361 /* #define HAL_PWR_ConfigPVD 12*/
mbed_official 489:119543c9f674 362 void HAL_PWR_EnablePVD(void);
mbed_official 489:119543c9f674 363 void HAL_PWR_DisablePVD(void);
mbed_official 489:119543c9f674 364
mbed_official 489:119543c9f674 365 /* WakeUp pins configuration functions ****************************************/
mbed_official 489:119543c9f674 366 void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinx);
mbed_official 489:119543c9f674 367 void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx);
mbed_official 489:119543c9f674 368
mbed_official 489:119543c9f674 369 /* Low Power modes configuration functions ************************************/
mbed_official 489:119543c9f674 370 void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry);
mbed_official 489:119543c9f674 371 void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry);
mbed_official 489:119543c9f674 372 void HAL_PWR_EnterSTANDBYMode(void);
mbed_official 489:119543c9f674 373
mbed_official 489:119543c9f674 374 void HAL_PWR_EnableSleepOnExit(void);
mbed_official 489:119543c9f674 375 void HAL_PWR_DisableSleepOnExit(void);
mbed_official 489:119543c9f674 376 void HAL_PWR_EnableSEVOnPend(void);
mbed_official 489:119543c9f674 377 void HAL_PWR_DisableSEVOnPend(void);
mbed_official 489:119543c9f674 378
mbed_official 489:119543c9f674 379
mbed_official 489:119543c9f674 380
mbed_official 489:119543c9f674 381 void HAL_PWR_PVD_IRQHandler(void);
mbed_official 489:119543c9f674 382 void HAL_PWR_PVDCallback(void);
mbed_official 489:119543c9f674 383 /**
mbed_official 489:119543c9f674 384 * @}
mbed_official 489:119543c9f674 385 */
mbed_official 489:119543c9f674 386
mbed_official 489:119543c9f674 387 /**
mbed_official 489:119543c9f674 388 * @}
mbed_official 489:119543c9f674 389 */
mbed_official 489:119543c9f674 390
mbed_official 489:119543c9f674 391 /**
mbed_official 489:119543c9f674 392 * @}
mbed_official 489:119543c9f674 393 */
mbed_official 489:119543c9f674 394
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 #ifdef __cplusplus
mbed_official 489:119543c9f674 400 }
mbed_official 489:119543c9f674 401 #endif
mbed_official 489:119543c9f674 402
mbed_official 489:119543c9f674 403
mbed_official 489:119543c9f674 404 #endif /* __STM32F1xx_HAL_PWR_H */
mbed_official 489:119543c9f674 405
mbed_official 489:119543c9f674 406 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/