pcnt_new_unit() function
Create a new PCNT unit, and return the handle
Arguments
config
PCNT unit configuration
ret_unit
Returned PCNT unit handle
Return value
- ESP_OK: Create PCNT unit successfully - ESP_ERR_INVALID_ARG: Create PCNT unit failed because of invalid argument (e.g. high/low limit value out of the range) - ESP_ERR_NO_MEM: Create PCNT unit failed because out of memory - ESP_ERR_NOT_FOUND: Create PCNT unit failed because all PCNT units are used up and no more free one - ESP_FAIL: Create PCNT unit failed because of other error
Notes
The newly created PCNT unit is put in the init state.
pcnt_new_unit() calls 18 functions:
![]()
pcnt_new_unit()
pcnt_new_unit() reads 30 variables and writes 10 variables:
![]()
pcnt_new_unit()