Go to the documentation of this file.00001
00022
00023 #ifndef __STM32F10x_PWR_H
00024 #define __STM32F10x_PWR_H
00025
00026
00027 #include "stm32f10x.h"
00028
00029 #define PWR_PVDLevel_2V2 ((uint32_t)0x00000000)
00030 #define PWR_PVDLevel_2V3 ((uint32_t)0x00000020)
00031 #define PWR_PVDLevel_2V4 ((uint32_t)0x00000040)
00032 #define PWR_PVDLevel_2V5 ((uint32_t)0x00000060)
00033 #define PWR_PVDLevel_2V6 ((uint32_t)0x00000080)
00034 #define PWR_PVDLevel_2V7 ((uint32_t)0x000000A0)
00035 #define PWR_PVDLevel_2V8 ((uint32_t)0x000000C0)
00036 #define PWR_PVDLevel_2V9 ((uint32_t)0x000000E0)
00037 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_2V2) || ((LEVEL) == PWR_PVDLevel_2V3)|| \
00038 ((LEVEL) == PWR_PVDLevel_2V4) || ((LEVEL) == PWR_PVDLevel_2V5)|| \
00039 ((LEVEL) == PWR_PVDLevel_2V6) || ((LEVEL) == PWR_PVDLevel_2V7)|| \
00040 ((LEVEL) == PWR_PVDLevel_2V8) || ((LEVEL) == PWR_PVDLevel_2V9))
00041
00049 #define PWR_Regulator_ON ((uint32_t)0x00000000)
00050 #define PWR_Regulator_LowPower ((uint32_t)0x00000001)
00051 #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \
00052 ((REGULATOR) == PWR_Regulator_LowPower))
00053
00061 #define PWR_STOPEntry_WFI ((uint8_t)0x01)
00062 #define PWR_STOPEntry_WFE ((uint8_t)0x02)
00063 #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE))
00064
00073 #define PWR_FLAG_WU ((uint32_t)0x00000001)
00074 #define PWR_FLAG_SB ((uint32_t)0x00000002)
00075 #define PWR_FLAG_PVDO ((uint32_t)0x00000004)
00076 #define PWR_CR_DBP ((uint32_t)(1<<8))
00077 #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \
00078 ((FLAG) == PWR_FLAG_PVDO))
00079
00080 #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB))
00081
00082
00083 typedef struct
00084 {
00085 __IO uint32_t CR;
00086 __IO uint32_t CSR;
00087 } PWR_TypeDef;
00088
00089 #define PWR_BASE (STM32_APB1PERIPH_BASE + 0x7000)
00090 #define PWR ((PWR_TypeDef *) PWR_BASE)
00091
00092
00093 #endif
00094
00095