pcnt_unit_register_event_callbacks() function
Set event callbacks for PCNT unit
Arguments
unit
PCNT unit handle created by `pcnt_new_unit()`
cbs
Group of callback functions
user_data
User data, which will be passed to callback functions directly
Return value
- ESP_OK: Set event callbacks successfully - ESP_ERR_INVALID_ARG: Set event callbacks failed because of invalid argument - ESP_ERR_INVALID_STATE: Set event callbacks failed because the unit is not in init state - ESP_FAIL: Set event callbacks failed because of other error
Notes
User registered callbacks are expected to be runnable within ISR context The first call to this function needs to be before the call to `pcnt_unit_enable` User can deregister a previously registered callback by calling this function and setting the callback member in the `cbs` structure to NULL.
pcnt_unit_register_event_callbacks() calls 7 functions:
![]()
pcnt_unit_register_event_callbacks()
pcnt_unit_register_event_callbacks() reads 20 variables and writes 2 variables:
![]()
pcnt_unit_register_event_callbacks()