The application demonstration is explained as follows. This application demonstrates only three modes of tamper detection in SAM L22 Xplained Pro. The procedure for testing active layer protection is explained in section Active Layer Protection.
Before entering into the application demonstration, the basic condition in which the device SAM L22 is configured is explained as follows. If the user needs variations in the basic configuration files, which are to be changed, this is explained as follows.
#define YEAR 2012
#define MONTH 12
#define DAY 31
#define HOUR 11
#define MINUTE 59
#define SECOND 50
#define TIME_PM false
config_rtc_calendar.clock_24h = true;
#define TAMPER_INPUT_PIN 4
While configuring some other tamper input pin, ensure that the pull is enabled and the pin is configured as input.
This
application is configured in such a way that the tamper is detected if there
occurs a rising edge on the pin RTC/IN [4]. In order to configure for falling
edge, change the level as shown below in both the functions,
configure_tamper_wake()
and
configure_tamper_capture()
.
config_rtc_tamper.in_cfg[4].level = RTC_TAMPER_LEVEL_FALLING;
struct tamper_time
.