diff --git a/arch/risc-v/src/common/espressif/Kconfig b/arch/risc-v/src/common/espressif/Kconfig index 41e4051c9c2..000c78794fb 100644 --- a/arch/risc-v/src/common/espressif/Kconfig +++ b/arch/risc-v/src/common/espressif/Kconfig @@ -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 diff --git a/arch/xtensa/src/common/espressif/Kconfig b/arch/xtensa/src/common/espressif/Kconfig index f1e8906b73b..3f8768777d8 100644 --- a/arch/xtensa/src/common/espressif/Kconfig +++ b/arch/xtensa/src/common/espressif/Kconfig @@ -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 diff --git a/boards/risc-v/esp32c6/common/src/esp_board_pcnt.c b/boards/risc-v/esp32c6/common/src/esp_board_pcnt.c index c8d50ae4b05..efba7286630 100644 --- a/boards/risc-v/esp32c6/common/src/esp_board_pcnt.c +++ b/boards/risc-v/esp32c6/common/src/esp_board_pcnt.c @@ -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, \ diff --git a/boards/risc-v/esp32h2/common/src/esp_board_pcnt.c b/boards/risc-v/esp32h2/common/src/esp_board_pcnt.c index bfa56202086..283a3ced3e1 100644 --- a/boards/risc-v/esp32h2/common/src/esp_board_pcnt.c +++ b/boards/risc-v/esp32h2/common/src/esp_board_pcnt.c @@ -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, \ diff --git a/boards/xtensa/esp32/common/src/esp32_board_pcnt.c b/boards/xtensa/esp32/common/src/esp32_board_pcnt.c index 018d23216e1..778ed99157a 100644 --- a/boards/xtensa/esp32/common/src/esp32_board_pcnt.c +++ b/boards/xtensa/esp32/common/src/esp32_board_pcnt.c @@ -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, \ diff --git a/boards/xtensa/esp32s2/common/src/esp32s2_board_pcnt.c b/boards/xtensa/esp32s2/common/src/esp32s2_board_pcnt.c index cbd7c49b782..b02fb0c7c9b 100644 --- a/boards/xtensa/esp32s2/common/src/esp32s2_board_pcnt.c +++ b/boards/xtensa/esp32s2/common/src/esp32s2_board_pcnt.c @@ -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, \ diff --git a/boards/xtensa/esp32s3/common/src/esp32s3_board_pcnt.c b/boards/xtensa/esp32s3/common/src/esp32s3_board_pcnt.c index 47621db8e4c..f1a22773828 100644 --- a/boards/xtensa/esp32s3/common/src/esp32s3_board_pcnt.c +++ b/boards/xtensa/esp32s3/common/src/esp32s3_board_pcnt.c @@ -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, \