mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 12:44:33 +02:00
rmt: support setting loop count at runtime
This commit is contained in:
@@ -859,6 +859,19 @@ esp_err_t rmt_add_channel_to_group(rmt_channel_t channel);
|
|||||||
esp_err_t rmt_remove_channel_from_group(rmt_channel_t channel);
|
esp_err_t rmt_remove_channel_from_group(rmt_channel_t channel);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if SOC_RMT_SUPPORT_TX_LOOP_COUNT
|
||||||
|
/**
|
||||||
|
* @brief Set loop count for RMT TX channel
|
||||||
|
*
|
||||||
|
* @param channel RMT channel
|
||||||
|
* @param count loop count
|
||||||
|
* @return
|
||||||
|
* - ESP_ERR_INVALID_ARG Parameter error
|
||||||
|
* - ESP_OK Success
|
||||||
|
*/
|
||||||
|
esp_err_t rmt_set_tx_loop_count(rmt_channel_t channel, uint32_t count);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Reset RMT TX/RX memory index.
|
* @brief Reset RMT TX/RX memory index.
|
||||||
*
|
*
|
||||||
|
@@ -1365,3 +1365,14 @@ esp_err_t rmt_memory_rw_rst(rmt_channel_t channel)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if SOC_RMT_SUPPORT_TX_LOOP_COUNT
|
||||||
|
esp_err_t rmt_set_tx_loop_count(rmt_channel_t channel, uint32_t count)
|
||||||
|
{
|
||||||
|
RMT_CHECK(RMT_IS_TX_CHANNEL(channel), RMT_CHANNEL_ERROR_STR, ESP_ERR_INVALID_ARG);
|
||||||
|
RMT_ENTER_CRITICAL();
|
||||||
|
rmt_ll_tx_set_loop_count(rmt_contex.hal.regs, channel, count);
|
||||||
|
RMT_EXIT_CRITICAL();
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Reference in New Issue
Block a user