You can use interrupt flags without enabling interrupts, certainly.
But as long as you enable a specific interrupt, the corresponding ISR will get called. I don't really see a way around this.
In most ARM MCUs there's a multi-step process to calling an ISR:
- Some sort of event happens that causes an interrupt flag to be set in the peripheral. At this stage, the interrupt flag is basically just another status flag in the peripheral.
- If the interrupt corresponding to the flag is enabled in the peripheral, the peripheral will raise an interrupt request to the interrupt controller. Most peripherals have only one IRQ line but many possible interrupt sources, so you can enable only the interrupts you actually want to act on. For example, in a timer you might want an interrupt on overflow, but not compare match.
- If the peripheral's interrupt line is enabled in the interrupt controller, only then will the NVIC execute the ISR as required by the ISR's priority and the current execution priority.
Generally you don't need to enable a peripheral interrupt in order to allow the interrupt flag to be set (though this is peripheral dependent), so if you just need the flag to be set/cleared then you may not need to do anything else. Even if you do need to enable the interrupt in the peripheral, you don't necessarily need to enable it in the NVIC. You'll still get the IRQ, but it will never be scheduled for execution. Of course if you need other interrupt sources on the same peripheral to be handled via an ISR, then you DO need to enable the IRQ in the NVIC, and you'll just need to check what caused the interrupt in the ISR and clear any flags that you don't want to handle.