On iMXRT1176, how can I completely reset a peripheral's registers to the default out-of-reset values?
For instance, if I have an RTOS task handling a peripheral, and the task crashes and is then restarted, the peripheral will be left in an unknown state. When the task restarts, it should re-initialize the peripheral. But in some cases it could be wrong to just reinitialize it as if just out of a reset; for instance, when a peripheral is active/transmitting, some registers cannot be written.
So, I'd need a way to revert the peripheral to the default state, without creating an ad hoc procedure to disable the peripheral (if active) following a specific, proper order for writing to the registers, and to restore all the default values (which might not all be 0).
Of course, I cannot just reset the whole MCU.
Is there a dedicated flag to completely reset a peripheral? Or, could it be done by some clock gating or power gating setting? Or some setting in the Slice Reset Controller (SRC)?