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