32.6.2.1 Initialization
The EIC must be initialized in the following order:
- Enable CLK_EIC_APB.
- If required, configure the NMI by writing the Non-Maskable Interrupt Control (NMICTRL) register.
- Enable GCLK_EIC or CLK_ULP32K when
one of the following external interrupt, EIC_EXTINTx pins, modes is selected:
- EIC_EXTINT pin filtering
- EIC_EXTINT pin synchronous edge detection
- EIC_EXTINT pin de-bouncing
- Configure the EIC input sense and filtering by writing the Configuration n register (CONFIG).
- Optionally, enable the Asynchronous mode.
- Optionally, enable the Debounce mode.
- Enable the EIC by writing a '1' to CTRLA.ENABLE.
The following bits are enable-protected, meaning that it can only be written when the EIC is disabled (CTRLA.ENABLE=0):
- Clock Selection bit in Control A register (CTRLA.CKSEL).
The following registers are enable-protected:
- Event Control register (EVCTRL).
- Configuration n register (CONFIG).
- External Interrupt Asynchronous Mode register (ASYNCH).
- Debouncer Enable register (DEBOUNCEN).
- Debounce Prescaler register (DPRESCALER).
