pcnt_new_channel() function
Create PCNT channel for specific unit, each PCNT has several channels associated with it
Arguments
unit
PCNT unit handle created by `pcnt_new_unit()`
config
PCNT channel configuration
ret_chan
Returned channel handle
Return value
- 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
Notes
This function should be called when the unit is in init state (i.e. before calling `pcnt_unit_enable()`)
pcnt_new_channel() calls 12 functions:
![]()
pcnt_new_channel()
pcnt_new_channel() reads 26 variables and writes 4 variables:
![]()
pcnt_new_channel()
pcnt_new_channel() allocates 1 types:
![]()
pcnt_new_channel()