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