ESP32 reset pin state

Hi,
I'm working with ESP32S3 Wroom1 now and because of the furture PCB positioning I need to reuse cam-dedicated pin as an Input pin after taking the picture and camera de-init afterwards (esp_camera_deinit(..)).
code for the main loop:

void loop() {

  if (OK_Button.onPressed()) {
    initCamera();

    sendImage(); 

    esp_camera_return_all();
    esp_camera_deinit();

    gpio_sleep_set_pull_mode(GPIO_NUM_10, GPIO_PULLUP_ONLY);
  }

  OK_Button.refreshStatus();
}

I also have a LEDC channel attached to the pin, astivating it as a flash during the photo taking which is sendImage(..) (for now only taking pic and returning the buffer, but buffer-> base64->mqtt ultimately).

What happens is after photo is taken, the pin GPIO_NUM_10 stays either floating or hooked on some camera lifecycle/action and OK_Button.onPressed() gets triggerd repeatedly. I have the pin physically pulled-up. I have tried to set it in the code after esp_camera_deinit, but it has no effect. It appears the button gets triggered (pulled down). I can even measure floating voltage on that pin.

So as I say, I need to re-use that pin(s) because of it's location on the side!
Is there some way to re-set the pin to it's original fixed state just like after powering the board up?

EDIT: i found a discussion talking about this issue and I tried to locate the PWDN pin in my config which looks like this (to be used):

#elif defined(CAMERA_MODEL_ESP32S3_EYE)
#define PWDN_GPIO_NUM  -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM  15
#define SIOD_GPIO_NUM  4
#define SIOC_GPIO_NUM  5

#define Y2_GPIO_NUM 11
#define Y3_GPIO_NUM 9
#define Y4_GPIO_NUM 8
#define Y5_GPIO_NUM 10
#define Y6_GPIO_NUM 12
#define Y7_GPIO_NUM 18
#define Y8_GPIO_NUM 17
#define Y9_GPIO_NUM 16

#define VSYNC_GPIO_NUM 6
#define HREF_GPIO_NUM  7
#define PCLK_GPIO_NUM  13

so it's -1 which means undefined.
so my extended question is about the camera pin definitions: do I have it right? why is that PWDN pin undefined in there (an it still works)?
I have tried to assign PWDN to the pin 21 and then cycle it LOW -> HIGH after camera deinit, but nothing changed.
no other clues yet

Thanks!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.