<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="ja"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> | |
<meta http-equiv="Content-Style-Type" content="text/css"> | |
<link rel="up" title="FatFs" href="../00index_j.html"> | |
<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default"> | |
<title>FatFs - f_forward</title> | |
</head> | |
<body> | |
<div class="para"> | |
<h2>f_forward</h2> | |
<p>t@C©çf[^ðÇÝoµAMXg[ɼÚ]µÜ·B</p> | |
<pre> | |
FRESULT f_forward ( | |
FIL* <em>FileObject</em>, /* t@CEIuWFNg\¢Ì */ | |
UINT (*<em>Func</em>)(const BYTE*,UINT), /* f[^]Ö */ | |
UINT <em>ByteToFwd</em>, /* ]·éoCg */ | |
UINT* <em>ByteFwd</em> /* ]³ê½oCg */ | |
); | |
</pre> | |
</div> | |
<div class="para"> | |
<h4>ø</h4> | |
<dl class="par"> | |
<dt>FileObject</dt> | |
<dd>t@CEIuWFNg\¢ÌÖÌ|C^ðwèµÜ·B</dd> | |
<dt>Func</dt> | |
<dd>f[^ðn·[Uè`ÖÖÌ|C^ðwèµÜ·B±ÌÖÌdlÍTvðQƵľ³¢B</dd> | |
<dt>ByteToRead</dt> | |
<dd>]·éoCg(0`UINTÌÅål)ðwèµÜ·B</dd> | |
<dt>ByteRead</dt> | |
<dd>ÀÛÉ]³ê½oCgði[·éÏðw·|C^ðwèµÜ·B</dd> | |
</dl> | |
</div> | |
<div class="para"> | |
<h4>ßèl</h4> | |
<dl class="ret"> | |
<dt>FR_OK (0)</dt> | |
<dd>³íI¹B</dd> | |
<dt>FR_DENIED</dt> | |
<dd>ñÇÝÝ[hÅJ¢½t@C©çÇÝà¤Æµ½B</dd> | |
<dt>FR_DISK_ERR</dt> | |
<dd>fBXNEG[Éæé¸sB</dd> | |
<dt>FR_INT_ERR</dt> | |
<dd>s³ÈFAT\¢Ü½ÍàG[Éæé¸sB</dd> | |
<dt>FR_NOT_READY</dt> | |
<dd>fBAªZbg³êĢȢÈÇA¨hCuª®ìs\óÔB</dd> | |
<dt>FR_INVALID_OBJECT</dt> | |
<dd>³øÈt@CEIuWFNgB</dd> | |
</dl> | |
</div> | |
<div class="para"> | |
<h4>ðà</h4> | |
<p>t@CÌf[^ðobt@ÉÇÝo³¸ÉMXg[ɼÚ]µÜ·BAvP[V¤Åf[^Eobt@ðKvƵȢÌÅAÌÀçê½Â«ÅLøÅ·B]JnÊuÍA»ÝÌt@CR/W|C^©çÉÈèÜ·Bt@CR/W|C^Í]³ê½oCg¾¯iÝÜ·Bwè³ê½oCgÌ]Ét@CÌI[ÉBµ½êâMXg[ªrW[ÉÈÁ½êA<tt>*ByteFwd</tt>Í<tt>ByteToFwd</tt>æèଳÈèÜ·B</p> | |
</div> | |
<div class="para"> | |
<h4>Îîñ</h4> | |
<p><tt>_USE_FORWARD == 1</tt>ÅAÂ<tt>_FS_TINY == 1</tt>ÌÆ«ÉgpÂ\Å·B</p> | |
</div> | |
<div class="para"> | |
<h4>gpáiI[fBIĶj</h4> | |
<pre> | |
/*-----------------------------------------------------------------------*/ | |
/* f_forwardÖ©çÄÎêéf[^MÖÌá */ | |
/*-----------------------------------------------------------------------*/ | |
UINT out_stream ( /* ßèl: ]³ê½oCgܽÍXg[ÌóÔ */ | |
const BYTE *p, /* ]·éf[^ðw·|C^ */ | |
UINT btf /* >0: ]ðs¤(oCg). 0: Xg[ÌóÔð²×é */ | |
) | |
{ | |
UINT cnt = 0; | |
if (btf == 0) { /* ZXv */ | |
/* Xg[ÌóÔðÔ· (0: rW[, 1: fB) */ | |
/* êUAfBðÔµ½çA±]vÅÈÆà1oCgÍ */ | |
/* ]³ê颮 f_forwardÖÍ FR_RW_ERROR ÆÈéB */ | |
if (FIFO_READY) cnt = 1; | |
} | |
else { /* ]v */ | |
do { /* SÄÌoCgð]·é©AXg[ªrW[ÉÈéÜÅJèÔ· */ | |
FIFO_PORT = *p++; | |
cnt++; | |
} while (cnt < btf && FIFO_READY); | |
} | |
return cnt; | |
} | |
/*-----------------------------------------------------------------------*/ | |
/* f_forwardÖÌgpá */ | |
/*-----------------------------------------------------------------------*/ | |
FRESULT play_file ( | |
char *fn /* Ķ·éI[fBIEt@C¼ðw·|C^ */ | |
) | |
{ | |
FRESULT rc; | |
FIL fil; | |
UINT dmy; | |
/* t@CðÇÝoµ[hÅJ */ | |
rc = f_open(&fil, fn, FA_READ); | |
/* SÄÌf[^ª]³êé©G[ª¶·éÜű¯é */ | |
while (rc == FR_OK && fil.fptr < fil.fsize) { | |
/* Ù©Ì... */ | |
/* èúIܽÍvɶÄf[^ðXg[Éo·é */ | |
rc = f_forward(&fil, out_stream, 1000, &dmy); | |
} | |
return rc; /* FR_OK: ³íI¹, Ù©:ÙíI¹ */ | |
} | |
</pre> | |
</div> | |
<div class="para"> | |
<h4>QÆ</h4> | |
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p> | |
</div> | |
<p class="foot"><a href="../00index_j.html">ßé</a></p> | |
</body> | |
</html> |