ATMEL MCU用于MP3播放系统的控制源代码程序
源代码在线查看: ideio.h
/*H**************************************************************************
* NAME: ideio.h
*----------------------------------------------------------------------------
* Copyright (c) 2004 Toplow.
*----------------------------------------------------------------------------
* RELEASE:
* REVISION:
*----------------------------------------------------------------------------
* PURPOSE:
*
*
* NOTES:
* Global Variables:
* - gl_sbc_wr_protect: write protect flag for SCSI disk
*****************************************************************************/
#ifndef _IDEIO_DRV_H_
#define _IDEIO_DRV_H_
#include
#define FILE0 XBYTE[0x7000] //硬盘数据寄存器
#define FILE1 XBYTE[0x7001] //错误/特征寄存器
#define FILE2 XBYTE[0x7002] //扇区数寄存器
#define FILE3 XBYTE[0x7003] //扇区号寄存器
#define FILE4 XBYTE[0x7004] //柱面号寄存器L
#define FILE5 XBYTE[0x7005] //柱面号寄存器H
#define FILE6 XBYTE[0x7006] //驱动器/磁头寄存器
#define FILE7 XBYTE[0x7007] //状态/命令寄存器
///////////////////位设置///////////////////////////
sbit BSY = ACC^7;
sbit DRDY = ACC^6;
sbit DRQ = ACC^3;
sbit ERR = ACC^0;
/************************************************************
* D7 D6 D5 D4 D3 D2 D1 D0 *
BSY DRDY DWF DSC DRQ CORR IDX ERR *
BSY:驱动器忙; *
DRDY:驱动器准备好; *
DWF:驱动器写失败; *
DSC:寻道结束; *
DRQ:请求服务,驱动器希望通过数据寄存器与CPU交换一字节数据;*
CORR:当可以纠正的读错误发生时,该位置1,数据传输将继续进行 *
IDX:收到综引信号; *
ERR:命令执行出错。 *
*************************************************************/
sbit ARST = P5^3;
sbit INTQ = P5^1;
void HardDiskSleep(void);
bit ata_install(void);
bit hdd_uninstall(void);
Byte hdd_read_byte(void);
bit hdd_read_open(Uint32);
bit hdd_read_close(void);
bit hdd_write_byte(Byte);
bit hdd_write_open(Uint32);
bit hdd_write_close(void);
bit hdd_read_long_big_endian(void);
bit hdd_read_one_sector(Uint32);
bit hdd_write_usb_sector(Uint32);
s_format *hdd_format(void);
extern Uint32 (hdd_mem_size);
#define delay(time) {uint i; for(i=0;i
#endif /* _IDEIO_DRV_H_ */