Merge branch 'docs/add_pin_touch_sensor' into 'master'

docs: add pin information of touch sensor

Closes DOC-3610

See merge request espressif/esp-idf!19927
pull/9839/head
Zhang Xiao Yan 2022-10-25 13:25:46 +08:00
commit ee8c84551e
2 zmienionych plików z 146 dodań i 20 usunięć

Wyświetl plik

@ -9,14 +9,6 @@ Introduction
A touch sensor system is built on a substrate which carries electrodes and relevant connections under a protective flat surface. When a user touches the surface, the capacitance variation is used to evaluate if the touch was valid.
.. only:: SOC_TOUCH_VERSION_1
Touch sensor on {IDF_TARGET_NAME} can support up to 10 capacitive touch pads / GPIOs.
.. only:: SOC_TOUCH_VERSION_2
Touch sensor on {IDF_TARGET_NAME} can support up to 14 capacitive touch pads / GPIOs.
The sensing pads can be arranged in different combinations (e.g., matrix, slider), so that a larger area or more points can be detected. The touch pad sensing process is under the control of a hardware-implemented finite-state machine (FSM) which is initiated by software or a dedicated hardware timer.
For design, operation, and control registers of a touch sensor, see *{IDF_TARGET_NAME} Technical Reference Manual* > *On-Chip Sensors and Analog Signal Processing* [`PDF <{IDF_TARGET_TRM_EN_URL}#sensor>`__].
@ -43,7 +35,6 @@ Description of API is broken down into groups of functions to provide a quick ov
For detailed description of a particular function, please go to Section :ref:`touch_pad-api-reference`. Practical implementation of this API is covered in Section :ref:`Application Examples <touch_pad-api-examples>`.
Initialization
^^^^^^^^^^^^^^
@ -54,7 +45,79 @@ If the driver is not required anymore, deinitialize it by calling :cpp:func:`tou
Configuration
^^^^^^^^^^^^^
Enabling the touch sensor functionality for a particular GPIO is done with :cpp:func:`touch_pad_config`.
.. only:: esp32
Enabling the touch sensor functionality for a particular GPIO is done with :cpp:func:`touch_pad_config()`. The following 10 capacitive touch pads are supported for {IDF_TARGET_NAME}.
.. list-table::
:align: center
:widths: 50 50
:header-rows: 1
* - Touch Pad
- GPIO Pin
* - T0
- GPIO4
* - T1
- GPIO0
* - T2
- GPIO2
* - T3
- MTDO
* - T4
- MTCK
* - T5
- MTDI
* - T6
- MTMS
* - T7
- GPIO27
* - T8
- 32K_XN
* - T9
- 32K_XP
.. only:: esp32s2 or esp32s3
Enabling the touch sensor functionality for a particular GPIO is done with :cpp:func:`touch_pad_config()`. The following 14 capacitive touch pads are supported for {IDF_TARGET_NAME}.
.. list-table::
:align: center
:widths: 50 50
:header-rows: 1
* - Touch Pad
- GPIO Pin
* - T0
- Internal channel, not connect to a GPIO
* - T1
- GPIO1
* - T2
- GPIO2
* - T3
- GPIO3
* - T4
- GPIO4
* - T5
- GPIO5
* - T6
- GPIO6
* - T7
- GPIO7
* - T8
- GPIO8
* - T9
- GPIO9
* - T10
- GPIO10
* - T11
- GPIO11
* - T12
- GPIO12
* - T13
- GPIO13
* - T14
- GPIO14
Use the function :cpp:func:`touch_pad_set_fsm_mode` to select if touch pad measurement (operated by FSM) should be started automatically by a hardware timer, or by software. If software mode is selected, use :cpp:func:`touch_pad_sw_start` to start the FSM.

Wyświetl plik

@ -9,14 +9,6 @@
触摸传感器系统由保护覆盖层、触摸电极、绝缘基板和走线组成,保护覆盖层位于最上层,绝缘基板上设有电极及走线。用户触摸覆盖层将产生电容变化,根据电容变化判断此次触摸是否为有效触摸行为。
.. only:: SOC_TOUCH_VERSION_1
ESP32 最多可支持 10 个电容式触摸传感器通道/GPIO。
.. only:: SOC_TOUCH_VERSION_2
{IDF_TARGET_NAME} 最多可支持 14 个电容式触摸传感器通道/GPIO。
触摸传感器可以以矩阵或滑条等方式组合使用,从而覆盖更大触感区域及更多触感点。触摸传感由软件或专用硬件计时器发起,由有限状态机 (FSM) 硬件控制。
如需了解触摸传感器设计、操作及其控制寄存器等相关信息,请参考《`{IDF_TARGET_NAME} 技术参考手册 <{IDF_TARGET_TRM_CN_URL}>`_》(PDF) 中“片上传感器与模拟信号处理”章节。
@ -43,7 +35,6 @@
请前往 :ref:`touch_pad-api-reference` 章节,查看某一函数的具体描述。:ref:`应用示例 <touch_pad-api-examples>` 章节则介绍了此 API 的具体实现。
初始化触摸传感器驱动程序
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -54,7 +45,79 @@
配置触摸传感器 GPIO 管脚
^^^^^^^^^^^^^^^^^^^^^^^^^^
调用 :cpp:func:`touch_pad_config` 使能某一 GPIO 的触感功能。
.. only:: esp32
可调用 :cpp:func:`touch_pad_config()` 使能某一 GPIO 的触感功能。{IDF_TARGET_NAME} 最多可支持 10 个电容式触摸传感器通道。
.. list-table::
:align: center
:widths: 50 50
:header-rows: 1
* - 触摸传感器通道
- GPIO 管脚
* - T0
- GPIO4
* - T1
- GPIO0
* - T2
- GPIO2
* - T3
- MTDO
* - T4
- MTCK
* - T5
- MTDI
* - T6
- MTMS
* - T7
- GPIO27
* - T8
- 32K_XN
* - T9
- 32K_XP
.. only:: esp32s2 or esp32s3
可调用 :cpp:func:`touch_pad_config()` 使能某一 GPIO 的触感功能。{IDF_TARGET_NAME} 最多可支持 14 个电容式触摸传感器通道。
.. list-table::
:align: center
:widths: 50 50
:header-rows: 1
* - 触摸传感器通道
- 管脚
* - T0
- 内部通道,无对应管脚
* - T1
- GPIO1
* - T2
- GPIO2
* - T3
- GPIO3
* - T4
- GPIO4
* - T5
- GPIO5
* - T6
- GPIO6
* - T7
- GPIO7
* - T8
- GPIO8
* - T9
- GPIO9
* - T10
- GPIO10
* - T11
- GPIO11
* - T12
- GPIO12
* - T13
- GPIO13
* - T14
- GPIO14
使用 :cpp:func:`touch_pad_set_fsm_mode` 选择触摸传感器测量(由 FSM 操作)是由硬件定时器自动启动,还是由软件自动启动。如果选择软件模式,请使用 :cpp:func:`touch_pad_sw_start` 启动 FSM。