interrupt_gcc.c

Go to the documentation of this file.
00001 /*This file has been prepared for Doxygen automatic documentation generation.*/
00022 #ifdef __GNUC__
00023 
00024 #include "interrupt_gcc.h"
00025 
00026 char * stringINT;
00027 int stringSizeINT;
00028 volatile avr32_usart_t * usart0;
00029 
00030 __int_handler * pdc_interrupt_handler()
00031 {
00032         pdc_setTxNextBuf( (void *) usart0,
00033                         pdc_translatePtr( stringINT ), stringSizeINT );
00034 
00035         return (void *) AVR32_RAR_INT2;
00036 }
00037 
00038 
00039 void start_interrupts()
00040 {
00041         stringINT = "INT: AVR32 PDC application demo\r\n";
00042         stringSizeINT = 33;
00043         usart0 = (volatile avr32_usart_t *) AVR32_USART0_ADDRESS;
00044 
00045         set_interrupts_base( (void *) AVR32_INTC_ADDRESS );
00046 
00047         /* register_interrupt( (__int_handler) INT_HANDLER_FUNC,
00048                         GROUP,
00049                         LINE,
00050                         PRIORITY); */
00051         register_interrupt( (__int_handler) pdc_interrupt_handler,
00052                         AVR32_USART0_IRQ / 32,
00053                         AVR32_USART0_IRQ % 32,
00054                         INT2 );
00055 
00056         /* Turn on interrupts from USART0 (IER.endrx) */
00057         usart0->ier = (1<<AVR32_USART_IER_ENDRX_OFFSET);
00058 
00059         __asm__( "csrf 0 \n" );
00060 
00061         /* PDC, full boobies */
00062         pdc_setTxBuf( (void *) usart0,
00063                         pdc_translatePtr( stringINT ), stringSizeINT,
00064                         pdc_translatePtr( stringINT ), stringSizeINT );
00065 }
00066 
00067 
00068 void stop_interrupts()
00069 {
00070 }
00071 
00072 #endif /* #ifdef __GNUC__ */
00073 

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