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

📄 mmc_8h.html

📁 MP3播放器源代码, VS1003B
💻 HTML
📖 第 1 页 / 共 3 页
字号:
00317     ConsoleWrite(<span class="stringliteral">"\rInitMMC ok.\r"</span>);00318   }00319 00320   <span class="comment">/* All OK return */</span>00321   <span class="keywordflow">return</span> 0; <span class="comment">//ok and MMC supports seek-before-read</span>00322 00323 }</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#a51" shape="rect" coords="673,58,713,82" alt=""><area href="mmc_8c.html#a3" shape="rect" coords="276,254,412,278" alt=""><area href="mmc_8c.html#a0" shape="rect" coords="500,158,596,182" alt=""><area href="mmc_8c.html#a9" shape="rect" coords="281,305,406,329" alt=""><area href="mmc_8c.html#a4" shape="rect" coords="304,57,384,81" alt=""><area href="mmc_8h.html#a2" shape="rect" coords="121,142,199,166" alt=""><area href="mmc_8c.html#a2" shape="rect" coords="505,206,590,230" alt=""><area href="mmc_8c.html#a1" shape="rect" coords="493,254,602,278" alt=""><area href="board_8h.html#a50" shape="rect" coords="656,206,730,230" alt=""><area href="mmc_8c.html#a6" shape="rect" coords="490,353,605,377" alt=""><area href="mmc_8c.html#a7" shape="rect" coords="247,105,441,129" 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#l00463">463</a> of file <a class="el" href="mmc_8c-source.html">mmc.c</a>.<p>References <a class="el" href="board_8h-source.html#l00178">MMCDeselect</a>, <a class="el" href="board_8h-source.html#l00175">MMCSelect</a>, <a class="el" href="mmc_8c-source.html#l00105">MmcWaitForData()</a>, <a class="el" href="mmc_8c-source.html#l00330">PerformBlockRead()</a>, <a class="el" href="board_8h-source.html#l00280">Public</a>, and <a class="el" href="board_8c-source.html#l00026">SPI8Clocks()</a>.<p>Referenced by <a class="el" href="mmc_8c-source.html#l00246">InitMMC()</a>, and <a class="el" href="storage_8c-source.html#l00110">ReadDiskSector()</a>.<p><pre class="fragment"><div>00463                                          {00464 00465   <span class="comment">// RED_LED = LED_ON; /* Disk Read LED on */</span>00466 00467   <a class="code" href="board_8h.html#a32">MMCSelect</a>();00468   <a class="code" href="mmc_8c.html#a1">MmcWaitForData</a>();00469   <a class="code" href="mmc_8c.html#a6">PerformBlockRead</a>();00470 00471   <span class="comment">/* generate SPI clock edges to finish up the command */</span>00472 00473   <a class="code" href="board_8h.html#a50">SPI8Clocks</a>(4); <span class="comment">//Send 8*4=32 clocks (4 ff's) to MMC to be nice.</span>00474   <a class="code" href="board_8h.html#a33">MMCDeselect</a>();00475   <a class="code" href="board_8h.html#a50">SPI8Clocks</a>(4); <span class="comment">//Again, give the poor MMC some clocks, it likes them.</span>00476 00477   <span class="comment">//RED_LED = LED_OFF; /* Disk Read LED off */</span>00478 00479   <span class="keywordflow">return</span> 0; <span class="comment">//ok return</span>00480 }</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#a50" 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>In English: Send the Read Sector command to MMC <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#l00397">ConsoleDecipherMMCResponse()</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="board_8h-source.html#l00280">Public</a>, <a class="el" href="mmc_8c-source.html#l00217">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#l00246">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   <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c, retries;00433 00434   retries = 0;00435   <span class="keywordflow">do</span>{00436     retries++;00437     <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>00438     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>,00439                  <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);00440     <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>00441 00442     <span class="comment">// If MMC works properly, it returns Busy (== Not idle) at this stage.    </span>00443     <span class="keywordflow">if</span> (c!=0x00){00444       <span class="keywordflow">if</span> (c != 0xff){ 00445         <span class="comment">//MMC returns something else than Busy or "Idle Bus", print what it is</span>00446         <a class="code" href="mmc_8c.html#a7">ConsoleDecipherMMCResponse</a>(c);00447       }00448       <span class="comment">// Something is wrong, take the standard action...</span>00449       <a class="code" href="mmc_8c.html#a4">RebootMMC</a>();00450       <span class="keywordflow">if</span> (retries &gt; 10){  00451         <span class="keywordflow">return</span> 7; <span class="comment">/* failed to execute mmc command */</span>00452       }00453     }00454   }<span class="keywordflow">while</span>(c!=0x00); <span class="comment">//repeat until we get busy signal from MMC.</span>00455     00456   <a class="code" href="board_8h.html#a33">MMCDeselect</a>();00457   00458   <span class="keywordflow">return</span> 0; <span class="comment">//ok return</span>00459 }</div></pre><p>Here is the call graph for this function:<p><center><img src="mmc_8h_a2_cgraph.png" border="0" usemap="#mmc_8h_a2_cgraph_map" alt=""></center><map name="mmc_8h_a2_cgraph_map"><area href="mmc_8c.html#a7" shape="rect" coords="270,9,465,33" alt="">

⌨️ 快捷键说明

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