feat(pcnt): add support for step notify

PCNT can add watch of value increment that we call step notify.
This commit add a step notify driver and a test for the driver.

Closes https://github.com/espressif/esp-idf/issues/9604
Closes https://github.com/espressif/esp-idf/issues/12136
This commit is contained in:
Chen Jichang
2024-06-19 21:42:03 +08:00
parent c9a504cdcb
commit d81546628a
9 changed files with 340 additions and 26 deletions

View File

@@ -33,6 +33,12 @@ typedef enum {
PCNT_LL_WATCH_EVENT_MAX
} pcnt_ll_watch_event_id_t;
typedef enum {
PCNT_LL_STEP_EVENT_REACH_LIMIT = PCNT_LL_WATCH_EVENT_MAX,
PCNT_LL_STEP_EVENT_REACH_INTERVAL
} pcnt_ll_step_event_id_t;
#define PCNT_LL_STEP_NOTIFY_DIR_LIMIT 1
#define PCNT_LL_WATCH_EVENT_MASK ((1 << PCNT_LL_WATCH_EVENT_MAX) - 1)
#define PCNT_LL_UNIT_WATCH_EVENT(unit_id) (1 << (unit_id))