stm32f10x_pwr.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32f10x_pwr.h
00004   * @author  MCD Application Team
00005   * @version V3.4.0
00006   * @date    10/15/2010
00007   * @brief   This file contains all the functions prototypes for the PWR firmware 
00008   *          library.
00009   ******************************************************************************
00010   * @copy
00011   *
00012   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00013   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00014   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00015   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00016   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00017   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00018   *
00019   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00020   */ 
00021 
00022 /* Define to prevent recursive inclusion -------------------------------------*/
00023 #ifndef __STM32F10x_PWR_H
00024 #define __STM32F10x_PWR_H
00025 
00026 #ifdef __cplusplus
00027  extern "C" {
00028 #endif
00029 
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32f10x.h"
00032 
00033 /** @addtogroup STM32F10x_StdPeriph_Driver
00034   * @{
00035   */
00036 
00037 /** @addtogroup PWR
00038   * @{
00039   */ 
00040 
00041 /** @defgroup PWR_Exported_Types
00042   * @{
00043   */ 
00044 
00045 /**
00046   * @}
00047   */ 
00048 
00049 /** @defgroup PWR_Exported_Constants
00050   * @{
00051   */ 
00052 
00053 /** @defgroup PVD_detection_level 
00054   * @{
00055   */ 
00056 
00057 #define PWR_PVDLevel_2V2          ((uint32_t)0x00000000)
00058 #define PWR_PVDLevel_2V3          ((uint32_t)0x00000020)
00059 #define PWR_PVDLevel_2V4          ((uint32_t)0x00000040)
00060 #define PWR_PVDLevel_2V5          ((uint32_t)0x00000060)
00061 #define PWR_PVDLevel_2V6          ((uint32_t)0x00000080)
00062 #define PWR_PVDLevel_2V7          ((uint32_t)0x000000A0)
00063 #define PWR_PVDLevel_2V8          ((uint32_t)0x000000C0)
00064 #define PWR_PVDLevel_2V9          ((uint32_t)0x000000E0)
00065 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_2V2) || ((LEVEL) == PWR_PVDLevel_2V3)|| \
00066                                  ((LEVEL) == PWR_PVDLevel_2V4) || ((LEVEL) == PWR_PVDLevel_2V5)|| \
00067                                  ((LEVEL) == PWR_PVDLevel_2V6) || ((LEVEL) == PWR_PVDLevel_2V7)|| \
00068                                  ((LEVEL) == PWR_PVDLevel_2V8) || ((LEVEL) == PWR_PVDLevel_2V9))
00069 /**
00070   * @}
00071   */
00072 
00073 /** @defgroup Regulator_state_is_STOP_mode 
00074   * @{
00075   */
00076 
00077 #define PWR_Regulator_ON          ((uint32_t)0x00000000)
00078 #define PWR_Regulator_LowPower    ((uint32_t)0x00000001)
00079 #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \
00080                                      ((REGULATOR) == PWR_Regulator_LowPower))
00081 /**
00082   * @}
00083   */
00084 
00085 /** @defgroup STOP_mode_entry 
00086   * @{
00087   */
00088 
00089 #define PWR_STOPEntry_WFI         ((uint8_t)0x01)
00090 #define PWR_STOPEntry_WFE         ((uint8_t)0x02)
00091 #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE))
00092  
00093 /**
00094   * @}
00095   */
00096 
00097 /** @defgroup PWR_Flag 
00098   * @{
00099   */
00100 
00101 #define PWR_FLAG_WU               ((uint32_t)0x00000001)
00102 #define PWR_FLAG_SB               ((uint32_t)0x00000002)
00103 #define PWR_FLAG_PVDO             ((uint32_t)0x00000004)
00104 #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \
00105                                ((FLAG) == PWR_FLAG_PVDO))
00106 
00107 #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB))
00108 /**
00109   * @}
00110   */
00111 
00112 /**
00113   * @}
00114   */
00115 
00116 /** @defgroup PWR_Exported_Macros
00117   * @{
00118   */
00119 
00120 /**
00121   * @}
00122   */
00123 
00124 /** @defgroup PWR_Exported_Functions
00125   * @{
00126   */
00127 
00128 void PWR_DeInit(void);
00129 void PWR_BackupAccessCmd(FunctionalState NewState);
00130 void PWR_PVDCmd(FunctionalState NewState);
00131 void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel);
00132 void PWR_WakeUpPinCmd(FunctionalState NewState);
00133 void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry);
00134 void PWR_EnterSTANDBYMode(void);
00135 FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG);
00136 void PWR_ClearFlag(uint32_t PWR_FLAG);
00137 
00138 #ifdef __cplusplus
00139 }
00140 #endif
00141 
00142 #endif /* __STM32F10x_PWR_H */
00143 /**
00144   * @}
00145   */
00146 
00147 /**
00148   * @}
00149   */
00150 
00151 /**
00152   * @}
00153   */
00154 
00155 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32