stm32f10x_pwr.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /**
  2. ******************************************************************************
  3. * @file stm32f10x_pwr.h
  4. * @author MCD Application Team
  5. * @version V3.3.0
  6. * @date 04/16/2010
  7. * @brief This file contains all the functions prototypes for the PWR firmware
  8. * library.
  9. ******************************************************************************
  10. * @copy
  11. *
  12. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  13. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  14. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  15. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  16. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  17. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  18. *
  19. * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __STM32F10x_PWR_H
  23. #define __STM32F10x_PWR_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f10x.h"
  29. /** @addtogroup STM32F10x_StdPeriph_Driver
  30. * @{
  31. */
  32. /** @addtogroup PWR
  33. * @{
  34. */
  35. /** @defgroup PWR_Exported_Types
  36. * @{
  37. */
  38. /**
  39. * @}
  40. */
  41. /** @defgroup PWR_Exported_Constants
  42. * @{
  43. */
  44. /** @defgroup PVD_detection_level
  45. * @{
  46. */
  47. #define PWR_PVDLevel_2V2 ((uint32_t)0x00000000)
  48. #define PWR_PVDLevel_2V3 ((uint32_t)0x00000020)
  49. #define PWR_PVDLevel_2V4 ((uint32_t)0x00000040)
  50. #define PWR_PVDLevel_2V5 ((uint32_t)0x00000060)
  51. #define PWR_PVDLevel_2V6 ((uint32_t)0x00000080)
  52. #define PWR_PVDLevel_2V7 ((uint32_t)0x000000A0)
  53. #define PWR_PVDLevel_2V8 ((uint32_t)0x000000C0)
  54. #define PWR_PVDLevel_2V9 ((uint32_t)0x000000E0)
  55. #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_2V2) || ((LEVEL) == PWR_PVDLevel_2V3)|| \
  56. ((LEVEL) == PWR_PVDLevel_2V4) || ((LEVEL) == PWR_PVDLevel_2V5)|| \
  57. ((LEVEL) == PWR_PVDLevel_2V6) || ((LEVEL) == PWR_PVDLevel_2V7)|| \
  58. ((LEVEL) == PWR_PVDLevel_2V8) || ((LEVEL) == PWR_PVDLevel_2V9))
  59. /**
  60. * @}
  61. */
  62. /** @defgroup Regulator_state_is_STOP_mode
  63. * @{
  64. */
  65. #define PWR_Regulator_ON ((uint32_t)0x00000000)
  66. #define PWR_Regulator_LowPower ((uint32_t)0x00000001)
  67. #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \
  68. ((REGULATOR) == PWR_Regulator_LowPower))
  69. /**
  70. * @}
  71. */
  72. /** @defgroup STOP_mode_entry
  73. * @{
  74. */
  75. #define PWR_STOPEntry_WFI ((uint8_t)0x01)
  76. #define PWR_STOPEntry_WFE ((uint8_t)0x02)
  77. #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE))
  78. /**
  79. * @}
  80. */
  81. /** @defgroup PWR_Flag
  82. * @{
  83. */
  84. #define PWR_FLAG_WU ((uint32_t)0x00000001)
  85. #define PWR_FLAG_SB ((uint32_t)0x00000002)
  86. #define PWR_FLAG_PVDO ((uint32_t)0x00000004)
  87. #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \
  88. ((FLAG) == PWR_FLAG_PVDO))
  89. #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB))
  90. /**
  91. * @}
  92. */
  93. /**
  94. * @}
  95. */
  96. /** @defgroup PWR_Exported_Macros
  97. * @{
  98. */
  99. /**
  100. * @}
  101. */
  102. /** @defgroup PWR_Exported_Functions
  103. * @{
  104. */
  105. void PWR_DeInit(void);
  106. void PWR_BackupAccessCmd(FunctionalState NewState);
  107. void PWR_PVDCmd(FunctionalState NewState);
  108. void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel);
  109. void PWR_WakeUpPinCmd(FunctionalState NewState);
  110. void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry);
  111. void PWR_EnterSTANDBYMode(void);
  112. FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG);
  113. void PWR_ClearFlag(uint32_t PWR_FLAG);
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117. #endif /* __STM32F10x_PWR_H */
  118. /**
  119. * @}
  120. */
  121. /**
  122. * @}
  123. */
  124. /**
  125. * @}
  126. */
  127. /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/