stm32f10x_pwr.h 3.8 KB

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