mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
shaoziyang
Date:
Sat Sep 13 14:25:46 2014 +0000
Revision:
323:9e901b0a5aa1
Parent:
181:a4cbdfbbd2f4
test with CLOCK_SETUP = 0

Who changed what in which revision?

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