S3C2440 interrupt register:
1. There are two categories of interruptions:: Internal and external interruptions.
2. External interruption.24 GPF0-GPF7 (EINT0-EINT7), GPG0-GPG15 (EINT8-EINT23 ). If you use these pins for interrupt input, you must configure the pins to interrupt and do not pull them up. For more information, see datesheet Data Manual.
Register:EXTINT0-EXTINT2: Three registers set the trigger mode for the EINT0-EINT23.
EINTFLT0-EINTFLT3: Controls the filter clock and filter width.
Eintpend: This is the interrupt pending register. When clearing, write 1, followed by write 1. When an External Interrupt (EINT4-EINT23) occurs, the corresponding bit is set to 1. Why no EINT0-EINT3, huh, lookSrcpndI know, there is no EINT4-EINT23 in the seat, so there isEintpend.
Eintmask: This is simple. It is used to block the interruption. That is to say, when the bit is 1, the interruption is invalid.
3. Internal interruption.There are eight registers for internal interrupt. Let's look at them one by one.
Register:Subsrcpnd: When an interruption occurs, the corresponding bit is set to 1, indicating that an interruption has occurred.
Intsubmsk: The last one is a group of Interrupt shielding registers. Read the manual for specific blocking.
Intmod: The method of interruption. An interruption can be a normal or fast interruption, but only one quick interruption can be set here.
Priority: Priority register.
Srcpnd: When an interruption occurs, the corresponding bit is set to 1, indicating that one or more interruptions occur.
Intmsk: Interrupt shielding register.
Intpnd: After an interruption occurs, srcpnd may have a location of 1 and several (because several interruptions may occur at the same time). These interruptions will be selected by the priority arbitration server as the most urgent one, then, set the corresponding position 1 in intpnd, so only one digit is 1 at a time. That is to say, if the previous register is set to 1, it indicates that it has occurred. Only when intpnd is set to 1 will the CPU process it.
Effecffset: Used to indicateIntpndWhich position is 1, so that you can query it. ClearIntpnd,SrcpndAutomatically cleared.
4. Interruption Process.
A. If it is an internal interruption without any interruptions: after the occurrenceSrcpndCorresponding position 1, if notIntmskBlock, so wait for further processing.
B. Internal interruption of tape interruption: After occurrenceSubsrcpndCorresponding position 1, if notIntsubmskBlocked, thenSrcpndCorresponding location 1, waiting for further processing, severalSubsrcpndIt may correspond to the sameSrcpnd, The corresponding table is as follows:
Srcpnd Subsrcpnd
Int_uart0 int_rxd0, int_txd0, int_err0
Int_uart1 int_rxd1, int_txd1, int_err1
Int_uart2 int_rxd2, int_txd2, int_err2
Int_adc int_adc_s, int_tc
Int_cam int_cam_c, int_cam_p
Int_wdt_ac97 int_wdt, int_ac97
C If it is external interrupt: After the EINT0-EINT3 occursSrcpndCorresponding position 1, if notIntmskBlock, so wait for further processing. After EINT4-EINT23 occursEintpendCorresponding position 1, if notEintmaskBlocked, thenSrcpndThe corresponding EINT4-7 or EINT8-23 is set to 1 if notIntmskBlocking, waiting for further processing, severalEintpendCorresponds to the sameSrcpnd, The corresponding table is as follows:
SrcpndEintpend
Eint0 eint0
Eint1 eint1
Eint2 eint2
Eint3 eint3
EINT4-7 EINT4-EINT4
EINT8-23 EINT8-EINT23
All three types of interruptions are pending for further processing. NextSrcpndLet's look at it.Intmsk. If the interrupt is blocked, it is unnecessary (note: the interrupt can also be blocked ). If it is not blockedIntmod. For fast interruption, go out and enter FIQ (that is, the CPU enters the fast interruption mode for processing ). For normal interruptionsSrcpndMost of them can be set to 1 (only one FIQ can be set ).PrioritySelect a high priority, andIntpndCorresponding position 1 (Note: Only one can be selected), enter IRQ, and let the CPU process.
5. Enable interrupt.
A. If the internal interrupt is not interrupted, you only need to setIntmskSo that it does not block the interruption.
B. If it is an internal interruption of the tape, you need to setIntsubmskAndIntmskSo that the door does not block the interruption.
C if it is an external interrupt, it needs to be set for EINT8-23EintmaskAndIntmsk. For EINT0-EINT3, you only need to setIntmsk.
6. Clear interrupt.
A. If the internal interruption is not interrupted, you only need to clearSrcpnd, Note that location 1 is required to be cleared.
B. If the internal interruption of the tape is interrupted, clear it.SrcpndAndSubsrcpnd, ClearSubsrcpnd, And then clearSrcpnd. Because, if you clearSrcpndThenSubsrcpndIn the process,SrcpndIt will think that another interruption occurs, and it will be set to 1. That is to say, a single interruption will respond twice. Therefore, the source must be cut off first.
C if it is an external interrupt and needs to be cleared for EINT8-23EintpendAndSrcpnd(Pay attention to the order ). For EINT0-EINT3 only clearSrcpnd.