fix(uart): lp uart rx iomux pin was not working as expected

Introduced in 8818157e42
The workaround in the commit routes the signal to LP GPIO matrix first.
When uses LP IOMUX pin as UART RX, the signal did not bypass the matrix,
which caused the issue.

This commit adds rtc_gpio_iomux_input and rtc_gpio_iomux_output APIs
to align with existing GPIO driver APIs.
This commit is contained in:
Song Ruo Jing
2026-04-21 16:55:31 +08:00
parent 7c1fd3fbbf
commit 9054cbd9db
6 changed files with 108 additions and 8 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -198,6 +198,23 @@ void rtcio_hal_set_direction_in_sleep(int rtcio_num, rtc_gpio_mode_t mode);
*/
#define rtcio_hal_iomux_func_sel(rtcio_num, func) rtcio_ll_iomux_func_sel(rtcio_num, func)
/**
* @brief Set pad input to an LP peripheral signal through the LP(RTC) IOMUX
*
* @param rtcio_num The index of rtcio. 0 ~ SOC_RTCIO_PIN_COUNT.
* @param func The index number of the IOMUX function to be selected for the pin.
* @param signal_idx Peripheral signal index to input. One of the ``*_IN_IDX`` signals in ``soc/lp_gpio_sig_map.h``.
*/
void rtcio_hal_iomux_input(int rtcio_num, int func, uint32_t signal_idx);
/**
* @brief Set LP peripheral output to an RTC IO pad through the LP(RTC) IOMUX
*
* @param rtcio_num The index of rtcio. 0 ~ SOC_RTCIO_PIN_COUNT.
* @param func The index number of the LP(RTC) IOMUX function to be selected for the pin
*/
void rtcio_hal_iomux_output(int rtcio_num, int func);
#if SOC_LP_GPIO_MATRIX_SUPPORTED
/**
* Select RTC GPIO input to a signal