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

📄 index.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="qindexHL" 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>VLSIModularPlayer Documentation</h1><p><h3 align="center">0.6BetaRelease44 </h3>This is a preliminary version of the new MP3 player evaluation kit source code. Some bugs still exist.<p>This is pure C code. No inline assembly. It compiles with SDCC 2.4.0. Upload with Atmel Flip. Connect a terminal with settings 115200bps,N81 to the serial port to see the console output.<p>The code is written for VLSI Evakit 1.5-1.6 that has VS1011/1002 and AT89C51RD2 microcontroller. Now also Evakit 2.0-2.5 with VS1011, VS1002 or VS1003 is supported. It should be easily portable for other microcontrollers.<p>All microcontroller/pcb -specific definitions should be in <a class="el" href="board_8h.html">board.h</a> and <a class="el" href="board_8c.html">board.c</a> but some board specific features may still lurk in the code elsewhere. Due to SDCC requirements, interrupts are defined in <a class="el" href="player_8c.html">player.c</a> (main file). They are of course board/cpu dependent.<p>Throughout the code, SDCC memory allocation pragmas "code" "data" and "xdata" are used, sorry. "Code" allocates from ROM, "data" allocates from fast RAM, "xdata" allocates from slow RAM. You may need to remove/adjust these to make code compatible with your compiler.<p>It is strongly suggested that you use the free SDCC 2.4.0 to compile the code. SDCC 2.5.0 fails to compile the code: Although it has advantages over v2.4, it tries to allocate more extra temporary memory than is available if you compile all the modules (incl. recording).<p><b>How to get started</b><p><ul><li>Look at "File list" to see what kind of modules are in the project.</li><li>Look at <a class="el" href="vs10xx_8c.html">vs10xx.c</a> and <a class="el" href="vs10xx_8h.html">vs10xx.h</a> file documentations to see how the vs10xx is reset and how to send MP3 data to it (<a class="el" href="vs10xx_8c.html#a6">PlayDiskSectors()</a>).</li><li>Function <a class="el" href="player_8c.html#a12">AvailableProcessorTime()</a> handles the user interface. It is called by <a class="el" href="vs10xx_8c.html#a6">PlayDiskSectors()</a> whenever the player seems to have some free time. Additionally, a timer interrupt routine sets the <b>userInterfaceDelayElapsed</b> flag every 50ms or so. To avoid unnecessary CPU load, <a class="el" href="player_8c.html#a12">AvailableProcessorTime()</a> checks this flag and updates display etc only when this flag is set.</li><li>The user interface commands the player routine by setting a special state variable <b>playingState</b>. For instance if the user pushes a "Next Song" button, the ui should set <b>playingState</b> to <em>PS_NEXT_SONG</em>. <a class="el" href="vs10xx_8c.html#a6">PlayDiskSectors()</a> detects this, stops playing and returns to caller.</li><li>Much of the main functionality is still in <a class="el" href="player_8c.html">player.c</a> and <a class="el" href="player_8c.html#a14">main()</a>. Much of it will be transferred to a new file ui.c at some time.</li></ul><p>The description of how the program works and the module structure will be written here soon. Please check <a href="http://www.vlsi.fi/">http://www.vlsi.fi/</a> often to see if the final code is released. Email to <a href="mailto:mp3@vlsi.fi">mp3@vlsi.fi</a> about bugs.<p><b>Changes in version 0.5:</b><p>Filesystem and Storage are affected. Code has been added to handle new MMC cards with manufacturer id 21 and possibly others that seem to (sometimes) require resetting CRC calculation before they agree to work. Storage.c is divided into submodules <a class="el" href="storage_8c.html">storage.c</a> and <a class="el" href="mmc_8c.html">mmc.c</a> and a new file <a class="el" href="buffer_8c.html">buffer.c</a> is created to hold the global I/O buffer. This clarifies the code a lot. Lots of documentation is added to MMC and filing system functions, do yourself a favor and read it through.<p>In <a class="el" href="storage_8c.html">storage.c</a>, <a class="el" href="mmc_8c.html">mmc.c</a> and <a class="el" href="filesys_8c.html">filesys.c</a> a "dummy" declarator Public is added in declarations for functions that are called from outside the module and thus form module interface. It has no code effect in C but is a reminder for the programmer that the functions need to be adjusted carefully.<p>Storage.c is now a "middle-level" disk handler that takes advantage of lower level functions in <a class="el" href="mmc_8c.html">mmc.c</a>. It handles decisions of when to seek based on testing whether the underlying storage module supports separate seeks before reads. A new function <a class="el" href="storage_8c.html#a2">PrepareToReadDiskSector()</a> is for telling the storage that it can do a seek now if the storage supports it.<p>Adding support for different storage media that MMC is easy: only <a class="el" href="mmc_8c.html">mmc.c</a> needs to be rewritten. Currently it only has 3 public functions: Init, Seek sector and Read sector. As the code uses ONLY the address granularity of 512 bytes, called a "disk sector", supporting hard disks etc should be very simple.<p><b>Support for compiling under Windows:</b><p>The code is natively developed under Linux and Makefile for GNU Make is included. Now also .bat files for compiling in Dos window under Win32 are included, plus a readme.txt file. Use them at your own risk :)<p><b>Changes in version 0.6</b><p>The major improvement is adding recording support. Recording for VS1003 is supported. See the <a class="el" href="record_8c.html#a3">Record()</a> function documentation for instructions. The <a class="el" href="record_8c.html#a3">Record()</a> function can only create a single file fragment. If a fragment boundary is reached, recording continues to a new file. Also there is an experimental function PlayAVI() in module <a class="el" href="aviplay_8c.html">aviplay.c</a> that often succeeds in demuxing an avifile and sending just the audio stream for decoding.<p>Much of the FAT code is rewritten for speedups.<p><dl compact><dt><b><a class="el" href="todo.html#_todo000002">Todo:</a></b></dt><dd>VFAT long file names, </dd></dl><dl compact><dt><b>Remarks:</b></dt><dd>If you are usind SDCC 2.4.0 and you need just a little bit of more DSEG memory (now how on Earth that might happen...) you can hand-allocate global variables to unused addresses 0x08..0x1F, for instance: declaring <pre> data at 0x08 unsigned int myVariable; </pre> would place myVariable in DSEG addresses 0x08..0x09.</dd></dl>Note for HyperTerminal users: Check the "Append Line Feeds" checkbox in terminal settings -&gt; ascii setup.<p>Example output to console: When the code runs it prints out something like: (from a little older version) <pre></pre><p><pre> Board: Console is up. Init: Board; supports: AT89C51RD2, MMC, VS10xx, RS232</pre><p><pre> VLSI Modular Player Starting up.</pre><p><pre> Init: Filesystem; supports: MBR, FAT16, FAT32 Trying to bring up storage... Init: Storage v2: supports: MMC,SD,miniSD in SPI mode Init: MMC Card found, starting... Ok.</pre><p><pre> MMC Manufacturer#: 30 Product Name: MMC    Production date: 10 / 2004 Media serial number: 00000468 This MMC has no support for interrupted read. Using compatibility mode. Storage initialized in seek-and-read mode. Storage ok. Sector 0 read...ok. Sector signature...ok. Partition 1... at sector 00000020 Formatter signature: j!BFIHC Bytes per sector:    512 Bytes per sector:    512 Reserved sectors:    1 Number of FATs:      2 Root entries:        512 Total Sectors 16:    0 Fat Size 16:         123 Hidden Sectors:      32 Total Sectors 32:    125408 File system is FAT16 File system signature is FAT16 Volume Label is NO NAME Sectors per Cluster: 4 FAT Start sector:    33 Root start sector:   279 Data start sector:   303</pre><p><pre> Init: VS10XX Loading patch.</pre><p><pre> Filesystem: Looking for file 1 ... found, FAT name is "UTOPIA~1MP3" File size: 1471792 bytes. Start cluster: 0003h, sector 315 decimal. Building file fragment table... Fragment Start: 315  Fragment End: 3190  Fragment length: 2876</pre><p><pre> Fragments: 1 Player: Playing from sector 315</pre><p><pre> </pre> ...and so on. <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 + -