DHT11
TARGET_NUCLEO_F072RB/stm32f0xx_hal_pwr.h@0:c52df770855b, 2015-08-13 (annotated)
- Committer:
- jhon309
- Date:
- Thu Aug 13 00:21:57 2015 +0000
- Revision:
- 0:c52df770855b
DHT11
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jhon309 | 0:c52df770855b | 1 | /** |
jhon309 | 0:c52df770855b | 2 | ****************************************************************************** |
jhon309 | 0:c52df770855b | 3 | * @file stm32f0xx_hal_pwr.h |
jhon309 | 0:c52df770855b | 4 | * @author MCD Application Team |
jhon309 | 0:c52df770855b | 5 | * @version V1.2.0 |
jhon309 | 0:c52df770855b | 6 | * @date 11-December-2014 |
jhon309 | 0:c52df770855b | 7 | * @brief Header file of PWR HAL module. |
jhon309 | 0:c52df770855b | 8 | ****************************************************************************** |
jhon309 | 0:c52df770855b | 9 | * @attention |
jhon309 | 0:c52df770855b | 10 | * |
jhon309 | 0:c52df770855b | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
jhon309 | 0:c52df770855b | 12 | * |
jhon309 | 0:c52df770855b | 13 | * Redistribution and use in source and binary forms, with or without modification, |
jhon309 | 0:c52df770855b | 14 | * are permitted provided that the following conditions are met: |
jhon309 | 0:c52df770855b | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
jhon309 | 0:c52df770855b | 16 | * this list of conditions and the following disclaimer. |
jhon309 | 0:c52df770855b | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
jhon309 | 0:c52df770855b | 18 | * this list of conditions and the following disclaimer in the documentation |
jhon309 | 0:c52df770855b | 19 | * and/or other materials provided with the distribution. |
jhon309 | 0:c52df770855b | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
jhon309 | 0:c52df770855b | 21 | * may be used to endorse or promote products derived from this software |
jhon309 | 0:c52df770855b | 22 | * without specific prior written permission. |
jhon309 | 0:c52df770855b | 23 | * |
jhon309 | 0:c52df770855b | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
jhon309 | 0:c52df770855b | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
jhon309 | 0:c52df770855b | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
jhon309 | 0:c52df770855b | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
jhon309 | 0:c52df770855b | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
jhon309 | 0:c52df770855b | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
jhon309 | 0:c52df770855b | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
jhon309 | 0:c52df770855b | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
jhon309 | 0:c52df770855b | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
jhon309 | 0:c52df770855b | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
jhon309 | 0:c52df770855b | 34 | * |
jhon309 | 0:c52df770855b | 35 | ****************************************************************************** |
jhon309 | 0:c52df770855b | 36 | */ |
jhon309 | 0:c52df770855b | 37 | |
jhon309 | 0:c52df770855b | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
jhon309 | 0:c52df770855b | 39 | #ifndef __STM32F0xx_HAL_PWR_H |
jhon309 | 0:c52df770855b | 40 | #define __STM32F0xx_HAL_PWR_H |
jhon309 | 0:c52df770855b | 41 | |
jhon309 | 0:c52df770855b | 42 | #ifdef __cplusplus |
jhon309 | 0:c52df770855b | 43 | extern "C" { |
jhon309 | 0:c52df770855b | 44 | #endif |
jhon309 | 0:c52df770855b | 45 | |
jhon309 | 0:c52df770855b | 46 | /* Includes ------------------------------------------------------------------*/ |
jhon309 | 0:c52df770855b | 47 | #include "stm32f0xx_hal_def.h" |
jhon309 | 0:c52df770855b | 48 | |
jhon309 | 0:c52df770855b | 49 | /** @addtogroup STM32F0xx_HAL_Driver |
jhon309 | 0:c52df770855b | 50 | * @{ |
jhon309 | 0:c52df770855b | 51 | */ |
jhon309 | 0:c52df770855b | 52 | |
jhon309 | 0:c52df770855b | 53 | /** @addtogroup PWR PWR HAL module Driver |
jhon309 | 0:c52df770855b | 54 | * @{ |
jhon309 | 0:c52df770855b | 55 | */ |
jhon309 | 0:c52df770855b | 56 | |
jhon309 | 0:c52df770855b | 57 | /* Exported types ------------------------------------------------------------*/ |
jhon309 | 0:c52df770855b | 58 | /* Exported constants --------------------------------------------------------*/ |
jhon309 | 0:c52df770855b | 59 | |
jhon309 | 0:c52df770855b | 60 | /** @defgroup PWR_Exported_Constants PWR Exported Constants |
jhon309 | 0:c52df770855b | 61 | * @{ |
jhon309 | 0:c52df770855b | 62 | */ |
jhon309 | 0:c52df770855b | 63 | |
jhon309 | 0:c52df770855b | 64 | /** @defgroup PWR_Regulator_state_in_STOP_mode PWR Regulator state in STOP mode |
jhon309 | 0:c52df770855b | 65 | * @{ |
jhon309 | 0:c52df770855b | 66 | */ |
jhon309 | 0:c52df770855b | 67 | #define PWR_MAINREGULATOR_ON ((uint32_t)0x00000000) |
jhon309 | 0:c52df770855b | 68 | #define PWR_LOWPOWERREGULATOR_ON PWR_CR_LPDS |
jhon309 | 0:c52df770855b | 69 | |
jhon309 | 0:c52df770855b | 70 | #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \ |
jhon309 | 0:c52df770855b | 71 | ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON)) |
jhon309 | 0:c52df770855b | 72 | /** |
jhon309 | 0:c52df770855b | 73 | * @} |
jhon309 | 0:c52df770855b | 74 | */ |
jhon309 | 0:c52df770855b | 75 | |
jhon309 | 0:c52df770855b | 76 | /** @defgroup PWR_SLEEP_mode_entry PWR SLEEP mode entry |
jhon309 | 0:c52df770855b | 77 | * @{ |
jhon309 | 0:c52df770855b | 78 | */ |
jhon309 | 0:c52df770855b | 79 | #define PWR_SLEEPENTRY_WFI ((uint8_t)0x01) |
jhon309 | 0:c52df770855b | 80 | #define PWR_SLEEPENTRY_WFE ((uint8_t)0x02) |
jhon309 | 0:c52df770855b | 81 | #define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE)) |
jhon309 | 0:c52df770855b | 82 | /** |
jhon309 | 0:c52df770855b | 83 | * @} |
jhon309 | 0:c52df770855b | 84 | */ |
jhon309 | 0:c52df770855b | 85 | |
jhon309 | 0:c52df770855b | 86 | /** @defgroup PWR_STOP_mode_entry PWR STOP mode entry |
jhon309 | 0:c52df770855b | 87 | * @{ |
jhon309 | 0:c52df770855b | 88 | */ |
jhon309 | 0:c52df770855b | 89 | #define PWR_STOPENTRY_WFI ((uint8_t)0x01) |
jhon309 | 0:c52df770855b | 90 | #define PWR_STOPENTRY_WFE ((uint8_t)0x02) |
jhon309 | 0:c52df770855b | 91 | #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE)) |
jhon309 | 0:c52df770855b | 92 | /** |
jhon309 | 0:c52df770855b | 93 | * @} |
jhon309 | 0:c52df770855b | 94 | */ |
jhon309 | 0:c52df770855b | 95 | |
jhon309 | 0:c52df770855b | 96 | |
jhon309 | 0:c52df770855b | 97 | /** |
jhon309 | 0:c52df770855b | 98 | * @} |
jhon309 | 0:c52df770855b | 99 | */ |
jhon309 | 0:c52df770855b | 100 | |
jhon309 | 0:c52df770855b | 101 | /* Exported macro ------------------------------------------------------------*/ |
jhon309 | 0:c52df770855b | 102 | /** @defgroup PWR_Exported_Macro PWR Exported Macro |
jhon309 | 0:c52df770855b | 103 | * @{ |
jhon309 | 0:c52df770855b | 104 | */ |
jhon309 | 0:c52df770855b | 105 | |
jhon309 | 0:c52df770855b | 106 | /** @brief Check PWR flag is set or not. |
jhon309 | 0:c52df770855b | 107 | * @param __FLAG__: specifies the flag to check. |
jhon309 | 0:c52df770855b | 108 | * This parameter can be one of the following values: |
jhon309 | 0:c52df770855b | 109 | * @arg PWR_FLAG_WU: Wake Up flag. This flag indicates that a wakeup event |
jhon309 | 0:c52df770855b | 110 | * was received from the WKUP pin or from the RTC alarm (Alarm A), |
jhon309 | 0:c52df770855b | 111 | * RTC Tamper event, RTC TimeStamp event or RTC Wakeup. |
jhon309 | 0:c52df770855b | 112 | * An additional wakeup event is detected if the WKUP pin is enabled |
jhon309 | 0:c52df770855b | 113 | * (by setting the EWUP bit) when the WKUP pin level is already high. |
jhon309 | 0:c52df770855b | 114 | * @arg PWR_FLAG_SB: StandBy flag. This flag indicates that the system was |
jhon309 | 0:c52df770855b | 115 | * resumed from StandBy mode. |
jhon309 | 0:c52df770855b | 116 | * @arg PWR_FLAG_PVDO: PVD Output. This flag is valid only if PVD is enabled |
jhon309 | 0:c52df770855b | 117 | * by the HAL_PWR_EnablePVD() function. The PVD is stopped by Standby mode |
jhon309 | 0:c52df770855b | 118 | * For this reason, this bit is equal to 0 after Standby or reset |
jhon309 | 0:c52df770855b | 119 | * until the PVDE bit is set. |
jhon309 | 0:c52df770855b | 120 | * Warning: this Flag is not available on STM32F030x8 products |
jhon309 | 0:c52df770855b | 121 | * @arg PWR_FLAG_VREFINTRDY: This flag indicates that the internal reference |
jhon309 | 0:c52df770855b | 122 | * voltage VREFINT is ready. |
jhon309 | 0:c52df770855b | 123 | * Warning: this Flag is not available on STM32F030x8 products |
jhon309 | 0:c52df770855b | 124 | * @retval The new state of __FLAG__ (TRUE or FALSE). |
jhon309 | 0:c52df770855b | 125 | */ |
jhon309 | 0:c52df770855b | 126 | #define __HAL_PWR_GET_FLAG(__FLAG__) ((PWR->CSR & (__FLAG__)) == (__FLAG__)) |
jhon309 | 0:c52df770855b | 127 | |
jhon309 | 0:c52df770855b | 128 | /** @brief Clear the PWR's pending flags. |
jhon309 | 0:c52df770855b | 129 | * @param __FLAG__: specifies the flag to clear. |
jhon309 | 0:c52df770855b | 130 | * This parameter can be one of the following values: |
jhon309 | 0:c52df770855b | 131 | * @arg PWR_FLAG_WU: Wake Up flag |
jhon309 | 0:c52df770855b | 132 | * @arg PWR_FLAG_SB: StandBy flag |
jhon309 | 0:c52df770855b | 133 | */ |
jhon309 | 0:c52df770855b | 134 | #define __HAL_PWR_CLEAR_FLAG(__FLAG__) (PWR->CR |= (__FLAG__) << 2) |
jhon309 | 0:c52df770855b | 135 | |
jhon309 | 0:c52df770855b | 136 | |
jhon309 | 0:c52df770855b | 137 | /** |
jhon309 | 0:c52df770855b | 138 | * @} |
jhon309 | 0:c52df770855b | 139 | */ |
jhon309 | 0:c52df770855b | 140 | |
jhon309 | 0:c52df770855b | 141 | /* Include PWR HAL Extension module */ |
jhon309 | 0:c52df770855b | 142 | #include "stm32f0xx_hal_pwr_ex.h" |
jhon309 | 0:c52df770855b | 143 | |
jhon309 | 0:c52df770855b | 144 | /* Exported functions --------------------------------------------------------*/ |
jhon309 | 0:c52df770855b | 145 | |
jhon309 | 0:c52df770855b | 146 | /** @addtogroup PWR_Exported_Functions PWR Exported Functions |
jhon309 | 0:c52df770855b | 147 | * @{ |
jhon309 | 0:c52df770855b | 148 | */ |
jhon309 | 0:c52df770855b | 149 | |
jhon309 | 0:c52df770855b | 150 | /** @addtogroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions |
jhon309 | 0:c52df770855b | 151 | * @{ |
jhon309 | 0:c52df770855b | 152 | */ |
jhon309 | 0:c52df770855b | 153 | |
jhon309 | 0:c52df770855b | 154 | /* Initialization and de-initialization functions *****************************/ |
jhon309 | 0:c52df770855b | 155 | void HAL_PWR_DeInit(void); |
jhon309 | 0:c52df770855b | 156 | |
jhon309 | 0:c52df770855b | 157 | /** |
jhon309 | 0:c52df770855b | 158 | * @} |
jhon309 | 0:c52df770855b | 159 | */ |
jhon309 | 0:c52df770855b | 160 | |
jhon309 | 0:c52df770855b | 161 | /** @addtogroup PWR_Exported_Functions_Group2 Peripheral Control functions |
jhon309 | 0:c52df770855b | 162 | * @{ |
jhon309 | 0:c52df770855b | 163 | */ |
jhon309 | 0:c52df770855b | 164 | |
jhon309 | 0:c52df770855b | 165 | /* Peripheral Control functions **********************************************/ |
jhon309 | 0:c52df770855b | 166 | void HAL_PWR_EnableBkUpAccess(void); |
jhon309 | 0:c52df770855b | 167 | void HAL_PWR_DisableBkUpAccess(void); |
jhon309 | 0:c52df770855b | 168 | |
jhon309 | 0:c52df770855b | 169 | /* WakeUp pins configuration functions ****************************************/ |
jhon309 | 0:c52df770855b | 170 | void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinx); |
jhon309 | 0:c52df770855b | 171 | void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx); |
jhon309 | 0:c52df770855b | 172 | |
jhon309 | 0:c52df770855b | 173 | /* Low Power modes configuration functions ************************************/ |
jhon309 | 0:c52df770855b | 174 | void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry); |
jhon309 | 0:c52df770855b | 175 | void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry); |
jhon309 | 0:c52df770855b | 176 | void HAL_PWR_EnterSTANDBYMode(void); |
jhon309 | 0:c52df770855b | 177 | |
jhon309 | 0:c52df770855b | 178 | void HAL_PWR_EnableSleepOnExit(void); |
jhon309 | 0:c52df770855b | 179 | void HAL_PWR_DisableSleepOnExit(void); |
jhon309 | 0:c52df770855b | 180 | void HAL_PWR_EnableSEVOnPend(void); |
jhon309 | 0:c52df770855b | 181 | void HAL_PWR_DisableSEVOnPend(void); |
jhon309 | 0:c52df770855b | 182 | |
jhon309 | 0:c52df770855b | 183 | /** |
jhon309 | 0:c52df770855b | 184 | * @} |
jhon309 | 0:c52df770855b | 185 | */ |
jhon309 | 0:c52df770855b | 186 | |
jhon309 | 0:c52df770855b | 187 | /** |
jhon309 | 0:c52df770855b | 188 | * @} |
jhon309 | 0:c52df770855b | 189 | */ |
jhon309 | 0:c52df770855b | 190 | |
jhon309 | 0:c52df770855b | 191 | /** |
jhon309 | 0:c52df770855b | 192 | * @} |
jhon309 | 0:c52df770855b | 193 | */ |
jhon309 | 0:c52df770855b | 194 | |
jhon309 | 0:c52df770855b | 195 | /** |
jhon309 | 0:c52df770855b | 196 | * @} |
jhon309 | 0:c52df770855b | 197 | */ |
jhon309 | 0:c52df770855b | 198 | |
jhon309 | 0:c52df770855b | 199 | #ifdef __cplusplus |
jhon309 | 0:c52df770855b | 200 | } |
jhon309 | 0:c52df770855b | 201 | #endif |
jhon309 | 0:c52df770855b | 202 | |
jhon309 | 0:c52df770855b | 203 | |
jhon309 | 0:c52df770855b | 204 | #endif /* __STM32F0xx_HAL_PWR_H */ |
jhon309 | 0:c52df770855b | 205 | |
jhon309 | 0:c52df770855b | 206 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
jhon309 | 0:c52df770855b | 207 |