The tool has the concept of 'functional groups':
ErichStyger_0-1657098490769.png
Basically you can group your pins or 'functionalities' into such a group, and configure with the settings (buttons on the right) if the configuration is called during startup from main or not. So you can create to groups, for example 'useAsSPI' and 'useAsGPIO'. 'useAsSPI would be called by default, and 'useAsGPIO' would be something called at runtime.
I'm doing this kind of things for example with the I2C bus, where for a bus reset you have to use the pins in GPIO mode too. One thing you might consider is taking the code generated and use it native in your application, especially if you need to do other 'special' things.
I hope this helps,
Erich