This is the quickstart guide for the SAM4L External Interrupt Controller (EIC) Driver, with step-by-step instructions on how to configure and use the driver in a selection of use cases.
The use cases contain several code fragments. The code fragments in the steps for setup can be copied into a custom initialization function, while the steps for usage can be copied into, e.g., the main application function.
In this basic use case, the EIC module and single line are configured for:
System Clock Management (Sysclock).
Add to application C-file:
Define the interrupt callback function in the application:
Enable EIC module:
Configure EIC line with specified mode:
Set the EIC callback function and enable EIC interrupt.
Enable EIC line: