PMC and AFEC Control Register

The AFEC Control register (AFEC_CR) enables the AFEC at the cell level. Before programming the AFEC_CR to enable the AFEC, the AFEC must be enabled from the Power Management Controller (PMC).

To enable the AFEC, the user program must perform the following steps:
  1. 1.Enable the AFEC in the PMC Peripheral Clock Enable register (PMC_PCER) using the AFEC PID (29).
  2. 2.Perform an AFEC reset by setting the SWRST bit of the AFEC_CR.
  3. 3.Clear the AFEC Mode register (AFEC_MR).

Code example for the AFEC0:

/* Enabling the AFEC in the PMC */
PMC->PMC_PCER0 = 1 << AFEC_ID

/*  Reset the controller */
AFEC0->AFEC_CR = AFEC_CR_SWRST;

/* Reset Mode Register */
AFEC0->AFEC_MR = 0;