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