Function esp_idf_sys::pcnt_unit_start
source · pub unsafe extern "C" fn pcnt_unit_start(
unit: pcnt_unit_handle_t,
) -> esp_err_t
Expand description
@brief Start the PCNT unit, the counter will start to count according to the edge and/or level input signals
@note This function should be called when the unit is in the enable state (i.e. after calling pcnt_unit_enable()
)
@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
is on, 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: Start PCNT unit successfully
- ESP_ERR_INVALID_ARG: Start PCNT unit failed because of invalid argument
- ESP_ERR_INVALID_STATE: Start PCNT unit failed because the unit is not enabled yet
- ESP_FAIL: Start PCNT unit failed because of other error