Function esp_idf_sys::pcnt_unit_clear_count
source · pub unsafe extern "C" fn pcnt_unit_clear_count(
unit: pcnt_unit_handle_t,
) -> esp_err_t
Expand description
@brief Clear PCNT pulse count value to zero
@note It’s recommended to call this function after adding a watch point by pcnt_unit_add_watch_point()
, so that the newly added watch point is effective immediately.
@note This function is allowed to run within ISR context
@note This function will be placed into IRAM if CONFIG_PCNT_CTRL_FUNC_IN_IRAM
, so that it’s allowed to be executed when Cache is disabled
@param[in] unit PCNT unit handle created by pcnt_new_unit()
@return
- ESP_OK: Clear PCNT pulse count successfully
- ESP_ERR_INVALID_ARG: Clear PCNT pulse count failed because of invalid argument
- ESP_FAIL: Clear PCNT pulse count failed because of other error