From 0cae6d526c0e7b63c313c5726a815b25ae93f65f Mon Sep 17 00:00:00 2001 From: laokaiyao Date: Fri, 6 Dec 2024 15:35:18 +0800 Subject: [PATCH] feat(ana_cmpr): support analog comparator on C61 --- .../test_apps/analog_comparator/README.md | 4 +- .../analog_comparator/pytest_ana_cmpr.py | 1 + .../hal/esp32c61/include/hal/ana_cmpr_ll.h | 169 ++++++++++++++++++ .../hal/esp32p4/include/hal/ana_cmpr_ll.h | 1 - components/soc/esp32c61/ana_cmpr_periph.c | 26 +++ .../esp32c61/include/soc/Kconfig.soc_caps.in | 16 ++ .../esp32c61/include/soc/ana_cmpr_channel.h | 10 ++ .../esp32c61/include/soc/ana_cmpr_struct.h | 36 ++++ .../soc/esp32c61/include/soc/clk_tree_defs.h | 17 ++ .../soc/esp32c61/include/soc/soc_caps.h | 6 + docs/docs_not_updated/esp32c61.txt | 1 - .../en/api-reference/peripherals/ana_cmpr.rst | 23 ++- .../api-reference/peripherals/ana_cmpr.rst | 23 ++- .../peripherals/analog_comparator/README.md | 4 +- .../pytest_ana_cmpr_example.py | 1 + 15 files changed, 308 insertions(+), 30 deletions(-) create mode 100644 components/hal/esp32c61/include/hal/ana_cmpr_ll.h create mode 100644 components/soc/esp32c61/ana_cmpr_periph.c create mode 100644 components/soc/esp32c61/include/soc/ana_cmpr_channel.h create mode 100644 components/soc/esp32c61/include/soc/ana_cmpr_struct.h diff --git a/components/esp_driver_ana_cmpr/test_apps/analog_comparator/README.md b/components/esp_driver_ana_cmpr/test_apps/analog_comparator/README.md index bde3cf8e73..522583ae5b 100644 --- a/components/esp_driver_ana_cmpr/test_apps/analog_comparator/README.md +++ b/components/esp_driver_ana_cmpr/test_apps/analog_comparator/README.md @@ -1,2 +1,2 @@ -| Supported Targets | ESP32-H2 | ESP32-P4 | -| ----------------- | -------- | -------- | +| Supported Targets | ESP32-C61 | ESP32-H2 | ESP32-P4 | +| ----------------- | --------- | -------- | -------- | diff --git a/components/esp_driver_ana_cmpr/test_apps/analog_comparator/pytest_ana_cmpr.py b/components/esp_driver_ana_cmpr/test_apps/analog_comparator/pytest_ana_cmpr.py index 020ff3713e..4bbc66b8a1 100644 --- a/components/esp_driver_ana_cmpr/test_apps/analog_comparator/pytest_ana_cmpr.py +++ b/components/esp_driver_ana_cmpr/test_apps/analog_comparator/pytest_ana_cmpr.py @@ -6,6 +6,7 @@ from pytest_embedded import Dut @pytest.mark.esp32h2 @pytest.mark.esp32p4 +@pytest.mark.esp32c61 @pytest.mark.generic @pytest.mark.parametrize( 'config', diff --git a/components/hal/esp32c61/include/hal/ana_cmpr_ll.h b/components/hal/esp32c61/include/hal/ana_cmpr_ll.h new file mode 100644 index 0000000000..73e99c5671 --- /dev/null +++ b/components/hal/esp32c61/include/hal/ana_cmpr_ll.h @@ -0,0 +1,169 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include "hal/misc.h" +#include "hal/assert.h" +#include "soc/ana_cmpr_struct.h" +#include "soc/soc_etm_source.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ANALOG_CMPR_LL_GET_HW(unit) (&ANALOG_CMPR[unit]) +#define ANALOG_CMPR_LL_GET_UNIT(hw) (0) +#define ANALOG_CMPR_LL_EVENT_CROSS (1 << 0) + +#define ANALOG_CMPR_LL_NEG_CROSS_MASK(unit) (1UL << ((int)unit * 3)) +#define ANALOG_CMPR_LL_POS_CROSS_MASK(unit) (1UL << ((int)unit * 3 + 1)) + +#define ANALOG_CMPR_LL_ETM_SOURCE(unit, type) (GPIO_EVT_ZERO_DET_POS0 + (unit) * 2 + (type)) + + +/** + * @brief Enable analog comparator + * + * @param hw Analog comparator register base address + * @param en True to enable, False to disable + */ +static inline void analog_cmpr_ll_enable(analog_cmpr_dev_t *hw, bool en) +{ + hw->pad_comp_config->xpd_comp_0 = en; +} + +/** + * @brief Set the voltage of the internal reference + * + * @param hw Analog comparator register base address + * @param volt_level The voltage level of the internal reference, range [0.0V, 0.7VDD], step 0.1VDD + */ +__attribute__((always_inline)) +static inline void analog_cmpr_ll_set_internal_ref_voltage(analog_cmpr_dev_t *hw, uint32_t volt_level) +{ + hw->pad_comp_config->dref_comp_0 = volt_level; +} + +/** + * @brief Get the voltage of the internal reference + * + * @param hw Analog comparator register base address + * @return The voltage of the internal reference + */ +static inline float analog_cmpr_ll_get_internal_ref_voltage(analog_cmpr_dev_t *hw) +{ + return hw->pad_comp_config->dref_comp_0 * 0.1F; +} + +/** + * @brief The reference voltage comes from internal or external + * + * @note Also see `analog_cmpr_ll_set_internal_ref_voltage` to use the internal reference voltage + * + * @param hw Analog comparator register base address + * @param ref_src reference source, 0 for internal, 1 for external GPIO pad (GPIO10) + */ +static inline void analog_cmpr_ll_set_ref_source(analog_cmpr_dev_t *hw, uint32_t ref_src) +{ + hw->pad_comp_config->mode_comp_0 = ref_src; +} + +/** + * @brief Get the interrupt mask by trigger type + * + * @param hw Analog comparator register base address + * @param type The type of cross interrupt + * - 0: disable interrupt + * - 1: enable positive cross interrupt (input analog goes from low to high and across the reference voltage) + * - 2: enable negative cross interrupt (input analog goes from high to low and across the reference voltage) + * - 3: enable any positive or negative cross interrupt + * @return interrupt mask + */ +__attribute__((always_inline)) +static inline uint32_t analog_cmpr_ll_get_intr_mask_by_type(analog_cmpr_dev_t *hw, uint8_t type) +{ + uint32_t unit = ANALOG_CMPR_LL_GET_UNIT(hw); + uint32_t mask = 0; + if (type & 0x01) { + mask |= ANALOG_CMPR_LL_POS_CROSS_MASK(unit); + } + if (type & 0x02) { + mask |= ANALOG_CMPR_LL_NEG_CROSS_MASK(unit); + } + return mask; +} + +/** + * @brief Set the debounce cycle for the cross detection + * + * @note When the comparator detects a cross, it will wait for the debounce cycle to make sure the cross is stable. + * + * @param hw Analog comparator register base address + * @param cycle The debounce cycle + */ +__attribute__((always_inline)) +static inline void analog_cmpr_ll_set_debounce_cycle(analog_cmpr_dev_t *hw, uint32_t cycle) +{ + hw->pad_comp_filter->zero_det_filter_cnt_0 = cycle; +} + +/** + * @brief Enable comparator interrupt + * + * @param hw Analog comparator register base address + * @param mask Interrupt mask + * @param enable True to enable, False to disable + */ +static inline void analog_cmpr_ll_enable_intr(analog_cmpr_dev_t *hw, uint32_t mask, bool enable) +{ + uint32_t val = hw->int_ena->val; + if (enable) { + val |= mask; + } else { + val &= ~mask; + } + hw->int_ena->val = val; +} + +/** + * @brief Get comparator interrupt status + * + * @param hw Analog comparator register base address + */ +__attribute__((always_inline)) +static inline uint32_t analog_cmpr_ll_get_intr_status(analog_cmpr_dev_t *hw) +{ + return hw->int_st->val; +} + +/** + * @brief Clear comparator interrupt status + * + * @param hw Analog comparator register base address + * @param mask Interrupt status word + */ +__attribute__((always_inline)) +static inline void analog_cmpr_ll_clear_intr(analog_cmpr_dev_t *hw, uint32_t mask) +{ + hw->int_clr->val = mask; +} + +/** + * @brief Get the interrupt status register address + * + * @param hw Analog comparator register base address + * @return The interrupt status register address + */ +static inline volatile void *analog_cmpr_ll_get_intr_status_reg(analog_cmpr_dev_t *hw) +{ + return hw->int_st; +} + +#ifdef __cplusplus +} +#endif diff --git a/components/hal/esp32p4/include/hal/ana_cmpr_ll.h b/components/hal/esp32p4/include/hal/ana_cmpr_ll.h index d1075ed64a..b0ada6928e 100644 --- a/components/hal/esp32p4/include/hal/ana_cmpr_ll.h +++ b/components/hal/esp32p4/include/hal/ana_cmpr_ll.h @@ -19,7 +19,6 @@ extern "C" { #define ANALOG_CMPR_LL_GET_HW(unit) (&ANALOG_CMPR[unit]) #define ANALOG_CMPR_LL_GET_UNIT(hw) ((hw) == (&ANALOG_CMPR[0]) ? 0 : 1) #define ANALOG_CMPR_LL_EVENT_CROSS (1 << 0) -#define ANALOG_CMPR_LL_ETM_EVENTS_PER_UNIT (2) #define ANALOG_CMPR_LL_NEG_CROSS_MASK(unit) (1UL << ((int)unit * 3)) #define ANALOG_CMPR_LL_POS_CROSS_MASK(unit) (1UL << ((int)unit * 3 + 1)) diff --git a/components/soc/esp32c61/ana_cmpr_periph.c b/components/soc/esp32c61/ana_cmpr_periph.c new file mode 100644 index 0000000000..ccacfdf622 --- /dev/null +++ b/components/soc/esp32c61/ana_cmpr_periph.c @@ -0,0 +1,26 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "soc/ana_cmpr_periph.h" +#include "soc/ana_cmpr_struct.h" + +const ana_cmpr_periph_t ana_cmpr_periph[SOC_ANA_CMPR_NUM] = { + [0] = { + .src_gpio = ANA_CMPR0_SRC_GPIO, + .ext_ref_gpio = ANA_CMPR0_EXT_REF_GPIO, + .intr_src = ETS_GPIO_INTERRUPT_EXT_SOURCE, + }, +}; + +analog_cmpr_dev_t ANALOG_CMPR[SOC_ANA_CMPR_NUM] = { + [0] = { + .pad_comp_config = &GPIO_EXT.pad_comp_config_0, + .pad_comp_filter = &GPIO_EXT.pad_comp_filter_0, + .int_st = &GPIO_EXT.int_st, + .int_ena = &GPIO_EXT.int_ena, + .int_clr = &GPIO_EXT.int_clr, + }, +}; diff --git a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in index 32f1de140e..be07f2aa39 100644 --- a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in @@ -7,6 +7,10 @@ config SOC_ADC_SUPPORTED bool default y +config SOC_ANA_CMPR_SUPPORTED + bool + default y + config SOC_DEDICATED_GPIO_SUPPORTED bool default y @@ -471,6 +475,18 @@ config SOC_DEDIC_PERIPH_ALWAYS_ENABLE bool default y +config SOC_ANA_CMPR_NUM + int + default 1 + +config SOC_ANA_CMPR_CAN_DISTINGUISH_EDGE + bool + default y + +config SOC_ANA_CMPR_SUPPORT_ETM + bool + default y + config SOC_I2C_NUM int default 1 diff --git a/components/soc/esp32c61/include/soc/ana_cmpr_channel.h b/components/soc/esp32c61/include/soc/ana_cmpr_channel.h new file mode 100644 index 0000000000..f51632ab0f --- /dev/null +++ b/components/soc/esp32c61/include/soc/ana_cmpr_channel.h @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#define ANA_CMPR0_EXT_REF_GPIO 8 /*!< The GPIO that can be used as external reference voltage */ +#define ANA_CMPR0_SRC_GPIO 9 /*!< The GPIO that used for inputting the source signal to compare */ diff --git a/components/soc/esp32c61/include/soc/ana_cmpr_struct.h b/components/soc/esp32c61/include/soc/ana_cmpr_struct.h new file mode 100644 index 0000000000..ef3fbe3824 --- /dev/null +++ b/components/soc/esp32c61/include/soc/ana_cmpr_struct.h @@ -0,0 +1,36 @@ +/** + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* NOTE: this file is created manually for compatibility */ + +#pragma once + +#include +#include "soc/gpio_ext_struct.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief The Analog Comparator Device struct + * @note The field in it are register pointers, which point to the physical address + * of the corresponding configuration register + * @note see 'ana_cmpr_periph.c' for the device instance + */ +typedef struct { + volatile gpio_ext_pad_comp_config_0_reg_t *pad_comp_config; + volatile gpio_ext_pad_comp_filter_0_reg_t *pad_comp_filter; + volatile gpio_ext_int_st_reg_t *int_st; + volatile gpio_ext_int_ena_reg_t *int_ena; + volatile gpio_ext_int_clr_reg_t *int_clr; +} analog_cmpr_dev_t; + +extern analog_cmpr_dev_t ANALOG_CMPR[1]; + +#ifdef __cplusplus +} +#endif diff --git a/components/soc/esp32c61/include/soc/clk_tree_defs.h b/components/soc/esp32c61/include/soc/clk_tree_defs.h index fec2e781d5..6d7ab501f4 100644 --- a/components/soc/esp32c61/include/soc/clk_tree_defs.h +++ b/components/soc/esp32c61/include/soc/clk_tree_defs.h @@ -278,6 +278,23 @@ typedef enum { GLITCH_FILTER_CLK_SRC_DEFAULT = SOC_MOD_CLK_PLL_F80M, /*!< Select PLL_F80M clock as the default clock choice */ } soc_periph_glitch_filter_clk_src_t; +///////////////////////////////////////////////////Analog Comparator//////////////////////////////////////////////////// + +/** + * @brief Array initializer for all supported clock sources of Analog Comparator + */ +#define SOC_ANA_CMPR_CLKS {SOC_MOD_CLK_PLL_F80M, SOC_MOD_CLK_RC_FAST, SOC_MOD_CLK_XTAL} + +/** + * @brief Analog Comparator clock source + */ +typedef enum { + ANA_CMPR_CLK_SRC_XTAL = SOC_MOD_CLK_XTAL, /*!< Select XTAL clock as the source clock */ + ANA_CMPR_CLK_SRC_RC_FAST = SOC_MOD_CLK_RC_FAST, /*!< Select RC_FAST clock as the source clock */ + ANA_CMPR_CLK_SRC_PLL_F80M = SOC_MOD_CLK_PLL_F80M, /*!< Select PLL_F80M clock as the source clock */ + ANA_CMPR_CLK_SRC_DEFAULT = SOC_MOD_CLK_PLL_F80M, /*!< Select PLL_F80M as the default clock choice */ +} soc_periph_ana_cmpr_clk_src_t; + //////////////////////////////////////////////////ADC/////////////////////////////////////////////////////////////////// /** diff --git a/components/soc/esp32c61/include/soc/soc_caps.h b/components/soc/esp32c61/include/soc/soc_caps.h index af95d3232c..9fc484e819 100644 --- a/components/soc/esp32c61/include/soc/soc_caps.h +++ b/components/soc/esp32c61/include/soc/soc_caps.h @@ -18,6 +18,7 @@ /*-------------------------- COMMON CAPS ---------------------------------------*/ #define SOC_ADC_SUPPORTED 1 +#define SOC_ANA_CMPR_SUPPORTED 1 #define SOC_DEDICATED_GPIO_SUPPORTED 1 #define SOC_UART_SUPPORTED 1 #define SOC_GDMA_SUPPORTED 1 @@ -211,6 +212,11 @@ #define SOC_DEDIC_GPIO_IN_CHANNELS_NUM (8) /*!< 8 inward channels on each CPU core */ #define SOC_DEDIC_PERIPH_ALWAYS_ENABLE (1) /*!< The dedicated GPIO (a.k.a. fast GPIO) is featured by some customized CPU instructions, which is always enabled */ +/*------------------------- Analog Comparator CAPS ---------------------------*/ +#define SOC_ANA_CMPR_NUM (1U) +#define SOC_ANA_CMPR_CAN_DISTINGUISH_EDGE (1) // Support positive/negative/any cross interrupt +#define SOC_ANA_CMPR_SUPPORT_ETM (1) + /*-------------------------- I2C CAPS ----------------------------------------*/ // ESP32-C61 has 1 I2C #define SOC_I2C_NUM (1U) diff --git a/docs/docs_not_updated/esp32c61.txt b/docs/docs_not_updated/esp32c61.txt index a6f5015cbb..06f5fabaca 100644 --- a/docs/docs_not_updated/esp32c61.txt +++ b/docs/docs_not_updated/esp32c61.txt @@ -45,7 +45,6 @@ api-reference/peripherals/usb_device.rst api-reference/peripherals/dac.rst api-reference/peripherals/touch_element.rst api-reference/peripherals/ppa.rst -api-reference/peripherals/ana_cmpr.rst api-reference/peripherals/camera_driver.rst api-reference/peripherals/spi_features.rst api-reference/peripherals/sdio_slave.rst diff --git a/docs/en/api-reference/peripherals/ana_cmpr.rst b/docs/en/api-reference/peripherals/ana_cmpr.rst index 44d9a34b44..a8954edbbc 100644 --- a/docs/en/api-reference/peripherals/ana_cmpr.rst +++ b/docs/en/api-reference/peripherals/ana_cmpr.rst @@ -3,8 +3,8 @@ Analog Comparator :link_to_translation:`zh_CN:[中文]` -{IDF_TARGET_ANA_CMPR_SRC_CHAN0: default="NOT UPDATED", esp32h2="GPIO11", esp32p4="GPIO52"} -{IDF_TARGET_ANA_CMPR_EXT_REF_CHAN0: default="NOT UPDATED", esp32h2="GPIO10", esp32p4="GPIO51"} +{IDF_TARGET_ANA_CMPR_SRC_CHAN0: default="NOT UPDATED", esp32h2="GPIO11", esp32p4="GPIO52", esp32c61="GPIO9"} +{IDF_TARGET_ANA_CMPR_EXT_REF_CHAN0: default="NOT UPDATED", esp32h2="GPIO10", esp32p4="GPIO51", esp32c61="GPIO8"} {IDF_TARGET_ANA_CMPR_SRC_CHAN1: default="NOT UPDATED", esp32p4="GPIO54"} {IDF_TARGET_ANA_CMPR_EXT_REF_CHAN1: default="NOT UPDATED", esp32p4="GPIO53"} @@ -36,17 +36,16 @@ Functional Overview The following sections of this document cover the typical steps to install and operate an analog comparator unit: -- :ref:`anacmpr-resource-allocation` - covers which parameters should be set up to get a unit handle and how to recycle the resources when it finishes working. -- :ref:`anacmpr-further-configurations` - covers the other configurations that might need to specify and what they are used for. -- :ref:`anacmpr-enable-and-disable-unit` - covers how to enable and disable the unit. -- :ref:`anacmpr-power-management` - describes how different source clock selections can affect power consumption. -- :ref:`anacmpr-iram-safe` - lists which functions are supposed to work even when the cache is disabled. -- :ref:`anacmpr-thread-safety` - lists which APIs are guaranteed to be thread safe by the driver. -- :ref:`anacmpr-kconfig-options` - lists the supported Kconfig options that can be used to make a different effect on driver behavior. +.. list:: -.. only:: SOC_ANA_CMPR_SUPPORT_ETM - - - :ref:`anacmpr-etm-events` - covers how to create an analog comparator cross event. + - :ref:`anacmpr-resource-allocation` - covers which parameters should be set up to get a unit handle and how to recycle the resources when it finishes working. + - :ref:`anacmpr-further-configurations` - covers the other configurations that might need to specify and what they are used for. + - :ref:`anacmpr-enable-and-disable-unit` - covers how to enable and disable the unit. + - :ref:`anacmpr-power-management` - describes how different source clock selections can affect power consumption. + - :ref:`anacmpr-iram-safe` - lists which functions are supposed to work even when the cache is disabled. + - :ref:`anacmpr-thread-safety` - lists which APIs are guaranteed to be thread safe by the driver. + - :ref:`anacmpr-kconfig-options` - lists the supported Kconfig options that can be used to make a different effect on driver behavior. + :SOC_ANA_CMPR_SUPPORT_ETM: - :ref:`anacmpr-etm-events` - covers how to create an analog comparator cross event. .. _anacmpr-resource-allocation: diff --git a/docs/zh_CN/api-reference/peripherals/ana_cmpr.rst b/docs/zh_CN/api-reference/peripherals/ana_cmpr.rst index 136f0f834d..d529b3f2cb 100644 --- a/docs/zh_CN/api-reference/peripherals/ana_cmpr.rst +++ b/docs/zh_CN/api-reference/peripherals/ana_cmpr.rst @@ -3,8 +3,8 @@ :link_to_translation:`en:[English]` -{IDF_TARGET_ANA_CMPR_SRC_CHAN0: default="未更新", esp32h2="GPIO11", esp32p4="GPIO52"} -{IDF_TARGET_ANA_CMPR_EXT_REF_CHAN0: default="未更新", esp32h2="GPIO10", esp32p4="GPIO51"} +{IDF_TARGET_ANA_CMPR_SRC_CHAN0: default="未更新", esp32h2="GPIO11", esp32p4="GPIO52", esp32c61="GPIO9"} +{IDF_TARGET_ANA_CMPR_EXT_REF_CHAN0: default="未更新", esp32h2="GPIO10", esp32p4="GPIO51", esp32c61="GPIO8"} {IDF_TARGET_ANA_CMPR_SRC_CHAN1: default="未更新", esp32p4="GPIO54"} {IDF_TARGET_ANA_CMPR_EXT_REF_CHAN1: default="未更新", esp32p4="GPIO53"} @@ -36,17 +36,16 @@ 本文中的以下章节涵盖了安装及操作模拟比较器单元的基本步骤: -- :ref:`anacmpr-resource-allocation` - 涵盖了应设置哪些参数以获取单元句柄,以及完成工作后如何回收资源。 -- :ref:`anacmpr-further-configurations` - 涵盖了可能需要指定的其他配置及其用途。 -- :ref:`anacmpr-enable-and-disable-unit` - 涵盖了如何启用和禁用单元。 -- :ref:`anacmpr-power-management` - 描述了不同时钟源对功耗的影响。 -- :ref:`anacmpr-iram-safe` - 列出了在 cache 被禁用时也能起效的函数。 -- :ref:`anacmpr-thread-safety` - 列出了驱动程序中线程安全的 API。 -- :ref:`anacmpr-kconfig-options` - 列出了支持的 Kconfig 选项,这些选项可以对驱动程序产生不同影响。 +.. list:: -.. only:: SOC_ANA_CMPR_SUPPORT_ETM - - - :ref:`anacmpr-etm-events` - 介绍了如何创建一个模拟比较器跨越事件。 + - :ref:`anacmpr-resource-allocation` - 涵盖了应设置哪些参数以获取单元句柄,以及完成工作后如何回收资源。 + - :ref:`anacmpr-further-configurations` - 涵盖了可能需要指定的其他配置及其用途。 + - :ref:`anacmpr-enable-and-disable-unit` - 涵盖了如何启用和禁用单元。 + - :ref:`anacmpr-power-management` - 描述了不同时钟源对功耗的影响。 + - :ref:`anacmpr-iram-safe` - 列出了在 cache 被禁用时也能起效的函数。 + - :ref:`anacmpr-thread-safety` - 列出了驱动程序中线程安全的 API。 + - :ref:`anacmpr-kconfig-options` - 列出了支持的 Kconfig 选项,这些选项可以对驱动程序产生不同影响。 + :SOC_ANA_CMPR_SUPPORT_ETM: - :ref:`anacmpr-etm-events` - 介绍了如何创建一个模拟比较器跨越事件。 .. _anacmpr-resource-allocation: diff --git a/examples/peripherals/analog_comparator/README.md b/examples/peripherals/analog_comparator/README.md index 330b1dcc0e..eb664cf6da 100644 --- a/examples/peripherals/analog_comparator/README.md +++ b/examples/peripherals/analog_comparator/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-H2 | ESP32-P4 | -| ----------------- | -------- | -------- | +| Supported Targets | ESP32-C61 | ESP32-H2 | ESP32-P4 | +| ----------------- | --------- | -------- | -------- | # Analog Comparator Example diff --git a/examples/peripherals/analog_comparator/pytest_ana_cmpr_example.py b/examples/peripherals/analog_comparator/pytest_ana_cmpr_example.py index 0c7b5c2b02..1f21a6f845 100644 --- a/examples/peripherals/analog_comparator/pytest_ana_cmpr_example.py +++ b/examples/peripherals/analog_comparator/pytest_ana_cmpr_example.py @@ -6,6 +6,7 @@ from pytest_embedded import Dut @pytest.mark.esp32h2 @pytest.mark.esp32p4 +@pytest.mark.esp32c61 @pytest.mark.generic @pytest.mark.parametrize( 'config',