Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
116:c0f6e94411f5
.

Who changed what in which revision?

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