sleep_retention.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include "sdkconfig.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /**
  13. * @file sleep_retention.h
  14. *
  15. * This file contains declarations of memory retention related functions in light sleeo mode.
  16. */
  17. #if SOC_PM_SUPPORT_CPU_PD
  18. /**
  19. * @brief Whether to allow the cpu power domain to be powered off.
  20. *
  21. * In light sleep mode, only when the system can provide enough memory
  22. * for cpu retention, the cpu power domain can be powered off.
  23. */
  24. bool cpu_domain_pd_allowed(void);
  25. #endif
  26. #if SOC_PM_SUPPORT_CPU_PD || SOC_PM_SUPPORT_TAGMEM_PD
  27. /**
  28. * @brief Enable memory retention of some modules.
  29. *
  30. * In light sleep mode, before the system goes to sleep, enable the memory
  31. * retention of modules such as CPU and I/D-cache tag memory.
  32. */
  33. void sleep_enable_memory_retention(void);
  34. /**
  35. * @brief Disable memory retention of some modules.
  36. *
  37. * In light sleep mode, after the system exits sleep, disable the memory
  38. * retention of moudles such as CPU and I/D-cache tag memory.
  39. */
  40. void sleep_disable_memory_retention(void);
  41. #endif // SOC_PM_SUPPORT_CPU_PD || SOC_PM_SUPPORT_TAGMEM_PD
  42. #ifdef __cplusplus
  43. }
  44. #endif