api_pwr.h 593 B

12345678910111213141516171819202122
  1. #ifndef _API_PWR_H_
  2. #define _API_PWR_H_
  3. #define WKO_10SRST_EN(x) { RTCCON10 = BIT(10);\
  4. RTCCON1 &= ~BIT(8);\
  5. if (x) {RTCCON1 |= BIT(8);}\
  6. RTCCON12 = (RTCCON12 & ~(0x03 << 8 | 0x03)) | (1 << 8); }
  7. #define WKO_10SRST_DIS() RTCCON12 |= 0x03
  8. void pmu_cpu1_core_off(void);
  9. void pmu_cpu1_ram_off(void);
  10. void pmu_cpu1_ram_on(void);
  11. void pmu_cpu1_core_on(void);
  12. void pmu_init(u8 cfg);
  13. void pmu_set_mode(u8 buck_en);
  14. u16 pmu_get_vbg(void);
  15. u16 pmu_get_vddio(void);
  16. #endif // _API_PWR_H_