This file gives an example of using the PDC to burst data on the USART. With and without the use of interrupts.
Definition in file interrupt_gcc.h.
#include <avr32/io.h>
#include "settings.h"
#include <sys/interrupts.h>
#include "usart.h"
#include "pdc.h"
Include dependency graph for interrupt_gcc.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Functions | |
| void | init_usart_interrupts (void) |
| Setup the interrupt. | |
| void | start_interrupts (void) |
| Start the interrupt. | |
| void | stop_interrupts (void) |
| Disables the interrupt. | |
|
|
Setup the interrupt.
Definition at line 72 of file interrupt_gcc.c. 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 }
|
|
|
Start the interrupt.
Definition at line 89 of file interrupt_gcc.c. 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 }
|
|
|
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 }
|
1.4.6-NO