sleep_clock.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include <stdbool.h>
  9. #include "sdkconfig.h"
  10. #include "esp_err.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /**
  15. * @file sleep_clock.h
  16. *
  17. * This file contains declarations of digital peripheral clock retention related functions in light sleep mode.
  18. */
  19. /**
  20. * @brief Whether to allow the TOP power domain to be powered off.
  21. *
  22. * In light sleep mode, only when the system can provide enough memory
  23. * for digital peripheral clock retention, the TOP power domain can be
  24. * powered off.
  25. *
  26. * @return True to allow power off
  27. */
  28. bool clock_domain_pd_allowed(void);
  29. /**
  30. * @brief PCR module power down initialize
  31. *
  32. * @return ESP_OK on success
  33. * ESP_ERR_INVALID_ARG on invalid sleep_retention_entries_create args
  34. * No memory for the retention link
  35. */
  36. esp_err_t sleep_clock_system_retention_init(void);
  37. /**
  38. * @brief PCR module power down deinitialize
  39. */
  40. void sleep_clock_system_retention_deinit(void);
  41. /**
  42. * @brief Modem syscon module power down initialize
  43. *
  44. * @return ESP_OK on success
  45. * ESP_ERR_INVALID_ARG on invalid sleep_retention_entries_create args
  46. * No memory for the retention link
  47. */
  48. esp_err_t sleep_clock_modem_retention_init(void);
  49. /**
  50. * @brief Modem syscon module power down deinitialize
  51. */
  52. void sleep_clock_modem_retention_deinit(void);
  53. #ifdef __cplusplus
  54. }
  55. #endif