590
SAM4CP [DATASHEET]
43051E–ATPL–08/14
Figure 32-6.
Event Detector on Input Lines (Figure represents line 0)
Example of interrupt generation on following lines:
Rising edge on PIO line 0
Falling edge on PIO line 1
Rising edge on PIO line 2
Low-level on PIO line 3
High-level on PIO line 4
High-level on PIO line 5
Falling edge on PIO line 6
Rising edge on PIO line 7
Any edge on the other lines
Table 32-1
details the required configuration for this example.
Table 32-1.
Configuration for Example Interrupt Generation
Configuration
Description
Interrupt Mode
All the interrupt sources are enabled by writing 32’hFFFF_FFFF in PIO_IER.
Then the additional interrupt mode is enabled for lines 0 to 7 by writing 32’h0000_00FF
in PIO_AIMER.
Edge or Level Detection
Lines 3, 4 and 5 are configured in level detection by writing 32’h0000_0038 in PIO_LSR.
The other lines are configured in edge detection by default, if they have not been
previously configured. Otherwise, lines 0, 1, 2, 6 and 7 must be configured in edge
detection by writing 32’h0000_00C7 in PIO_ESR.
Falling/Rising Edge or Low/High-
Level Detection
Lines 0, 2, 4, 5 and 7 are configured in rising edge or high-level detection by writing
32’h0000_00B5 in PIO_REHLSR.
The other lines are configured in falling edge or low-level detection by default if they
have not been previously configured. Otherwise, lines 1, 3 and 6 must be configured in
falling edge/low-level detection by writing 32’h0000_004A in PIO_FELLSR.
Event Detector
0
1
0
1
1
0
0
1
Edge
Detector
Falling Edge
Detector
Rising Edge
Detector
PIO_FELLSR[0]
PIO_FRLHSR[0]
PIO_REHLSR[0]
Low Level
Detector
High Level
Detector
PIO_ESR[0]
PIO_ELSR[0]
PIO_LSR[0]
PIO_AIMDR[0]
PIO_AIMMR[0]
PIO_AIMER[0]
Event detection on line 0
Resynchronized input on line 0