diff options
| author | Jonathan Hogg <me@jonathanhogg.com> | 2023-08-15 13:03:45 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-08-01 23:45:18 +1000 |
| commit | c3f3339c87444acec814a150fdad28e650483405 (patch) | |
| tree | 215915b2cd5c0c1699bde05b5e83b3b539d06d88 /ports/esp32/modesp32.c | |
| parent | bf6f229cf3feb6767d37b9df9dcf1e2d9abc49bd (diff) | |
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 <me@jonathanhogg.com>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'ports/esp32/modesp32.c')
| -rw-r--r-- | ports/esp32/modesp32.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ports/esp32/modesp32.c b/ports/esp32/modesp32.c index bf7aec394..858be2ed0 100644 --- a/ports/esp32/modesp32.c +++ b/ports/esp32/modesp32.c @@ -299,6 +299,9 @@ static const mp_rom_map_elem_t esp32_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_NVS), MP_ROM_PTR(&esp32_nvs_type) }, { MP_ROM_QSTR(MP_QSTR_Partition), MP_ROM_PTR(&esp32_partition_type) }, + #if MICROPY_PY_ESP32_PCNT + { MP_ROM_QSTR(MP_QSTR_PCNT), MP_ROM_PTR(&esp32_pcnt_type) }, + #endif #if SOC_RMT_SUPPORTED { MP_ROM_QSTR(MP_QSTR_RMT), MP_ROM_PTR(&esp32_rmt_type) }, #endif |
