Disconnecting output pin

Slinisa
Posts: 32
Joined: Sat Oct 07, 2023 8:21 am

Disconnecting output pin

Postby Slinisa » Sun Nov 26, 2023 12:02 am

Hi,

I'm using the following method to connect a pin to a signal:

esp_rom_gpio_connect_out_signal(pin, signal, false, false);
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[pin], PIN_FUNC_GPIO);
gpio_set_drive_capability((gpio_num_t)pin, (gpio_drive_cap_t)3);

I found it somewhere on the internet, can't remember where, but it works fine. The question is if it is possible to disconnect the pin from a signal and connecting another pin without restarting ESP32?
I tried searching the include folder for something like esp_rom_gpio_disconnect_out_signal, but it doesn't exist.

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: Disconnecting output pin

Postby ESP_Sprite » Sun Nov 26, 2023 12:40 am

You can't disconnect an output pin; it always needs to be driven by something. You can re-initialize it as a GPIO (esp-idf has gpio_reset_pin for that, should work on Arduino as well) and make it an input or something.,

Slinisa
Posts: 32
Joined: Sat Oct 07, 2023 8:21 am

Re: Disconnecting output pin

Postby Slinisa » Sun Nov 26, 2023 3:42 pm

Thank you for your reply. Since the pin is connected to LCD peripheral, is there something I have to keep in mind while doing it while it's in use? I'm changing the pixel format "on the fly". I don't mind if I get some artefact while it's being changed, if that's the only conncern.

Who is online

Users browsing this forum: No registered users and 40 guests