11/*
2- * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -892,12 +892,12 @@ void i2s_gpio_check_and_set(i2s_chan_handle_t handle, int gpio, uint32_t signal_
892892 if (gpio != (int )I2S_GPIO_UNUSED ) {
893893 gpio_func_sel (gpio , PIN_FUNC_GPIO );
894894 if (is_input ) {
895- /* Set direction , for some GPIOs, the input function are not enabled as default */
896- gpio_set_direction (gpio , GPIO_MODE_INPUT );
895+ /* Enable the input , for some GPIOs, the input function are not enabled as default */
896+ gpio_input_enable (gpio );
897897 esp_rom_gpio_connect_in_signal (gpio , signal_idx , is_invert );
898898 } else {
899899 i2s_output_gpio_reserve (handle , gpio );
900- gpio_set_direction ( gpio , GPIO_MODE_OUTPUT );
900+ /* output will be enabled in esp_rom_gpio_connect_out_signal */
901901 esp_rom_gpio_connect_out_signal (gpio , signal_idx , is_invert , 0 );
902902 }
903903 }
@@ -908,7 +908,7 @@ void i2s_gpio_loopback_set(i2s_chan_handle_t handle, int gpio, uint32_t out_sig_
908908 if (gpio != (int )I2S_GPIO_UNUSED ) {
909909 i2s_output_gpio_reserve (handle , gpio );
910910 gpio_func_sel (gpio , PIN_FUNC_GPIO );
911- gpio_set_direction (gpio , GPIO_MODE_INPUT_OUTPUT );
911+ gpio_input_enable (gpio );
912912 esp_rom_gpio_connect_out_signal (gpio , out_sig_idx , 0 , 0 );
913913 esp_rom_gpio_connect_in_signal (gpio , in_sig_idx , 0 );
914914 }
0 commit comments