⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmc_8h.html

📁 MP3 Player Source Code
💻 HTML
📖 第 1 页 / 共 3 页
字号:
00321     ConsoleWrite(<span class="stringliteral">"\rInitMMC ok.\r"</span>);00322   }00323 00324   <span class="comment">/* All OK return */</span>00325   <span class="keywordflow">return</span> 0; <span class="comment">//ok and MMC supports seek-before-read</span>00326 00327 }</div></pre><p>Here is the call graph for this function:<p><center><img src="mmc_8h_a1_cgraph.png" border="0" usemap="#mmc_8h_a1_cgraph_map" alt=""></center><map name="mmc_8h_a1_cgraph_map"><area href="board_8h.html#a49" shape="rect" coords="528,34,568,58" alt=""><area href="mmc_8c.html#a3" shape="rect" coords="276,257,412,281" alt=""><area href="mmc_8c.html#a0" shape="rect" coords="500,161,596,185" alt=""><area href="mmc_8c.html#a9" shape="rect" coords="281,306,406,330" alt=""><area href="mmc_8c.html#a4" shape="rect" coords="304,60,384,84" alt=""><area href="mmc_8h.html#a2" shape="rect" coords="121,158,199,182" alt=""><area href="mmc_8c.html#a2" shape="rect" coords="505,209,590,233" alt=""><area href="mmc_8c.html#a1" shape="rect" coords="493,257,602,281" alt=""><area href="board_8h.html#a48" shape="rect" coords="656,257,730,281" alt=""><area href="mmc_8c.html#a6" shape="rect" coords="490,356,605,380" alt=""><area href="mmc_8c.html#a7" shape="rect" coords="247,158,441,182" alt=""></map>    </td>  </tr></table><a class="anchor" name="a3" doxytag="mmc.h::ReadPhysicalSector" ></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 ReadPhysicalSector           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Perform block read of previously sought sector to diskSect. <p><p>Definition at line <a class="el" href="mmc_8c-source.html#l00477">477</a> of file <a class="el" href="mmc_8c-source.html">mmc.c</a>.<p>References <a class="el" href="board_8h-source.html#l00075">LED_OFF</a>, <a class="el" href="board_8h-source.html#l00072">LED_ON</a>, <a class="el" href="board_8h-source.html#l00159">MMC_NOT_SELECTED</a>, <a class="el" href="board_8h-source.html#l00156">MMC_SELECTED</a>, <a class="el" href="board_8h-source.html#l00153">MMC_XCS</a>, <a class="el" href="mmc_8c-source.html#l00102">MmcWaitForData()</a>, <a class="el" href="mmc_8c-source.html#l00332">PerformBlockRead()</a>, <a class="el" href="board_8h-source.html#l00262">Public</a>, <a class="el" href="board_8h-source.html#l00066">RED_LED</a>, and <a class="el" href="board_8c-source.html#l00026">SPI8Clocks()</a>.<p>Referenced by <a class="el" href="mmc_8c-source.html#l00249">InitMMC()</a>, and <a class="el" href="storage_8c-source.html#l00110">ReadDiskSector()</a>.<p><pre class="fragment"><div>00477                                          {00478 00479   <a class="code" href="board_8h.html#a10">RED_LED</a> = <a class="code" href="board_8h.html#a12">LED_ON</a>; <span class="comment">/* Disk Read LED on */</span>00480 00481   <a class="code" href="board_8h.html#a29">MMC_XCS</a> = <a class="code" href="board_8h.html#a30">MMC_SELECTED</a>;00482   <span class="comment">//ConsoleWrite("&lt;wait&gt;");</span>00483   <a class="code" href="mmc_8c.html#a1">MmcWaitForData</a>();00484   00485   <span class="comment">//ConsoleWrite("&lt;read&gt;");</span>00486   <a class="code" href="mmc_8c.html#a6">PerformBlockRead</a>();00487 00488   <span class="comment">//ConsoleWrite("&lt;deselect&gt;");</span>00489   <span class="comment">/* generate SPI clock edges to finish up the command */</span>00490 00491   <a class="code" href="board_8h.html#a48">SPI8Clocks</a>(4); <span class="comment">//Send 8*4=32 clocks (4 ff's) to MMC to be nice.</span>00492   <a class="code" href="board_8h.html#a29">MMC_XCS</a> = <a class="code" href="board_8h.html#a31">MMC_NOT_SELECTED</a>;00493   <a class="code" href="board_8h.html#a48">SPI8Clocks</a>(4); <span class="comment">//Again, give the poor MMC some clocks, it likes them.</span>00494 00495   <a class="code" href="board_8h.html#a10">RED_LED</a> = <a class="code" href="board_8h.html#a13">LED_OFF</a>; <span class="comment">/* Disk Read LED off */</span>00496 00497   <span class="keywordflow">return</span> 0; <span class="comment">//ok return</span>00498 }</div></pre><p>Here is the call graph for this function:<p><center><img src="mmc_8h_a3_cgraph.png" border="0" usemap="#mmc_8h_a3_cgraph_map" alt=""></center><map name="mmc_8h_a3_cgraph_map"><area href="mmc_8c.html#a1" shape="rect" coords="197,57,306,81" alt=""><area href="board_8h.html#a48" shape="rect" coords="361,9,435,33" alt=""><area href="mmc_8c.html#a6" shape="rect" coords="194,105,309,129" alt=""><area href="board_8c.html#a1" shape="rect" coords="359,57,437,81" alt=""></map>    </td>  </tr></table><a class="anchor" name="a2" doxytag="mmc.h::SeekSector" ></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 SeekSector           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">unsigned long&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>sectorN</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Perform MMC Seek Command for offset sectorN*512. <p><p>Definition at line <a class="el" href="mmc_8c-source.html#l00431">431</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="mmc_8c-source.html#l00399">ConsoleDecipherMMCResponse()</a>, <a class="el" href="buffer_8h-source.html#l00129">Address::l</a>, <a class="el" href="board_8h-source.html#l00159">MMC_NOT_SELECTED</a>, <a class="el" href="board_8h-source.html#l00153">MMC_XCS</a>, <a class="el" href="mmc_8c-source.html#l00019">MmcCommand()</a>, <a class="el" href="board_8h-source.html#l00262">Public</a>, <a class="el" href="mmc_8c-source.html#l00221">RebootMMC()</a>, and <a class="el" href="buffer_8c-source.html#l00015">sectorAddress</a>.<p>Referenced by <a class="el" href="mmc_8c-source.html#l00249">InitMMC()</a>, <a class="el" href="storage_8c-source.html#l00071">PrepareToReadDiskSector()</a>, and <a class="el" href="storage_8c-source.html#l00110">ReadDiskSector()</a>.<p><pre class="fragment"><div>00431                                                       {00432   00433   <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c;00434   00435 <span class="preprocessor">#ifdef MMCDEBUG    </span>00436 <span class="preprocessor"></span>  ConsoleWrite(<span class="stringliteral">"{s"</span>); <span class="comment">//Seek called</span>00437 <span class="preprocessor">#endif</span>00438 <span class="preprocessor"></span>00439   <span class="keywordflow">do</span>{00440     <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a> = sectorN * 2; <span class="comment">//convert to bytes (combined with 8bit shift)</span>00441     c=<a class="code" href="mmc_8c.html#a0">MmcCommand</a>(0x51,<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>,00442                  <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);00443     <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> &gt;&gt; 1; <span class="comment">//convert back to blocks</span>00444 00445     <span class="comment">//if MMC returs "nothing" (0xff) or 0x81(busy), </span>00446     <span class="comment">//toggle chip select and retry</span>00447     <span class="keywordflow">if</span> ((c==0xff)||(c==0x81)){00448       c=0xff;00449       <a class="code" href="mmc_8c.html#a4">RebootMMC</a>();00450     }00451     <span class="keywordflow">if</span> (c==0x01){ <span class="comment">//MMC says "busy"</span>00452       c=0xff; <span class="comment">//try again</span>00453     }00454 00455   }<span class="keywordflow">while</span>(c==0xff); <span class="comment">//repeat until we get signal from MMC.</span>00456   00457   <span class="keywordflow">if</span> ((c &amp; 0xfe)){ <span class="comment">//MMC returns something else than idle or busy signal</span>00458     <a class="code" href="mmc_8c.html#a7">ConsoleDecipherMMCResponse</a>(c);00459     <a class="code" href="board_8h.html#a29">MMC_XCS</a> = <a class="code" href="board_8h.html#a31">MMC_NOT_SELECTED</a>;00460 00461 <span class="preprocessor">#ifdef MMCDEBUG</span>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -