ESP32 custom pin initialization

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.