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

📄 board_8c.html

📁 MP3 Player Source Code
💻 HTML
字号:
<!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>board.c File Reference</h1>Board related utility functions such as delay().  <a href="#_details">More...</a><p><code>#include "<a class="el" href="board_8h-source.html">board.h</a>"</code><br><code>#include "<a class="el" href="lcd_8h-source.html">lcd.h</a>"</code><br><p>Include dependency graph for board.c:<p><center><img src="board_8c__incl.png" border="0" usemap="#board.c_map" alt="Include dependency graph"></center><map name="board.c_map"><area href="board_8h.html" shape="rect" coords="71,93,121,117" alt=""><area href="lcd_8h.html" shape="rect" coords="172,93,209,117" alt=""><area href="lcdfonts_8h.html" shape="rect" coords="246,18,310,42" alt=""></map><p><a href="board_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>Classes</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>union &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="unionTemp.html">Temp</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generic temp variable for non-reentrant main routines.  <a href="unionTemp.html#_details">More...</a><br><br></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="board_8c.html#a1">SPIGetChar</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send 8 ones to SPI bus and receive the result byte.  <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="board_8c.html#a2">SPI8Clocks</a> (unsigned char nClocks)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send nClocks x 8 clock transitions with MOSI=1 (0xff).  <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="board_8c.html#a3">Delay</a> (int milliseconds)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Busy loop delay function.  <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="board_8c.html#a4">InitBoard</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Startup initialization of the microcontroller board.  <a href="#a4"></a><br><br></td></tr><tr><td colspan=2><br><h2>Variables</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="unionTemp.html">Temp</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="board_8c.html#a0">temp</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generic temp variable for non-reentrant main routines.  <a href="#a0"></a><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Board related utility functions such as delay(). <p><p>Definition in file <a class="el" href="board_8c-source.html">board.c</a>.<hr><h2>Function Documentation</h2><a class="anchor" name="a3" doxytag="board.c::Delay" ></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 Delay           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">int&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>milliseconds</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>Busy loop delay function. <p>Creates n times 1 ms hardware delays <p>Definition at line <a class="el" href="board_8c-source.html#l00035">35</a> of file <a class="el" href="board_8c-source.html">board.c</a>.<p>References <a class="el" href="board_8h-source.html#l00192">InitiateDelay</a>, and <a class="el" href="board_8h-source.html#l00203">WaitOutDelay</a>.<p>Referenced by <a class="el" href="mmc_8c-source.html#l00249">InitMMC()</a>, <a class="el" href="lcd_8c-source.html#l00185">LcdPrintGenericResult()</a>, <a class="el" href="player_8c-source.html#l00260">LoadPatch()</a>, <a class="el" href="vs10xx_8c-source.html#l00069">Mp3Reset()</a>, <a class="el" href="vs10xx_8c-source.html#l00035">Mp3SoftReset()</a>, <a class="el" href="mmc_8c-source.html#l00221">RebootMMC()</a>, <a class="el" href="record_8c-source.html#l00101">Record()</a>, and <a class="el" href="vs10xx_8c-source.html#l00112">VsSineTest()</a>.<p><pre class="fragment"><div>00035                             {00036   <span class="keywordflow">for</span> (;milliseconds;milliseconds--){  <span class="comment">/* for n times do: */</span>00037     <a class="code" href="board_8h.html#a38">InitiateDelay</a> (1000);00038     <a class="code" href="board_8h.html#a39">WaitOutDelay</a>(); <span class="comment">/* 1 ms delay */</span>00039     }00040 }</div></pre>    </td>  </tr></table><a class="anchor" name="a4" doxytag="board.c::InitBoard" ></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 InitBoard           </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>Startup initialization of the microcontroller board. <p><p>Definition at line <a class="el" href="board_8c-source.html#l00043">43</a> of file <a class="el" href="board_8c-source.html">board.c</a>.<p>References <a class="el" href="board_8h-source.html#l00192">InitiateDelay</a>, <a class="el" href="board_8h-source.html#l00150">MMC_OFF</a>, and <a class="el" href="board_8h-source.html#l00025">MP3_XRESET</a>.<p>Referenced by <a class="el" href="player_8c-source.html#l00733">main()</a>.<p><pre class="fragment"><div>00044 {00045   AUXR   = 0x11;           <span class="comment">/* Take full memory into use */</span>00046   <a class="code" href="board_8h.html#a0">MP3_XRESET</a> = 0;          <span class="comment">/* Put the MP3 chip into reset */</span>00047   <a class="code" href="board_8h.html#a28">MMC_OFF</a> = 1;             <span class="comment">/* Turn mmc power off        */</span>00048 00049 00050   SPCON  = 0xF2;    <span class="comment">/* Set slow spi clock        */</span>00051   CKCON0 = 0x01;    <span class="comment">/* CPU x 2, timer2 x 1       */</span>00052   IEN0   = 0;       <span class="comment">/* Disable all interrupts    */</span>00053   00054   BDRCON = 0x1F;    <span class="comment">/* Set uart for  115200,8n1  */</span>00055   PCON   = 0x80;    <span class="comment">/* Double Baud Rate */</span>00056   BRL    = 248;00057   SCON   = 0x50;    <span class="comment">/* Serial Port Control Register */</span>00058   TI     = 1;00059  00060   ConsoleWrite (<span class="stringliteral">"\r\r\rBoard: Console is up.\r"</span>);00061 00062   00063   TMOD = 1;00064 00065 00066   RCAP2H = 143;     <span class="comment">/* Set timer2 for 128 interrupts in second */</span>00067   RCAP2L = 89;00068   TH2    = 143;00069   TL2    = 89;00070   T2CON  = 0;00071   T2MOD  = 0;00072 00073   TR2 = 1;          <span class="comment">/* Start timer2               */</span>00074   <span class="comment">// ET2 = 1;          /* Enable timer2 interrupts   */</span>00075 00076   P2 = 0xEF;00077   P3 = 0xFF;00078 00079   <a class="code" href="board_8h.html#a38">InitiateDelay</a>(0); <span class="comment">/* Initialize the Delay System */</span>00080 00081   ConsoleWrite (<span class="stringliteral">"Init: Board; supports: AT89C51RD2, MMC, VS10xx, RS232\r"</span>);00082 00083 00084   <span class="comment">// EA  = 1;          /* Global enable for interrupts */</span>00085 }</div></pre>    </td>  </tr></table><a class="anchor" name="a2" doxytag="board.c::SPI8Clocks" ></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 SPI8Clocks           </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>nClocks</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>Send nClocks x 8 clock transitions with MOSI=1 (0xff). <p><p>Definition at line <a class="el" href="board_8c-source.html#l00026">26</a> of file <a class="el" href="board_8c-source.html">board.c</a>.<p>References <a class="el" href="board_8h-source.html#l00220">SPIPutCharWithoutWaiting</a>, and <a class="el" href="board_8h-source.html#l00214">SPIWait</a>.<p>Referenced by <a class="el" href="mmc_8c-source.html#l00019">MmcCommand()</a>, <a class="el" href="mmc_8c-source.html#l00102">MmcWaitForData()</a>, <a class="el" href="mmc_8c-source.html#l00477">ReadPhysicalSector()</a>, and <a class="el" href="mmc_8c-source.html#l00502">WritePhysicalSector()</a>.<p><pre class="fragment"><div>00026                                       {00027   <span class="keywordflow">while</span> (nClocks--){00028     <a class="code" href="board_8h.html#a43">SPIPutCharWithoutWaiting</a>(0xff);00029     <a class="code" href="board_8h.html#a41">SPIWait</a>();00030   }00031 }</div></pre>    </td>  </tr></table><a class="anchor" name="a1" doxytag="board.c::SPIGetChar" ></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 SPIGetChar           </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>Send 8 ones to SPI bus and receive the result byte. <p><p>Definition at line <a class="el" href="board_8c-source.html#l00018">18</a> of file <a class="el" href="board_8c-source.html">board.c</a>.<p>References <a class="el" href="board_8h-source.html#l00223">SPI_RESULT_BYTE</a>, <a class="el" href="board_8h-source.html#l00220">SPIPutCharWithoutWaiting</a>, and <a class="el" href="board_8h-source.html#l00214">SPIWait</a>.<p>Referenced by <a class="el" href="mmc_8c-source.html#l00399">ConsoleDecipherMMCResponse()</a>, <a class="el" href="mmc_8c-source.html#l00019">MmcCommand()</a>, <a class="el" href="mmc_8c-source.html#l00169">MmcGetData()</a>, <a class="el" href="mmc_8c-source.html#l00102">MmcWaitForData()</a>, and <a class="el" href="mmc_8c-source.html#l00502">WritePhysicalSector()</a>.<p><pre class="fragment"><div>00018                           {00019   <a class="code" href="board_8h.html#a43">SPIPutCharWithoutWaiting</a>(0xff); <span class="comment">/* send 0xff */</span>00020   <a class="code" href="board_8h.html#a41">SPIWait</a>(); <span class="comment">/* wait for the byte to transfer */</span>00021   <span class="keywordflow">return</span> <a class="code" href="board_8h.html#a44">SPI_RESULT_BYTE</a>; <span class="comment">/* Return the received byte */</span>00022 }</div></pre>    </td>  </tr></table><hr><h2>Variable Documentation</h2><a class="anchor" name="a0" doxytag="board.c::temp" ></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"> union <a class="el" href="unionTemp.html">Temp</a>  <a class="el" href="board_8h.html#a46">temp</a>          </td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Generic temp variable for non-reentrant main routines. <p><p>Referenced by <a class="el" href="filesys_8c-source.html#l00401">BuildFragmentTable()</a>, <a class="el" href="filesys_8c-source.html#l00806">FatInitGlobals()</a>, <a class="el" href="aviplay_8c-source.html#l00015">GetAVIBlock()</a>, <a class="el" href="mmc_8c-source.html#l00249">InitMMC()</a>, <a class="el" href="player_8c-source.html#l00260">LoadPatch()</a>, <a class="el" href="player_8c-source.html#l00733">main()</a>, <a class="el" href="filesys_8c-source.html#l00610">OpenFile()</a>, <a class="el" href="record_8c-source.html#l00101">Record()</a>, <a class="el" href="vs10xx_8c-source.html#l00178">SendZerosToVS10xx()</a>, <a class="el" href="display_8c-source.html#l00058">UpdateDisplay()</a>, and <a class="el" href="filesys_8c-source.html#l00129">WriteClusterChain()</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 + -