資源簡介
CPU采用STM32F103單片機,用戶可以非常方便地移植軟件到ST的Cortex單片機上;單片機采用SPI總線和間接總線與W5100接口,用戶可任選一種方式;

代碼片段和文件信息
/*-----------------------------------------------------------------------*/
/*?Low?level?disk?I/O?module?skeleton?for?FatFs?????(C)ChaN?2007????????*/
/*-----------------------------------------------------------------------*/
/*?This?is?a?stub?disk?I/O?module?that?acts?as?front?end?of?the?existing?*/
/*?disk?I/O?modules?and?attach?it?to?FatFs?module?with?common?interface.?*/
/*-----------------------------------------------------------------------*/
#include?“diskio.h“
#include?“ff.h“
#include?“sdcard.h“
#include?“RTC_Time.h“
/*-----------------------------------------------------------------------*/
/*?Correspondence?between?physical?drive?number?and?physical?drive.??????*/
#define?ATA 1
#define?MMC 0
#define?USB 2
/*-----------------------------------------------------------------------*/
/*?Inidialize?a?Drive????????????????????????????????????????????????????*/
DSTATUS?disk_initialize?(
BYTE?drv /*?Physical?drive?nmuber?(0..)?*/
)
{
DSTATUS?stat;
SD_Error?Status?=?SD_OK;
SD_CardInfo?CardInfo;
switch?(drv)?{
case?ATA?:
//result?=?ATA_disk_initialize();
//?translate?the?reslut?code?here
stat=RES_OK;
return?stat;
case?MMC?:
Status?=?SD_Init();
????????Status?=?SD_GetCardInfo(&CardInfo);
????????Status?=?SD_SelectDeselect((u32)?(CardInfo.RCA?<16));
????????Status?=?SD_EnableWideBusOperation(SDIO_BusWide_1b);
????????Status?=?SD_SetDeviceMode(SD_DMA_MODE);
????????if?(Status?==?SD_OK)??stat=RES_OK;?
return?stat;
case?USB?:
//result?=?USB_disk_initialize();
//?translate?the?reslut?code?here
stat=RES_OK;
return?stat;
}
return?STA_NOINIT;
}
/*-----------------------------------------------------------------------*/
/*?Return?Disk?Status????????????????????????????????????????????????????*/
DSTATUS?disk_status?(
BYTE?drv /*?Physical?drive?nmuber?(0..)?*/
)
{
DSTATUS?stat;
switch?(drv)?{
case?ATA?:
//result?=?ATA_disk_status();
//?translate?the?reslut?code?here
stat=RES_OK;
return?stat;
case?MMC?:
//result?=?MMC_disk_status();
//?translate?the?reslut?code?here
stat=RES_OK;
return?stat;
case?USB?:
//result?=?USB_disk_status();
//?translate?the?reslut?code?here
stat=RES_OK;
return?stat;
}
return?STA_NOINIT;
}
/*-----------------------------------------------------------------------*/
/*?Read?Sector(s)????????????????????????????????????????????????????????*/
DRESULT?disk_read?(
BYTE?drv /*?Physical?drive?nmuber?(0..)?*/
BYTE?*buff /*?Data?buffer?to?store?read?data?*/
DWORD?sector /*?Sector?address?(LBA)?*/
BYTE?count /*?Number?of?sectors?to?read?(1..255)?*/
)
{
DRESULT?res;
SD_Error?Status?=?SD_OK;
BYTE?i;
switch?(drv)?{
case?ATA?:
//result?=?ATA_disk_read(buff?sector?count);
//?translate?the?reslut?code?here
res=RES_OK;
return?res;
case?MMC?:
//result?=?MMC_disk_read(buff?sector?count);
//?translate?the?reslu
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4429??2009-04-14?00:34??web-http-STM32-W5100\FATFS\00readme.txt
?????文件???????7934??2010-04-18?15:24??web-http-STM32-W5100\FATFS\diskio.c
?????文件???????7876??2009-06-06?18:03??web-http-STM32-W5100\FATFS\diskio.c.bak
?????文件???????1845??2009-05-31?20:29??web-http-STM32-W5100\FATFS\diskio.h
?????文件???????1839??2009-05-31?20:28??web-http-STM32-W5100\FATFS\diskio.h.bak
?????文件???????5471??2009-04-14?00:10??web-http-STM32-W5100\FATFS\doc\00index_e.html
?????文件???????5437??2009-04-14?00:10??web-http-STM32-W5100\FATFS\doc\00index_j.html
?????文件???????2637??2009-03-28?22:21??web-http-STM32-W5100\FATFS\doc\css_e.css
?????文件???????3000??2009-03-28?22:22??web-http-STM32-W5100\FATFS\doc\css_j.css
?????文件??????13980??2009-04-14?00:13??web-http-STM32-W5100\FATFS\doc\en\appnote.html
?????文件???????2959??2009-03-28?16:32??web-http-STM32-W5100\FATFS\doc\en\chmod.html
?????文件???????2118??2009-03-28?16:32??web-http-STM32-W5100\FATFS\doc\en\close.html
?????文件???????1518??2008-12-13?15:49??web-http-STM32-W5100\FATFS\doc\en\dinit.html
?????文件???????2689??2009-04-13?20:31??web-http-STM32-W5100\FATFS\doc\en\dioctl.html
?????文件???????1858??2009-03-29?14:23??web-http-STM32-W5100\FATFS\doc\en\dread.html
?????文件???????1599??2008-10-20?00:02??web-http-STM32-W5100\FATFS\doc\en\dstat.html
?????文件???????1985??2009-03-29?14:23??web-http-STM32-W5100\FATFS\doc\en\dwrite.html
?????文件???????1363??2007-12-22?16:06??web-http-STM32-W5100\FATFS\doc\en\fattime.html
?????文件???????3114??2009-04-01?00:18??web-http-STM32-W5100\FATFS\doc\en\filename.html
?????文件???????4917??2009-03-29?14:26??web-http-STM32-W5100\FATFS\doc\en\forward.html
?????文件???????3233??2009-04-10?23:36??web-http-STM32-W5100\FATFS\doc\en\getfree.html
?????文件???????2185??2009-04-03?20:22??web-http-STM32-W5100\FATFS\doc\en\gets.html
?????文件???????3713??2009-03-29?17:04??web-http-STM32-W5100\FATFS\doc\en\lseek.html
?????文件???????2429??2009-03-28?16:33??web-http-STM32-W5100\FATFS\doc\en\mkdir.html
?????文件???????3405??2009-03-29?22:57??web-http-STM32-W5100\FATFS\doc\en\mkfs.html
?????文件???????2012??2009-02-28?15:03??web-http-STM32-W5100\FATFS\doc\en\mount.html
?????文件???????2005??2006-12-13?00:15??web-http-STM32-W5100\FATFS\doc\en\mountdrv.html
?????文件???????5675??2009-03-28?16:30??web-http-STM32-W5100\FATFS\doc\en\open.html
?????文件???????2458??2009-03-28?16:30??web-http-STM32-W5100\FATFS\doc\en\opendir.html
?????文件???????2407??2009-04-03?20:16??web-http-STM32-W5100\FATFS\doc\en\printf.html
............此處省略414個文件信息
- 上一篇:微機原理第五版
- 下一篇:VC 視頻會議系統 演示程序
評論
共有 條評論