mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-21 19:09:13 +00:00
feat(global): add macros for GPIO->channel lookup
including: macros for dac, adc, touch, rtc_gpio, uart and clk_out. TW#13970
This commit is contained in:
@@ -44,6 +44,15 @@ API Reference
|
||||
|
||||
.. include:: /_build/inc/adc.inc
|
||||
|
||||
GPIO Lookup Macros
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
Some useful macros can be used to specified the GPIO number of a ADC channel, or vice versa.
|
||||
e.g.
|
||||
|
||||
1. ``ADC1_CHANNEL_0_GPIO_NUM`` is the GPIO number of ADC1 channel 0 (36);
|
||||
2. ``ADC1_GPIO32_CHANNEL`` is the ADC1 channel number of GPIO 32 (ADC1 channel 4).
|
||||
|
||||
.. include:: /_build/inc/adc_channel.inc
|
||||
|
||||
ADC Calibration
|
||||
===============
|
||||
@@ -99,4 +108,4 @@ Routing ADC reference voltage to GPIO::
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
.. include:: /_build/inc/esp_adc_cal.inc
|
||||
.. include:: /_build/inc/esp_adc_cal.inc
|
||||
|
||||
@@ -30,3 +30,12 @@ API Reference
|
||||
|
||||
.. include:: /_build/inc/dac.inc
|
||||
|
||||
GPIO Lookup Macros
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
Some useful macros can be used to specified the GPIO number of a DAC channel, or vice versa.
|
||||
e.g.
|
||||
|
||||
1. ``DAC_CHANNEL_1_GPIO_NUM`` is the GPIO number of channel 1 (25);
|
||||
2. ``DAC_GPIO26_CHANNEL`` is the channel number of GPIO 26 (channel 2).
|
||||
|
||||
.. include:: /_build/inc/dac_channel.inc
|
||||
|
||||
@@ -19,3 +19,13 @@ API Reference
|
||||
|
||||
.. include:: /_build/inc/touch_pad.inc
|
||||
|
||||
GPIO Lookup Macros
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
Some useful macros can be used to specified the GPIO number of a touchpad channel, or vice versa.
|
||||
e.g.
|
||||
|
||||
1. ``TOUCH_PAD_NUM5_GPIO_NUM`` is the GPIO number of channel 5 (12);
|
||||
2. ``TOUCH_PAD_GPIO4_CHANNEL`` is the channel number of GPIO 4 (channel 0).
|
||||
|
||||
.. include:: /_build/inc/touch_channel.inc
|
||||
|
||||
|
||||
@@ -18,4 +18,17 @@ API Reference
|
||||
|
||||
.. include:: /_build/inc/uart.inc
|
||||
|
||||
GPIO Lookup Macros
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
Some useful macros can be used to specified the **direct** GPIO (UART module connected to pads through direct IO mux without the GPIO mux) number of a UART channel, or vice versa.
|
||||
The pin name can be omitted if specify the channel of a GPIO num.
|
||||
e.g.
|
||||
|
||||
1. ``UART_NUM_2_TXD_DIRECT_GPIO_NUM`` is the GPIO number of UART channel 2 TXD pin (17);
|
||||
2. ``UART_GPIO19_DIRECT_CHANNEL`` is the UART channel number of GPIO 19 (channel 0);
|
||||
3. ``UART_CTS_GPIO19_DIRECT_CHANNEL`` is the UART channel number of GPIO 19, and GPIO 19 must be a CTS pin (channel 0).
|
||||
|
||||
|
||||
.. include:: /_build/inc/uart_channel.inc
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user