version 2.8
petitfs-0.03/src/diskio.c
1 /*-----------------------------------------------------------------------*/
2 /* Low level disk I/O module skeleton for Petit FatFs (C)ChaN, 2014 */
3 /*-----------------------------------------------------------------------*/
4 
5 #include "diskio.h"
6 
7 
8 /*-----------------------------------------------------------------------*/
9 /* Initialize Disk Drive */
10 /*-----------------------------------------------------------------------*/
11 
12 DSTATUS disk_initialize (void)
13 {
14  DSTATUS stat;
15 
16  // Put your code here
17 
18  return stat;
19 }
20 
21 
22 
23 /*-----------------------------------------------------------------------*/
24 /* Read Partial Sector */
25 /*-----------------------------------------------------------------------*/
26 
27 DRESULT disk_readp (
28  BYTE* buff, /* Pointer to the destination object */
29  DWORD sector, /* Sector number (LBA) */
30  UINT offset, /* Offset in the sector */
31  UINT count /* Byte count (bit15:destination) */
32 )
33 {
34  DRESULT res;
35 
36  // Put your code here
37 
38  return res;
39 }
40 
41 
42 
43 /*-----------------------------------------------------------------------*/
44 /* Write Partial Sector */
45 /*-----------------------------------------------------------------------*/
46 
47 DRESULT disk_writep (
48  BYTE* buff, /* Pointer to the data to be written, NULL:Initiate/Finalize write operation */
49  DWORD sc /* Sector number (LBA) or Number of bytes to send */
50 )
51 {
52  DRESULT res;
53 
54 
55  if (!buff) {
56  if (sc) {
57 
58  // Initiate write process
59 
60  } else {
61 
62  // Finalize write process
63 
64  }
65  } else {
66 
67  // Send data to the disk
68 
69  }
70 
71  return res;
72 }
73