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>CTRDG_WriteAgbFlashSectorAsync</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">CTRDG_WriteAgbFlashSectorAsync <IMG src="../image/NTR.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14  <DD>
15  <PRE><CODE>#include &lt;nitro/ctrdg.h&gt;</CODE></PRE>
16  <PRE><CODE>void CTRDG_WriteAgbFlashSectorAsync(u16 sec_num, u8* src, CTRDG_TASK_FUNC callback);
17  </CODE></PRE>
18</DL>
19<H2>Arguments</H2>
20<TABLE border="1">
21  <TBODY>
22    <TR>
23<TD><SPAN class="argument">sec_num</SPAN></TD>
24<TD>Destination flash sector number.</TD>
25    </TR>
26    <TR>
27<TD><SPAN class="argument">src</SPAN></TD>
28<TD>Source address.</TD>
29    </TR>
30    <TR>
31<TD><SPAN class="argument">callback</SPAN></TD>
32<TD>Callback function called when the data write process ends.</TD>
33    </TR>
34  </TBODY>
35</TABLE>
36<H2>Return Values</H2>
37<P>None.</P>
38<H2>Description</H2>
39<P>Asynchronously writes one sector (4 KB) of data beginning from the address given by <SPAN class="argument">src</SPAN> into the target sector number. The <A href="CTRDG_EraseAgbFlashSector.html"><CODE>CTRDG_EraseAgbFlashSector</CODE></A> function is called from this function, and data is written after the sector is erased. To find out how many bytes remain available while this function is executing, access the global variable <CODE>flash_remainder</CODE>. To find out whether the write process succeeded, access the result member of the <CODE>CTRDGTaskInfo</CODE> structure used as an argument to the callback function that returns after this function is called. Returns zero if the write process succeeds. Returns a nonzero value if the write process fails or if the target sector number is out of range.</P>
40<P>The access cycle setting does not need to be set in advance because it is created inside the function. In addition, the <A href="../os/time/OS_InitTick.html"><CODE>OS_InitTick</CODE></A> function must be called in advance because clock ticks are used by this function to measure timeouts.</P>
41<P><B>Note:</B> All interrupts are disabled inside this function, and the cartridge bus is locked for a set period. In particular, when this function is called, do not use DMA that starts automatically during direct sound and V/H blank synchronization, display synchronization, cartridge request, and so on.</P>
42<P>Note that the AGB backup device cannot be accessed normally with IS-NITRO-DEBUGGER version 1.66 or earlier.</P>
43<PRE>/*  callback  function  */
44typedef u32 (*CTRDG_TASK_FUNC) (struct CTRDGiTaskInfo_tag *);
45</PRE>
46<H2>See Also</H2>
47<P><A href="CTRDG_EraseAgbFlashSector.html"><CODE>CTRDG_EraseAgbFlashSector</CODE></A><BR> <A href="CTRDG_WriteAgbFlashSector.html"><CODE>CTRDG_WriteAgbFlashSector</CODE></A><BR> <A href="CTRDG_WriteAndVerifyAgbFlash.html"><CODE>CTRDG_WriteAndVerifyAgbFlash</CODE></A><BR> <A href="CTRDG_WriteAndVerifyAgbFlashAsync.html"><CODE>CTRDG_WriteAndVerifyAgbFlashAsync</CODE></A></P>
48<H2>Revision History</H2>
49<P>2006/05/25 Added a description that the AGB backup device cannot be accessed normally with IS-NITRO-DEBUGGER version 1.66 or earlier.<BR> 2006/04/07 Initial version.</P>
50<hr><p>CONFIDENTIAL</p></body>
51</HTML>
52