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_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 |
|
|
Setup the interrupt.
Definition at line 71 of file interrupt_iar.c. References pdc_interrupt_handler(), and USART_MODULE_IRQ.
Here is the call graph for this function: ![]() |
|
|
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: ![]() |
|
|
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: ![]() |
|
|
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: ![]() |
|
|
Definition at line 53 of file interrupt_iar.c. Referenced by start_interrupts(). |
|
|
Definition at line 55 of file interrupt_iar.c. Referenced by pdc_interrupt_handler(), and start_interrupts(). |
|
|
Definition at line 54 of file interrupt_iar.c. |
|
|
Definition at line 56 of file interrupt_iar.c. |
1.4.6-NO