Page 1 of 1

Undo esp_rom_gpio_connect_out_signal

Posted: Wed Mar 13, 2024 11:18 pm
by cruvus
Hi,

I have to use the function
esp_rom_gpio_connect_out_signal
to combine two signals. There is no real documentation for this function. In esp_rom_gpio.h it just says "Combine a peripheral signal which tagged as output attribute with a GPIO. There's no limitation on the number of signals that a GPIO can combine with."
How can I undo this connection? I do not want to reset all the config for this GPIO. Just undo what esp_rom_gpio_connect_out_signal did.

Re: Undo esp_rom_gpio_connect_out_signal

Posted: Fri Mar 15, 2024 6:58 pm
by MicroController
If by 'undo' you mean disconnect the signal's output from the pad and the input, I believe setting the direction/"mode" to input (or, not-output) should be sufficient. I say 'believe' because the ESP32 TRM isn't too clear about it, while in the ESP32-S3's TRM we can see the workings of the the OE signal. Not sure if ESP32 and S3 differ in that regard. But trying it out shouldn't cause any harm :)

Re: Undo esp_rom_gpio_connect_out_signal

Posted: Sat Mar 16, 2024 12:01 am
by cruvus
I mean the exact same state as just before executing esp_rom_gpio_connect_out_signal(). The GPIOs are involved in a bus initialization (ESP-IDF API) I do not want to re-initialize the bus over and over again.

Re: Undo esp_rom_gpio_connect_out_signal

Posted: Sat Mar 16, 2024 11:18 am
by MicroController
Start by reconnecting the signal that was connected before you called esp_rom_gpio_connect_out_signal().

Re: Undo esp_rom_gpio_connect_out_signal

Posted: Sat Mar 16, 2024 4:43 pm
by cruvus
That is the mystery. It is the MOSI pin, the one called mosi_io_num in spi_bus_config_t.

Re: Undo esp_rom_gpio_connect_out_signal

Posted: Sat Mar 16, 2024 5:49 pm
by MicroController
You can draw inspiration from spicommon_bus_initialize_io(), or you can read the currently connected signal (MCU_SEL) from the corresponding IOMUX register before rerouting it.