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_SendGXCommand*</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">MI_SendGXCommand* <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14<DD><CODE>#include <nitro/mi.h></CODE><BR> <BR> <CODE>void MI_SendGXCommand( u32 dmaNo, const void* src, u32 commandLength );<BR> <BR> void MI_SendGXCommandAsync( u32 dmaNo, const void* src, u32 commandLength,<BR> MIDmaCallback callback, void* arg );</CODE> 15<DD><CODE><BR> void MI_SendGXCommandAsyncFast( u32 dmaNo, const void* src, u32 commandLength,<BR> MIDmaCallback callback, void* arg );</CODE> 16</DL> 17<H2>Arguments</H2> 18<TABLE border="1" width="100%"> 19 <TBODY> 20 <TR> 21<TD width="13%"><EM><STRONG>dmaNo</STRONG></EM></TD> 22<TD width="87%">DMA channel used.</TD> 23 </TR> 24 <TR> 25<TD width="13%"><EM><STRONG>src</STRONG></EM></TD> 26<TD width="87%">The transfer source address.</TD> 27 </TR> 28 <TR> 29<TD><EM><STRONG>commandLength</STRONG></EM></TD> 30<TD>Transfer command size</TD> 31 </TR> 32 <TR> 33<TD><EM><STRONG>callback</STRONG></EM></TD> 34<TD>Callback when DMA ends.</TD> 35 </TR> 36 <TR> 37<TD><EM><STRONG>arg</STRONG></EM></TD> 38<TD>Callback argument when DMA ends.</TD> 39 </TR> 40 </TBODY> 41</TABLE> 42<H2>Return Values</H2> 43<P>None.</P> 44<H2>Description</H2> 45<P>This function uses DMA to send a display list (GX command string) to command FIFO. The transfer source address must be 4-byte aligned.</P> 46<P>The synchronous version of <code>MI_SendGXCommand()</code> waits for DMA to end inside the function. The asynchronous version of <code>MI_SendGXCommandAsync()</code> and <code>MI_SendGXCommandAsFast()</code> call <em><strong><code>callback</code></strong></em> when DMA ends. The callback is an <code>MIDmaCallback</code> type function (a <code>void</code>–type function that takes one <code>void*</code> argument). <code>callback</code> is called from the system DMA interrupt handler and therefore is called while interrupts are prohibited.</P> 47<P>The difference between <code>MI_SendGXCommandAsync()</code> and <code>MI_SendGXCommandAsyncFast()</code>:<br /><code>MI_SendGXCommandAsync()</code> does not use the Geometry transfer DMA but uses only the usual synchronous DMA. A small amount of DMA is performed by using the interrupt that is generated when GXFIFO is less than half. <code>MI_SendGXCommandAsyncFast()</code> uses the Geometry transfer DMA, so that DMA starts automatically when GXFIFO becomes low. Note that multiple automatic DMAs cannot be started simultaneously because of hardware restrictions. However, the hardware allows the simultaneous startup of multipl automatic DMAs of the same type.</P> 48<P>With TWL-SDK, exclusive processing is not performed with the <code>MI_SendGXCommandAsync*</code> functions and other <code>G3_</code>-based APIs because the execution speed of the graphics command has been prioritized. Therefore, we cannot guarantee correct operation if the GX command is written directly to command FIFO by a <code>G3_</code> function while the GX command is being transferred by <code>MI_SendGXCommandAsync*()</code>. It is strongly recommended that you pay particular attention in avoiding such a situation on the API call side.</P> 49<H3><BR> About the DMA to Be Used <IMG src="../../image/TWL.gif" align="middle"></H3> 50<P>Although this function uses the old DMA, the function that performs the same operation using the new DMA is <CODE><A href="../ndma/MI_SendNDmaGXCommand.html">MI_SendNDmaGXCommand*</A></CODE>. The <CODE><A href="../dma/MI_SendGXCommand.html">MI_SendNDmaGXCommand*</A></CODE> and <CODE>MI_SendGXCommand*</CODE> functions cannot be used at the same time.</P> 51<H2>Internal Operation</H2> 52<P>Uses the following IO registers: DMA<i>n</i> source register (0x40000B0 + 12<i>n</i>), DMA<i>n</i> destination register (0x40000B4 + 12<i>n</i>), and DMA<i>n</i> control register (0x40000B8 + 12<i>n</i>). (<i>n</i> is the DMA channel used.))The <code>GXFIFO(0x4000400)</code> IO register is also accessed.</P> 53<H2>See Also</H2> 54<P><CODE><A href="MI_DmaCopy.html">MI_DmaCopy*</A><BR> <A href="../../gx/g3/G3_BeginMakeDL.html">G3_BeginMakeDL</A><BR> <A href="../../gx/g3/G3_EndMakeDL.html">G3_EndMakeDL</A></CODE><BR> <CODE><A href="../ndma/MI_SendNDmaGXCommand.html">MI_SendNDmaGXCommand*</A></CODE></P> 55<H2>Revision History</H2> 56<P>2008/10/16 Added information about functions that use the new DMA.<br />2005/03/08 Standardized the Japanese term for "interrupt."<BR> 2004/12/22 Added a description about calling a callback.<br />2004/08/26 Added description for <code>MI_SendGXCommandAsyncFast</code>.<br> 2004/07/18 Added description when the callback is NULL.<br> 2003/12/01 Initial version.</P> 57<hr><p>CONFIDENTIAL</p></body> 58</HTML>