interrupt_example_iar.c File Reference

#include <avr32/ioap7000.h>
#include <intrinsics.h>

Include dependency graph for interrupt_example_iar.c:

Go to the source code of this file.

Defines

#define ERROR   -1;
#define INPUT_MASK   0x000000ff
#define OUTPUT_MASK   0x0000ff00
#define SUCCESS   0;

Functions

int main (void)
 Sets up the pio and enables interrupts. Push switches to generate interrupts.
__interrupt __root void pioc_interrupt_handler ()
 The IAR PIO interrupt handler.


Define Documentation

#define ERROR   -1;
 

Definition at line 51 of file interrupt_example_iar.c.

#define INPUT_MASK   0x000000ff
 

Definition at line 53 of file interrupt_example_iar.c.

#define OUTPUT_MASK   0x0000ff00
 

Definition at line 54 of file interrupt_example_iar.c.

#define SUCCESS   0;
 

Definition at line 50 of file interrupt_example_iar.c.


Function Documentation

int main void   ) 
 

Sets up the pio and enables interrupts. Push switches to generate interrupts.

Parameters:
; 
Returns:
;

Definition at line 78 of file interrupt_example_iar.c.

References INPUT_MASK, and OUTPUT_MASK.

00079 {
00080   volatile struct avr32_pio_t *pioc = &AVR32_PIOC;
00081 
00082   /*
00083   Setup the PIO controller. Set PIOC[8..15] as output, PIOC[0..7] as input.
00084   */
00085 
00086   pioc->oer = OUTPUT_MASK;
00087   pioc->odr= INPUT_MASK;
00088   pioc->per = OUTPUT_MASK&INPUT_MASK;
00089   pioc->codr = INPUT_MASK & OUTPUT_MASK;
00090   pioc->puer = INPUT_MASK & OUTPUT_MASK;
00091 
00092   pioc->idr &= ~INPUT_MASK;
00093   pioc->ier = INPUT_MASK;
00094   pioc->ower = OUTPUT_MASK;
00095 
00096   __enable_interrupt();
00097 
00098   while(1);
00099 
00100 }

__interrupt __root void pioc_interrupt_handler  ) 
 

The IAR PIO interrupt handler.

Parameters:
; 
Returns:
;

Definition at line 63 of file interrupt_example_iar.c.

References INPUT_MASK.

00064 {
00065   volatile struct avr32_pio_t *pioc = &AVR32_PIOC;
00066   int status;
00067 
00068   status = pioc->isr;
00069   status = pioc->pdsr;
00070   pioc->odsr =~(status&INPUT_MASK)<<8; /* set led */
00071 }


Generated on Wed May 10 15:23:25 2006 for AVR32101 The AVR32 Interrupt Controller by  doxygen 1.4.6