1 /*
2  * SPDX-FileCopyrightText: 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 <stdint.h>
13 #include <stdbool.h>
14 #include "esp_err.h"
15 #include "driver/mcpwm_types.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /**
22  * @brief Get MCPWM timer phase
23  *
24  * @param[in] timer MCPWM timer handle, allocated by `mcpwm_new_timer()`
25  * @param[out] count_value Returned MCPWM timer phase
26  * @param[out] direction Returned MCPWM timer counting direction
27  * @return
28  *      - ESP_OK: Get MCPWM timer status successfully
29  *      - ESP_ERR_INVALID_ARG: Get MCPWM timer status failed because of invalid argument
30  *      - ESP_FAIL: Get MCPWM timer status failed because of other error
31  */
32 esp_err_t mcpwm_timer_get_phase(mcpwm_timer_handle_t timer, uint32_t *count_value, mcpwm_timer_direction_t *direction);
33 
34 #ifdef __cplusplus
35 }
36 #endif
37