Question

What is the IFC Read-Clear Operation?

Answer

The IFC Read-Clear Operation is a new feature in EFM32 Gecko Series 1 and EFR32 Wireless Gecko Series 1 devices.

 

In addition to the normal interrupt setting and clearing operations via the IFS/IFC registers, there is an additional atomic Read-Clear operation that can be enabled by setting IFCREADCLEAR = 1 in the MSC_CTRL register.

 

When enabled, reads of peripheral IFC registers will return the interrupt vector (mirroring the IF register), while at the same time clearing whichever interrupt flags are set. This operation is functionally equivalent to reading the IF register and then writing the result immediately back to the IFC register.

 

 

/* Enable atomic read-clear operation on reading IFC register */
MSC->CTRL |= MSC_CTRL_IFCREADCLEAR;

 

  • Knowledge Base Articles
  • 32-bit MCUs