refactor(rtcio): split rtcio/gpio switch with rtc iomux func sel func

This allows rtc_gpio_deinit to always switch the pad back to GPIO,
regardless of lp io clock enabled or not, so that gpio_config can
always switch the IO back to GPIO use after wakeup from deep sleep.
This commit is contained in:
Song Ruo Jing
2026-05-22 15:35:21 +08:00
parent 7a6e80e1f3
commit 5b7db25db1
10 changed files with 64 additions and 68 deletions
@@ -80,8 +80,6 @@ static inline void rtcio_ll_function_select(int rtcio_num, rtcio_ll_func_t func)
}
// 0: GPIO connected to digital GPIO module. 1: GPIO connected to analog RTC module.
SET_PERI_REG_MASK(rtc_io_desc[rtcio_num].reg, (rtc_io_desc[rtcio_num].mux));
//0:RTC FUNCTION 1,2,3:Reserved
rtcio_ll_iomux_func_sel(rtcio_num, RTCIO_LL_PIN_FUNC);
} else if (func == RTCIO_LL_FUNC_DIGITAL) {
CLEAR_PERI_REG_MASK(rtc_io_desc[rtcio_num].reg, (rtc_io_desc[rtcio_num].mux));
// USB Serial JTAG pad re-enable won't be done here (it requires both DM and DP pins not in rtc function)