Skip to content

Commit ffa1c92

Browse files
LucasTamborcarlescufi
authored andcommitted
drivers: sensor: esp32: pcnt driver
Add new pcnt peripheral driver. Signed-off-by: Lucas Tamborrino <[email protected]>
1 parent ca9126f commit ffa1c92

File tree

5 files changed

+450
-0
lines changed

5 files changed

+450
-0
lines changed

drivers/sensor/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ add_subdirectory_ifdef(CONFIG_TACH_NPCX nuvoton_tach_npcx)
108108
add_subdirectory_ifdef(CONFIG_ADC_CMP_NPCX nuvoton_adc_cmp_npcx)
109109
add_subdirectory_ifdef(CONFIG_TACH_IT8XXX2 ite_tach_it8xxx2)
110110
add_subdirectory_ifdef(CONFIG_VCMP_IT8XXX2 ite_vcmp_it8xxx2)
111+
add_subdirectory_ifdef(CONFIG_PCNT_ESP32 pcnt_esp32)
111112

112113
if(CONFIG_USERSPACE OR CONFIG_SENSOR_SHELL OR CONFIG_SENSOR_SHELL_BATTERY)
113114
# The above if() is needed or else CMake would complain about

drivers/sensor/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,6 @@ source "drivers/sensor/ite_tach_it8xxx2/Kconfig"
252252

253253
source "drivers/sensor/ite_vcmp_it8xxx2/Kconfig"
254254

255+
source "drivers/sensor/pcnt_esp32/Kconfig"
256+
255257
endif # SENSOR
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
5+
zephyr_library_sources_ifdef(CONFIG_PCNT_ESP32 pcnt_esp32.c)

drivers/sensor/pcnt_esp32/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ESP32 Pulse Counter configuration
2+
3+
# Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config PCNT_ESP32
7+
bool "ESP32 Pulse Counter driver"
8+
default y
9+
depends on DT_HAS_ESPRESSIF_ESP32_PCNT_ENABLED
10+
help
11+
This option enables the PCNT driver for ESP32 family of
12+
processors.
13+
14+
config PCNT_ESP32_TRIGGER
15+
bool "Trigger support"
16+
depends on PCNT_ESP32
17+
default y
18+
help
19+
Enable trigger support for the PCNT.

0 commit comments

Comments
 (0)