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:
Mon Nov 03 10:15:07 2014 +0000
Revision:
380:510f0c3515e3
Parent:
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F411RE/stm32f4xx_hal_pwr.h@235:685d5f11838f
Child:
532:fe11edbda85c
Synchronized with git revision 417f470ba9f4882d7079611cbc576afd9c49b0ef

Full URL: https://github.com/mbedmicro/mbed/commit/417f470ba9f4882d7079611cbc576afd9c49b0ef/

Targets: Factorisation of NUCLEO_F401RE and F411RE cmsis folders

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 235:685d5f11838f 1 /**
mbed_official 235:685d5f11838f 2 ******************************************************************************
mbed_official 235:685d5f11838f 3 * @file stm32f4xx_hal_pwr.h
mbed_official 235:685d5f11838f 4 * @author MCD Application Team
mbed_official 235:685d5f11838f 5 * @version V1.1.0
mbed_official 235:685d5f11838f 6 * @date 19-June-2014
mbed_official 235:685d5f11838f 7 * @brief Header file of PWR HAL module.
mbed_official 235:685d5f11838f 8 ******************************************************************************
mbed_official 235:685d5f11838f 9 * @attention
mbed_official 235:685d5f11838f 10 *
mbed_official 235:685d5f11838f 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 235:685d5f11838f 12 *
mbed_official 235:685d5f11838f 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 235:685d5f11838f 14 * are permitted provided that the following conditions are met:
mbed_official 235:685d5f11838f 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 235:685d5f11838f 16 * this list of conditions and the following disclaimer.
mbed_official 235:685d5f11838f 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 235:685d5f11838f 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 235:685d5f11838f 19 * and/or other materials provided with the distribution.
mbed_official 235:685d5f11838f 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 235:685d5f11838f 21 * may be used to endorse or promote products derived from this software
mbed_official 235:685d5f11838f 22 * without specific prior written permission.
mbed_official 235:685d5f11838f 23 *
mbed_official 235:685d5f11838f 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 235:685d5f11838f 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 235:685d5f11838f 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 235:685d5f11838f 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 235:685d5f11838f 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 235:685d5f11838f 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 235:685d5f11838f 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 235:685d5f11838f 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 235:685d5f11838f 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 235:685d5f11838f 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 235:685d5f11838f 34 *
mbed_official 235:685d5f11838f 35 ******************************************************************************
mbed_official 235:685d5f11838f 36 */
mbed_official 235:685d5f11838f 37
mbed_official 235:685d5f11838f 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 235:685d5f11838f 39 #ifndef __STM32F4xx_HAL_PWR_H
mbed_official 235:685d5f11838f 40 #define __STM32F4xx_HAL_PWR_H
mbed_official 235:685d5f11838f 41
mbed_official 235:685d5f11838f 42 #ifdef __cplusplus
mbed_official 235:685d5f11838f 43 extern "C" {
mbed_official 235:685d5f11838f 44 #endif
mbed_official 235:685d5f11838f 45
mbed_official 235:685d5f11838f 46 /* Includes ------------------------------------------------------------------*/
mbed_official 235:685d5f11838f 47 #include "stm32f4xx_hal_def.h"
mbed_official 235:685d5f11838f 48
mbed_official 235:685d5f11838f 49 /** @addtogroup STM32F4xx_HAL_Driver
mbed_official 235:685d5f11838f 50 * @{
mbed_official 235:685d5f11838f 51 */
mbed_official 235:685d5f11838f 52
mbed_official 235:685d5f11838f 53 /** @addtogroup PWR
mbed_official 235:685d5f11838f 54 * @{
mbed_official 235:685d5f11838f 55 */
mbed_official 235:685d5f11838f 56
mbed_official 235:685d5f11838f 57 /* Exported types ------------------------------------------------------------*/
mbed_official 235:685d5f11838f 58 /**
mbed_official 235:685d5f11838f 59 * @brief PWR PVD configuration structure definition
mbed_official 235:685d5f11838f 60 */
mbed_official 235:685d5f11838f 61 typedef struct
mbed_official 235:685d5f11838f 62 {
mbed_official 235:685d5f11838f 63 uint32_t PVDLevel; /*!< PVDLevel: Specifies the PVD detection level.
mbed_official 235:685d5f11838f 64 This parameter can be a value of @ref PWR_PVD_detection_level */
mbed_official 235:685d5f11838f 65
mbed_official 235:685d5f11838f 66 uint32_t Mode; /*!< Mode: Specifies the operating mode for the selected pins.
mbed_official 235:685d5f11838f 67 This parameter can be a value of @ref PWR_PVD_Mode */
mbed_official 235:685d5f11838f 68 }PWR_PVDTypeDef;
mbed_official 235:685d5f11838f 69
mbed_official 235:685d5f11838f 70 /* Exported constants --------------------------------------------------------*/
mbed_official 235:685d5f11838f 71 /* ------------- PWR registers bit address in the alias region ---------------*/
mbed_official 235:685d5f11838f 72 #define PWR_OFFSET (PWR_BASE - PERIPH_BASE)
mbed_official 235:685d5f11838f 73
mbed_official 235:685d5f11838f 74 /* --- CR Register ---*/
mbed_official 235:685d5f11838f 75 /* Alias word address of DBP bit */
mbed_official 235:685d5f11838f 76 #define CR_OFFSET (PWR_OFFSET + 0x00)
mbed_official 235:685d5f11838f 77 #define DBP_BitNumber 0x08
mbed_official 235:685d5f11838f 78 #define CR_DBP_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (DBP_BitNumber * 4))
mbed_official 235:685d5f11838f 79
mbed_official 235:685d5f11838f 80 /* Alias word address of PVDE bit */
mbed_official 235:685d5f11838f 81 #define PVDE_BitNumber 0x04
mbed_official 235:685d5f11838f 82 #define CR_PVDE_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PVDE_BitNumber * 4))
mbed_official 235:685d5f11838f 83
mbed_official 235:685d5f11838f 84 /* Alias word address of PMODE bit */
mbed_official 235:685d5f11838f 85 #define PMODE_BitNumber 0x0E
mbed_official 235:685d5f11838f 86 #define CR_PMODE_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (PMODE_BitNumber * 4))
mbed_official 235:685d5f11838f 87
mbed_official 235:685d5f11838f 88 /* --- CSR Register ---*/
mbed_official 235:685d5f11838f 89 /* Alias word address of EWUP bit */
mbed_official 235:685d5f11838f 90 #define CSR_OFFSET (PWR_OFFSET + 0x04)
mbed_official 235:685d5f11838f 91 #define EWUP_BitNumber 0x08
mbed_official 235:685d5f11838f 92 #define CSR_EWUP_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (EWUP_BitNumber * 4))
mbed_official 235:685d5f11838f 93
mbed_official 235:685d5f11838f 94 /** @defgroup PWR_Exported_Constants
mbed_official 235:685d5f11838f 95 * @{
mbed_official 235:685d5f11838f 96 */
mbed_official 235:685d5f11838f 97
mbed_official 235:685d5f11838f 98 /** @defgroup PWR_WakeUp_Pins
mbed_official 235:685d5f11838f 99 * @{
mbed_official 235:685d5f11838f 100 */
mbed_official 235:685d5f11838f 101
mbed_official 235:685d5f11838f 102 #define PWR_WAKEUP_PIN1 PWR_CSR_EWUP
mbed_official 235:685d5f11838f 103 #define IS_PWR_WAKEUP_PIN(PIN) ((PIN) == PWR_WAKEUP_PIN1)
mbed_official 235:685d5f11838f 104 /**
mbed_official 235:685d5f11838f 105 * @}
mbed_official 235:685d5f11838f 106 */
mbed_official 235:685d5f11838f 107
mbed_official 235:685d5f11838f 108 /** @defgroup PWR_PVD_detection_level
mbed_official 235:685d5f11838f 109 * @{
mbed_official 235:685d5f11838f 110 */
mbed_official 235:685d5f11838f 111 #define PWR_PVDLEVEL_0 PWR_CR_PLS_LEV0
mbed_official 235:685d5f11838f 112 #define PWR_PVDLEVEL_1 PWR_CR_PLS_LEV1
mbed_official 235:685d5f11838f 113 #define PWR_PVDLEVEL_2 PWR_CR_PLS_LEV2
mbed_official 235:685d5f11838f 114 #define PWR_PVDLEVEL_3 PWR_CR_PLS_LEV3
mbed_official 235:685d5f11838f 115 #define PWR_PVDLEVEL_4 PWR_CR_PLS_LEV4
mbed_official 235:685d5f11838f 116 #define PWR_PVDLEVEL_5 PWR_CR_PLS_LEV5
mbed_official 235:685d5f11838f 117 #define PWR_PVDLEVEL_6 PWR_CR_PLS_LEV6
mbed_official 235:685d5f11838f 118 #define PWR_PVDLEVEL_7 PWR_CR_PLS_LEV7
mbed_official 235:685d5f11838f 119 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \
mbed_official 235:685d5f11838f 120 ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \
mbed_official 235:685d5f11838f 121 ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \
mbed_official 235:685d5f11838f 122 ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7))
mbed_official 235:685d5f11838f 123 /**
mbed_official 235:685d5f11838f 124 * @}
mbed_official 235:685d5f11838f 125 */
mbed_official 235:685d5f11838f 126
mbed_official 235:685d5f11838f 127 /** @defgroup PWR_PVD_Mode
mbed_official 235:685d5f11838f 128 * @{
mbed_official 235:685d5f11838f 129 */
mbed_official 235:685d5f11838f 130 #define PWR_MODE_EVT ((uint32_t)0x00000000) /*!< No Interrupt */
mbed_official 235:685d5f11838f 131 #define PWR_MODE_IT_RISING ((uint32_t)0x00000001) /*!< External Interrupt Mode with Rising edge trigger detection */
mbed_official 235:685d5f11838f 132 #define PWR_MODE_IT_FALLING ((uint32_t)0x00000002) /*!< External Interrupt Mode with Falling edge trigger detection */
mbed_official 235:685d5f11838f 133 #define PWR_MODE_IT_RISING_FALLING ((uint32_t)0x00000003) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
mbed_official 235:685d5f11838f 134 #define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_MODE_EVT) || ((MODE) == PWR_MODE_IT_RISING)|| \
mbed_official 235:685d5f11838f 135 ((MODE) == PWR_MODE_IT_FALLING) || ((MODE) == PWR_MODE_IT_RISING_FALLING))
mbed_official 235:685d5f11838f 136 /**
mbed_official 235:685d5f11838f 137 * @}
mbed_official 235:685d5f11838f 138 */
mbed_official 235:685d5f11838f 139
mbed_official 235:685d5f11838f 140 /** @defgroup PWR_Regulator_state_in_STOP_mode
mbed_official 235:685d5f11838f 141 * @{
mbed_official 235:685d5f11838f 142 */
mbed_official 235:685d5f11838f 143 #define PWR_MAINREGULATOR_ON ((uint32_t)0x00000000)
mbed_official 235:685d5f11838f 144 #define PWR_LOWPOWERREGULATOR_ON PWR_CR_LPDS
mbed_official 235:685d5f11838f 145
mbed_official 235:685d5f11838f 146 #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \
mbed_official 235:685d5f11838f 147 ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON))
mbed_official 235:685d5f11838f 148 /**
mbed_official 235:685d5f11838f 149 * @}
mbed_official 235:685d5f11838f 150 */
mbed_official 235:685d5f11838f 151
mbed_official 235:685d5f11838f 152 /** @defgroup PWR_SLEEP_mode_entry
mbed_official 235:685d5f11838f 153 * @{
mbed_official 235:685d5f11838f 154 */
mbed_official 235:685d5f11838f 155 #define PWR_SLEEPENTRY_WFI ((uint8_t)0x01)
mbed_official 235:685d5f11838f 156 #define PWR_SLEEPENTRY_WFE ((uint8_t)0x02)
mbed_official 235:685d5f11838f 157 #define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE))
mbed_official 235:685d5f11838f 158 /**
mbed_official 235:685d5f11838f 159 * @}
mbed_official 235:685d5f11838f 160 */
mbed_official 235:685d5f11838f 161
mbed_official 235:685d5f11838f 162 /** @defgroup PWR_STOP_mode_entry
mbed_official 235:685d5f11838f 163 * @{
mbed_official 235:685d5f11838f 164 */
mbed_official 235:685d5f11838f 165 #define PWR_STOPENTRY_WFI ((uint8_t)0x01)
mbed_official 235:685d5f11838f 166 #define PWR_STOPENTRY_WFE ((uint8_t)0x02)
mbed_official 235:685d5f11838f 167 #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE))
mbed_official 235:685d5f11838f 168 /**
mbed_official 235:685d5f11838f 169 * @}
mbed_official 235:685d5f11838f 170 */
mbed_official 235:685d5f11838f 171
mbed_official 235:685d5f11838f 172 /** @defgroup PWR_Regulator_Voltage_Scale
mbed_official 235:685d5f11838f 173 * @{
mbed_official 235:685d5f11838f 174 */
mbed_official 235:685d5f11838f 175 #define PWR_REGULATOR_VOLTAGE_SCALE1 ((uint32_t)0x0000C000)
mbed_official 235:685d5f11838f 176 #define PWR_REGULATOR_VOLTAGE_SCALE2 ((uint32_t)0x00008000)
mbed_official 235:685d5f11838f 177 #define PWR_REGULATOR_VOLTAGE_SCALE3 ((uint32_t)0x00004000)
mbed_official 235:685d5f11838f 178 #define IS_PWR_REGULATOR_VOLTAGE(VOLTAGE) (((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE1) || \
mbed_official 235:685d5f11838f 179 ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE2) || \
mbed_official 235:685d5f11838f 180 ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE3))
mbed_official 235:685d5f11838f 181 /**
mbed_official 235:685d5f11838f 182 * @}
mbed_official 235:685d5f11838f 183 */
mbed_official 235:685d5f11838f 184
mbed_official 235:685d5f11838f 185 /** @defgroup PWR_Flag
mbed_official 235:685d5f11838f 186 * @{
mbed_official 235:685d5f11838f 187 */
mbed_official 235:685d5f11838f 188 #define PWR_FLAG_WU PWR_CSR_WUF
mbed_official 235:685d5f11838f 189 #define PWR_FLAG_SB PWR_CSR_SBF
mbed_official 235:685d5f11838f 190 #define PWR_FLAG_PVDO PWR_CSR_PVDO
mbed_official 235:685d5f11838f 191 #define PWR_FLAG_BRR PWR_CSR_BRR
mbed_official 235:685d5f11838f 192 #define PWR_FLAG_VOSRDY PWR_CSR_VOSRDY
mbed_official 235:685d5f11838f 193
mbed_official 235:685d5f11838f 194 /**
mbed_official 235:685d5f11838f 195 * @}
mbed_official 235:685d5f11838f 196 */
mbed_official 235:685d5f11838f 197
mbed_official 235:685d5f11838f 198 /**
mbed_official 235:685d5f11838f 199 * @}
mbed_official 235:685d5f11838f 200 */
mbed_official 235:685d5f11838f 201
mbed_official 235:685d5f11838f 202 /* Exported macro ------------------------------------------------------------*/
mbed_official 235:685d5f11838f 203
mbed_official 235:685d5f11838f 204 /** @brief macros configure the main internal regulator output voltage.
mbed_official 235:685d5f11838f 205 * @param __REGULATOR__: specifies the regulator output voltage to achieve
mbed_official 235:685d5f11838f 206 * a tradeoff between performance and power consumption when the device does
mbed_official 235:685d5f11838f 207 * not operate at the maximum frequency (refer to the datasheets for more details).
mbed_official 235:685d5f11838f 208 * This parameter can be one of the following values:
mbed_official 235:685d5f11838f 209 * @arg PWR_REGULATOR_VOLTAGE_SCALE1: Regulator voltage output Scale 1 mode
mbed_official 235:685d5f11838f 210 * @arg PWR_REGULATOR_VOLTAGE_SCALE2: Regulator voltage output Scale 2 mode
mbed_official 235:685d5f11838f 211 * @arg PWR_REGULATOR_VOLTAGE_SCALE3: Regulator voltage output Scale 3 mode
mbed_official 235:685d5f11838f 212 * @retval None
mbed_official 235:685d5f11838f 213 */
mbed_official 235:685d5f11838f 214 #define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__) (MODIFY_REG(PWR->CR, PWR_CR_VOS, (__REGULATOR__)))
mbed_official 235:685d5f11838f 215
mbed_official 235:685d5f11838f 216 /** @brief Check PWR flag is set or not.
mbed_official 235:685d5f11838f 217 * @param __FLAG__: specifies the flag to check.
mbed_official 235:685d5f11838f 218 * This parameter can be one of the following values:
mbed_official 235:685d5f11838f 219 * @arg PWR_FLAG_WU: Wake Up flag. This flag indicates that a wakeup event
mbed_official 235:685d5f11838f 220 * was received from the WKUP pin or from the RTC alarm (Alarm A
mbed_official 235:685d5f11838f 221 * or Alarm B), RTC Tamper event, RTC TimeStamp event or RTC Wakeup.
mbed_official 235:685d5f11838f 222 * An additional wakeup event is detected if the WKUP pin is enabled
mbed_official 235:685d5f11838f 223 * (by setting the EWUP bit) when the WKUP pin level is already high.
mbed_official 235:685d5f11838f 224 * @arg PWR_FLAG_SB: StandBy flag. This flag indicates that the system was
mbed_official 235:685d5f11838f 225 * resumed from StandBy mode.
mbed_official 235:685d5f11838f 226 * @arg PWR_FLAG_PVDO: PVD Output. This flag is valid only if PVD is enabled
mbed_official 235:685d5f11838f 227 * by the HAL_PWR_EnablePVD() function. The PVD is stopped by Standby mode
mbed_official 235:685d5f11838f 228 * For this reason, this bit is equal to 0 after Standby or reset
mbed_official 235:685d5f11838f 229 * until the PVDE bit is set.
mbed_official 235:685d5f11838f 230 * @arg PWR_FLAG_BRR: Backup regulator ready flag. This bit is not reset
mbed_official 235:685d5f11838f 231 * when the device wakes up from Standby mode or by a system reset
mbed_official 235:685d5f11838f 232 * or power reset.
mbed_official 235:685d5f11838f 233 * @arg PWR_FLAG_VOSRDY: This flag indicates that the Regulator voltage
mbed_official 235:685d5f11838f 234 * scaling output selection is ready.
mbed_official 235:685d5f11838f 235 * @retval The new state of __FLAG__ (TRUE or FALSE).
mbed_official 235:685d5f11838f 236 */
mbed_official 235:685d5f11838f 237 #define __HAL_PWR_GET_FLAG(__FLAG__) ((PWR->CSR & (__FLAG__)) == (__FLAG__))
mbed_official 235:685d5f11838f 238
mbed_official 235:685d5f11838f 239 /** @brief Clear the PWR's pending flags.
mbed_official 235:685d5f11838f 240 * @param __FLAG__: specifies the flag to clear.
mbed_official 235:685d5f11838f 241 * This parameter can be one of the following values:
mbed_official 235:685d5f11838f 242 * @arg PWR_FLAG_WU: Wake Up flag
mbed_official 235:685d5f11838f 243 * @arg PWR_FLAG_SB: StandBy flag
mbed_official 235:685d5f11838f 244 */
mbed_official 235:685d5f11838f 245 #define __HAL_PWR_CLEAR_FLAG(__FLAG__) (PWR->CR |= (__FLAG__) << 2)
mbed_official 235:685d5f11838f 246
mbed_official 235:685d5f11838f 247 #define PWR_EXTI_LINE_PVD ((uint32_t)0x00010000) /*!< External interrupt line 16 Connected to the PVD EXTI Line */
mbed_official 235:685d5f11838f 248 /**
mbed_official 235:685d5f11838f 249 * @brief Enable the PVD Exti Line.
mbed_official 235:685d5f11838f 250 * @param __EXTILINE__: specifies the PVD Exti sources to be enabled.
mbed_official 235:685d5f11838f 251 * This parameter can be:
mbed_official 235:685d5f11838f 252 * @arg PWR_EXTI_LINE_PVD
mbed_official 235:685d5f11838f 253 * @retval None.
mbed_official 235:685d5f11838f 254 */
mbed_official 235:685d5f11838f 255 #define __HAL_PVD_EXTI_ENABLE_IT(__EXTILINE__) (EXTI->IMR |= (__EXTILINE__))
mbed_official 235:685d5f11838f 256
mbed_official 235:685d5f11838f 257 /**
mbed_official 235:685d5f11838f 258 * @brief Disable the PVD EXTI Line.
mbed_official 235:685d5f11838f 259 * @param __EXTILINE__: specifies the PVD EXTI sources to be disabled.
mbed_official 235:685d5f11838f 260 * This parameter can be:
mbed_official 235:685d5f11838f 261 * @arg PWR_EXTI_LINE_PVD
mbed_official 235:685d5f11838f 262 * @retval None.
mbed_official 235:685d5f11838f 263 */
mbed_official 235:685d5f11838f 264 #define __HAL_PVD_EXTI_DISABLE_IT(__EXTILINE__) (EXTI->IMR &= ~(__EXTILINE__))
mbed_official 235:685d5f11838f 265
mbed_official 235:685d5f11838f 266 /**
mbed_official 235:685d5f11838f 267 * @brief checks whether the specified PVD Exti interrupt flag is set or not.
mbed_official 235:685d5f11838f 268 * @param __EXTILINE__: specifies the PVD Exti sources to be cleared.
mbed_official 235:685d5f11838f 269 * This parameter can be:
mbed_official 235:685d5f11838f 270 * @arg PWR_EXTI_LINE_PVD
mbed_official 235:685d5f11838f 271 * @retval EXTI PVD Line Status.
mbed_official 235:685d5f11838f 272 */
mbed_official 235:685d5f11838f 273 #define __HAL_PVD_EXTI_GET_FLAG(__EXTILINE__) (EXTI->PR & (__EXTILINE__))
mbed_official 235:685d5f11838f 274
mbed_official 235:685d5f11838f 275 /**
mbed_official 235:685d5f11838f 276 * @brief Clear the PVD Exti flag.
mbed_official 235:685d5f11838f 277 * @param __EXTILINE__: specifies the PVD Exti sources to be cleared.
mbed_official 235:685d5f11838f 278 * This parameter can be:
mbed_official 235:685d5f11838f 279 * @arg PWR_EXTI_LINE_PVD
mbed_official 235:685d5f11838f 280 * @retval None.
mbed_official 235:685d5f11838f 281 */
mbed_official 235:685d5f11838f 282 #define __HAL_PVD_EXTI_CLEAR_FLAG(__EXTILINE__) (EXTI->PR = (__EXTILINE__))
mbed_official 235:685d5f11838f 283
mbed_official 235:685d5f11838f 284 /**
mbed_official 235:685d5f11838f 285 * @brief Generates a Software interrupt on selected EXTI line.
mbed_official 235:685d5f11838f 286 * @param __EXTILINE__: specifies the PVD EXTI sources to be disabled.
mbed_official 235:685d5f11838f 287 * This parameter can be:
mbed_official 235:685d5f11838f 288 * @arg PWR_EXTI_LINE_PVD
mbed_official 235:685d5f11838f 289 * @retval None
mbed_official 235:685d5f11838f 290 */
mbed_official 235:685d5f11838f 291 #define __HAL_PVD_EXTI_GENERATE_SWIT(__EXTI_LINE__) (EXTI->SWIER |= (__EXTI_LINE__))
mbed_official 235:685d5f11838f 292
mbed_official 235:685d5f11838f 293 /* Include PWR HAL Extension module */
mbed_official 235:685d5f11838f 294 #include "stm32f4xx_hal_pwr_ex.h"
mbed_official 235:685d5f11838f 295
mbed_official 235:685d5f11838f 296 /* Exported functions --------------------------------------------------------*/
mbed_official 235:685d5f11838f 297
mbed_official 235:685d5f11838f 298 /* Initialization and de-initialization functions *****************************/
mbed_official 235:685d5f11838f 299 void HAL_PWR_DeInit(void);
mbed_official 235:685d5f11838f 300 void HAL_PWR_EnableBkUpAccess(void);
mbed_official 235:685d5f11838f 301 void HAL_PWR_DisableBkUpAccess(void);
mbed_official 235:685d5f11838f 302
mbed_official 235:685d5f11838f 303 /* Peripheral Control functions **********************************************/
mbed_official 235:685d5f11838f 304 /* PVD configuration */
mbed_official 235:685d5f11838f 305 void HAL_PWR_PVDConfig(PWR_PVDTypeDef *sConfigPVD);
mbed_official 235:685d5f11838f 306 void HAL_PWR_EnablePVD(void);
mbed_official 235:685d5f11838f 307 void HAL_PWR_DisablePVD(void);
mbed_official 235:685d5f11838f 308
mbed_official 235:685d5f11838f 309 /* WakeUp pins configuration */
mbed_official 235:685d5f11838f 310 void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinx);
mbed_official 235:685d5f11838f 311 void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx);
mbed_official 235:685d5f11838f 312
mbed_official 235:685d5f11838f 313 /* Low Power modes entry */
mbed_official 235:685d5f11838f 314 void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry);
mbed_official 235:685d5f11838f 315 void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry);
mbed_official 235:685d5f11838f 316 void HAL_PWR_EnterSTANDBYMode(void);
mbed_official 235:685d5f11838f 317
mbed_official 235:685d5f11838f 318 void HAL_PWR_PVD_IRQHandler(void);
mbed_official 235:685d5f11838f 319 void HAL_PWR_PVDCallback(void);
mbed_official 235:685d5f11838f 320
mbed_official 235:685d5f11838f 321
mbed_official 235:685d5f11838f 322 /**
mbed_official 235:685d5f11838f 323 * @}
mbed_official 235:685d5f11838f 324 */
mbed_official 235:685d5f11838f 325
mbed_official 235:685d5f11838f 326 /**
mbed_official 235:685d5f11838f 327 * @}
mbed_official 235:685d5f11838f 328 */
mbed_official 235:685d5f11838f 329
mbed_official 235:685d5f11838f 330 #ifdef __cplusplus
mbed_official 235:685d5f11838f 331 }
mbed_official 235:685d5f11838f 332 #endif
mbed_official 235:685d5f11838f 333
mbed_official 235:685d5f11838f 334
mbed_official 235:685d5f11838f 335 #endif /* __STM32F4xx_HAL_PWR_H */
mbed_official 235:685d5f11838f 336
mbed_official 235:685d5f11838f 337 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/