feat(ana_cmpr): supported analog comparator on esp32p4

This commit is contained in:
laokaiyao
2023-07-18 20:08:22 +08:00
parent b953afe030
commit a989ce4ab1
18 changed files with 377 additions and 66 deletions
+26 -5
View File
@@ -1,9 +1,11 @@
Analog Comparator
=================
{IDF_TARGET_ANA_CMPR_NUM: default="NOT UPDATED", esp32h2="one"}
{IDF_TARGET_ANA_CMPR_SRC_CHAN: default="NOT UPDATED", esp32h2="GPIO11"}
{IDF_TARGET_ANA_CMPR_EXT_REF_CHAN: default="NOT UPDATED", esp32h2="GPIO10"}
{IDF_TARGET_ANA_CMPR_NUM: default="NOT UPDATED", esp32h2="one", esp32p4="two"}
{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_CHAN1: default="NOT UPDATED", esp32p4="GPIO54"}
{IDF_TARGET_ANA_CMPR_EXT_REF_CHAN1: default="NOT UPDATED", esp32p4="GPIO53"}
Introduction
------------
@@ -16,10 +18,18 @@ Analog Comparator on {IDF_TARGET_NAME} has {IDF_TARGET_ANA_CMPR_NUM} unit(s), th
**UNIT0**
- Source Channel: {IDF_TARGET_ANA_CMPR_SRC_CHAN}
- External Reference Channel: {IDF_TARGET_ANA_CMPR_EXT_REF_CHAN}
- Source Channel: {IDF_TARGET_ANA_CMPR_SRC_CHAN0}
- External Reference Channel: {IDF_TARGET_ANA_CMPR_EXT_REF_CHAN0}
- Internal Reference Channel: Range 0% ~ 70% VDD, step 10% VDD
.. only:: esp32p4
**UNIT1**
- Source Channel: {IDF_TARGET_ANA_CMPR_SRC_CHAN1}
- External Reference Channel: {IDF_TARGET_ANA_CMPR_EXT_REF_CHAN1}
- Internal Reference Channel: Range 0% ~ 70% VDD, step 10% VDD
Functional Overview
-------------------
@@ -33,6 +43,10 @@ The following sections of this document cover the typical steps to install and o
- `Thread Safety <#thread-safety>`__ - lists which APIs are guaranteed to be thread safe by the driver.
- `Kconfig Options <#kconfig-options>`__ - lists the supported Kconfig options that can be used to make a different effect on driver behavior.
.. only:: SOC_ANA_CMPR_SUPPORT_ETM
- `ETM Events <#etm-events>`__ -
Resource Allocation
^^^^^^^^^^^^^^^^^^^
@@ -180,6 +194,13 @@ Kconfig Options
- :ref:`CONFIG_ANA_CMPR_CTRL_FUNC_IN_IRAM` controls where to place the Analog Comparator control functions (IRAM or Flash), see `IRAM Safe <#iram-safe>`__ for more information.
- :ref:`CONFIG_ANA_CMPR_ENABLE_DEBUG_LOG` is used to enabled the debug log output. Enabling this option increases the firmware binary size.
.. only:: SOC_ANA_CMPR_SUPPORT_ETM
ETM Events
^^^^^^^^^^
To create an analog comparator cross event, you need to include ``driver/ana_cmpr_etm.h`` additionally, and allocate the event by :cpp:func:`ana_cmpr_new_etm_event`. You can refer to :doc:`GPTimer </api-reference/peripherals/etm>` for how to connect an event to a task.
Application Example
-------------------
@@ -71,6 +71,10 @@ Other Peripheral Events
:SOC_GDMA_SUPPORT_ETM: - Refer to :doc:`/api-reference/system/async_memcpy` for how to get the ETM event handle from async memcpy.
:SOC_MCPWM_SUPPORT_ETM: - Refer to :doc:`/api-reference/peripherals/mcpwm` for how to get the ETM event handle from MCPWM.
.. only:: esp32p4
:SOC_ANA_CMPR_SUPPORT_ETM: - Refer to :doc:`/api-reference/peripherals/ana_cmpr` for how to get the ETM event handle from analog comparator.
.. _etm-task:
ETM Task