annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_pwr.h @ 80:cc2bb7bb8456

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