apm32f10x_pmu.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*!
  2. * @file apm32f10x_pmu.h
  3. *
  4. * @brief This file contains all the functions prototypes for the PMU firmware library.
  5. *
  6. * @version V1.0.1
  7. *
  8. * @date 2021-03-23
  9. *
  10. */
  11. #ifndef __APM32F10X_PMU_H
  12. #define __APM32F10X_PMU_H
  13. #include "apm32f10x.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /** @addtogroup Peripherals_Library Standard Peripheral Library
  18. @{
  19. */
  20. /** @addtogroup PMU_Driver PMU Driver
  21. @{
  22. */
  23. /** @addtogroup PMU_Enumerations Enumerations
  24. @{
  25. */
  26. typedef enum
  27. {
  28. PMU_PVD_LEVEL_2V2 = 0x00, //!< PVD detection level set to 2.2V
  29. PMU_PVD_LEVEL_2V3 = 0x01, //!< PVD detection level set to 2.3V
  30. PMU_PVD_LEVEL_2V4 = 0x02, //!< PVD detection level set to 2.4V
  31. PMU_PVD_LEVEL_2V5 = 0x03, //!< PVD detection level set to 2.5V
  32. PMU_PVD_LEVEL_2V6 = 0x04, //!< PVD detection level set to 2.6V
  33. PMU_PVD_LEVEL_2V7 = 0x05, //!< PVD detection level set to 2.7V
  34. PMU_PVD_LEVEL_2V8 = 0x06, //!< PVD detection level set to 2.8V
  35. PMU_PVD_LEVEL_2V9 = 0x07, //!< PVD detection level set to 2.9V
  36. } PMU_PVD_LEVEL_T;
  37. typedef enum
  38. {
  39. PMU_REGULATOR_ON = 0x00,
  40. PMU_REGULATOR_LOWPOWER = 0x01
  41. } PMU_REGULATOR_T;
  42. typedef enum
  43. {
  44. PMU_STOP_ENTRY_WFI = 0x01,
  45. PMU_STOP_ENTRY_WFE = 0x02
  46. } PMU_STOP_ENTRY_T;
  47. typedef enum
  48. {
  49. PMU_FLAG_WUE,
  50. PMU_FLAG_SB,
  51. PMU_FLAG_PVDO
  52. } PMU_FLAG_T;
  53. /**@} end of group PMU_Enumerations*/
  54. /** @addtogroup PMU_Fuctions Fuctions
  55. @{
  56. */
  57. /** PMU Reset */
  58. void PMU_Reset(void);
  59. /** Configuration and Operation modes */
  60. void PMU_EnableBackupAccess(void);
  61. void PMU_DisableBackupAccess(void);
  62. void PMU_EnablePVD(void);
  63. void PMU_DisablePVD(void);
  64. void PMU_ConfigPVDLevel(PMU_PVD_LEVEL_T level);
  65. void PMU_EnableWakeUpPin(void);
  66. void PMU_DisableWakeUpPin(void);
  67. void PMU_EnterSTOPMode(PMU_REGULATOR_T regulator, PMU_STOP_ENTRY_T entry);
  68. void PMU_EnterSTANDBYMode(void);
  69. /** flags */
  70. uint8_t PMU_ReadStatusFlag(PMU_FLAG_T flag);
  71. void PMU_ClearStatusFlag(PMU_FLAG_T flag);
  72. /**@} end of group PMU_Fuctions*/
  73. /**@} end of group PMU_Driver */
  74. /**@} end of group Peripherals_Library*/
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78. #endif /* __APM32F10X_PMU_H */