]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/ST Library/inc/stm32f10x_pwr.h
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / CORTEX_STM32F103_GCC_Rowley / ST Library / inc / stm32f10x_pwr.h
1 /******************** (C) COPYRIGHT 2008 STMicroelectronics ********************\r
2 * File Name          : stm32f10x_pwr.h\r
3 * Author             : MCD Application Team\r
4 * Version            : V2.0.1\r
5 * Date               : 06/13/2008\r
6 * Description        : This file contains all the functions prototypes for the\r
7 *                      PWR firmware library.\r
8 ********************************************************************************\r
9 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS\r
10 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.\r
11 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,\r
12 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE\r
13 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING\r
14 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.\r
15 *******************************************************************************/\r
16 \r
17 /* Define to prevent recursive inclusion -------------------------------------*/\r
18 #ifndef __STM32F10x_PWR_H\r
19 #define __STM32F10x_PWR_H\r
20 \r
21 /* Includes ------------------------------------------------------------------*/\r
22 #include "stm32f10x_map.h"\r
23 \r
24 /* Exported types ------------------------------------------------------------*/\r
25 /* Exported constants --------------------------------------------------------*/\r
26 /* PVD detection level */\r
27 #define PWR_PVDLevel_2V2          ((u32)0x00000000)\r
28 #define PWR_PVDLevel_2V3          ((u32)0x00000020)\r
29 #define PWR_PVDLevel_2V4          ((u32)0x00000040)\r
30 #define PWR_PVDLevel_2V5          ((u32)0x00000060)\r
31 #define PWR_PVDLevel_2V6          ((u32)0x00000080)\r
32 #define PWR_PVDLevel_2V7          ((u32)0x000000A0)\r
33 #define PWR_PVDLevel_2V8          ((u32)0x000000C0)\r
34 #define PWR_PVDLevel_2V9          ((u32)0x000000E0)\r
35 \r
36 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_2V2) || ((LEVEL) == PWR_PVDLevel_2V3)|| \\r
37                                  ((LEVEL) == PWR_PVDLevel_2V4) || ((LEVEL) == PWR_PVDLevel_2V5)|| \\r
38                                  ((LEVEL) == PWR_PVDLevel_2V6) || ((LEVEL) == PWR_PVDLevel_2V7)|| \\r
39                                  ((LEVEL) == PWR_PVDLevel_2V8) || ((LEVEL) == PWR_PVDLevel_2V9))\r
40 \r
41 /* Regulator state is STOP mode */\r
42 #define PWR_Regulator_ON          ((u32)0x00000000)\r
43 #define PWR_Regulator_LowPower    ((u32)0x00000001)\r
44 \r
45 #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \\r
46                                      ((REGULATOR) == PWR_Regulator_LowPower))\r
47 \r
48 /* STOP mode entry */\r
49 #define PWR_STOPEntry_WFI         ((u8)0x01)\r
50 #define PWR_STOPEntry_WFE         ((u8)0x02)\r
51 \r
52 #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE))\r
53  \r
54 /* PWR Flag */\r
55 #define PWR_FLAG_WU               ((u32)0x00000001)\r
56 #define PWR_FLAG_SB               ((u32)0x00000002)\r
57 #define PWR_FLAG_PVDO             ((u32)0x00000004)\r
58 \r
59 #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \\r
60                                ((FLAG) == PWR_FLAG_PVDO))\r
61 #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB))\r
62 \r
63 /* Exported macro ------------------------------------------------------------*/\r
64 /* Exported functions ------------------------------------------------------- */\r
65 void PWR_DeInit(void);\r
66 void PWR_BackupAccessCmd(FunctionalState NewState);\r
67 void PWR_PVDCmd(FunctionalState NewState);\r
68 void PWR_PVDLevelConfig(u32 PWR_PVDLevel);\r
69 void PWR_WakeUpPinCmd(FunctionalState NewState);\r
70 void PWR_EnterSTOPMode(u32 PWR_Regulator, u8 PWR_STOPEntry);\r
71 void PWR_EnterSTANDBYMode(void);\r
72 FlagStatus PWR_GetFlagStatus(u32 PWR_FLAG);\r
73 void PWR_ClearFlag(u32 PWR_FLAG);\r
74 \r
75 #endif /* __STM32F10x_PWR_H */\r
76 \r
77 /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/\r