ARM ARM DUI 0224I manual Example 4-2 Pseudo code for SIC SCI1 card out interrupt

Models: ARM DUI 0224I

1 402
Download 402 pages 14.06 Kb
Page 231
Image 231

 

 

 

 

Programmer’s Reference

// ...

 

 

 

 

*SCI0_IMSC

=

SCI0_CARDOUTIM;

//

Enable SCI0 card out interrupt

*PIC_IntEnable

=

PIC_SCI0;

//

Enable the PIC SCI0 interrupt

Example 4-2 shows how to detect the SCI1 card out interrupt signal from the secondary interrupt controller.

Example 4-2 Pseudo code for SIC SCI1 card out interrupt

If PIC_IRQStatus flags set, If PIC_SRC31 set,

...SIC interrupt handler If SIC_SCI1 set,

...SCI1 interrupt handler

If SCI1_MIS,SCI1_CARDOUTIM flag set,

...act on interrupt then clear flag with SCI1_ICR

...Test other SCI1 flags

...Test other SIC flags

...Test other PIC flags

Example 4-3 shows clearing and re-enabling the SIC SCI1 card out interrupt by using PIC_SCR31.

Example 4-3 Clearing and re-enabling SCI1 card out interrupt

#define PIC_BASE #define PIC_IntEnable #define PIC_SRC31

#define SIC_BASE #define SIC_ENSET #define SIC_ENCLR #define SIC_SCI1

#define SCI1_CARDOUTIM #define SCI1_IMSC #define SCI1_ICR

0x10140000

((volatile unsigned int *)(PIC_BASE + 0x10)) 0x80000000 // SIC interrupt

0x10003000

((volatile unsigned int *)(SIC_BASE + 0x08)) ((volatile unsigned int *)(SIC_BASE + 0x0C)) (1 << 5) // Smart Card interrupt

0x002 // Card removed ((volatile int *)(SCI1_BASE + 0x6C)) ((volatile int *)(SCI1_BASE + 0x78))

*PIC_IntEnable

= PIC_SRC31;

// Mask

the

PIC

SIC (SRC 31) interrupt

*SIC_ENCLR

=

SIC_SCI1;

//

Mask

the

SIC

SCI1 interrupt

*SCI1_ICR

=

SCI1_CARDOUTIM;

//

Clear SCI1 card out flag

//. . .

//code for managing SCI I/0

ARM DUI 0224I

Copyright © 2003-2010 ARM Limited. All rights reserved.

4-65

Page 231
Image 231
ARM ARM DUI 0224I manual Example 4-2 Pseudo code for SIC SCI1 card out interrupt