apm32e10x_pmu.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*!
  2. * @file apm32e10x_pmu.h
  3. *
  4. * @brief This file contains all the functions prototypes for the PMU firmware library.
  5. *
  6. * @version V1.0.2
  7. *
  8. * @date 2022-12-31
  9. *
  10. * @attention
  11. *
  12. * Copyright (C) 2021-2023 Geehy Semiconductor
  13. *
  14. * You may not use this file except in compliance with the
  15. * GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
  16. *
  17. * The program is only for reference, which is distributed in the hope
  18. * that it will be useful and instructional for customers to develop
  19. * their software. Unless required by applicable law or agreed to in
  20. * writing, the program is distributed on an "AS IS" BASIS, WITHOUT
  21. * ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
  23. * and limitations under the License.
  24. */
  25. /* Define to prevent recursive inclusion */
  26. #ifndef __APM32E10X_PMU_H
  27. #define __APM32E10X_PMU_H
  28. /* Includes */
  29. #include "apm32e10x.h"
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /** @addtogroup APM32E10x_StdPeriphDriver
  34. @{
  35. */
  36. /** @addtogroup PMU_Driver
  37. @{
  38. */
  39. /** @defgroup PMU_Enumerations Enumerations
  40. @{
  41. */
  42. /**
  43. * @brief PMU PVD detection level
  44. */
  45. typedef enum
  46. {
  47. PMU_PVD_LEVEL_2V2 = 0x00, /*!< PVD detection level set to 2.2V */
  48. PMU_PVD_LEVEL_2V3 = 0x01, /*!< PVD detection level set to 2.3V */
  49. PMU_PVD_LEVEL_2V4 = 0x02, /*!< PVD detection level set to 2.4V */
  50. PMU_PVD_LEVEL_2V5 = 0x03, /*!< PVD detection level set to 2.5V */
  51. PMU_PVD_LEVEL_2V6 = 0x04, /*!< PVD detection level set to 2.6V */
  52. PMU_PVD_LEVEL_2V7 = 0x05, /*!< PVD detection level set to 2.7V */
  53. PMU_PVD_LEVEL_2V8 = 0x06, /*!< PVD detection level set to 2.8V */
  54. PMU_PVD_LEVEL_2V9 = 0x07, /*!< PVD detection level set to 2.9V */
  55. } PMU_PVD_LEVEL_T;
  56. /**
  57. * @brief PMU Regulator state in STOP mode
  58. */
  59. typedef enum
  60. {
  61. PMU_REGULATOR_ON = 0x00,
  62. PMU_REGULATOR_LOWPOWER = 0x01
  63. } PMU_REGULATOR_T;
  64. typedef enum
  65. {
  66. PMU_STOP_ENTRY_WFI = 0x01,
  67. PMU_STOP_ENTRY_WFE = 0x02
  68. } PMU_STOP_ENTRY_T;
  69. /**
  70. * @brief PMU Flag
  71. */
  72. typedef enum
  73. {
  74. PMU_FLAG_WUE,
  75. PMU_FLAG_SB,
  76. PMU_FLAG_PVDO
  77. } PMU_FLAG_T;
  78. /**@} end of group PMU_Enumerations */
  79. /** @addtogroup PMU_Functions Functions
  80. @{
  81. */
  82. /* PMU Reset */
  83. void PMU_Reset(void);
  84. /* Configuration and Operation modes */
  85. void PMU_EnableBackupAccess(void);
  86. void PMU_DisableBackupAccess(void);
  87. void PMU_EnablePVD(void);
  88. void PMU_DisablePVD(void);
  89. void PMU_ConfigPVDLevel(PMU_PVD_LEVEL_T level);
  90. void PMU_EnableWakeUpPin(void);
  91. void PMU_DisableWakeUpPin(void);
  92. void PMU_EnterSTOPMode(PMU_REGULATOR_T regulator, PMU_STOP_ENTRY_T entry);
  93. void PMU_EnterSTANDBYMode(void);
  94. /* flags */
  95. uint8_t PMU_ReadStatusFlag(PMU_FLAG_T flag);
  96. void PMU_ClearStatusFlag(PMU_FLAG_T flag);
  97. /**@} end of group PMU_Functions */
  98. /**@} end of group PMU_Driver */
  99. /**@} end of group APM32E10x_StdPeriphDriver*/
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103. #endif /* __APM32E10X_PMU_H */