See Espressif example here
Category: Pulse Count Controller (PCNT)
Incremental counter from 1 pin
Using the “Pulse Count Controller” (PCNT) CMakeLists.txt REQUIRES Ensure the following is added to the REQUIRES section of your CMakeLists.txt file in the \main folder: Configuring Reading value More useful version