mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
feat(i2s): append the i2s signals instead of overwrite
This commit is contained in:
parent
3dd1ad9fdd
commit
79fd265c20
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -892,12 +892,12 @@ void i2s_gpio_check_and_set(i2s_chan_handle_t handle, int gpio, uint32_t signal_
|
||||
if (gpio != (int)I2S_GPIO_UNUSED) {
|
||||
gpio_func_sel(gpio, PIN_FUNC_GPIO);
|
||||
if (is_input) {
|
||||
/* Set direction, for some GPIOs, the input function are not enabled as default */
|
||||
gpio_set_direction(gpio, GPIO_MODE_INPUT);
|
||||
/* Enable the input, for some GPIOs, the input function are not enabled as default */
|
||||
gpio_input_enable(gpio);
|
||||
esp_rom_gpio_connect_in_signal(gpio, signal_idx, is_invert);
|
||||
} else {
|
||||
i2s_output_gpio_reserve(handle, gpio);
|
||||
gpio_set_direction(gpio, GPIO_MODE_OUTPUT);
|
||||
/* output will be enabled in esp_rom_gpio_connect_out_signal */
|
||||
esp_rom_gpio_connect_out_signal(gpio, signal_idx, is_invert, 0);
|
||||
}
|
||||
}
|
||||
@ -908,7 +908,7 @@ void i2s_gpio_loopback_set(i2s_chan_handle_t handle, int gpio, uint32_t out_sig_
|
||||
if (gpio != (int)I2S_GPIO_UNUSED) {
|
||||
i2s_output_gpio_reserve(handle, gpio);
|
||||
gpio_func_sel(gpio, PIN_FUNC_GPIO);
|
||||
gpio_set_direction(gpio, GPIO_MODE_INPUT_OUTPUT);
|
||||
gpio_input_enable(gpio);
|
||||
esp_rom_gpio_connect_out_signal(gpio, out_sig_idx, 0, 0);
|
||||
esp_rom_gpio_connect_in_signal(gpio, in_sig_idx, 0);
|
||||
}
|
||||
|
@ -143,7 +143,6 @@ static esp_clock_output_mapping_t* clkout_mapping_alloc(clkout_channel_handle_t*
|
||||
#elif SOC_GPIO_CLOCKOUT_BY_GPIO_MATRIX
|
||||
gpio_set_pull_mode(gpio_num, GPIO_FLOATING);
|
||||
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_num], PIN_FUNC_GPIO);
|
||||
gpio_set_direction(gpio_num, GPIO_MODE_OUTPUT);
|
||||
esp_rom_gpio_connect_out_signal(gpio_num, CLKOUT_CHANNEL_TO_GPIO_SIG_ID(allocated_mapping->clkout_channel_hdl->channel_id), false, false);
|
||||
#endif
|
||||
}
|
||||
@ -175,7 +174,7 @@ static void clkout_mapping_free(esp_clock_output_mapping_t *mapping_hdl)
|
||||
if (--mapping_hdl->ref_cnt == 0) {
|
||||
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[mapping_hdl->mapped_io], PIN_FUNC_GPIO);
|
||||
esp_rom_gpio_connect_out_signal(mapping_hdl->mapped_io, SIG_GPIO_OUT_IDX, false, false);
|
||||
gpio_set_direction(mapping_hdl->mapped_io, GPIO_MODE_DISABLE);
|
||||
gpio_output_disable(mapping_hdl->mapped_io);
|
||||
|
||||
portENTER_CRITICAL(&mapping_hdl->clkout_channel_hdl->clkout_channel_lock);
|
||||
mapping_hdl->clkout_channel_hdl->mapped_io_bmap &= ~BIT(mapping_hdl->mapped_io);
|
||||
|
Loading…
x
Reference in New Issue
Block a user