Merge branch 'feat/support_pcnt_on_h4' into 'master'

feat(pcnt): support pcnt on esp32h4

Closes IDF-12338 and IDF-13637

See merge request espressif/esp-idf!41526
This commit is contained in:
morris
2025-09-03 17:15:11 +08:00
67 changed files with 1542 additions and 791 deletions

View File

@@ -18,8 +18,9 @@
#include <stdlib.h>
#include <stdbool.h>
#include "soc/pcnt_struct.h"
#include "hal/pcnt_types.h"
#include "soc/system_struct.h"
#include "hal/pcnt_types.h"
#include "hal/assert.h"
#ifdef __cplusplus
extern "C" {
@@ -42,6 +43,19 @@ typedef enum {
#define PCNT_LL_WATCH_EVENT_MASK ((1 << PCNT_LL_WATCH_EVENT_MAX) - 1)
#define PCNT_LL_UNIT_WATCH_EVENT(unit_id) (1 << (unit_id))
#define PCNT_LL_CLOCK_SUPPORT_APB 1
/**
* @brief Set clock source for pcnt group
*
* @param hw Peripheral PCNT hardware instance address.
* @param clk_src Clock source
*/
static inline void pcnt_ll_set_clock_source(pcnt_dev_t *hw, pcnt_clock_source_t clk_src)
{
(void)hw;
HAL_ASSERT(clk_src == PCNT_CLK_SRC_APB && "unsupported clock source");
}
/**
* @brief Set PCNT channel edge action