The ESP32 is built on layers. At the lowest level there is hardware which exposes its controls at specific addresses in the address space. We set the bits there and the magic of the silicon logic in the processor does its stuff. This is all documented in the ESP32 Technical Reference manual that you can find here:
http://espressif.com/sites/default/file ... ual_en.pdf
Page 66 describes onwards this detail.
However ... and this is opinion ... very, very few project or products will actually need to code to this level. It would be like in Unix saying "ignore open, close, read and write ... and instead, twiddle the bits by using /dev/sda0". Instead, some folks (that I call the heroes) have studied these specifications (or written them themselves) and have encapsulated them in higher level libraries that are dramatically easier to consume. In the ESP-IDF, these are termed "drivers". As of the date of this posting, the driver for I2C hasn't yet been released ... but all indications are that it will be here by December 1st. Now imagine that the driver was available ... with all its documentation and high level functions ... would you use that or do you still see yourself dropping down to the lowest architectural levels?
If the answer is that you would use the drivers, then maybe you can work on other aspects of your project until the drivers become available. If you absolutely can't wait, then there is one more consideration ... and that is to use the drivers that are supplied with the Arduino environment for ESP32. Specifically, see
https://github.com/espressif/arduino-es ... -hal-i2c.c
This is a fully functioning driver that is available today that can be linked in with your ESP-IDF applications. It is likely (but that is a guess on my part) that this API will be distinct from the driver shipped with ESP-IDF 1.0 and if you use the Arduino driver ... you will likely want to change when ESP-IDF 1.0 ships (in about 8 days).
Notice that the API for the Arduino driver includes two API calls called:
i2cAttachSCL() and i2cAttachSDA()
each of which take the pin numbers you wish to use for the respective function.