Skip to content

Commit c3f3339

Browse files
jonathanhoggdpgeorge
authored andcommitted
esp32/modesp32: Add esp32.PCNT class.
Add a new `esp32.PCNT` class that provides complete, low-level support to the ESP32 PCNT pulse counting hardware units. This can be used as a building block to implement the higher-level `machine.Counter` and `machine.Encoder` classes. This is enabled by default on all OG, S2, S3, C6 boards, but not on C3 (as the PCNT peripheral is not supported). Original implementation by: Jonathan Hogg <[email protected]> Signed-off-by: Jim Mussared <[email protected]> Signed-off-by: Angus Gratton <[email protected]>
1 parent bf6f229 commit c3f3339

File tree

7 files changed

+533
-0
lines changed

7 files changed

+533
-0
lines changed

ports/esp32/boards/sdkconfig.base

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ CONFIG_ADC_CAL_LUT_ENABLE=y
117117
CONFIG_UART_ISR_IN_IRAM=y
118118

119119
# IDF 5 deprecated
120+
CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN=y
120121
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y
121122

122123
CONFIG_ETH_USE_SPI_ETHERNET=y

ports/esp32/esp32_common.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ list(APPEND MICROPY_SOURCE_PORT
127127
modesp.c
128128
esp32_nvs.c
129129
esp32_partition.c
130+
esp32_pcnt.c
130131
esp32_rmt.c
131132
esp32_ulp.c
132133
modesp32.c

0 commit comments

Comments
 (0)