?? cf.c
字號:
/****************************************************************************/
/* */
/* FILE NAME VERSION */
/* */
/* CF.C 1.0 */
/* */
/* DESCRIPTION */
/* */
/* JX44B0(S3C44B0X)CF卡驅(qū)動實驗 */
/* */
/* */
/* DATA STRUCTURES */
/* */
/* FUNCTIONS : */
/* 在JX44B0教學(xué)實驗箱進(jìn)行CF卡讀寫的實驗 */
/* */
/* DEPENDENCIES */
/* JX44B0-1 */
/* JX44B0-2 */
/* JX44B0-3 */
/* */
/* */
/* NAME: */
/* REMARKS: */
/* */
/* Copyright (C) 2003 Wuhan CVTECH CO.,LTD */
/****************************************************************************/
/****************************************************************************/
/* 學(xué)習(xí)JX44B0中CF卡操作函數(shù)的編寫方法: */
/* 注意: */
/* 1. 程序運(yùn)行前請插入CF卡到CF卡座 */
/* 2. 請不要帶電拔插CF卡 */
/* 3. 寫CF卡操作將破壞CF卡中的數(shù)據(jù),請小心實驗,并備份您的數(shù)據(jù) */
/****************************************************************************/
/* 包含文件 */
#include "44b.h"
#include "44blib.h"
#include "rtc.h"
void Main()
{
int i = 0;
unsigned char cf_cis_string[512];
unsigned char ch1, ch2, ch3, ch4;
Uart_Printf("Compact Flash Card Test!\n");
memset(cf_cis_string, 0x0, 512);
cf_init();
// read cis
/* 讀取CF卡信息 */
cf_read_cis(cf_cis_string);
Uart_Printf("\nManufacturer Information Stored in CIS:\n");
Uart_Printf(cf_cis_string);
Uart_Printf("\n");
/* 寫數(shù)據(jù)到BLOCK0 */
for(i=0; i<512; i++)
cf_cis_string[i] = i;
cf_memory_write_block(cf_cis_string, 0);
while(1)
{
static int ncount = 0;
Uart_Printf("ncount = %d\n", ncount);
/* 讀取CF卡ncount BLOCK的數(shù)據(jù)到cf_cis_string中,并打印 */
memset(cf_cis_string, 0x0, 512);
cf_memory_read_block(cf_cis_string, ncount);
{
int loopcnt;
for(loopcnt = 0; loopcnt < 512; loopcnt ++)
{
if(loopcnt % 0x10 == 0)
Uart_Printf("\n");
Uart_Printf("%02x ", cf_cis_string[loopcnt]);
}
Uart_Printf("\n");
}
Uart_Getch();
ncount++;
}
while(1); /* dead here! */
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -