1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>MI_NDmaFill*</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">MI_NDmaFill* <IMG src="../../image/TWL.gif" width="24" height="12" border="0" align=middle></H1> 12<H2>Syntax</H2> 13<DL> 14<DD><CODE>#include <twl/mi.h></CODE><BR> <BR> <CODE>void MI_NDmaFill( u32 ndmaNo,</CODE> 15<DT> <CODE>void* dest, u32 data, u32 size );</CODE> 16</DL> 17<DL> 18<DD><CODE>void MI_NDmaFill_SetUp( u32 ndmaNo,</CODE> 19<DT> <CODE>void* dest, u32 data, u32 size );</CODE> 20</DL> 21<DL> 22<DD><CODE>void MI_NDmaFillAsync( u32 dmaNo,</CODE> 23<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 24<DT><CODE> MINDmaCallback callback, void* arg );</CODE> 25</DL> 26<DL> 27<DD><CODE>void MI_NDmaFillAsync_SetUp( u32 dmaNo,</CODE> 28<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 29<DT><CODE> MINDmaCallback callback, void* arg );</CODE> 30</DL> 31<DL> 32<DD><CODE>void MI_NDmaFillEx( u32 ndmaNo,</CODE> 33<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 34<DT> <CODE> MINDmaConfig *config );</CODE> 35</DL> 36<DL> 37<DD><CODE>void MI_NDmaFillEx_SetUp( u32 ndmaNo,</CODE> 38<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 39<DT> <CODE> MINDmaConfig *config );</CODE> 40</DL> 41<DL> 42<DD><CODE>void MI_NDmaFillExAsync( u32 ndmaNo,</CODE> 43<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 44<DT><CODE> MINDmaCallback callback, void* arg,</CODE> 45<DD> <CODE> MINDmaConfig *config</CODE><CODE> );</CODE> 46</DL> 47<DL> 48<DD><CODE>void MI_NDmaFillExAsync_SetUp( u32 ndmaNo,</CODE> 49<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 50<DT><CODE> MINDmaCallback callback, void* arg,</CODE> 51<DD> <CODE> MINDmaConfig *config</CODE><CODE> );</CODE> 52</DL> 53<DL> 54<DD><CODE>void MI_NDmaFill_Dev( u32 ndmaNo,</CODE> 55<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 56<DT><CODE> MINDmaDevice dev );</CODE> 57</DL> 58<DL> 59<DD><CODE>void MI_NDmaFill_Dev_SetUp( u32 ndmaNo,</CODE> 60<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 61<DT><CODE> MINDmaDevice dev );</CODE> 62</DL> 63<DL> 64<DD><CODE>void MI_NDmaFillAsync_Dev( u32 ndmaNo,</CODE> 65<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 66<DT><CODE> MINDmaCallback callback, void* arg,</CODE> 67<DT><CODE> MINDmaDevice dev );</CODE> 68</DL> 69<DL> 70<DD><CODE>void MI_NDmaFillAsync_Dev_SetUp( u32 ndmaNo,</CODE> 71<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 72<DT><CODE> MINDmaCallback callback, void* arg,</CODE> 73<DT><CODE> MINDmaDevice dev );</CODE> 74</DL> 75<DL> 76<DD><CODE>void MI_NDmaFillEx_Dev( u32 ndmaNo,</CODE> 77<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 78<DT><CODE> MINDmaConfig *config,</CODE> 79<DT><CODE> MINDmaDevice dev );</CODE> 80</DL> 81<DL> 82<DD><CODE>void MI_NDmaFillEx_Dev_SetUp( u32 ndmaNo,</CODE> 83<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 84<DT><CODE> MINDmaConfig *config,</CODE> 85<DT><CODE> MINDmaDevice dev );</CODE> 86</DL> 87<DL> 88<DD><CODE>void MI_NDmaFillExAsync_Dev( u32 ndmaNo,</CODE> 89<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 90<DT><CODE> MINDmaCallback callback, void* arg,</CODE> 91<DD> <CODE>MINDmaConfig *config,</CODE> 92<DT><CODE> MINDmaDevice dev );</CODE> 93</DL> 94<DL> 95<DD><CODE>void MI_NDmaFillExAsync_Dev_SetUp( u32 ndmaNo,</CODE> 96<DT> <CODE>void* dest, u32 data, u32 size,</CODE> 97<DT><CODE> MINDmaCallback callback, void* arg,</CODE> 98<DD> <CODE>MINDmaConfig *config,</CODE> 99<DT><CODE> MINDmaDevice dev );</CODE> 100</DL> 101<H2>Arguments</H2> 102<TABLE border="1" width="100%"> 103 <TBODY> 104 <TR> 105<TD width="13%"><SPAN class="argument">ndmaNo</SPAN></TD> 106<TD width="87%">DMA channel to use (0-3 within the new DMA)</TD> 107 </TR> 108 <TR> 109<TD width="13%"><SPAN class="argument">dest</SPAN></TD> 110<TD width="87%">Transfer destination address</TD> 111 </TR> 112 <TR> 113<TD width="13%"><SPAN class="argument">data</SPAN></TD> 114<TD width="87%">Fill data</TD> 115 </TR> 116 <TR> 117<TD><SPAN class="argument">size</SPAN></TD> 118<TD>Transfer size</TD> 119 </TR> 120 <TR> 121<TD><SPAN class="argument">callback</SPAN></TD> 122<TD>Callback when DMA ends</TD> 123 </TR> 124 <TR> 125<TD><SPAN class="argument">arg</SPAN></TD> 126<TD>Callback argument when DMA ends</TD> 127 </TR> 128 <TR> 129<TD><SPAN class="argument">config</SPAN></TD> 130<TD>DMA configuration</TD> 131 </TR> 132 <TR> 133<TD><SPAN class="argument">dev</SPAN></TD> 134<TD>Device (if starting a device)</TD> 135 </TR> 136 </TBODY> 137</TABLE> 138<H2>Return Values</H2> 139<P>None.</P> 140<H2>Description</H2> 141<P>Uses the new DMA to fill data.<BR> (The <CODE>*_SetUp</CODE> functions configure the DMA settings but do not transfer data.)</P> 142<P>The <CODE>MI_NDmaFill*</CODE> functions use the TWL's new DMA to fill data in word (4-byte) units. The transfer destination address (<SPAN class="argument">dest</SPAN>) must be 4-byte aligned. The transfer size (<SPAN class="argument">size</SPAN>) needs to be a multiple of 4.</P> 143<P>Specify the new DMA to use as a number between 0 and 3, in <SPAN class="argument">ndmaNo</SPAN>.</P> 144<P>The <SPAN class="argument">data</SPAN> argument is the data to fill in the specified region.</P> 145<P>The <CODE>MI_NDmaFill*</CODE> functions include functions for the separate operations given below.</P> 146<P>-Whether to wait for DMA shutdown inside the function<BR>-Whether to use defaults for advanced DMA settings or user specifications<BR>-Whether to start DMA immediately, or start it based on an interrupt from a peripheral device</P> 147<P> Note that the <CODE>*_SetUp</CODE> functions configure the DMA settings but do not transfer data. To start DMA, call the <A href="MI_NDmaRestart.html"><CODE>MI_NDmaRestart</CODE></A> function.<BR> 148</P> 149<TABLE border="1"> 150 <TBODY> 151 <TR> 152<TH>Functions</TH> 153<TH>Wait for DMA Completion in the Function</TH> 154<TH>Detailed DMA Settings</TH> 155<TH>Start DMA</TH> 156 </TR> 157 <TR> 158<TD><CODE>MI_NDmaFill</CODE></TD> 159<TD>Yes</TD> 160<TD>Default</TD> 161<TD>Immediately</TD> 162 </TR> 163 <TR> 164<TD><CODE>MI_NDmaFillAsync</CODE></TD> 165<TD>No (Async)</TD> 166<TD>Default</TD> 167<TD>Immediately</TD> 168 </TR> 169 <TR> 170<TD><CODE>MI_NDmaFill</CODE></TD> 171<TD>Yes</TD> 172<TD>User-defined</TD> 173<TD>Immediately</TD> 174 </TR> 175 <TR> 176<TD><CODE>MI_NDmaFillExAsync</CODE></TD> 177<TD>No (Async)</TD> 178<TD>User-defined</TD> 179<TD>Immediately</TD> 180 </TR> 181 <TR> 182<TD><CODE>MI_NDmaFill_Dev</CODE></TD> 183<TD>Yes</TD> 184<TD>Default</TD> 185<TD>Interrupt from peripheral device</TD> 186 </TR> 187 <TR> 188<TD><CODE>MI_NDmaFillAsync_Dev</CODE></TD> 189<TD>No (Async)</TD> 190<TD>Default</TD> 191<TD>Interrupt from peripheral device</TD> 192 </TR> 193 <TR> 194<TD><CODE>MI_NDmaFill_Dev</CODE></TD> 195<TD>Yes</TD> 196<TD>User-defined</TD> 197<TD>Interrupt from peripheral device</TD> 198 </TR> 199 <TR> 200<TD><CODE>MI_NDmaFillExAsync_Dev</CODE></TD> 201<TD>No (Async)</TD> 202<TD>User-defined</TD> 203<TD>Interrupt from peripheral device</TD> 204 </TR> 205 </TBODY> 206</TABLE> 207<P><BR> 208</P> 209<P>The <CODE>Async-type functions</CODE> calls the callback specified in <SPAN class="argument">callback</SPAN> upon DMA completion. The callback is of type <CODE>MINDmaCallback</CODE> (a <code>void</code>-type function that takes one of the <code>void*</code> arguments). The <SPAN class="argument">callback</SPAN> argument is called from the system DMA interrupt handler and therefore is called even if interrupts are prohibited.</P> 210<P>To achieve maximum functionality, it is necessary to understand how to use Async-type functions.<BR>For more information, see the <A href="../dma/MI_DmaCopy.html"><CODE>MI_DmaCopy</CODE></A> function.</P> 211<P>The <SPAN class="argument">config</SPAN> argument is a pointer to the structure that determines the details of the DMA behavior.</P> 212<P>The <SPAN class="argument">dev</SPAN> argument indicates the device when performing DMA upon startup of a peripheral device. For the values that can be set, see <A href="about_ndma.html#MINDmaDevice">"DMA Start Timing" in <B>New DMA: Overview</B></A></P> 213<H2>Internal Operation</H2> 214<P>Uses the new I/O DMA registers.</P> 215<H2>See Also</H2> 216<P><A href="MI_NDmaCopy.html"><CODE>MI_NDmaCopy*</CODE></A><BR> <A href="MI_NDmaClear.html"><CODE>MI_NDmaClear*</CODE></A><BR> <A href="../dma/MI_DmaFill.html"><CODE>MI_DmaFill*</CODE></A><BR> <A href="../memory/MI_CpuFill.html"><CODE>MI_CpuFill*</CODE></A><BR> <A href="MI_NDmaRestart.html"><CODE>MI_NDmaRestart</CODE></A><BR> <A href="about_ndma.html">New NDMA: Overview</A></P> 217<H2>Revision History</H2> 218<P>2008/11/19 Added the link for <CODE>MINDmaDevice</CODE>. <BR>2007/10/31 Added <CODE>_SetUp</CODE>. <BR>2007/09/06 Initial version.</P> 219<hr><p>CONFIDENTIAL</p></body> 220</HTML> 221