I am having trouble with attaching different io pins to SPI clock, mosi, miso, I2C etc
How do I do that? I want to assign custom pin numbers to f.ex SPI - other than some default set by Arduino framework for ESP32
I appreciate any help
Thanks
How do I do that?
On the Arduinos, the pins are given special meaning, like SPI, I2C, etc. by the chip maker.
IF the ESP allows customizing the SPI, I2C, etc. pins, you should ask on the ESP forum how to do that.
It would help me immensely if you showed me where in the Arduino esp library the SPI is initialized.
There is some struct object needed for attaching pin numbers. Can you help with that?
Thanks
The ESP32 actually has THREE SPI Channels, of which TWO are available. You can't use the third because that's how it communicates with Program Flash. The attached PINMAP shows how this is done on an ESP32-DEV. You can actually using the esp32-hal-spi.h and .c files call these names HSPI and VSPI. As stated, stay off of the FLASH pins because you could break being able to upload a sketch.
Deous:
It would help me immensely if you showed me where in the Arduino esp library the SPI is initialized.
There is some struct object needed for attaching pin numbers. Can you help with that?
Thanks
The SPI initialisation code on the ESP32 core is in two files named (suprisingly?) spi.h and spi.c.
Find those files and you will find within them the begin method which sets up the spi.
