Hi,
I’ve used this module extensively, let me try to help.
It’s important to know that ESP32 uses a microcontroller which allows for pin multiplexing, which means you can assign different peripherals (like I2C, SPI, PWM, etc) to different pins. This means there aren’t really dedicated pins for the peripherals.
That being said, the ESP32 LoRa module from HelTec includes things like the screen which, in order to use them, are connected to specific pins (GPIO15 and GPIO4)
Looking at the pinout, you see “OLED_SCL” and OLED_SDA" on pins 15 and 4 respectively. To use the screen, you need to have an i2c running on those pins. But you are not limited to using I2C on only those pins, and you can use that bus if you want, as long as you understand that the screen is taking up a specific address on that bus. And you can use those pins for other stuff if you want. Just note that whatever you do with them is connected to the OLED i2c, so you run into issues.
You can run I2C using any available pair of GPIOs which are both inputs and outputs. ESP32 has
There are caveats, however. ESP32s have pins which might be input only, or might be used as part of the programming process.
Likewise, some pins default to certain functionality. For example, RX and TX are, by default, connected to the same UART that the USB port uses.
The best way to answer your question fully is to look at that GPIO from the ESP32 are connected directly to the pins on the HelTec module, and understand how those GPIO work from ESP32 documentation.
To give specifics for your question:
- any GPIO that is an output can manage a PWM.
- Not all ESP32 pins are capable of output (specifically 34-39, note the astrisks in the diagram)
- I2C pins can be set in software
- ESP32 I2S requires the DACs on GPIO26 and GPIO26
This is all noted in the pinout diagram, but requires decoding against the capabilities of the ESP32 specifically.
Let me know if the above wasn’t clear. If it’s your first time using a chip with IO multiplexing it takes a bit to get used to. In your code you tell the MCU which pins you want the I2C SDA and SCL lines to be, rather than being limited to dedicated pins. However, there are caveats like input only pins. That goes for most of the peripherals. You can reassign them, but not all GPIO are equal.