mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Mon Nov 03 10:45:07 2014 +0000
Revision:
382:ee426a420dbb
Parent:
targets/cmsis/TARGET_STM/TARGET_DISCO_L053C8/stm32l0xx_hal_pwr.h@376:cb4d9db17537
Child:
489:119543c9f674
Synchronized with git revision d54467eb07f62efd9ccdf44f1ede7fe1c1b0cf83

Full URL: https://github.com/mbedmicro/mbed/commit/d54467eb07f62efd9ccdf44f1ede7fe1c1b0cf83/

Who changed what in which revision?

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