mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-08 22:01:42 +00:00
feat(pcnt): support pcnt on esp32h4
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user