gptimer.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. // DO NOT USE THESE APIS IN YOUR APPLICATIONS
  7. // The following APIs are for internal use, public to other IDF components, but not for users' applications.
  8. #pragma once
  9. #include "esp_err.h"
  10. #include "esp_intr_alloc.h"
  11. #include "esp_pm.h"
  12. #include "driver/gptimer.h"
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /**
  17. * @brief Get GPTimer interrupt handle
  18. *
  19. * @param[in] timer Timer handle created by `gptimer_new_timer()`
  20. * @param[out] ret_intr_handle Timer's internal interrupt handle
  21. * @return
  22. * - ESP_OK: Get GPTimer interrupt handle successfully
  23. * - ESP_ERR_INVALID_ARG: Get GPTimer interrupt handle failed because of invalid argument
  24. * - ESP_FAIL: Get GPTimer interrupt handle failed because of other error
  25. */
  26. esp_err_t gptimer_get_intr_handle(gptimer_handle_t timer, intr_handle_t *ret_intr_handle);
  27. /**
  28. * @brief Get GPTimer power management lock
  29. *
  30. * @param[in] timer Timer handle created by `gptimer_new_timer()`
  31. * @param[out] ret_pm_lock Timer's internal power management lock
  32. * @return
  33. * - ESP_OK: Get GPTimer power management lock successfully
  34. * - ESP_ERR_INVALID_ARG: Get GPTimer power management lock failed because of invalid argument
  35. * - ESP_FAIL: Get GPTimer power management lock failed because of other error
  36. */
  37. esp_err_t gptimer_get_pm_lock(gptimer_handle_t timer, esp_pm_lock_handle_t *ret_pm_lock);
  38. #ifdef __cplusplus
  39. }
  40. #endif