mcpwm.h 1.0 KB

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