For more information on ESP-IDF programming, I recommend reading: the ESP-IDF Programming Guide, at https://docs.espressif.com/projects/esp-idf/en/latest/.