?? mmc_8h.html
字號:
<area href="mmc_8c.html#a0" shape="rect" coords="320,58,416,82" alt=""><area href="mmc_8c.html#a4" shape="rect" coords="142,108,222,132" alt=""><area href="board_8c.html#a1" shape="rect" coords="514,34,592,58" alt=""><area href="board_8h.html#a51" shape="rect" coords="533,96,573,120" alt=""><area href="board_8h.html#a50" shape="rect" coords="516,145,590,169" alt=""></map> </td> </tr></table><a class="anchor" name="a4" doxytag="mmc.h::WritePhysicalSector" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> unsigned char WritePhysicalSector </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Perform MMC block write from <b>*dataBufPtr</b> to sector sectorAddress.l. <p><p>Definition at line <a class="el" href="mmc_8c-source.html#l00484">484</a> of file <a class="el" href="mmc_8c-source.html">mmc.c</a>.<p>References <a class="el" href="unionAddress.html#o1">Address::b</a>, <a class="el" href="buffer_8h-source.html#l00131">Address::B::b0</a>, <a class="el" href="buffer_8h-source.html#l00132">Address::B::b1</a>, <a class="el" href="buffer_8h-source.html#l00133">Address::B::b2</a>, <a class="el" href="buffer_8h-source.html#l00107">DiskBlock::Raw::buf</a>, <a class="el" href="buffer_8c-source.html#l00013">dataBufPtr</a>, <a class="el" href="buffer_8c-source.html#l00010">diskSect</a>, <a class="el" href="buffer_8h-source.html#l00129">Address::l</a>, <a class="el" href="mmc_8c-source.html#l00019">MmcCommand()</a>, <a class="el" href="board_8h-source.html#l00178">MMCDeselect</a>, <a class="el" href="unionDiskBlock.html#o1">DiskBlock::raw</a>, <a class="el" href="buffer_8c-source.html#l00015">sectorAddress</a>, <a class="el" href="board_8c-source.html#l00026">SPI8Clocks()</a>, <a class="el" href="board_8c-source.html#l00018">SPIGetChar()</a>, <a class="el" href="board_8h-source.html#l00238">SPIPutCharWithoutWaiting</a>, and <a class="el" href="board_8h-source.html#l00232">SPIWait</a>.<p>Referenced by <a class="el" href="storage_8c-source.html#l00183">WriteDiskSector()</a>.<p><pre class="fragment"><div>00484 {00485 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c; 00486 00487 <span class="preprocessor">#ifdef MMCDEBUG</span>00488 <span class="preprocessor"></span> ConsoleWrite(<span class="stringliteral">"<W"</span>);00489 <span class="preprocessor">#endif </span>00490 <span class="preprocessor"></span>00491 00492 <span class="comment">//RED_LED = LED_ON;</span>00493 <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a> = <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a> * 2; <span class="comment">//convert to bytes (combined with 8bit shift)</span>00494 c=<a class="code" href="mmc_8c.html#a0">MmcCommand</a>(0x40 | 24, <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o1">b</a>.<a class="code" href="structAddress_1_1B.html#o2">b2</a>, <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o1">b</a>.<a class="code" href="structAddress_1_1B.html#o1">b1</a>,00495 <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o1">b</a>.<a class="code" href="structAddress_1_1B.html#o0">b0</a>, 0);00496 <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a> = <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a> >> 1; <span class="comment">//convert back to blocks</span>00497 00498 <span class="comment">//ConsolePutChar('w');</span>00499 <span class="comment">//ConsolePutHex8(c);</span>00500 00501 <span class="keywordflow">if</span> (c!=0x00) <span class="keywordflow">return</span> (c); <span class="comment">//Error - MMC did not go to write mode</span>00502 00503 <span class="comment">/*</span>00504 <span class="comment"> while (c!=0x00) { //wait for BUSY token, if you get 0x01(idle), it's an ERROR!</span>00505 <span class="comment"> c = SPIGetChar();</span>00506 <span class="comment"> ConsolePutHex8(c);</span>00507 <span class="comment"> } </span>00508 <span class="comment">*/</span> 00509 <a class="code" href="buffer_8c.html#a1">dataBufPtr</a> = <a class="code" href="buffer_8c.html#a0">diskSect</a>.<a class="code" href="unionDiskBlock.html#o1">raw</a>.<a class="code" href="structDiskBlock_1_1Raw.html#o0">buf</a>;00510 <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(0xFE);00511 <a class="code" href="board_8h.html#a43">SPIWait</a>();00512 00513 <span class="keywordflow">for</span> (c=0;c<128;c++){00514 <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(*dataBufPtr++); 00515 <a class="code" href="board_8h.html#a43">SPIWait</a>();00516 <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(*dataBufPtr++); 00517 <a class="code" href="board_8h.html#a43">SPIWait</a>();00518 <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(*dataBufPtr++); 00519 <a class="code" href="board_8h.html#a43">SPIWait</a>();00520 <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(*dataBufPtr++); 00521 <a class="code" href="board_8h.html#a43">SPIWait</a>();00522 }00523 <span class="comment">//ConsolePutChar('-');</span>00524 00525 c = <a class="code" href="board_8c.html#a1">SPIGetChar</a>(); <span class="comment">//crc 1st byte (sends 0xff)</span>00526 c = <a class="code" href="board_8c.html#a1">SPIGetChar</a>(); <span class="comment">//crc 2nd byte (sends 0xff)</span>00527 c = <a class="code" href="board_8c.html#a1">SPIGetChar</a>();00528 <span class="comment">//ConsolePutHex8(c); //This prints xxx00101, (usually e5) when data ok</span>00529 00530 <span class="comment">// while (SPIGetChar()!=0xff) //busy wait moved to mmcCommand</span>00531 <span class="comment">// ; // Wait until MMC not busy. </span>00532 00533 <span class="preprocessor">#ifdef MMCDEBUG</span>00534 <span class="preprocessor"></span> ConsoleWrite(<span class="stringliteral">"W>"</span>);00535 <span class="preprocessor">#endif </span>00536 <span class="preprocessor"></span>00537 00538 <a class="code" href="board_8h.html#a50">SPI8Clocks</a>(16);00539 <a class="code" href="board_8h.html#a33">MMCDeselect</a>();00540 <a class="code" href="board_8h.html#a50">SPI8Clocks</a>(16);00541 00542 <span class="comment">//RED_LED = LED_OFF;</span>00543 00544 <span class="keywordflow">return</span> 0;00545 }</div></pre><p>Here is the call graph for this function:<p><center><img src="mmc_8h_a4_cgraph.png" border="0" usemap="#mmc_8h_a4_cgraph_map" alt=""></center><map name="mmc_8h_a4_cgraph_map"><area href="mmc_8c.html#a0" shape="rect" coords="196,57,292,81" alt=""><area href="board_8h.html#a50" shape="rect" coords="342,9,417,33" alt=""><area href="board_8c.html#a1" shape="rect" coords="341,105,418,129" alt=""><area href="board_8h.html#a51" shape="rect" coords="360,57,400,81" alt=""></map> </td> </tr></table><hr><h2>Variable Documentation</h2><a class="anchor" name="a0" doxytag="mmc.h::storageFlags" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> xdata unsigned char <a class="el" href="storage_8c.html#a0">storageFlags</a> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Storage status flags. <p><ul><li>Bit 1 (LSB): 1=Device does not support interrupted read</li><li>Bit 2: 1=A sector is seeked and ready for reading</li><li>Bit 3: 1=No storage </li></ul><p>Definition at line <a class="el" href="mmc_8h-source.html#l00008">8</a> of file <a class="el" href="mmc_8h-source.html">mmc.h</a>.<p>Referenced by <a class="el" href="storage_8c-source.html#l00043">InitStorage()</a>, <a class="el" href="storage_8c-source.html#l00071">PrepareToReadDiskSector()</a>, and <a class="el" href="storage_8c-source.html#l00110">ReadDiskSector()</a>. </td> </tr></table><hr><FONT SIZE="-1">All software copyright 2000-2004 <a href="http://www.vlsi.fi/"> VLSI Solution OY.</a>Redistribution of these software modules are limited to promotional use onlyand only with the VS1011 / VS1002 / VS1003 MP3-Evakit evaluation boards. Free orcommercial use of these software modules in MP3 players is ok if theproduct includes MP3 decoder chip(s) from VLSI. You can request the complete(compilable) package from mp3@vlsi.fi</FONT>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -