Function esp_idf_sys::pcnt_new_channel
source ยท pub unsafe extern "C" fn pcnt_new_channel(
unit: pcnt_unit_handle_t,
config: *const pcnt_chan_config_t,
ret_chan: *mut pcnt_channel_handle_t,
) -> esp_err_t
Expand description
@brief Create PCNT channel for specific unit, each PCNT has several channels associated with it
@note This function should be called when the unit is in init state (i.e. before calling pcnt_unit_enable()
)
@param[in] unit PCNT unit handle created by pcnt_new_unit()
@param[in] config PCNT channel configuration
@param[out] ret_chan Returned channel handle
@return
- ESP_OK: Create PCNT channel successfully
- ESP_ERR_INVALID_ARG: Create PCNT channel failed because of invalid argument
- ESP_ERR_NO_MEM: Create PCNT channel failed because of insufficient memory
- ESP_ERR_NOT_FOUND: Create PCNT channel failed because all PCNT channels are used up and no more free one
- ESP_ERR_INVALID_STATE: Create PCNT channel failed because the unit is not in the init state
- ESP_FAIL: Create PCNT channel failed because of other error