mbed library sources

Dependents:   Marvino mbot

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Aug 14 13:15:17 2015 +0100
Revision:
610:813dcc80987e
Parent:
573:ad23fe03a082
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599

Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/

DISCO_F746NG - Improvements

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 573:ad23fe03a082 1 /**
mbed_official 573:ad23fe03a082 2 ******************************************************************************
mbed_official 573:ad23fe03a082 3 * @file stm32f7xx_hal_pwr.h
mbed_official 573:ad23fe03a082 4 * @author MCD Application Team
mbed_official 610:813dcc80987e 5 * @version V1.0.1
mbed_official 610:813dcc80987e 6 * @date 25-June-2015
mbed_official 573:ad23fe03a082 7 * @brief Header file of PWR HAL module.
mbed_official 573:ad23fe03a082 8 ******************************************************************************
mbed_official 573:ad23fe03a082 9 * @attention
mbed_official 573:ad23fe03a082 10 *
mbed_official 573:ad23fe03a082 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 573:ad23fe03a082 12 *
mbed_official 573:ad23fe03a082 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 573:ad23fe03a082 14 * are permitted provided that the following conditions are met:
mbed_official 573:ad23fe03a082 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 573:ad23fe03a082 16 * this list of conditions and the following disclaimer.
mbed_official 573:ad23fe03a082 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 573:ad23fe03a082 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 573:ad23fe03a082 19 * and/or other materials provided with the distribution.
mbed_official 573:ad23fe03a082 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 573:ad23fe03a082 21 * may be used to endorse or promote products derived from this software
mbed_official 573:ad23fe03a082 22 * without specific prior written permission.
mbed_official 573:ad23fe03a082 23 *
mbed_official 573:ad23fe03a082 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 573:ad23fe03a082 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 573:ad23fe03a082 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 573:ad23fe03a082 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 573:ad23fe03a082 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 573:ad23fe03a082 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 573:ad23fe03a082 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 573:ad23fe03a082 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 573:ad23fe03a082 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 573:ad23fe03a082 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 573:ad23fe03a082 34 *
mbed_official 573:ad23fe03a082 35 ******************************************************************************
mbed_official 573:ad23fe03a082 36 */
mbed_official 573:ad23fe03a082 37
mbed_official 573:ad23fe03a082 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 573:ad23fe03a082 39 #ifndef __STM32F7xx_HAL_PWR_H
mbed_official 573:ad23fe03a082 40 #define __STM32F7xx_HAL_PWR_H
mbed_official 573:ad23fe03a082 41
mbed_official 573:ad23fe03a082 42 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 43 extern "C" {
mbed_official 573:ad23fe03a082 44 #endif
mbed_official 573:ad23fe03a082 45
mbed_official 573:ad23fe03a082 46 /* Includes ------------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 47 #include "stm32f7xx_hal_def.h"
mbed_official 573:ad23fe03a082 48
mbed_official 573:ad23fe03a082 49 /** @addtogroup STM32F7xx_HAL_Driver
mbed_official 573:ad23fe03a082 50 * @{
mbed_official 573:ad23fe03a082 51 */
mbed_official 573:ad23fe03a082 52
mbed_official 573:ad23fe03a082 53 /** @addtogroup PWR
mbed_official 573:ad23fe03a082 54 * @{
mbed_official 573:ad23fe03a082 55 */
mbed_official 573:ad23fe03a082 56
mbed_official 573:ad23fe03a082 57 /* Exported types ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 58
mbed_official 573:ad23fe03a082 59 /** @defgroup PWR_Exported_Types PWR Exported Types
mbed_official 573:ad23fe03a082 60 * @{
mbed_official 573:ad23fe03a082 61 */
mbed_official 573:ad23fe03a082 62
mbed_official 573:ad23fe03a082 63 /**
mbed_official 573:ad23fe03a082 64 * @brief PWR PVD configuration structure definition
mbed_official 573:ad23fe03a082 65 */
mbed_official 573:ad23fe03a082 66 typedef struct
mbed_official 573:ad23fe03a082 67 {
mbed_official 573:ad23fe03a082 68 uint32_t PVDLevel; /*!< PVDLevel: Specifies the PVD detection level.
mbed_official 573:ad23fe03a082 69 This parameter can be a value of @ref PWR_PVD_detection_level */
mbed_official 573:ad23fe03a082 70
mbed_official 573:ad23fe03a082 71 uint32_t Mode; /*!< Mode: Specifies the operating mode for the selected pins.
mbed_official 573:ad23fe03a082 72 This parameter can be a value of @ref PWR_PVD_Mode */
mbed_official 573:ad23fe03a082 73 }PWR_PVDTypeDef;
mbed_official 573:ad23fe03a082 74
mbed_official 573:ad23fe03a082 75 /**
mbed_official 573:ad23fe03a082 76 * @}
mbed_official 573:ad23fe03a082 77 */
mbed_official 573:ad23fe03a082 78
mbed_official 573:ad23fe03a082 79 /* Exported constants --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 80 /** @defgroup PWR_Exported_Constants PWR Exported Constants
mbed_official 573:ad23fe03a082 81 * @{
mbed_official 573:ad23fe03a082 82 */
mbed_official 573:ad23fe03a082 83
mbed_official 573:ad23fe03a082 84 /** @defgroup PWR_PVD_detection_level PWR PVD detection level
mbed_official 573:ad23fe03a082 85 * @{
mbed_official 573:ad23fe03a082 86 */
mbed_official 573:ad23fe03a082 87 #define PWR_PVDLEVEL_0 PWR_CR1_PLS_LEV0
mbed_official 573:ad23fe03a082 88 #define PWR_PVDLEVEL_1 PWR_CR1_PLS_LEV1
mbed_official 573:ad23fe03a082 89 #define PWR_PVDLEVEL_2 PWR_CR1_PLS_LEV2
mbed_official 573:ad23fe03a082 90 #define PWR_PVDLEVEL_3 PWR_CR1_PLS_LEV3
mbed_official 573:ad23fe03a082 91 #define PWR_PVDLEVEL_4 PWR_CR1_PLS_LEV4
mbed_official 573:ad23fe03a082 92 #define PWR_PVDLEVEL_5 PWR_CR1_PLS_LEV5
mbed_official 573:ad23fe03a082 93 #define PWR_PVDLEVEL_6 PWR_CR1_PLS_LEV6
mbed_official 573:ad23fe03a082 94 #define PWR_PVDLEVEL_7 PWR_CR1_PLS_LEV7/* External input analog voltage
mbed_official 573:ad23fe03a082 95 (Compare internally to VREFINT) */
mbed_official 573:ad23fe03a082 96
mbed_official 573:ad23fe03a082 97 /**
mbed_official 573:ad23fe03a082 98 * @}
mbed_official 573:ad23fe03a082 99 */
mbed_official 573:ad23fe03a082 100
mbed_official 573:ad23fe03a082 101 /** @defgroup PWR_PVD_Mode PWR PVD Mode
mbed_official 573:ad23fe03a082 102 * @{
mbed_official 573:ad23fe03a082 103 */
mbed_official 573:ad23fe03a082 104 #define PWR_PVD_MODE_NORMAL ((uint32_t)0x00000000) /*!< basic mode is used */
mbed_official 573:ad23fe03a082 105 #define PWR_PVD_MODE_IT_RISING ((uint32_t)0x00010001) /*!< External Interrupt Mode with Rising edge trigger detection */
mbed_official 573:ad23fe03a082 106 #define PWR_PVD_MODE_IT_FALLING ((uint32_t)0x00010002) /*!< External Interrupt Mode with Falling edge trigger detection */
mbed_official 573:ad23fe03a082 107 #define PWR_PVD_MODE_IT_RISING_FALLING ((uint32_t)0x00010003) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
mbed_official 573:ad23fe03a082 108 #define PWR_PVD_MODE_EVENT_RISING ((uint32_t)0x00020001) /*!< Event Mode with Rising edge trigger detection */
mbed_official 573:ad23fe03a082 109 #define PWR_PVD_MODE_EVENT_FALLING ((uint32_t)0x00020002) /*!< Event Mode with Falling edge trigger detection */
mbed_official 573:ad23fe03a082 110 #define PWR_PVD_MODE_EVENT_RISING_FALLING ((uint32_t)0x00020003) /*!< Event Mode with Rising/Falling edge trigger detection */
mbed_official 573:ad23fe03a082 111 /**
mbed_official 573:ad23fe03a082 112 * @}
mbed_official 573:ad23fe03a082 113 */
mbed_official 573:ad23fe03a082 114
mbed_official 573:ad23fe03a082 115 /** @defgroup PWR_Regulator_state_in_STOP_mode PWR Regulator state in SLEEP/STOP mode
mbed_official 573:ad23fe03a082 116 * @{
mbed_official 573:ad23fe03a082 117 */
mbed_official 573:ad23fe03a082 118 #define PWR_MAINREGULATOR_ON ((uint32_t)0x00000000)
mbed_official 573:ad23fe03a082 119 #define PWR_LOWPOWERREGULATOR_ON PWR_CR1_LPDS
mbed_official 573:ad23fe03a082 120 /**
mbed_official 573:ad23fe03a082 121 * @}
mbed_official 573:ad23fe03a082 122 */
mbed_official 573:ad23fe03a082 123
mbed_official 573:ad23fe03a082 124 /** @defgroup PWR_SLEEP_mode_entry PWR SLEEP mode entry
mbed_official 573:ad23fe03a082 125 * @{
mbed_official 573:ad23fe03a082 126 */
mbed_official 573:ad23fe03a082 127 #define PWR_SLEEPENTRY_WFI ((uint8_t)0x01)
mbed_official 573:ad23fe03a082 128 #define PWR_SLEEPENTRY_WFE ((uint8_t)0x02)
mbed_official 573:ad23fe03a082 129 /**
mbed_official 573:ad23fe03a082 130 * @}
mbed_official 573:ad23fe03a082 131 */
mbed_official 573:ad23fe03a082 132
mbed_official 573:ad23fe03a082 133 /** @defgroup PWR_STOP_mode_entry PWR STOP mode entry
mbed_official 573:ad23fe03a082 134 * @{
mbed_official 573:ad23fe03a082 135 */
mbed_official 573:ad23fe03a082 136 #define PWR_STOPENTRY_WFI ((uint8_t)0x01)
mbed_official 573:ad23fe03a082 137 #define PWR_STOPENTRY_WFE ((uint8_t)0x02)
mbed_official 573:ad23fe03a082 138 /**
mbed_official 573:ad23fe03a082 139 * @}
mbed_official 573:ad23fe03a082 140 */
mbed_official 573:ad23fe03a082 141
mbed_official 573:ad23fe03a082 142 /** @defgroup PWR_Regulator_Voltage_Scale PWR Regulator Voltage Scale
mbed_official 573:ad23fe03a082 143 * @{
mbed_official 573:ad23fe03a082 144 */
mbed_official 573:ad23fe03a082 145 #define PWR_REGULATOR_VOLTAGE_SCALE1 PWR_CR1_VOS
mbed_official 573:ad23fe03a082 146 #define PWR_REGULATOR_VOLTAGE_SCALE2 PWR_CR1_VOS_1
mbed_official 573:ad23fe03a082 147 #define PWR_REGULATOR_VOLTAGE_SCALE3 PWR_CR1_VOS_0
mbed_official 573:ad23fe03a082 148 /**
mbed_official 573:ad23fe03a082 149 * @}
mbed_official 573:ad23fe03a082 150 */
mbed_official 573:ad23fe03a082 151
mbed_official 573:ad23fe03a082 152 /** @defgroup PWR_Flag PWR Flag
mbed_official 573:ad23fe03a082 153 * @{
mbed_official 573:ad23fe03a082 154 */
mbed_official 573:ad23fe03a082 155 #define PWR_FLAG_WU PWR_CSR1_WUIF
mbed_official 573:ad23fe03a082 156 #define PWR_FLAG_SB PWR_CSR1_SBF
mbed_official 573:ad23fe03a082 157 #define PWR_FLAG_PVDO PWR_CSR1_PVDO
mbed_official 573:ad23fe03a082 158 #define PWR_FLAG_BRR PWR_CSR1_BRR
mbed_official 573:ad23fe03a082 159 #define PWR_FLAG_VOSRDY PWR_CSR1_VOSRDY
mbed_official 573:ad23fe03a082 160 /**
mbed_official 573:ad23fe03a082 161 * @}
mbed_official 573:ad23fe03a082 162 */
mbed_official 573:ad23fe03a082 163
mbed_official 573:ad23fe03a082 164 /**
mbed_official 573:ad23fe03a082 165 * @}
mbed_official 573:ad23fe03a082 166 */
mbed_official 573:ad23fe03a082 167
mbed_official 573:ad23fe03a082 168 /* Exported macro ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 169 /** @defgroup PWR_Exported_Macro PWR Exported Macro
mbed_official 573:ad23fe03a082 170 * @{
mbed_official 573:ad23fe03a082 171 */
mbed_official 573:ad23fe03a082 172
mbed_official 573:ad23fe03a082 173 /** @brief macros configure the main internal regulator output voltage.
mbed_official 573:ad23fe03a082 174 * @param __REGULATOR__: specifies the regulator output voltage to achieve
mbed_official 573:ad23fe03a082 175 * a tradeoff between performance and power consumption when the device does
mbed_official 573:ad23fe03a082 176 * not operate at the maximum frequency (refer to the datasheets for more details).
mbed_official 573:ad23fe03a082 177 * This parameter can be one of the following values:
mbed_official 573:ad23fe03a082 178 * @arg PWR_REGULATOR_VOLTAGE_SCALE1: Regulator voltage output Scale 1 mode
mbed_official 573:ad23fe03a082 179 * @arg PWR_REGULATOR_VOLTAGE_SCALE2: Regulator voltage output Scale 2 mode
mbed_official 573:ad23fe03a082 180 * @arg PWR_REGULATOR_VOLTAGE_SCALE3: Regulator voltage output Scale 3 mode
mbed_official 573:ad23fe03a082 181 * @retval None
mbed_official 573:ad23fe03a082 182 */
mbed_official 573:ad23fe03a082 183 #define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__) do { \
mbed_official 573:ad23fe03a082 184 __IO uint32_t tmpreg; \
mbed_official 573:ad23fe03a082 185 MODIFY_REG(PWR->CR1, PWR_CR1_VOS, (__REGULATOR__)); \
mbed_official 573:ad23fe03a082 186 /* Delay after an RCC peripheral clock enabling */ \
mbed_official 573:ad23fe03a082 187 tmpreg = READ_BIT(PWR->CR1, PWR_CR1_VOS); \
mbed_official 573:ad23fe03a082 188 UNUSED(tmpreg); \
mbed_official 573:ad23fe03a082 189 } while(0)
mbed_official 573:ad23fe03a082 190
mbed_official 573:ad23fe03a082 191 /** @brief Check PWR flag is set or not.
mbed_official 573:ad23fe03a082 192 * @param __FLAG__: specifies the flag to check.
mbed_official 573:ad23fe03a082 193 * This parameter can be one of the following values:
mbed_official 573:ad23fe03a082 194 * @arg PWR_FLAG_WU: Wake Up flag. This flag indicates that a wakeup event
mbed_official 573:ad23fe03a082 195 * was received on the internal wakeup line in standby mode (RTC alarm (Alarm A or Alarm B),
mbed_official 573:ad23fe03a082 196 * RTC Tamper event, RTC TimeStamp event or RTC Wakeup)).
mbed_official 573:ad23fe03a082 197 * @arg PWR_FLAG_SB: StandBy flag. This flag indicates that the system was
mbed_official 573:ad23fe03a082 198 * resumed from StandBy mode.
mbed_official 573:ad23fe03a082 199 * @arg PWR_FLAG_PVDO: PVD Output. This flag is valid only if PVD is enabled
mbed_official 573:ad23fe03a082 200 * by the HAL_PWR_EnablePVD() function. The PVD is stopped by Standby mode
mbed_official 573:ad23fe03a082 201 * For this reason, this bit is equal to 0 after Standby or reset
mbed_official 573:ad23fe03a082 202 * until the PVDE bit is set.
mbed_official 573:ad23fe03a082 203 * @arg PWR_FLAG_BRR: Backup regulator ready flag. This bit is not reset
mbed_official 573:ad23fe03a082 204 * when the device wakes up from Standby mode or by a system reset
mbed_official 573:ad23fe03a082 205 * or power reset.
mbed_official 573:ad23fe03a082 206 * @arg PWR_FLAG_VOSRDY: This flag indicates that the Regulator voltage
mbed_official 573:ad23fe03a082 207 * scaling output selection is ready.
mbed_official 573:ad23fe03a082 208 * @retval The new state of __FLAG__ (TRUE or FALSE).
mbed_official 573:ad23fe03a082 209 */
mbed_official 573:ad23fe03a082 210 #define __HAL_PWR_GET_FLAG(__FLAG__) ((PWR->CSR1 & (__FLAG__)) == (__FLAG__))
mbed_official 573:ad23fe03a082 211
mbed_official 573:ad23fe03a082 212 /** @brief Clear the PWR's pending flags.
mbed_official 573:ad23fe03a082 213 * @param __FLAG__: specifies the flag to clear.
mbed_official 573:ad23fe03a082 214 * This parameter can be one of the following values:
mbed_official 573:ad23fe03a082 215 * @arg PWR_FLAG_SB: StandBy flag
mbed_official 573:ad23fe03a082 216 */
mbed_official 573:ad23fe03a082 217 #define __HAL_PWR_CLEAR_FLAG(__FLAG__) (PWR->CR1 |= (__FLAG__) << 2)
mbed_official 573:ad23fe03a082 218
mbed_official 573:ad23fe03a082 219 /**
mbed_official 573:ad23fe03a082 220 * @brief Enable the PVD Exti Line 16.
mbed_official 573:ad23fe03a082 221 * @retval None.
mbed_official 573:ad23fe03a082 222 */
mbed_official 573:ad23fe03a082 223 #define __HAL_PWR_PVD_EXTI_ENABLE_IT() (EXTI->IMR |= (PWR_EXTI_LINE_PVD))
mbed_official 573:ad23fe03a082 224
mbed_official 573:ad23fe03a082 225 /**
mbed_official 573:ad23fe03a082 226 * @brief Disable the PVD EXTI Line 16.
mbed_official 573:ad23fe03a082 227 * @retval None.
mbed_official 573:ad23fe03a082 228 */
mbed_official 573:ad23fe03a082 229 #define __HAL_PWR_PVD_EXTI_DISABLE_IT() (EXTI->IMR &= ~(PWR_EXTI_LINE_PVD))
mbed_official 573:ad23fe03a082 230
mbed_official 573:ad23fe03a082 231 /**
mbed_official 573:ad23fe03a082 232 * @brief Enable event on PVD Exti Line 16.
mbed_official 573:ad23fe03a082 233 * @retval None.
mbed_official 573:ad23fe03a082 234 */
mbed_official 573:ad23fe03a082 235 #define __HAL_PWR_PVD_EXTI_ENABLE_EVENT() (EXTI->EMR |= (PWR_EXTI_LINE_PVD))
mbed_official 573:ad23fe03a082 236
mbed_official 573:ad23fe03a082 237 /**
mbed_official 573:ad23fe03a082 238 * @brief Disable event on PVD Exti Line 16.
mbed_official 573:ad23fe03a082 239 * @retval None.
mbed_official 573:ad23fe03a082 240 */
mbed_official 573:ad23fe03a082 241 #define __HAL_PWR_PVD_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(PWR_EXTI_LINE_PVD))
mbed_official 573:ad23fe03a082 242
mbed_official 573:ad23fe03a082 243 /**
mbed_official 573:ad23fe03a082 244 * @brief Enable the PVD Extended Interrupt Rising Trigger.
mbed_official 573:ad23fe03a082 245 * @retval None.
mbed_official 573:ad23fe03a082 246 */
mbed_official 573:ad23fe03a082 247 #define __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD)
mbed_official 573:ad23fe03a082 248
mbed_official 573:ad23fe03a082 249 /**
mbed_official 573:ad23fe03a082 250 * @brief Disable the PVD Extended Interrupt Rising Trigger.
mbed_official 573:ad23fe03a082 251 * @retval None.
mbed_official 573:ad23fe03a082 252 */
mbed_official 573:ad23fe03a082 253 #define __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD)
mbed_official 573:ad23fe03a082 254
mbed_official 573:ad23fe03a082 255 /**
mbed_official 573:ad23fe03a082 256 * @brief Enable the PVD Extended Interrupt Falling Trigger.
mbed_official 573:ad23fe03a082 257 * @retval None.
mbed_official 573:ad23fe03a082 258 */
mbed_official 573:ad23fe03a082 259 #define __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD)
mbed_official 573:ad23fe03a082 260
mbed_official 573:ad23fe03a082 261
mbed_official 573:ad23fe03a082 262 /**
mbed_official 573:ad23fe03a082 263 * @brief Disable the PVD Extended Interrupt Falling Trigger.
mbed_official 573:ad23fe03a082 264 * @retval None.
mbed_official 573:ad23fe03a082 265 */
mbed_official 573:ad23fe03a082 266 #define __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD)
mbed_official 573:ad23fe03a082 267
mbed_official 573:ad23fe03a082 268
mbed_official 573:ad23fe03a082 269 /**
mbed_official 573:ad23fe03a082 270 * @brief PVD EXTI line configuration: set rising & falling edge trigger.
mbed_official 573:ad23fe03a082 271 * @retval None.
mbed_official 573:ad23fe03a082 272 */
mbed_official 573:ad23fe03a082 273 #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 573:ad23fe03a082 274
mbed_official 573:ad23fe03a082 275 /**
mbed_official 573:ad23fe03a082 276 * @brief Disable the PVD Extended Interrupt Rising & Falling Trigger.
mbed_official 573:ad23fe03a082 277 * @retval None.
mbed_official 573:ad23fe03a082 278 */
mbed_official 573:ad23fe03a082 279 #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 573:ad23fe03a082 280
mbed_official 573:ad23fe03a082 281 /**
mbed_official 573:ad23fe03a082 282 * @brief checks whether the specified PVD Exti interrupt flag is set or not.
mbed_official 573:ad23fe03a082 283 * @retval EXTI PVD Line Status.
mbed_official 573:ad23fe03a082 284 */
mbed_official 573:ad23fe03a082 285 #define __HAL_PWR_PVD_EXTI_GET_FLAG() (EXTI->PR & (PWR_EXTI_LINE_PVD))
mbed_official 573:ad23fe03a082 286
mbed_official 573:ad23fe03a082 287 /**
mbed_official 573:ad23fe03a082 288 * @brief Clear the PVD Exti flag.
mbed_official 573:ad23fe03a082 289 * @retval None.
mbed_official 573:ad23fe03a082 290 */
mbed_official 573:ad23fe03a082 291 #define __HAL_PWR_PVD_EXTI_CLEAR_FLAG() (EXTI->PR = (PWR_EXTI_LINE_PVD))
mbed_official 573:ad23fe03a082 292
mbed_official 573:ad23fe03a082 293 /**
mbed_official 573:ad23fe03a082 294 * @brief Generates a Software interrupt on PVD EXTI line.
mbed_official 573:ad23fe03a082 295 * @retval None
mbed_official 573:ad23fe03a082 296 */
mbed_official 573:ad23fe03a082 297 #define __HAL_PWR_PVD_EXTI_GENERATE_SWIT() (EXTI->SWIER |= (PWR_EXTI_LINE_PVD))
mbed_official 573:ad23fe03a082 298
mbed_official 573:ad23fe03a082 299 /**
mbed_official 573:ad23fe03a082 300 * @}
mbed_official 573:ad23fe03a082 301 */
mbed_official 573:ad23fe03a082 302
mbed_official 573:ad23fe03a082 303 /* Include PWR HAL Extension module */
mbed_official 573:ad23fe03a082 304 #include "stm32f7xx_hal_pwr_ex.h"
mbed_official 573:ad23fe03a082 305
mbed_official 573:ad23fe03a082 306 /* Exported functions --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 307 /** @addtogroup PWR_Exported_Functions PWR Exported Functions
mbed_official 573:ad23fe03a082 308 * @{
mbed_official 573:ad23fe03a082 309 */
mbed_official 573:ad23fe03a082 310
mbed_official 573:ad23fe03a082 311 /** @addtogroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions
mbed_official 573:ad23fe03a082 312 * @{
mbed_official 573:ad23fe03a082 313 */
mbed_official 573:ad23fe03a082 314 /* Initialization and de-initialization functions *****************************/
mbed_official 573:ad23fe03a082 315 void HAL_PWR_DeInit(void);
mbed_official 573:ad23fe03a082 316 void HAL_PWR_EnableBkUpAccess(void);
mbed_official 573:ad23fe03a082 317 void HAL_PWR_DisableBkUpAccess(void);
mbed_official 573:ad23fe03a082 318 /**
mbed_official 573:ad23fe03a082 319 * @}
mbed_official 573:ad23fe03a082 320 */
mbed_official 573:ad23fe03a082 321
mbed_official 573:ad23fe03a082 322 /** @addtogroup PWR_Exported_Functions_Group2 Peripheral Control functions
mbed_official 573:ad23fe03a082 323 * @{
mbed_official 573:ad23fe03a082 324 */
mbed_official 573:ad23fe03a082 325 /* Peripheral Control functions **********************************************/
mbed_official 573:ad23fe03a082 326 /* PVD configuration */
mbed_official 573:ad23fe03a082 327 void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD);
mbed_official 573:ad23fe03a082 328 void HAL_PWR_EnablePVD(void);
mbed_official 573:ad23fe03a082 329 void HAL_PWR_DisablePVD(void);
mbed_official 573:ad23fe03a082 330
mbed_official 573:ad23fe03a082 331 /* WakeUp pins configuration */
mbed_official 573:ad23fe03a082 332 void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinPolarity);
mbed_official 573:ad23fe03a082 333 void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx);
mbed_official 573:ad23fe03a082 334
mbed_official 573:ad23fe03a082 335 /* Low Power modes entry */
mbed_official 573:ad23fe03a082 336 void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry);
mbed_official 573:ad23fe03a082 337 void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry);
mbed_official 573:ad23fe03a082 338 void HAL_PWR_EnterSTANDBYMode(void);
mbed_official 573:ad23fe03a082 339
mbed_official 573:ad23fe03a082 340 /* Power PVD IRQ Handler */
mbed_official 573:ad23fe03a082 341 void HAL_PWR_PVD_IRQHandler(void);
mbed_official 573:ad23fe03a082 342 void HAL_PWR_PVDCallback(void);
mbed_official 573:ad23fe03a082 343
mbed_official 573:ad23fe03a082 344 /* Cortex System Control functions *******************************************/
mbed_official 573:ad23fe03a082 345 void HAL_PWR_EnableSleepOnExit(void);
mbed_official 573:ad23fe03a082 346 void HAL_PWR_DisableSleepOnExit(void);
mbed_official 573:ad23fe03a082 347 void HAL_PWR_EnableSEVOnPend(void);
mbed_official 573:ad23fe03a082 348 void HAL_PWR_DisableSEVOnPend(void);
mbed_official 573:ad23fe03a082 349 /**
mbed_official 573:ad23fe03a082 350 * @}
mbed_official 573:ad23fe03a082 351 */
mbed_official 573:ad23fe03a082 352
mbed_official 573:ad23fe03a082 353 /**
mbed_official 573:ad23fe03a082 354 * @}
mbed_official 573:ad23fe03a082 355 */
mbed_official 573:ad23fe03a082 356
mbed_official 573:ad23fe03a082 357 /* Private types -------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 358 /* Private variables ---------------------------------------------------------*/
mbed_official 573:ad23fe03a082 359 /* Private constants ---------------------------------------------------------*/
mbed_official 573:ad23fe03a082 360 /** @defgroup PWR_Private_Constants PWR Private Constants
mbed_official 573:ad23fe03a082 361 * @{
mbed_official 573:ad23fe03a082 362 */
mbed_official 573:ad23fe03a082 363
mbed_official 573:ad23fe03a082 364 /** @defgroup PWR_PVD_EXTI_Line PWR PVD EXTI Line
mbed_official 573:ad23fe03a082 365 * @{
mbed_official 573:ad23fe03a082 366 */
mbed_official 573:ad23fe03a082 367 #define PWR_EXTI_LINE_PVD ((uint32_t)EXTI_IMR_MR16) /*!< External interrupt line 16 Connected to the PVD EXTI Line */
mbed_official 573:ad23fe03a082 368 /**
mbed_official 573:ad23fe03a082 369 * @}
mbed_official 573:ad23fe03a082 370 */
mbed_official 573:ad23fe03a082 371
mbed_official 573:ad23fe03a082 372 /**
mbed_official 573:ad23fe03a082 373 * @}
mbed_official 573:ad23fe03a082 374 */
mbed_official 573:ad23fe03a082 375 /* Private macros ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 376 /** @defgroup PWR_Private_Macros PWR Private Macros
mbed_official 573:ad23fe03a082 377 * @{
mbed_official 573:ad23fe03a082 378 */
mbed_official 573:ad23fe03a082 379
mbed_official 573:ad23fe03a082 380 /** @defgroup PWR_IS_PWR_Definitions PWR Private macros to check input parameters
mbed_official 573:ad23fe03a082 381 * @{
mbed_official 573:ad23fe03a082 382 */
mbed_official 573:ad23fe03a082 383 #define IS_PWR_WAKEUP_POLARITY(POLARITY) (((POLARITY) == PWR_POLARITY_RISINGEDGE) || \
mbed_official 573:ad23fe03a082 384 ((POLARITY) == PWR_POLARITY_FALLINGEDGE))
mbed_official 573:ad23fe03a082 385 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \
mbed_official 573:ad23fe03a082 386 ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \
mbed_official 573:ad23fe03a082 387 ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \
mbed_official 573:ad23fe03a082 388 ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7))
mbed_official 573:ad23fe03a082 389 #define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_PVD_MODE_IT_RISING)|| ((MODE) == PWR_PVD_MODE_IT_FALLING) || \
mbed_official 573:ad23fe03a082 390 ((MODE) == PWR_PVD_MODE_IT_RISING_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING) || \
mbed_official 573:ad23fe03a082 391 ((MODE) == PWR_PVD_MODE_EVENT_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING_FALLING) || \
mbed_official 573:ad23fe03a082 392 ((MODE) == PWR_PVD_MODE_NORMAL))
mbed_official 573:ad23fe03a082 393 #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \
mbed_official 573:ad23fe03a082 394 ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON))
mbed_official 573:ad23fe03a082 395 #define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE))
mbed_official 573:ad23fe03a082 396 #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE))
mbed_official 573:ad23fe03a082 397 #define IS_PWR_REGULATOR_VOLTAGE(VOLTAGE) (((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE1) || \
mbed_official 573:ad23fe03a082 398 ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE2) || \
mbed_official 573:ad23fe03a082 399 ((VOLTAGE) == PWR_REGULATOR_VOLTAGE_SCALE3))
mbed_official 573:ad23fe03a082 400
mbed_official 573:ad23fe03a082 401 /**
mbed_official 573:ad23fe03a082 402 * @}
mbed_official 573:ad23fe03a082 403 */
mbed_official 573:ad23fe03a082 404
mbed_official 573:ad23fe03a082 405 /**
mbed_official 573:ad23fe03a082 406 * @}
mbed_official 573:ad23fe03a082 407 */
mbed_official 573:ad23fe03a082 408
mbed_official 573:ad23fe03a082 409 /**
mbed_official 573:ad23fe03a082 410 * @}
mbed_official 573:ad23fe03a082 411 */
mbed_official 573:ad23fe03a082 412
mbed_official 573:ad23fe03a082 413 /**
mbed_official 573:ad23fe03a082 414 * @}
mbed_official 573:ad23fe03a082 415 */
mbed_official 573:ad23fe03a082 416
mbed_official 573:ad23fe03a082 417 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 418 }
mbed_official 573:ad23fe03a082 419 #endif
mbed_official 573:ad23fe03a082 420
mbed_official 573:ad23fe03a082 421
mbed_official 573:ad23fe03a082 422 #endif /* __STM32F7xx_HAL_PWR_H */
mbed_official 573:ad23fe03a082 423
mbed_official 573:ad23fe03a082 424 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/