?? vs10xx_8c.html
字號:
00315 }00316 }00317 <a class="code" href="board_8h.html#a11">GREEN_LED</a> = <a class="code" href="board_8h.html#a13">LED_OFF</a>;00318 00319 <span class="comment">/* Send 32 octets of disk block data to VS10xx */</span>00320 <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(*dataBufPtr++);00321 <a class="code" href="board_8h.html#a43">SPIWait</a>();00322 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00323 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00324 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00325 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00326 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00327 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00328 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00329 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00330 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00331 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00332 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00333 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00334 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00335 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00336 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00337 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00338 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00339 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00340 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00341 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00342 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00343 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00344 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00345 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00346 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00347 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00348 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00349 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00350 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00351 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00352 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(*dataBufPtr++);00353 <a class="code" href="board_8h.html#a43">SPIWait</a>();00354 }00355 00356 00357 <a class="code" href="board_8h.html#a43">SPIWait</a>();00358 <a class="code" href="board_8h.html#a8">Mp3DeselectData</a>();00359 }00360 00361 00362 <span class="keywordflow">return</span> 0; <span class="comment">//OK Exit</span>00363 }</div></pre><p>Here is the call graph for this function:<p><center><img src="vs10xx_8c_a6_cgraph.png" border="0" usemap="#vs10xx_8c_a6_cgraph_map" alt=""></center><map name="vs10xx_8c_a6_cgraph_map"><area href="player_8c.html#a12" shape="rect" coords="178,6,327,30" alt=""><area href="vs10xx_8h.html#a38" shape="rect" coords="382,32,494,56" alt=""><area href="aviplay_8c.html#a6" shape="rect" coords="228,105,278,129" alt=""><area href="storage_8h.html#a2" shape="rect" coords="387,129,489,153" alt=""><area href="storage_8h.html#a1" shape="rect" coords="173,204,333,228" alt=""><area href="vs10xx_8c.html#a5" shape="rect" coords="189,252,317,276" alt=""></map> </td> </tr></table><a class="anchor" name="a5" doxytag="vs10xx.c::SendZerosToVS10xx" ></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 SendZerosToVS10xx </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Send 2048 zeros. <p><dl compact><dt><b><a class="el" href="todo.html#_todo000008">Todo:</a></b></dt><dd>Timeouts for all DREQ busy loop waits!</dd></dl><p>Definition at line <a class="el" href="vs10xx_8c-source.html#l00178">178</a> of file <a class="el" href="vs10xx_8c-source.html">vs10xx.c</a>.<p>References <a class="el" href="board_8h-source.html#l00254">Temp::i</a>, <a class="el" href="board_8h-source.html#l00070">MP3_DREQ</a>, <a class="el" href="board_8h-source.html#l00061">Mp3DeselectData</a>, <a class="el" href="board_8h-source.html#l00058">Mp3SelectData</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="board_8c.html#a0">temp</a>.<p>Referenced by <a class="el" href="player_8c-source.html#l00724">PlayCurrentFile()</a>, and <a class="el" href="vs10xx_8c-source.html#l00202">PlayDiskSectors()</a>.<p><pre class="fragment"><div>00178 {00179 <a class="code" href="board_8h.html#a7">Mp3SelectData</a>();00180 <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(0);00181 <span class="keywordflow">for</span> (<a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a>=0; <a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a><1048; <a class="code" href="board_8c.html#a0">temp</a>.<a class="code" href="unionTemp.html#o1">i</a>++){ <span class="comment">/* TESTING 1048 TESTING */</span>00182 <span class="keywordflow">while</span> (!<a class="code" href="board_8h.html#a9">MP3_DREQ</a>)00183 ;00184 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0);00185 }00186 <a class="code" href="board_8h.html#a43">SPIWait</a>();00187 <a class="code" href="board_8h.html#a8">Mp3DeselectData</a>();00188 } </div></pre> </td> </tr></table><a class="anchor" name="a4" doxytag="vs10xx.c::VsSineTest" ></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 VsSineTest </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Execute VS1011/VS1002 Sine Test Function. <p><p>Definition at line <a class="el" href="vs10xx_8c-source.html#l00112">112</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#l00081">GREEN_LED</a>, <a class="el" href="board_8h-source.html#l00087">LED_OFF</a>, <a class="el" href="board_8h-source.html#l00084">LED_ON</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="board_8h-source.html#l00049">Mp3SelectControl</a>, <a class="el" href="board_8h-source.html#l00058">Mp3SelectData</a>, <a class="el" href="board_8h-source.html#l00078">RED_LED</a>, <a class="el" href="board_8h-source.html#l00235">SPIPutChar</a>, <a class="el" href="board_8h-source.html#l00238">SPIPutCharWithoutWaiting</a>, and <a class="el" href="board_8h-source.html#l00232">SPIWait</a>.<p><pre class="fragment"><div>00112 {00113 00114 <span class="comment">/* Reset MP3 chip */</span>00115 <a class="code" href="board_8h.html#a1">Mp3PutInReset</a>(); <span class="comment">/* Pull xRESET low -> hardware reset */</span>00116 <a class="code" href="board_8h.html#a51">Delay</a>(100); <span class="comment">/* 100 ms delay */</span>00117 00118 <span class="comment">/* Send dummy SPI byte to initialize SPI of Atmel microcontroller */</span>00119 <a class="code" href="board_8h.html#a45">SPIPutCharWithoutWaiting</a>(0xFF);00120 00121 <span class="comment">/* Un-reset MP3 chip */</span>00122 <a class="code" href="board_8h.html#a5">Mp3DeselectControl</a>(); <span class="comment">/* Pull xCS high */</span>00123 <a class="code" href="board_8h.html#a8">Mp3DeselectData</a>(); <span class="comment">/* Pull xDCS high */</span>00124 <a class="code" href="board_8h.html#a2">Mp3ReleaseFromReset</a>(); <span class="comment">/* Pull xRESET high */</span>00125 <a class="code" href="board_8h.html#a51">Delay</a>(100); <span class="comment">/* 100 ms delay */</span>00126 00127 <a class="code" href="board_8h.html#a11">GREEN_LED</a> = <a class="code" href="board_8h.html#a12">LED_ON</a>;00128 <a class="code" href="board_8h.html#a10">RED_LED</a> = <a class="code" href="board_8h.html#a12">LED_ON</a>;00129 00130 <span class="comment">/* VS10xx Application Notes, chapter 4.8 ---------------------------------*/</span>00131 <span class="comment">/* As an example, let's write value 0x0820 to register 00 byte by byte */</span>00132 <a class="code" href="board_8h.html#a4">Mp3SelectControl</a>(); <span class="comment">/* Now SPI writes go to SCI port */</span>00133 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x02); <span class="comment">/* Send SPI Byte, then wait for byte to be sent. */</span>00134 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x00); <span class="comment">/* 0x02 was WRITE command, 0x00 is register number */</span>00135 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x08); <span class="comment">/* This byte goes to MSB */</span>00136 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x20); <span class="comment">/* ..and this is LSB. (0x20=Allow Test Mode) */</span>00137 <a class="code" href="board_8h.html#a43">SPIWait</a>(); <span class="comment">/* Wait until Atmel MCU signals SPI write complete */</span>00138 <a class="code" href="board_8h.html#a5">Mp3DeselectControl</a>(); <span class="comment">/* Now SPI writes don't go to SCI port */</span>00139 00140 <span class="keywordflow">while</span> (!<a class="code" href="board_8h.html#a9">MP3_DREQ</a>) <span class="comment">/* Wait for DREQ = 1 */</span>00141 ; <span class="comment">/* Do nothing while waiting for DREQ = 1 */</span>00142 00143 <span class="comment">/* Send a Sine Test Header to Data port */</span>00144 <a class="code" href="board_8h.html#a7">Mp3SelectData</a>(); <span class="comment">/* Now SPI writes go to SDI port */</span>00145 00146 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x53); <span class="comment">/* - This is a special VLSI Solution test header - */</span>00147 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0xef); <span class="comment">/* - that starts a sine sound. It's good for - */</span>00148 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x6e); <span class="comment">/* - testing your code, the chip and also for - */</span>00149 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x44); <span class="comment">/* - seeing if your MP3 decoder was manufactured - */</span>00150 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x00); <span class="comment">/* - by VLSI Solution oy. ------------------------ */</span>00151 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x00);00152 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x00);00153 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x00);00154 <a class="code" href="board_8h.html#a43">SPIWait</a>();00155 <a class="code" href="board_8h.html#a8">Mp3DeselectData</a>();00156 00157 <a class="code" href="board_8h.html#a10">RED_LED</a> = <a class="code" href="board_8h.html#a13">LED_OFF</a>;00158 <a class="code" href="board_8h.html#a51">Delay</a> (500); <span class="comment">/* 500 ms delay */</span>00159 <a class="code" href="board_8h.html#a11">GREEN_LED</a> = <a class="code" href="board_8h.html#a13">LED_OFF</a>;00160 00161 <span class="comment">/* Stop the sine test sound */</span>00162 <a class="code" href="board_8h.html#a7">Mp3SelectData</a>();00163 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x45);00164 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x78);00165 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x69);00166 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x74);00167 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x00);00168 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x00);00169 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x00);00170 <a class="code" href="board_8h.html#a44">SPIPutChar</a>(0x00);00171 <a class="code" href="board_8h.html#a43">SPIWait</a>();00172 <a class="code" href="board_8h.html#a8">Mp3DeselectData</a>();00173 00174 <a class="code" href="board_8h.html#a51">Delay</a>(500); <span class="comment">/* 500 ms delay */</span>00175 } </div></pre><p>Here is the call graph for this function:<p><center><img src="vs10xx_8c_a4_cgraph.png" border="0" usemap="#vs10xx_8c_a4_cgraph_map" alt=""></center><map name="vs10xx_8c_a4_cgraph_map"><area href="board_8h.html#a51" shape="rect" coords="144,7,184,30" alt=""></map> </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 + -