interrupt_gcc.c File Reference


Detailed Description

PDC and interrupt control example application.

This file gives an example of using the PDC to burst data on the USART. With and without the use of interrupts.

Author:
Atmel Corporation: http://www.atmel.com
Support email: avr32@atmel.com
Name
RELEASE_1_0
Revision
1.9
RCSfile
interrupt_gcc.c,v
Date
2006/05/09 08:53:16

Definition in file interrupt_gcc.c.

#include "interrupt_gcc.h"

Include dependency graph for interrupt_gcc.c:

Go to the source code of this file.

Functions

char *stringINT __attribute__ ((aligned(32)))
void init_usart_interrupts (void)
 Setup the interrupt.
__int_handler * pdc_interrupt_handler (void)
 Interrupt handler for USART interrupts.
void start_interrupts (void)
 Start the interrupt.
void stop_interrupts (void)
 Disables the interrupt.

Variables

int stringSizeINT
int stringSizeINT2


Function Documentation

char *stringINT2 __attribute__ (aligned(32))   ) 
 

Referenced by main().

void init_usart_interrupts void   ) 
 

Setup the interrupt.

Definition at line 72 of file interrupt_gcc.c.

Referenced by main().

00073 {
00074     set_interrupts_base((void *) AVR32_INTC_ADDRESS);
00075 
00076     /* register_interrupt((__int_handler) INT_HANDLER_FUNC,
00077        GROUP,
00078        LINE,
00079        PRIORITY); */
00080     register_interrupt((__int_handler) pdc_interrupt_handler,
00081             USART_MODULE_IRQ / 32,
00082             USART_MODULE_IRQ % 32,
00083             INT0);
00084 }

__int_handler* pdc_interrupt_handler void   ) 
 

Interrupt handler for USART interrupts.

Definition at line 61 of file interrupt_gcc.c.

References pdc_setTxNextBuf(), pdc_translatePtr(), stringINT2, and USART_MODULE.

Referenced by init_usart_interrupts().

00062 {
00063     pdc_setTxNextBuf((void *) &USART_MODULE,
00064             pdc_translatePtr((void *)stringINT2), stringSizeINT2);
00065 
00066     return (void *) AVR32_RAR_INT0;
00067 }

Here is the call graph for this function:

void start_interrupts void   ) 
 

Start the interrupt.

Definition at line 89 of file interrupt_gcc.c.

Referenced by do_interrupt_mode().

00090 {
00091     pdc_disable((void *) &USART_MODULE);
00092 
00093     stringINT = "INT: AVR32 PDC application demo\r\n";
00094     stringSizeINT = 33;
00095     stringINT2 = "INT: AVR32 PDC application demo ENDTX int\r\n";
00096     stringSizeINT2 = 43;
00097 
00098     pdc_flushCache((void *)stringINT, stringSizeINT/4);
00099     pdc_flushCache((void *)stringINT2, stringSizeINT2/4);
00100 
00101     pdc_setTxBuf((void *) &USART_MODULE,
00102             pdc_translatePtr((void *)stringINT), stringSizeINT,
00103             pdc_translatePtr((void *)stringINT), stringSizeINT);
00104 
00105     /* Turn on ENDTX interrupts from USART */
00106     USART_MODULE.ier = AVR32_USART_IER_ENDTX_MASK;
00107     init_interrupts();
00108 
00109     pdc_enable((void *) &USART_MODULE);
00110 }

void stop_interrupts void   ) 
 

Disables the interrupt.

Definition at line 115 of file interrupt_gcc.c.

00116 {
00117     USART_MODULE.idr = AVR32_USART_IDR_ENDTX_MASK;
00118 
00119     /* Wait for current PDC transfer to complete */
00120     do {
00121     } while(pdc_txBytesLeft((void *) &USART_MODULE) != 0);
00122 
00123     pdc_disable((void *) &USART_MODULE);
00124 }


Variable Documentation

int stringSizeINT
 

Definition at line 54 of file interrupt_gcc.c.

Referenced by start_interrupts().

int stringSizeINT2
 

Definition at line 56 of file interrupt_gcc.c.

Referenced by pdc_interrupt_handler(), and start_interrupts().


Generated on Wed May 10 15:03:12 2006 for AVR32108 - Peripheral Direct Memory Access Driver by  doxygen 1.4.6-NO