📄 test.c
字号:
/*所在文件test.c*/
#include "config.h"
uint8 temp1,temp2,temp3,temp4,temp5,temp6,temp7;
uint16 temp16;
int main(void)
{
SYS_BusIni();
/*探测设备是否存在函数测试*/
if(SYS_HaveCard()) //探测CF卡是否存在
{ /*复位及读寄存器函数测试*/
SYS_IdeHardReset(); //ATA设备硬件复位
SYS_WaitInUS(48000); //复位后ATA设备需在480mS内完成硬件初始化和自检
temp1 = GetSECCNT(); //复位该寄存器的值为0x01
if(0x01!=temp1)
{
while(1); //读函数有误或设备无效
}
temp2 = GetSector(); //复位该寄存器的值为0x01
temp3 = GetCylinderLow(); //复位该寄存器的值为0x00
temp4 = GetCylinderHigh(); //复位该寄存器的值为0x00
temp5 = GetDeviceHead(); //复位该寄存器的值为0x00
temp6 = GetStatus(); //复位该寄存器的值为0x50
temp7 = GetAStatus(); //复位该寄存器的值为0x50
/*写函数测试*/
SetSector(0xaa); //写数据寄存器
temp16 = GetSector();
if(0xaa!=temp16) //比较写入与读出的值
{
while(1); //写函数有误
}
}
while(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -