2.4.6.2 External Interrupt Line Programming
The steps to set up or change the external interrupt line x configuration are the following:
- Clear SCFGxR.EN to disable the EIC interrupt source.
- Perform any external setup that might be required at the source peripheral and wait until the peripheral source output is stabilized.
- If the glitch filter is enabled on the interrupt line, wait until the Ready flag RDYx is set in the Glitch Filter Configuration Status register (EIC_GFCS).
- Write the required interrupt line configuration fields among GFSEL, GFEN, POL, LVL into EIC_SCFGxR.
- If the glitch filter is enabled on the interrupt line, wait until EIC_GFCS.RDYx is set.
- Set EIC_SCFGxR.EN if the source is not yet enabled and, if required for safety, freeze the interrupt line x configuration by setting EIC_SCFGxR.FRZ.
Example:
If the user desires to stop or minimize the circuit activity after a voltage or frequency failure detection on a rising edge of an EIC interrupt source, the polarity can be changed with a single write to EIC_SCFGxR.POL to detect a falling edge of the same source. Detection of the falling edge source indicates the recovery of a normal condition. In this case, the steps described previously can be ignored.