So can definitely change the ADC configuration on demand by running the configureADC function. If I'm understanding correctly, I think something like:
changeConfig(uint8_t channels) {
//ADC1
if (channels & 0x01) {
//ADC1 is active:
configureADC(1,10,0,BIPOLAR_10V,getADC1);
} else {
disableADC(1);
}
//ADC2
if (channels & 0x02) {
//ADC2 is active:
configureADC(2,10,0,BIPOLAR_10V,getADC2);
} else {
disableADC(2);
}
//continue for ADC3 and ADC4
}
Then you can run changeConfig(0) to turn off all the ADC's. changeConfig(15) to turn them all one, or changeConfig(8) to just turn on ADC4. You can then use qCommand to call that function based on a serial command. If you need faster response then serial communication, you can use one of the triggers to fire an interrupt when the line goes high (see OutputPatternOnTrigger example for reference). Then you can either walk through different modes, one per trigger, or read either a variable set by a serial command, or a few of the GPIO pins to determine which mode to go to.
Yes, you have read-write access to all the GPIO and trigger pins in the setup() function a beyond, so you can definitely use them for initialization if you want. But I think doing no ADC initialization in setup() might serve you better and then run the configureADC on-demand based on an external digital line or a serial command.
I hope this makes sense. Please let me know if you have any questions.