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

📄 vs10xx_8c.html

📁 MP3播放器源代码, VS1003B
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!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>vs10xx.c File Reference</h1>Functions for interfacing with the mp3 player chip.  <a href="#_details">More...</a><p><code>#include "<a class="el" href="vs10xx_8h-source.html">vs10xx.h</a>"</code><br><code>#include "<a class="el" href="lcd_8h-source.html">lcd.h</a>"</code><br><code>#include "<a class="el" href="filesys_8h-source.html">filesys.h</a>"</code><br><code>#include "<a class="el" href="storage_8h-source.html">storage.h</a>"</code><br><code>#include "<a class="el" href="ui_8h-source.html">ui.h</a>"</code><br><code>#include "<a class="el" href="aviplay_8c-source.html">aviplay.c</a>"</code><br><p>Include dependency graph for vs10xx.c:<p><center><img src="vs10xx_8c__incl.png" border="0" usemap="#vs10xx.c_map" alt="Include dependency graph"></center><map name="vs10xx.c_map"><area href="vs10xx_8h.html" shape="rect" coords="6,93,65,117" alt=""><area href="board_8h.html" shape="rect" coords="10,18,61,42" alt=""><area href="filesys_8h.html" shape="rect" coords="89,93,145,117" alt=""><area href="lcd_8h.html" shape="rect" coords="169,93,206,117" alt=""><area href="lcdfonts_8h.html" shape="rect" coords="245,18,309,42" alt=""><area href="buffer_8h.html" shape="rect" coords="85,18,133,42" alt=""><area href="storage_8h.html" shape="rect" coords="230,93,291,117" alt=""><area href="ui_8h.html" shape="rect" coords="315,93,353,117" alt=""><area href="aviplay_8c.html" shape="rect" coords="377,93,433,117" alt=""></map><p><a href="vs10xx_8c-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>Defines</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="vs10xx_8c.html#a0">AVIPLAY</a></td></tr><tr><td colspan=2><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="vs10xx_8c.html#a1">Mp3ReadRegister</a> (unsigned char addressbyte)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read the 16-bit value of a VS10xx register.  <a href="#a1"></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="vs10xx_8c.html#a2">Mp3SoftReset</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Soft Reset of VS10xx (Between songs).  <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="vs10xx_8c.html#a3">Mp3Reset</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reset VS10xx.  <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="vs10xx_8c.html#a4">VsSineTest</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Execute VS1011/VS1002 Sine Test Function.  <a href="#a4"></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="vs10xx_8c.html#a5">SendZerosToVS10xx</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send 2048 zeros.  <a href="#a5"></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="vs10xx_8c.html#a6">PlayDiskSectors</a> (unsigned int nSectorsToPlay)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Play disk sectors from disk.  <a href="#a6"></a><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Functions for interfacing with the mp3 player chip. <p><dl compact><dt><b><a class="el" href="todo.html#_todo000007">Todo:</a></b></dt><dd>safe rewind <p>VS1003 WMA "wma-bytes-left" variable adjustment at ff/rew </dd></dl><p>Definition in file <a class="el" href="vs10xx_8c-source.html">vs10xx.c</a>.<hr><h2>Define Documentation</h2><a class="anchor" name="a0" doxytag="vs10xx.c::AVIPLAY" ></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"> #define AVIPLAY          </td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><p>Definition at line <a class="el" href="vs10xx_8c-source.html#l00191">191</a> of file <a class="el" href="vs10xx_8c-source.html">vs10xx.c</a>.    </td>  </tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="a1" doxytag="vs10xx.c::Mp3ReadRegister" ></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 int Mp3ReadRegister           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">unsigned char&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>addressbyte</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>Read the 16-bit value of a VS10xx register. <p><p>Definition at line <a class="el" href="vs10xx_8c-source.html#l00017">17</a> of file <a class="el" href="vs10xx_8c-source.html">vs10xx.c</a>.<p>References <a class="el" href="board_8h-source.html#l00052">Mp3DeselectControl</a>, <a class="el" href="board_8h-source.html#l00049">Mp3SelectControl</a>, <a class="el" href="board_8h-source.html#l00241">SPI_RESULT_BYTE</a>, <a class="el" href="board_8h-source.html#l00235">SPIPutChar</a>, <a class="el" href="board_8h-source.html#l00238">SPIPutCharWithoutWaiting</a>, <a class="el" href="board_8h-source.html#l00232">SPIWait</a>, and <a class="el" href="vs10xx_8h-source.html#l00016">VS_READ_COMMAND</a>.<p>Referenced by <a class="el" href="player_8c-source.html#l00332">AvailableProcessorTime()</a>, <a class="el" href="vs10xx_8c-source.html#l00202">PlayDiskSectors()</a>, <a class="el" href="record_8c-source.html#l00101">Record()</a>, and <a class="el" href="player_8c-source.html#l00290">ScreenSetPlayTime()</a>.<p><pre class="fragment"><div>00017                                                         {00018   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> resultvalue = 0;00019 00020   <a class="code" href="board_8h.html#a4">Mp3SelectControl</a>();00021   <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(VS_READ_COMMAND);00022   <a class="code" href="board_8h.html#a44">SPIPutChar</a>((addressbyte));00023   <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0xff);00024   <a class="code" href="board_8h.html#a43">SPIWait</a>();00025   resultvalue = (<a class="code" href="board_8h.html#a46">SPI_RESULT_BYTE</a>) &lt;&lt; 8;00026   <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(0xff);00027   <a class="code" href="board_8h.html#a43">SPIWait</a>();00028   resultvalue |= (<a class="code" href="board_8h.html#a46">SPI_RESULT_BYTE</a>);00029   <a class="code" href="board_8h.html#a5">Mp3DeselectControl</a>();00030   <span class="keywordflow">return</span> resultvalue;00031 }</div></pre>    </td>  </tr></table><a class="anchor" name="a3" doxytag="vs10xx.c::Mp3Reset" ></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 Mp3Reset           </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>Reset VS10xx. <p><p>Definition at line <a class="el" href="vs10xx_8c-source.html#l00069">69</a> of file <a class="el" href="vs10xx_8c-source.html">vs10xx.c</a>.<p>References <a class="el" href="board_8c-source.html#l00036">Delay()</a>, <a class="el" href="board_8h-source.html#l00070">MP3_DREQ</a>, <a class="el" href="board_8h-source.html#l00052">Mp3DeselectControl</a>, <a class="el" href="board_8h-source.html#l00061">Mp3DeselectData</a>, <a class="el" href="board_8h-source.html#l00038">Mp3PutInReset</a>, <a class="el" href="board_8h-source.html#l00041">Mp3ReleaseFromReset</a>, <a class="el" href="vs10xx_8h-source.html#l00078">Mp3SetVolume</a>, <a class="el" href="vs10xx_8c-source.html#l00035">Mp3SoftReset()</a>, <a class="el" href="vs10xx_8h-source.html#l00068">Mp3WriteRegister</a>, <a class="el" href="vs10xx_8h-source.html#l00024">SPI_AUDATA</a>, <a class="el" href="vs10xx_8h-source.html#l00022">SPI_CLOCKF</a>, <a class="el" href="board_8h-source.html#l00238">SPIPutCharWithoutWaiting</a>, and <a class="el" href="board_8h-source.html#l00228">SPISetFastClock</a>.<p>Referenced by <a class="el" href="player_8c-source.html#l00765">main()</a>, and <a class="el" href="record_8c-source.html#l00101">Record()</a>.<p><pre class="fragment"><div>00069                {00070 00071   <a class="code" href="board_8h.html#a1">Mp3PutInReset</a>();00072   <a class="code" href="board_8h.html#a51">Delay</a>(1);00073 00074   <span class="comment">/* Send dummy SPI byte to initialize SPI */</span>00075   <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(0xFF);00076 00077   <span class="comment">/* Un-reset MP3 chip */</span>00078   <a class="code" href="board_8h.html#a5">Mp3DeselectControl</a>();00079   <a class="code" href="board_8h.html#a8">Mp3DeselectData</a>();00080   <a class="code" href="board_8h.html#a2">Mp3ReleaseFromReset</a>();00081   <a class="code" href="vs10xx_8h.html#a33">Mp3SetVolume</a>(0xff,0xff);00082   00083   <span class="comment">/* Set clock register, doubler etc. */</span>00084 <span class="preprocessor">#ifdef VS1003</span>00085 <span class="preprocessor"></span>  <a class="code" href="vs10xx_8h.html#a32">Mp3WriteRegister</a>(SPI_CLOCKF, 0xa6, 0x96); <span class="comment">//oli 0xa66c</span>00086 <span class="preprocessor">#else</span>00087 <span class="preprocessor"></span>  <a class="code" href="vs10xx_8h.html#a32">Mp3WriteRegister</a>(SPI_CLOCKF, 156, 204);00088 <span class="preprocessor">#endif</span>00089 <span class="preprocessor"></span>  00090   <span class="comment">/* Wait for DREQ */</span>00091   <span class="keywordflow">while</span> (!<a class="code" href="board_8h.html#a9">MP3_DREQ</a>)00092     ;00093   00094   <span class="comment">/* Slow sample rate for slow analog part startup */</span>00095   <a class="code" href="vs10xx_8h.html#a32">Mp3WriteRegister</a>(SPI_AUDATA, 0, 10); <span class="comment">/* 10 Hz */</span>00096   <a class="code" href="board_8h.html#a51">Delay</a>(100);00097 00098   <span class="comment">/* Switch on the analog parts */</span>00099   <a class="code" href="vs10xx_8h.html#a33">Mp3SetVolume</a>(0xfe,0xfe);00100   <a class="code" href="vs10xx_8h.html#a32">Mp3WriteRegister</a> (SPI_AUDATA, 31, 64); <span class="comment">/* 8kHz */</span>00101   <a class="code" href="vs10xx_8h.html#a33">Mp3SetVolume</a>(20,20);00102   <a class="code" href="vs10xx_8c.html#a2">Mp3SoftReset</a>();00103   <a class="code" href="board_8h.html#a42">SPISetFastClock</a>();00104   00105 00106   ConsoleWrite (<span class="stringliteral">"Init: VS10XX\r"</span>);00107 00108 }</div></pre><p>Here is the call graph for this function:<p><center><img src="vs10xx_8c_a3_cgraph.png" border="0" usemap="#vs10xx_8c_a3_cgraph_map" alt=""></center><map name="vs10xx_8c_a3_cgraph_map">

⌨️ 快捷键说明

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