interrupt_iar.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.7
RCSfile
interrupt_iar.c,v
Date
2006/05/09 10:32:56

Definition in file interrupt_iar.c.

#include "interrupt_iar.h"

Include dependency graph for interrupt_iar.c:

Go to the source code of this file.

Functions

void init_usart_interrupts (void)
 Setup the interrupt.
__interrupt __root void pdc_interrupt_handler (void)
 Interrupt handler for USART interrupts.
void start_interrupts (void)
 Start the interrupt.
void stop_interrupts (void)
 Disables the interrupt.

Variables

char * stringINT
char * stringINT2
int stringSizeINT
int stringSizeINT2


Function Documentation

void init_usart_interrupts void   ) 
 

Setup the interrupt.

Definition at line 71 of file interrupt_iar.c.

References pdc_interrupt_handler(), and USART_MODULE_IRQ.

00072 {
00073 }

Here is the call graph for this function:

__interrupt __root void pdc_interrupt_handler void   ) 
 

Interrupt handler for USART interrupts.

Definition at line 62 of file interrupt_iar.c.

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

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

Here is the call graph for this function:

void start_interrupts void   ) 
 

Start the interrupt.

Definition at line 78 of file interrupt_iar.c.

References pdc_disable(), pdc_enable(), pdc_flushCache(), pdc_setTxBuf(), pdc_translatePtr(), stringINT, stringINT2, stringSizeINT, stringSizeINT2, and USART_MODULE.

00079 {
00080     pdc_disable((void *) &USART_MODULE);
00081 
00082     stringINT = "INT: AVR32 PDC application demo\r\n";
00083     stringSizeINT = 33;
00084     stringINT2 = "INT: AVR32 PDC application demo ENDTX int\r\n";
00085     stringSizeINT2 = 43;
00086 
00087     pdc_flushCache((void *)stringINT, stringSizeINT/4);
00088     pdc_flushCache((void *)stringINT2, stringSizeINT2/4);
00089 
00090     pdc_setTxBuf((void *) &USART_MODULE,
00091             pdc_translatePtr( stringINT ), stringSizeINT,
00092             pdc_translatePtr( stringINT ), stringSizeINT);
00093 
00094     /* Turn on interrupts from USART0 (IER.txrdy) */
00095     USART_MODULE.ier = AVR32_USART_IER_TXRDY_MASK;
00096     __enable_interrupt();
00097 
00098     pdc_enable((void *) &USART_MODULE);
00099 }

Here is the call graph for this function:

void stop_interrupts void   ) 
 

Disables the interrupt.

Definition at line 104 of file interrupt_iar.c.

References pdc_disable(), pdc_txBytesLeft(), and USART_MODULE.

00105 {
00106     __disable_interrupt();
00107     USART_MODULE.idr = AVR32_USART_IDR_ENDRX_MASK;
00108 
00109     /* Wait for current PDC transfer to complete */
00110     do {
00111     } while(pdc_txBytesLeft((void *) &USART_MODULE) != 0);
00112 
00113     pdc_disable((void *) &USART_MODULE);
00114 }

Here is the call graph for this function:


Variable Documentation

char* stringINT
 

Definition at line 53 of file interrupt_iar.c.

Referenced by start_interrupts().

char* stringINT2
 

Definition at line 55 of file interrupt_iar.c.

Referenced by pdc_interrupt_handler(), and start_interrupts().

int stringSizeINT
 

Definition at line 54 of file interrupt_iar.c.

int stringSizeINT2
 

Definition at line 56 of file interrupt_iar.c.


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