Public Version
www.ti.com
IVA2.2 Subsystem Basic Programming Model
–
By polling
–
By interrupt
5.4.4.6.9 Tracking DMA Completion
There are two ways to track DMA completion:
•
Polling the completion register when the estimated completion time has elapsed
•
Enabling completion interrupts
Polling example (total completion)
•
PARAM[myLCH].OPT.TCINTEN = 1; // total interrupt completion bit update
•
PARAM[myLCH].OPT.ITCINTEN = 0; // no partial interrupt completion bit update
•
PARAM[myLCH].OPT.TCC = myTCC
•
// myTCC does not contribute to interrupt generation (polling mode)
•
IER = (IER & ~(1<<myTCC)) | 0<<myTCC
•
// start transfer
•
DCHMAP[myEvt] = (DCHMAP[myEvt] & ~(0x1FF<<5)) | myLCH<<5
•
ESR = 1 << myEvt
•
// do something useful (that does not depend on DMA completion)
•
// poll IPR bit
•
while( !(IPR & (1<<myTCC)) ); // polls for completion
Interrupt example (total completion)
•
disable_interrupts()
•
PARAM[myLCH].OPT.TCINTEN = 1; // total interrupt completion bit update
•
PARAM[myLCH].OPT.ITCINTEN = 0; // no partial interrupt completion bit update
•
PARAM[myLCH].OPT.TCC = myTCC
•
// myTCC does contribute to interrupt generation (polling mode)
•
IER = (IER & ~(1<<myTCC)) | 1<<myTCC
•
INTMUX[0] = (INTMUX[0] & ~(0x7F)) | 0x1D; // map CPU it #4
•
CPU.IER = (CPU.IER & (1<<4)) | 1<<4; // unmask CPU it #4
•
enable_interrupts()
•
// start transfer
•
DCHMAP[myEvt] = (DCHMAP[myEvt] & ~(0x1FF<<5)) | myLCH<<5
•
ESR = 1 << myEvt
•
// do something useful (that does not depend on DMA completion)
•
// this code is interrupted when DMA completes
5.4.4.6.10 DMA Interrupt Service Routine
The channel controller does not generate a new interrupt signal for new pending interrupts if the user did
not clear previous pending interrupts. There are two options for constructing an ISR for DMA. The first is
to poll all the bits during execution of the ISR, and to clear all enabled bits in an interrupt-pending register
by writing to the interrupt-pending clear (ICR/ICRH) register before exiting any ISR. Pseudo-code for this
option follows:
1. Enter ISR.
2. Read
3. For the condition set in
(a) Perform operation as needed.
(b) Clear bit for serviced INT.
4. Read IPR.
(a) If
= 0, exit ISR.
(b) If
= 1, go to Step 3.
765
SWPU177N – December 2009 – Revised November 2010
IVA2.2 Subsystem
Copyright © 2009–2010, Texas Instruments Incorporated
Содержание OMAP36 Series
Страница 174: ...174 List of Tables SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 692: ...692 MPU Subsystem SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 1084: ...1084 IVA2 2 Subsystem SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 1990: ...1990 2D 3D Graphics Accelerator SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 2334: ...2334 Memory Subsystem SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 2700: ...2700 Memory Management Units SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 2868: ...2868 HDQ 1 Wire SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 2974: ...2974 UART IrDA CIR SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3054: ...3054 Multichannel SPI SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3462: ...3462 MMC SD SDIO Card Interface SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3508: ...3508 General Purpose Interface SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3584: ...3584 Initialization SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3648: ...3648 Debug and Emulation SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...