mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
rmt: support setting loop count at runtime
This commit is contained in:
parent
19d92ef6b2
commit
467d44970e
@ -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);
|
||||
#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.
|
||||
*
|
||||
|
@ -1365,3 +1365,14 @@ esp_err_t rmt_memory_rw_rst(rmt_channel_t channel)
|
||||
return ESP_OK;
|
||||
}
|
||||
#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
|
||||
|
Loading…
x
Reference in New Issue
Block a user