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

📄 storage_8h.html

📁 MP3 Player Source Code
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>VLSI Solution Oy Evaluation MP3 Player Source Code Documentation</title><link href="doxygen.css" rel="stylesheet" type="text/css"><img src="vlsi_small.gif" hspace="20" bordercolor="#ffffff"  alt="VLSI Solution Oy"><b>VLSI Solution Oy Evaluation MP3 Player Source Code Documentation</b><p></p></head><body><!-- Generated by Doxygen 1.3.7 --><div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div><h1>storage.h File Reference</h1>Disk read/write routines.  <a href="#_details">More...</a><p><p>This graph shows which files directly or indirectly include this file:<p><center><img src="storage_8h__dep__incl.png" border="0" usemap="#storage.hdep_map" alt="Included by dependency graph"></center><map name="storage.hdep_map"><area href="filesys_8c.html" shape="rect" coords="6,18,62,42" alt=""><area href="player_8c.html" shape="rect" coords="86,18,140,42" alt=""><area href="record_8c.html" shape="rect" coords="164,18,217,42" alt=""><area href="storage_8c.html" shape="rect" coords="241,18,302,42" alt=""><area href="vs10xx_8c.html" shape="rect" coords="326,18,385,42" alt=""></map><p><a href="storage_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="storage_8h.html#a0">InitStorage</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the storage system.  <a href="#a0"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="storage_8h.html#a1">PrepareToReadDiskSector</a> (unsigned long sectorN)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Give a hint to the storage that the next sector we will read is sectorN.  <a href="#a1"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="storage_8h.html#a2">ReadDiskSector</a> (unsigned long sectorN)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read a disk sector to global buffer.  <a href="#a2"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="storage_8h.html#a3">DumpDiskSector</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Do a hex dump on console of current sector in memory.  <a href="#a3"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="storage_8h.html#a4">WriteDiskSector</a> (unsigned long sectorN)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write current buffer memory to sectorN.  <a href="#a4"></a><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Disk read/write routines. <p>Implemented Disk interface: MMC. This module reads and writes blocks of disk data to/from a global buffer. The logical place to define these globals is where they are needed most: the module that contains the file system functions. By default that means <a class="el" href="filesys_8c.html">filesys.c</a>. These globals are needed (see <a class="el" href="filesys_8h.html">filesys.h</a>):<ul><li>sectorAddress - contains the absolute disk sector number</li><li>diskSect[512] for data read/write</li></ul><p>Definition in file <a class="el" href="storage_8h-source.html">storage.h</a>.<hr><h2>Function Documentation</h2><a class="anchor" name="a3" doxytag="storage.h::DumpDiskSector" ></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"> void DumpDiskSector           </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>Do a hex dump on console of current sector in memory. <p><p>Definition at line <a class="el" href="storage_8c-source.html#l00141">141</a> of file <a class="el" href="storage_8c-source.html">storage.c</a>.<p>References <a class="el" href="buffer_8h-source.html#l00107">DiskBlock::Raw::buf</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="board_8h-source.html#l00262">Public</a>, <a class="el" href="unionDiskBlock.html#o1">DiskBlock::raw</a>, and <a class="el" href="buffer_8c-source.html#l00015">sectorAddress</a>.<p><pre class="fragment"><div>00141                             {00142   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ha,la;00143   00144   ConsoleWrite(<span class="stringliteral">"\rDiskBlock "</span>);00145   ConsolePutUInt(<a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a>);00146   ConsoleWrite(<span class="stringliteral">":\r"</span>);00147   <span class="keywordflow">for</span> (ha=0; ha&lt;32; ha++){00148     ConsolePutHex16 ((ha&lt;&lt;4));00149     ConsoleWrite(<span class="stringliteral">": "</span>);00150     <span class="keywordflow">for</span> (la=0; la&lt;16; la++){00151       ConsolePutHex8(<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>[(ha&lt;&lt;4)+la]);00152       ConsolePutChar(<span class="charliteral">' '</span>);00153       <span class="keywordflow">if</span> (la==7){ 00154         ConsolePutChar(<span class="charliteral">' '</span>);00155       }00156     }00157     ConsolePutChar(<span class="charliteral">' '</span>);00158     <span class="keywordflow">for</span> (la=0; la&lt;16; la++){00159       <span class="keywordflow">if</span> ((<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>[(ha&lt;&lt;4)+la]) &gt; 30){00160         ConsolePutChar(<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>[(ha&lt;&lt;4)+la]);00161       }<span class="keywordflow">else</span>{00162         ConsolePutChar(<span class="charliteral">'.'</span>);00163       }00164     }00165     ConsolePutChar(<span class="charliteral">'\r'</span>);00166   } 00167 }</div></pre>    </td>  </tr></table><a class="anchor" name="a0" doxytag="storage.h::InitStorage" ></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 InitStorage           </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>Initialize the storage system. <p><ul><li>returns 0 when successful</li><li>returns 1 if mmc was not properly initialized </li></ul><p>Definition at line <a class="el" href="storage_8c-source.html#l00043">43</a> of file <a class="el" href="storage_8c-source.html">storage.c</a>.<p>References <a class="el" href="mmc_8c-source.html#l00249">InitMMC()</a>, <a class="el" href="board_8h-source.html#l00262">Public</a>, and <a class="el" href="mmc_8h-source.html#l00008">storageFlags</a>.<p>Referenced by <a class="el" href="filesys_8c-source.html#l00923">InitFileSystem()</a>.<p><pre class="fragment"><div>00043                                   {00044 00045   <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> result;00046 00047   ConsoleWrite (<span class="stringliteral">"Init: Storage v2: supports: MMC,SD,miniSD in SPI mode\r"</span>);00048 00049   result=<a class="code" href="mmc_8c.html#a5">InitMMC</a>();00050   <span class="keywordflow">if</span> (result==0x0e){ <span class="comment">//ok, no support for seek-before-read</span>00051     ConsoleWrite(<span class="stringliteral">"Storage initialized in seek-and-read mode.\r"</span>);00052     <a class="code" href="mmc_8h.html#a0">storageFlags</a> = 1;00053     <span class="keywordflow">return</span> 0;00054   }00055 00056   <span class="keywordflow">if</span> (result){ <span class="comment">//error resulted in MMC startup</span>00057     ConsoleWrite(<span class="stringliteral">"InitStorage: Can't start MMC. "</span>);00058     ConsolePutHex8(result);00059     ConsolePutChar(13);00060     <a class="code" href="mmc_8h.html#a0">storageFlags</a> = 4;00061     <span class="keywordflow">return</span> 1; <span class="comment">//MMC Init Error</span>00062   }00063 00064   ConsoleWrite(<span class="stringliteral">"InitStorage ok.\r"</span>);00065   <a class="code" href="mmc_8h.html#a0">storageFlags</a> = 0;00066   <span class="keywordflow">return</span> 0;00067 00068 }</div></pre><p>Here is the call graph for this function:<p><center><img src="storage_8h_a0_cgraph.png" border="0" usemap="#storage_8h_a0_cgraph_map" alt=""></center><map name="storage_8h_a0_cgraph_map"><area href="mmc_8c.html#a5" shape="rect" coords="137,132,193,156" alt=""><area href="board_8h.html#a49" shape="rect" coords="632,35,672,59" alt=""><area href="mmc_8c.html#a3" shape="rect" coords="418,200,554,224" alt=""><area href="mmc_8c.html#a0" shape="rect" coords="604,169,700,193" alt=""><area href="mmc_8c.html#a9" shape="rect" coords="243,156,368,180" alt=""><area href="mmc_8c.html#a4" shape="rect" coords="446,65,526,89" alt=""><area href="mmc_8h.html#a2" shape="rect" coords="267,108,344,132" alt=""></map>    </td>  </tr></table><a class="anchor" name="a1" doxytag="storage.h::PrepareToReadDiskSector" ></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 PrepareToReadDiskSector           </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>

⌨️ 快捷键说明

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