mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
gpio: support glitch filter on esp32h2
This commit is contained in:
@@ -359,14 +359,6 @@ config SOC_GPIO_FLEX_GLITCH_FILTER_NUM
|
||||
int
|
||||
default 8
|
||||
|
||||
config SOC_GPIO_FILTER_CLK_SUPPORT_XTAL
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_GPIO_FILTER_CLK_SUPPORT_PLL_F80M
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_GPIO_SUPPORT_ETM
|
||||
bool
|
||||
default y
|
||||
|
||||
@@ -161,8 +161,6 @@
|
||||
#define SOC_GPIO_PIN_COUNT 31
|
||||
#define SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER 1
|
||||
#define SOC_GPIO_FLEX_GLITCH_FILTER_NUM 8
|
||||
#define SOC_GPIO_FILTER_CLK_SUPPORT_XTAL 1
|
||||
#define SOC_GPIO_FILTER_CLK_SUPPORT_PLL_F80M 1
|
||||
|
||||
// GPIO peripheral has the ETM extension
|
||||
#define SOC_GPIO_SUPPORT_ETM 1
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
# using gen_soc_caps_kconfig.py, do not edit manually
|
||||
#####################################################
|
||||
|
||||
config SOC_DEDICATED_GPIO_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_UART_SUPPORTED
|
||||
bool
|
||||
default y
|
||||
@@ -283,6 +287,14 @@ config SOC_GPIO_PIN_COUNT
|
||||
int
|
||||
default 28
|
||||
|
||||
config SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_GPIO_FLEX_GLITCH_FILTER_NUM
|
||||
int
|
||||
default 8
|
||||
|
||||
config SOC_GPIO_SUPPORT_ETM
|
||||
bool
|
||||
default y
|
||||
|
||||
@@ -371,7 +371,11 @@ typedef enum {
|
||||
typedef enum {
|
||||
GLITCH_FILTER_CLK_SRC_XTAL = SOC_MOD_CLK_XTAL, /*!< Select XTAL clock as the source clock */
|
||||
GLITCH_FILTER_CLK_SRC_PLL_F48M = SOC_MOD_CLK_PLL_F48M, /*!< Select PLL_F48M clock as the source clock */
|
||||
#if CONFIG_IDF_ENV_FPGA
|
||||
GLITCH_FILTER_CLK_SRC_DEFAULT = SOC_MOD_CLK_XTAL, /*!< Select XTAL as the default clock choice */
|
||||
#else
|
||||
GLITCH_FILTER_CLK_SRC_DEFAULT = SOC_MOD_CLK_PLL_F48M, /*!< Select PLL_F48M clock as the default clock choice */
|
||||
#endif
|
||||
} soc_periph_glitch_filter_clk_src_t;
|
||||
|
||||
//////////////////////////////////////////////////TWAI/////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -112,22 +112,22 @@ typedef union {
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
/** filter_ch0_en : R/W; bitpos: [0]; default: 0;
|
||||
/** filter_chn_en : R/W; bitpos: [0]; default: 0;
|
||||
* Glitch Filter channel enable bit.
|
||||
*/
|
||||
uint32_t filter_ch0_en:1;
|
||||
/** filter_ch0_input_io_num : R/W; bitpos: [6:1]; default: 0;
|
||||
uint32_t filter_chn_en:1;
|
||||
/** filter_chn_input_io_num : R/W; bitpos: [6:1]; default: 0;
|
||||
* Glitch Filter input io number.
|
||||
*/
|
||||
uint32_t filter_ch0_input_io_num:6;
|
||||
/** filter_ch0_window_thres : R/W; bitpos: [12:7]; default: 0;
|
||||
uint32_t filter_chn_input_io_num:6;
|
||||
/** filter_chn_window_thres : R/W; bitpos: [12:7]; default: 0;
|
||||
* Glitch Filter window threshold.
|
||||
*/
|
||||
uint32_t filter_ch0_window_thres:6;
|
||||
/** filter_ch0_window_width : R/W; bitpos: [18:13]; default: 0;
|
||||
uint32_t filter_chn_window_thres:6;
|
||||
/** filter_chn_window_width : R/W; bitpos: [18:13]; default: 0;
|
||||
* Glitch Filter window width.
|
||||
*/
|
||||
uint32_t filter_ch0_window_width:6;
|
||||
uint32_t filter_chn_window_width:6;
|
||||
uint32_t reserved_19:13;
|
||||
};
|
||||
uint32_t val;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/*-------------------------- COMMON CAPS ---------------------------------------*/
|
||||
// #define SOC_ADC_SUPPORTED 1 // TODO: IDF-6214
|
||||
// #define SOC_DEDICATED_GPIO_SUPPORTED 1 // TODO: IDF-6241
|
||||
#define SOC_DEDICATED_GPIO_SUPPORTED 1
|
||||
#define SOC_UART_SUPPORTED 1
|
||||
#define SOC_GDMA_SUPPORTED 1
|
||||
#define SOC_ASYNC_MEMCPY_SUPPORTED 1
|
||||
@@ -154,8 +154,10 @@
|
||||
|
||||
/*-------------------------- GPIO CAPS ---------------------------------------*/
|
||||
// ESP32-H2 has 1 GPIO peripheral
|
||||
#define SOC_GPIO_PORT (1U)
|
||||
#define SOC_GPIO_PIN_COUNT (28)
|
||||
#define SOC_GPIO_PORT 1U
|
||||
#define SOC_GPIO_PIN_COUNT 28
|
||||
#define SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER 1
|
||||
#define SOC_GPIO_FLEX_GLITCH_FILTER_NUM 8
|
||||
|
||||
// GPIO peripheral has the ETM extension
|
||||
#define SOC_GPIO_SUPPORT_ETM 1
|
||||
@@ -174,7 +176,6 @@
|
||||
// digital I/O pad powered by VDD3P3_CPU or VDD_SPI(GPIO_NUM_0~6. GPIO_NUM_15~27)
|
||||
#define SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK 0x000000000FFF807FULL
|
||||
|
||||
// TODO: IDF-6241
|
||||
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
||||
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
||||
#define SOC_DEDIC_GPIO_IN_CHANNELS_NUM (8) /*!< 8 inward channels on each CPU core */
|
||||
|
||||
Reference in New Issue
Block a user