feat(rmt): add API to return the real clock resolution of a channel

Closes https://github.com/espressif/esp-idf/pull/15074
This commit is contained in:
morris
2024-12-24 11:16:50 +08:00
parent 25a1ad7e98
commit 55d5ba38c6
2 changed files with 20 additions and 1 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -28,6 +28,18 @@ extern "C" {
*/
esp_err_t rmt_get_channel_id(rmt_channel_handle_t channel, int *ret_id);
/**
* @brief Get the RMT channel's real clock resolution
*
* @param[in] channel RMT generic channel that created by `rmt_new_tx_channel()` or `rmt_new_rx_channel()`
* @param[out] ret_resolution_hz The real clock resolution in Hz
* @return
* - ESP_OK: Get RMT channel resolution successfully
* - ESP_ERR_INVALID_ARG: Get RMT channel resolution failed because of invalid argument
* - ESP_FAIL: Get RMT channel resolution failed because of other reasons
*/
esp_err_t rmt_get_channel_resolution(rmt_channel_handle_t channel, uint32_t *ret_resolution_hz);
#ifdef __cplusplus
}
#endif