Is there any SPI firmware uploader that will run on ESP32?

I am looking for any ESP32 C/C++ or ESP-IDF compatible code, not ESP32-Arduino compatible code, that will flash firmware to atmega chips such as 328 and 32u4. I'm not sure if anyone has developed or ported Nick's hex uploader but it would be great for esp32 to flash 328 if they are on one circuit board.