Function esp_idf_sys::pcnt_unit_enable
source · pub unsafe extern "C" fn pcnt_unit_enable(
unit: pcnt_unit_handle_t,
) -> esp_err_t
Expand description
@brief Enable the PCNT unit
@note This function will transit the unit state from init to enable.
@note This function will enable the interrupt service, if it’s lazy installed in pcnt_unit_register_event_callbacks()
.
@note This function will acquire the PM lock if it’s lazy installed in pcnt_unit_set_glitch_filter()
.
@note Enable a PCNT unit doesn’t mean to start it. See also pcnt_unit_start()
for how to start the PCNT counter.
@param[in] unit PCNT unit handle created by pcnt_new_unit()
@return
- ESP_OK: Enable PCNT unit successfully
- ESP_ERR_INVALID_ARG: Enable PCNT unit failed because of invalid argument
- ESP_ERR_INVALID_STATE: Enable PCNT unit failed because the unit is already enabled
- ESP_FAIL: Enable PCNT unit failed because of other error