微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 模拟电路设计 > ZipAmp中英文对照表

ZipAmp中英文对照表

时间:07-23 来源:互联网 点击:

ZipAmp中英文对照表

/*********************************************
ZipAmp

Author : Nasif Akand
Copyright : (C) Nasif Akand 2003
Notice :
Copyright 2003 Nasif Akand (nasif@yifan.net)
http://go.to/zipamp
http://zipamp.virtualave.net

This file is part of ZipAmp MP3 software.

ZipAmp is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License or
(at your option) any later version.

ZipAmp is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this code; if not write to the Free Software
Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
这一个文件是 ZipAmp MP3 软件的一部份。

ZipAmp 是免费的软件;你能重新分配它及[或] 修正
它在角马公众执照的术语之下当做出版被
免费的软件基础; 或执照的 2 版 或
(在你的选项)任何的较迟版本。

ZipAmp 在希望中被分配它将会是有用的
但是没有任何的担保; 没有更甚至被暗示的担保
为一个特别的目的 MERCHANTABILITY 或健身。 那
为较多的细节角马公众执照。

你应该要接受角马公众执照的副本
连同这一个密码一起; 如果不 写到免费的软件
基础,公司, 59个寺庙地方,随员 330 ,波士顿 文学硕士 02111-1307 美国

Chip type : AT90S8515
Clock frequency : 12.00000 MHz
Memory model : Small
Internal SRAM size : 512 bytes
External SRAM size : 0 byte
Data Stack size : 64 bytes

这个是用来设置Codevision的,按照这个设置然后添加下面所提示的包含就可以编译了。
芯片类型 : AT90S8515
时钟频率 : 12.00000 MHz
内存模式 : 小的
内在的 SRAM 大小 : 512 bytes
外部 SRAM 大小 : 0 byte
数据堆栈大小 : 64 bytes

Tested ATA Drive
Samsung SpinPoint SV3064D 30 GB

Test Drive Access Time:
Track to Track : 0.8 m/s
Average : 9.0m/s
Full Stroke : 17 m/s

Test Drive Playback:
Full speed MP3 playback at 320KBps.

测试时使用的是三星的 SV3064D 30 GB 硬盘

测试硬盘的平均时间:
轨迹到轨迹 : 0.8 m/s
平均 : 9.0m/s
完全的读取 : 17 m/s

测试硬盘重放:
使用的是编码率高达320KBps的mp3.
*********************************************/

#define DataReq PINB.2

#include 90s8515.h> //8515 header file
#include //Codevision spi
#include "zfat.h"
#include "zata.h"
#include "ztype.h"
#include "zcontrol.h"
#include "zlcd.h"
#include //Codevision delay
#include "i2c.h"
//下面是按照Datazyb所提示而添加进的。添加这些包含后就能顺利的编译了。
//编译好了的程序能读取我的富士通3g的硬盘,但是出来的声音不流畅,可能示由于硬盘太老的缘故吧。
#include "zata.c"
#include "zfat.c"
#include "ztype.c"
#include "zcontrol.c"
#include "zlcd.c"
#include "i2c.c"

// External Interrupt 0 service routine
// 外部中断 0个服务常式
//这里说明一下,这里是按钮输入的反应设置,也就是说当按钮按下zipmap要干些什么就是在这里设置的。
//情形(case)按照1,2,4,8...这样排列是照按键接口ad0,ad1...来的,
interrupt [EXT_INT0] void ext_int0_isr(void)
{
unsigned char in;
#asm("cli");
in=PINC; //Read the input buttons /读输入按钮
in=~in; //Invert them to see which one is high (thats the one pressed) /判断它们是哪一个按下了。

while ((!PIND.2)); //wait until interrupt key released /等候按纽松开了才输出

switch (in) {

//Case 1= STOP /情形 1= 停止
case 1: //play=0 is pause play=1 is play play=2 is stop
//播放=0 代表暂停 播放=1 代表播放 播放=2 代表停止

play=2; //STOP /停止
STAPlay(); //Stop player /停止播放器
UnBusy(); //Remove HD Busy light /使硬盘指示灯长亮
currentCluster=firstCluster; //Remember file start cluster /记忆文件开始群
clusterBufferReadPos=clusterBufferWritePos; //Clear cluster buffer /清除群缓冲

filePos=0; //Set filestart pos at beginning
sectorPos=0;
mp3Pos=0;
break;

//Case 2= Play or Pause /情形 2= 播放或暂停
case 2: play=(~play) 1; //Invert play. If play then pause if pause then play
//反转播放.如果是播放就暂停,如果暂停就播放
STAPlay(); //Load command /读取命令
break;

//Case 4=
case 4:
if (currentFileNum=1) currentFileNum=totalFiles-1;
else currentFileNum=currentFileNum-2;
dirReadOffset.fileNum=0; //To reread dir from start.

break;

case 8: currentFileNum+=advance; //FF
if (currentFileNum>totalFiles) {
currentFileNum=1;
dirReadOffset.fileNum=0;
}
break;

case 16: filePos=FileSize; //NEXT
break;

case 32: //声音模式设置
soundMode = (soundMode+1) soundModeMask;
SetBassTreble();
break;

case 64: playMode = (playMode+1) playModeMask; //播放模式设定
break;
};

intFlag=1; //Set interrupt occured flag /设置中断发生情况
}

/*
// External Interrupt 1 service routine / 外部中断 1个服务常式
interrupt [EXT_INT1] void ext_int1_isr(void)
{
// Place your code here
// 把你的代码放到这里,实际上在zipamp里这里可以不用理会,因为它的中断1口根本就没有接东西上去
//不过你如果想添加遥控的话,把代码放到这里是再合适不过的了。
printf("Entered Interrupt 2");
} */


// Declare your global variables here
//全局变量在这里

void main(void)
{
// Declare your local variables here
byte temp; dword extension;

//这些设置要结合硬件电路图才能看得明白。
// Input/Output Ports initialization /设定输入输出口初始值。
// Port A /PA口
DDRA=0x00; //Start as Input port /开始为输入口
PORTA=0x00; //Set to High-Z state /设定为高阻状态

// Port B /PA口
DDRB=0xBB;
PORTB=0x0B; //Enable Reset for STA013 Disable ATA IOR and IOW. /允许重启STA013 禁止ATA IOR与IOW.

// Port C /PA口
DDRC=0xFF; //Output port /输出口
PORTC=0x00; //Set 0 /设定 0

// Port D /PA口
DDRD=0xF2;
PORTD=0x20; //Disable Latch and Buffer. Never pull PORTD.1 high that will cause damage to STA013
//使门电路和缓冲器失去能力。千万别拉高“PORTD.1”(这里注释可能有误,应该为PORTD.0)那样做会损坏到STA013

//这些设置要结合90s8515的说明书才会明白
// Timer/Counter 0 initialization / 定时/计数器0初始值设定
// Clock source: System Clock / 时钟来源: 系统时钟
// Clock value: Timer 0 Stopped / 时钟值: 时钟0停止
// Mode: Output Compare / 模式: 输出比较
// OC0 output: Disconnected / OC0 输出: 分离
TCCR0=0x00;
TCNT0=0x00;

// Timer/Counter 1 initialization / 定时/计数器1初始值设定
// Clock source: System Clock / 时钟来源: 系统时钟
// Clock value: 14318.180 kHz / 时钟值: 14318.180 kHz
// Mode: Output Compare / 模式: 输出比较
// OC1A output: Discon. / OC1A 输出: 不精读.
// OC1B output: Discon. / OC1B 输出: 不精读.
// Noise Canceler: Off / 噪音取消: 关
// Input Capture on Falling Edge / 输入取下下降沿
TCCR1A=0x00;
TCCR1B=0x01;
TCNT1H=0x00;
TCNT1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// External Interrupt(s) initialization /设定外部(s)初始值
// INT0: On /INT0: 开
// INT0 Mode: Low level /INT0 模式: 低电平有效
// INT1: On /INT1: 开
// INT1 Mode: Low level /INT1 模式: 低电平有效
GIMSK=0x40;
MCUCR=0x00;
GIFR=0x40;


// Timer(s)/Counter(s) Interrupt(s) initialization /设定定时(s)/计数器(s)中断(s)初始值
TIMSK=0x00;

// UART initialization /串口初始值设定
// Communication Parameters: 8 Data 1 Stop No Parity /沟通叁数: 8 数据 1 没有同等
// UART Receiver: Off /串口接收器(rx):开
// UART Transmitter: On /串口发射器(tx):关


// UART Baud rate: 19200 at 14.3181 /串口通讯波特率: 19200到14.3181之间
UCR=0x08;
UBRR=0x2E;


// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;

// SPI initialization
// SPI Type: Master
// SPI Clock Rate: 2460.000 kHz
// SPI Clock Phase: Cycle Half
// SPI Clock Polarity: Low
// SPI Data Order: MSB First
// SPI 初始值设定
// SPI 类型: Master
// SPI 时钟频率: 2460.000 kHz
// SPI 时钟周期: 一半
// SPI 时钟极性: 低
// SPI 数据次序: MSB第一
SPCR=0x50;

#asm("cli");

//好了,设置好8515各个端口的初始之后,我们要开始干正事了,先初始化lcd屏,然后延时3000ms,这是为了在
//屏上显示logo
InitLCD();
delay_ms(3000);
//DDRC=0x00;
//PORTC=0x00;

//接下来就初始话ata与fta
ATA_Init();
InitFAT();

currentFileNum=0;
temp=0;

//Find two required files in root dir ZIPAMP.SYS and ZIPAMP.CFG and save their LBA address
//查找两个必须的文件ZIPAMP.SYS和ZIPAMP.CFG并保存它们的LBA地址
while ((temp2)(getDirEntry(0)==1)) {
extension = (*(dword *)fileExtension) 0x00FFFFFF;
//low-case z "logic AND" up-case Z =will equal up-case Z. Thus following checks for both 'z' and 'Z'
//通过逻辑或来检测zipamp文件的存在
if ((fileName[0] 0x5A)==0x5A) { //if the name starts with Z then see if it is SYS or CFG file
//如果有文件名字为zipamp那么检查它是否为SYS或CFG文件
if (extension==0x00535953) { dirStackLBA=clust2LBA(currentCluster); temp++; } //ZIPAMP.SYS Stack file address
// 如果是ZIPAMP.SYS文件则保存文件地址
if (extension==0x00474643) { cfgFileLBA=clust2LBA(currentCluster); temp++; } //ZIPAMP.CFG Config file address
// 如果是ZIPAMP.CFG文件则保存文件地址,这里不知是否有错,cfg文件名转换成bin码应该为0x00434647
}
}

if (temp2) Halt(4); //Missing SYS or CFG file. /如果找不到SYS或CFG文件则停止并显示错误.

STA013Setup(); //Setup STA013 decoder. /装载STA013解码器.

currentFileNum=0;
if (loadConfig()!=1) {//goto LOADED; /转到装载;
while (getDirEntry(1)==1) { //count # of MP3 files. /计数MP3文件.
totalFiles++;
gotoxy(3 0
writeNumber(totalFiles); //这里要用到数字输出,因为统计出来的数字是16进制的,所以需要通过数字输出
//将其转换成10进制的显示在屏幕上面。
}
}

//gotoxy(3 0
writestring(" Wait.."); //显示等待种,如果是中文屏的话,这里可以输入中文字

dirReadOffset.fileNum=0;
SetSoundCg(); //Load Sound Mode character bars into LCD CGRAM. /载如声音模式特性图形到LCD CGRAM.
play=1; //ZipAmp will start playing after boot finish. /ZipAmp会在启动完毕后开始播放.
SetBassTreble(); //Setup Bass Treble registers in STA013. /装备低音使 STA013 的寄存器增为三倍
SongSelect();
while (1) { //Main loop /主体循环

key=1;
if (key==0) key=1;
PORTC=~key;
DDRC=key;
#asm("sei");

//下面这段还不是太清楚,暂时不进行翻译。
//Following "if" is True when INTR in NEXT FF PREV occurs. filePos and FileSize is set equal there.
//In first iteration filePos will be greater than FileSize because STA013.BIN has been read to the finish
//thus this becomes true.
if (filePos>=FileSize) SongSelect(); //Song is selected when playing finished or NEXT/PREV button pressed
///当歌曲在播放的时候被按下了NEXT或PREV按纽时
if (intFlag) { //Interrupt occured and LCD display wasn't fixed fix it.
intFlag=0;
printInfo();
}

while ((DataReq)(filePos if (mp3Pos==0) read();
spi(sectorBuffer.data[mp3Pos++]);
spi(sectorBuffer.data[mp3Pos++]);
}

//If finished reading one cluster and head hasn't been moved
if ((sectorPos==Sectors_Per_Cluster) (headMoved==0)) {

//if we have buffered next cluster then move head
if (readClusterBuffer()==1) ATA_Move_Head(clust2LBA(currentCluster));


else { //we didn't buffer it so find next cluster and move head
currentCluster=findNextCluster();
ATA_Move_Head(clust2LBA(currentCluster)); //Move head to read position
}
//Reset all parameters /重新安排全部数
sectorPos=0;
readPos=0;
headMoved=1;
}

//if we have already moved head then we can buffer next clusters
else if ((readPos|DataReq)==0) {
//check if datareq is set if set then get out of buffering
temp=sectorPos;
if (writeClusterBuffer()==1) { //if buffering was successful then move head to original location.
sectorPos=temp;
ATA_Move_Head(clust2LBA(currentCluster)+sectorPos); //move head to the current reading cluster.
headMoved=1;
readPos=0;
}
}

} // end of main loop /主体循环结束


} //END. /结束.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top