I've been using ESP32 for a couple of years, mostly through Arduino IDE. Since July I've been using exclusively VSCode + PlatformIO with Arduino framework. My reason for changing has been the interruption of support to SPIFFS in the latest Arduino IDE versions.
Nevertheless, now I'm facing difficulties for setting up GPIO 12 and 13 as INPUT_PULLUP in a ESP32-Pico-D4. I've been using
Code: Select all
pinMode( 12, INPUT_PULLUP);
So, I'd like to use the safest solution for this issue, that is configuring these GPIOs directly through configuration registers.
I've been reading chapter 5 of esp32_technical_reference_manual_en.pdf, but I didn't understand what to do. Maybe I need to understand better the microprocessor's architecture itself.
Anyway, I'd like to count on your help for:
item 1) setting up GPIO12 and GPIO13 as inputs with pullup, through writing on configuration registers;
item 2) understanding better how attribute functions to GPIO pads.
I'd like to start by item 1, making GPIO 12 and 13 behave as INPUT_PULLUP by writing on the proper configuration registers. Then, I'd like to play with other basic IO functions, like INPUT_PULLDOWN, INPUT and OUTPUT.
Later (item 2, I'd like to go through an overview of the GPIOs related registers, from a single GPIO pad toward a specific embedded function.
Starting from Figure 7 ("IO_MUX, RTC IO_MUX and GPIO Matrix Overview") on page 47, I'd like to understand where I should find the simple digital IOs, such as those accessible through "digitalRead" or "digitalWrite".
2.1) Are these ones are considered as "peripherals" or not? I can't identify them in the diagram.
2.2) Should they be treated attached directly to IO_MUX or via GPIO Matrix?
2.3) This Figure also shows "34 GPIOs" between "GPIO Matrix" and "IO_MUX". Isn't 34 the same number of GPIO pads? Is it a coincidence or is this label ("34 GPIOs") misplaced in the diagram?
Thank you.
Best regards,
Ciro.