feat(pcnt): support pcnt on esp32h4

This commit is contained in:
Chen Jichang
2025-08-26 16:40:14 +08:00
parent 04b934951e
commit ad5bdc83a7
30 changed files with 997 additions and 115 deletions

View File

@@ -18,9 +18,10 @@
#include <stdlib.h>
#include <stdbool.h>
#include "soc/pcnt_struct.h"
#include "hal/pcnt_types.h"
#include "soc/dport_reg.h"
#include "soc/dport_access.h"
#include "hal/pcnt_types.h"
#include "hal/assert.h"
#ifdef __cplusplus
extern "C" {
@@ -43,6 +44,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