Restructure libs source to support multi platform
[fw/stlink] / example / libs_stm / inc / stm32l1xx / stm32l1xx_pwr.h
diff --git a/example/libs_stm/inc/stm32l1xx/stm32l1xx_pwr.h b/example/libs_stm/inc/stm32l1xx/stm32l1xx_pwr.h
new file mode 100644 (file)
index 0000000..ae2adb7
--- /dev/null
@@ -0,0 +1,207 @@
+/**\r
+  ******************************************************************************\r
+  * @file    stm32l1xx_pwr.h\r
+  * @author  MCD Application Team\r
+  * @version V1.0.0\r
+  * @date    31-December-2010\r
+  * @brief   This file contains all the functions prototypes for the PWR firmware \r
+  *          library.\r
+  ******************************************************************************\r
+  * @attention\r
+  *\r
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS\r
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE\r
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY\r
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING\r
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE\r
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.\r
+  *\r
+  * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>\r
+  ******************************************************************************  \r
+  */ \r
+\r
+/* Define to prevent recursive inclusion -------------------------------------*/\r
+#ifndef __STM32L1xx_PWR_H\r
+#define __STM32L1xx_PWR_H\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32l1xx.h"\r
+\r
+/** @addtogroup STM32L1xx_StdPeriph_Driver\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup PWR\r
+  * @{\r
+  */ \r
+\r
+/* Exported types ------------------------------------------------------------*/\r
+/* Exported constants --------------------------------------------------------*/\r
+\r
+/** @defgroup PWR_Exported_Constants\r
+  * @{\r
+  */ \r
+\r
+/** @defgroup PVD_detection_level \r
+  * @{\r
+  */ \r
+\r
+#define PWR_PVDLevel_0                  PWR_CR_PLS_LEV0\r
+#define PWR_PVDLevel_1                  PWR_CR_PLS_LEV1\r
+#define PWR_PVDLevel_2                  PWR_CR_PLS_LEV2\r
+#define PWR_PVDLevel_3                  PWR_CR_PLS_LEV3\r
+#define PWR_PVDLevel_4                  PWR_CR_PLS_LEV4\r
+#define PWR_PVDLevel_5                  PWR_CR_PLS_LEV5\r
+#define PWR_PVDLevel_6                  PWR_CR_PLS_LEV6\r
+#define PWR_PVDLevel_7                  PWR_CR_PLS_LEV7 /* External input analog voltage \r
+                                                          (Compare internally to VREFINT) */\r
+#define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_0) || ((LEVEL) == PWR_PVDLevel_1)|| \\r
+                                 ((LEVEL) == PWR_PVDLevel_2) || ((LEVEL) == PWR_PVDLevel_3)|| \\r
+                                 ((LEVEL) == PWR_PVDLevel_4) || ((LEVEL) == PWR_PVDLevel_5)|| \\r
+                                 ((LEVEL) == PWR_PVDLevel_6) || ((LEVEL) == PWR_PVDLevel_7))\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup WakeUp_Pins \r
+  * @{\r
+  */\r
+\r
+#define PWR_WakeUpPin_1                 ((uint32_t)0x00000000)\r
+#define PWR_WakeUpPin_2                 ((uint32_t)0x00000004)\r
+#define PWR_WakeUpPin_3                 ((uint32_t)0x00000008)\r
+#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WakeUpPin_1) || \\r
+                                ((PIN) == PWR_WakeUpPin_2) || \\r
+                                ((PIN) == PWR_WakeUpPin_3))\r
+/**\r
+  * @}\r
+  */\r
+\r
+  \r
+/** @defgroup Voltage_Scaling_Ranges\r
+  * @{\r
+  */\r
+\r
+#define PWR_VoltageScaling_Range1       PWR_CR_VOS_0\r
+#define PWR_VoltageScaling_Range2       PWR_CR_VOS_1\r
+#define PWR_VoltageScaling_Range3       PWR_CR_VOS\r
+\r
+#define IS_PWR_VOLTAGE_SCALING_RANGE(RANGE) (((RANGE) == PWR_VoltageScaling_Range1) || \\r
+                                             ((RANGE) == PWR_VoltageScaling_Range2) || \\r
+                                             ((RANGE) == PWR_VoltageScaling_Range3))\r
+/**\r
+  * @}\r
+  */    \r
+  \r
+/** @defgroup Regulator_state_is_Sleep_STOP_mode \r
+  * @{\r
+  */\r
+\r
+#define PWR_Regulator_ON                ((uint32_t)0x00000000)\r
+#define PWR_Regulator_LowPower          PWR_CR_LPSDSR\r
+#define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \\r
+                                     ((REGULATOR) == PWR_Regulator_LowPower))\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup SLEEP_mode_entry \r
+  * @{\r
+  */\r
+\r
+#define PWR_SLEEPEntry_WFI              ((uint8_t)0x01)\r
+#define PWR_SLEEPEntry_WFE              ((uint8_t)0x02)\r
+#define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPEntry_WFI) || ((ENTRY) == PWR_SLEEPEntry_WFE))\r
\r
+/**\r
+  * @}\r
+  */\r
+  \r
+/** @defgroup STOP_mode_entry \r
+  * @{\r
+  */\r
+\r
+#define PWR_STOPEntry_WFI               ((uint8_t)0x01)\r
+#define PWR_STOPEntry_WFE               ((uint8_t)0x02)\r
+#define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE))\r
\r
+/**\r
+  * @}\r
+  */\r
+\r
+/** @defgroup PWR_Flag \r
+  * @{\r
+  */\r
+\r
+#define PWR_FLAG_WU                     PWR_CSR_WUF\r
+#define PWR_FLAG_SB                     PWR_CSR_SBF\r
+#define PWR_FLAG_PVDO                   PWR_CSR_PVDO\r
+#define PWR_FLAG_VREFINTRDY             PWR_CSR_VREFINTRDYF\r
+#define PWR_FLAG_VOS                    PWR_CSR_VOSF\r
+#define PWR_FLAG_REGLP                  PWR_CSR_REGLPF\r
+\r
+#define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \\r
+                               ((FLAG) == PWR_FLAG_PVDO) || ((FLAG) == PWR_FLAG_VREFINTRDY) || \\r
+                               ((FLAG) == PWR_FLAG_VOS) || ((FLAG) == PWR_FLAG_REGLP))\r
+\r
+#define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB))\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/* Exported macro ------------------------------------------------------------*/\r
+/* Exported functions ------------------------------------------------------- */\r
+\r
+/* Function used to set the PWR configuration to the default reset state ******/ \r
+void PWR_DeInit(void);\r
+\r
+/* RTC Domain Access function *************************************************/ \r
+void PWR_RTCAccessCmd(FunctionalState NewState);\r
+\r
+/* PVD configuration functions ************************************************/ \r
+void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel);\r
+void PWR_PVDCmd(FunctionalState NewState);\r
+\r
+/* WakeUp pins configuration functions ****************************************/ \r
+void PWR_WakeUpPinCmd(uint32_t PWR_WakeUpPin, FunctionalState NewState);\r
+\r
+/* Ultra Low Power mode configuration functions *******************************/ \r
+void PWR_FastWakeUpCmd(FunctionalState NewState);\r
+void PWR_UltraLowPowerCmd(FunctionalState NewState);\r
+\r
+/* Voltage Scaling configuration functions ************************************/ \r
+void PWR_VoltageScalingConfig(uint32_t PWR_VoltageScaling);\r
+\r
+/* Low Power modes configuration functions ************************************/ \r
+void PWR_EnterLowPowerRunMode(FunctionalState NewState);\r
+void PWR_EnterSleepMode(uint32_t PWR_Regulator, uint8_t PWR_SLEEPEntry);\r
+void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry);\r
+void PWR_EnterSTANDBYMode(void);\r
+\r
+/* Flags management functions *************************************************/ \r
+FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG);\r
+void PWR_ClearFlag(uint32_t PWR_FLAG);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __STM32L1xx_PWR_H */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/**\r
+  * @}\r
+  */\r
+\r
+/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/\r