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