Generalization of C++-Based DSP software for voltage source regulation and control of diverse power converters in particle accelerators