ESP_PCNT: add high and low limit Kconfig options

Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
This commit is contained in:
Martin Vajnar 2025-07-19 16:53:19 +02:00 committed by Alan C. Assis
parent d7a05dfcc6
commit 150854c6f2
7 changed files with 42 additions and 10 deletions

View file

@ -682,6 +682,22 @@ config ESP_PCNT_TEST_MODE
to the receiver internally, being able to test the PCNT
peripheral without any external connection.
config ESP_PCNT_HIGH_LIMIT
int "PCNT high limit value"
default 1024
range 1 32767
---help---
This sets thr_h_lim value for all units. When pulse_cnt reaches
this value, the counter will be cleared.
config ESP_PCNT_LOW_LIMIT
int "PCNT low limit value"
default -1024
range -32768 -1
---help---
This sets thr_l_lim value for all units. When pulse_cnt reaches
this value, the counter will be cleared.
config ESP_PCNT_AS_QE
bool
default n

View file

@ -348,6 +348,22 @@ config ESP_PCNT_TEST_MODE
to the receiver internally, being able to test the PCNT
peripheral without any external connection.
config ESP_PCNT_HIGH_LIMIT
int "PCNT high limit value"
default 1024
range 1 32767
---help---
This sets thr_h_lim value for all units. When pulse_cnt reaches
this value, the counter will be cleared.
config ESP_PCNT_LOW_LIMIT
int "PCNT low limit value"
default -1024
range -32768 -1
---help---
This sets thr_l_lim value for all units. When pulse_cnt reaches
this value, the counter will be cleared.
config ESP_PCNT_AS_QE
bool
default n

View file

@ -41,8 +41,8 @@
* Pre-processor Definitions
****************************************************************************/
#define PCNT_HIGH_LIMIT 1000
#define PCNT_LOW_LIMIT -1000
#define PCNT_HIGH_LIMIT CONFIG_ESP_PCNT_HIGH_LIMIT
#define PCNT_LOW_LIMIT CONFIG_ESP_PCNT_LOW_LIMIT
#define PCNT_GLITCH_FILTER(pcnt, thres) pcnt->ops->ioctl(pcnt, \
CAPIOC_FILTER, \

View file

@ -41,8 +41,8 @@
* Pre-processor Definitions
****************************************************************************/
#define PCNT_HIGH_LIMIT 1000
#define PCNT_LOW_LIMIT -1000
#define PCNT_HIGH_LIMIT CONFIG_ESP_PCNT_HIGH_LIMIT
#define PCNT_LOW_LIMIT CONFIG_ESP_PCNT_LOW_LIMIT
#define PCNT_GLITCH_FILTER(pcnt, thres) pcnt->ops->ioctl(pcnt, \
CAPIOC_FILTER, \

View file

@ -40,8 +40,8 @@
* Pre-processor Definitions
****************************************************************************/
#define PCNT_HIGH_LIMIT 1000
#define PCNT_LOW_LIMIT -1000
#define PCNT_HIGH_LIMIT CONFIG_ESP_PCNT_HIGH_LIMIT
#define PCNT_LOW_LIMIT CONFIG_ESP_PCNT_LOW_LIMIT
#define PCNT_GLITCH_FILTER(pcnt, thres) pcnt->ops->ioctl(pcnt, \
CAPIOC_FILTER, \

View file

@ -40,8 +40,8 @@
* Pre-processor Definitions
****************************************************************************/
#define PCNT_HIGH_LIMIT 1000
#define PCNT_LOW_LIMIT -1000
#define PCNT_HIGH_LIMIT CONFIG_ESP_PCNT_HIGH_LIMIT
#define PCNT_LOW_LIMIT CONFIG_ESP_PCNT_LOW_LIMIT
#define PCNT_GLITCH_FILTER(pcnt, thres) pcnt->ops->ioctl(pcnt, \
CAPIOC_FILTER, \

View file

@ -40,8 +40,8 @@
* Pre-processor Definitions
****************************************************************************/
#define PCNT_HIGH_LIMIT 1000
#define PCNT_LOW_LIMIT -1000
#define PCNT_HIGH_LIMIT CONFIG_ESP_PCNT_HIGH_LIMIT
#define PCNT_LOW_LIMIT CONFIG_ESP_PCNT_LOW_LIMIT
#define PCNT_GLITCH_FILTER(pcnt, thres) pcnt->ops->ioctl(pcnt, \
CAPIOC_FILTER, \