pcnt_unit_get_count() function
Get PCNT count value
Arguments
unit
PCNT unit handle created by `pcnt_new_unit()`
value
Returned count value
Return value
- ESP_OK: Get PCNT pulse count successfully - ESP_ERR_INVALID_ARG: Get PCNT pulse count failed because of invalid argument - ESP_FAIL: Get PCNT pulse count failed because of other error
Notes
This function is allowed to run within ISR context This function will be placed into IRAM if `CONFIG_PCNT_CTRL_FUNC_IN_IRAM`, so that it's allowed to be executed when Cache is disabled
pcnt_unit_get_count() calls 6 functions:
![]()
pcnt_unit_get_count()
pcnt_unit_get_count() reads 7 variables:
![]()
pcnt_unit_get_count()