pio_test.c

Go to the documentation of this file.
00001 #include "../part.h"
00002 
00003 #define CPU_HZ 20000000
00004 #define PIO_MASK 0x000000ff
00005 
00006 void delay( void );
00007 
00008 int main ( void )
00009 {
00010         int i;
00011         avr32_pio_t *piob = (void *) AVR32_PIOB_ADDRESS;
00012         avr32_pio_t *pioc = (void *) AVR32_PIOC_ADDRESS;
00013 
00014         piob->per = 0xFFFFffff;
00015         piob->oer = 0xFFFFffff;
00016         piob->idr = 0xFFFFffff;
00017         piob->ower = 0xFFFFffff;
00018 
00019         pioc->per = 0xFFFFffff;
00020         pioc->oer = 0xFFFFffff;
00021         pioc->idr = 0xFFFFffff;
00022         pioc->ower = 0xFFFFffff;
00023 
00024 
00025         while(1){
00026                 for(i=0; i<8; i++){
00027                         piob->codr = 0x0000ffff;
00028                         pioc->codr = 0x0000ffff;
00029                         delay();
00030                         piob->sodr = 0x0000ffff;
00031                         pioc->sodr = 0x0000ffff;
00032                         delay();
00033 
00034                 }
00035         }
00036 }
00037 
00038 void delay( void )
00039 {
00040         int i;
00041         for(i=0; i<500000; i++);
00042 }

Generated on Thu May 10 14:14:48 2007 for AVR321000 Communication with the AVR32 USART by  doxygen 1.5.1