Pulse generator with adjustable frequency, duty cycle, number of pulse

no - generate as many signals as you require with the ESP32 timer used to setup timings between them

and where is that done in this code

if ((timerPhase1 = timerBegin(10000000)) == NULL)

should I change the NULL to another value higher than null =0 to let say 15 ?