ch32v00X_pwr.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /********************************** (C) COPYRIGHT *******************************
  2. * File Name : ch32v00X_pwr.h
  3. * Author : WCH
  4. * Version : V1.0.0
  5. * Date : 2024/11/07
  6. * Description : This file contains all the functions prototypes for the PWR
  7. * firmware library.
  8. *********************************************************************************
  9. * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
  10. * Attention: This software (modified or not) and binary are used for
  11. * microcontroller manufactured by Nanjing Qinheng Microelectronics.
  12. *******************************************************************************/
  13. #ifndef __CH32V00X_PWR_H
  14. #define __CH32V00X_PWR_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #include <ch32v00X.h>
  19. /* PVD_detection_level */
  20. #define PWR_PVDLevel_0 ((uint32_t)0x00000000)
  21. #define PWR_PVDLevel_1 ((uint32_t)0x00000020)
  22. #define PWR_PVDLevel_2 ((uint32_t)0x00000040)
  23. #define PWR_PVDLevel_3 ((uint32_t)0x00000060)
  24. /* PWR_AWU_Prescaler */
  25. #define PWR_AWU_Prescaler_1 ((uint32_t)0x00000000)
  26. #define PWR_AWU_Prescaler_2 ((uint32_t)0x00000002)
  27. #define PWR_AWU_Prescaler_4 ((uint32_t)0x00000003)
  28. #define PWR_AWU_Prescaler_8 ((uint32_t)0x00000004)
  29. #define PWR_AWU_Prescaler_16 ((uint32_t)0x00000005)
  30. #define PWR_AWU_Prescaler_32 ((uint32_t)0x00000006)
  31. #define PWR_AWU_Prescaler_64 ((uint32_t)0x00000007)
  32. #define PWR_AWU_Prescaler_128 ((uint32_t)0x00000008)
  33. #define PWR_AWU_Prescaler_256 ((uint32_t)0x00000009)
  34. #define PWR_AWU_Prescaler_512 ((uint32_t)0x0000000A)
  35. #define PWR_AWU_Prescaler_1024 ((uint32_t)0x0000000B)
  36. #define PWR_AWU_Prescaler_2048 ((uint32_t)0x0000000C)
  37. #define PWR_AWU_Prescaler_4096 ((uint32_t)0x0000000D)
  38. #define PWR_AWU_Prescaler_10240 ((uint32_t)0x0000000E)
  39. #define PWR_AWU_Prescaler_61440 ((uint32_t)0x0000000F)
  40. /* STOP_mode_entry */
  41. #define PWR_STANDBYEntry_WFI ((uint8_t)0x01)
  42. #define PWR_STANDBYEntry_WFE ((uint8_t)0x02)
  43. /* PWR_Flag */
  44. #define PWR_FLAG_PVDO ((uint32_t)0x00000004)
  45. void PWR_DeInit(void);
  46. void PWR_PVDCmd(FunctionalState NewState);
  47. void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel);
  48. void PWR_AutoWakeUpCmd(FunctionalState NewState);
  49. void PWR_AWU_SetPrescaler(uint32_t AWU_Prescaler);
  50. void PWR_AWU_SetWindowValue(uint8_t WindowValue);
  51. void PWR_EnterSTANDBYMode(uint8_t PWR_STANDBYEntry);
  52. FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG);
  53. void PWR_FLASH_LP_Cmd(FunctionalState NewState);
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif /* __CH32V00X_PWR_H */