1 /*-----------------------------------------------------------------------*/
2 /* Low level disk I/O module skeleton for FatFs (C)ChaN, 2007 */
3 /*-----------------------------------------------------------------------*/
4 /* This is a stub disk I/O module that acts as front end of the existing */
5 /* disk I/O modules and attach it to FatFs module with common interface. */
6 /*-----------------------------------------------------------------------*/
10 /*-----------------------------------------------------------------------*/
11 /* Correspondence between physical drive number and physical drive. */
19 /*-----------------------------------------------------------------------*/
20 /* Inidialize a Drive */
22 DSTATUS disk_initialize (
23 BYTE drv /* Physical drive nmuber (0..) */
31 result = ATA_disk_initialize();
32 // translate the reslut code here
37 result = MMC_disk_initialize();
38 // translate the reslut code here
43 result = USB_disk_initialize();
44 // translate the reslut code here
53 /*-----------------------------------------------------------------------*/
54 /* Return Disk Status */
57 BYTE drv /* Physical drive nmuber (0..) */
65 result = ATA_disk_status();
66 // translate the reslut code here
71 result = MMC_disk_status();
72 // translate the reslut code here
77 result = USB_disk_status();
78 // translate the reslut code here
87 /*-----------------------------------------------------------------------*/
91 BYTE drv, /* Physical drive nmuber (0..) */
92 BYTE *buff, /* Data buffer to store read data */
93 DWORD sector, /* Sector address (LBA) */
94 BYTE count /* Number of sectors to read (1..255) */
102 result = ATA_disk_read(buff, sector, count);
103 // translate the reslut code here
108 result = MMC_disk_read(buff, sector, count);
109 // translate the reslut code here
114 result = USB_disk_read(buff, sector, count);
115 // translate the reslut code here
124 /*-----------------------------------------------------------------------*/
125 /* Write Sector(s) */
129 BYTE drv, /* Physical drive nmuber (0..) */
130 const BYTE *buff, /* Data to be written */
131 DWORD sector, /* Sector address (LBA) */
132 BYTE count /* Number of sectors to write (1..255) */
140 result = ATA_disk_write(buff, sector, count);
141 // translate the reslut code here
146 result = MMC_disk_write(buff, sector, count);
147 // translate the reslut code here
152 result = USB_disk_write(buff, sector, count);
153 // translate the reslut code here
159 #endif /* _READONLY */
163 /*-----------------------------------------------------------------------*/
164 /* Miscellaneous Functions */
167 BYTE drv, /* Physical drive nmuber (0..) */
168 BYTE ctrl, /* Control code */
169 void *buff /* Buffer to send/receive control data */
179 result = ATA_disk_ioctl(ctrl, buff);
187 result = MMC_disk_ioctl(ctrl, buff);
195 result = USB_disk_ioctl(ctrl, buff);