From dd38d907244bc0e483c3d760f2ba464a394ec229 Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Tue, 11 Mar 2014 23:55:41 -0700 Subject: Initial checkin with STM HAL This compiles and links, but hasn't been tested on a board yet and even if it was run, it doesn't currently do anything. --- stmhal/fatfs/doc/en/fdisk.html | 97 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 stmhal/fatfs/doc/en/fdisk.html (limited to 'stmhal/fatfs/doc/en/fdisk.html') diff --git a/stmhal/fatfs/doc/en/fdisk.html b/stmhal/fatfs/doc/en/fdisk.html new file mode 100644 index 000000000..d9dfbe190 --- /dev/null +++ b/stmhal/fatfs/doc/en/fdisk.html @@ -0,0 +1,97 @@ + + +
+ + + + + +The f_fdisk fucntion divides a physical drive.
++FRESULT f_fdisk ( + BYTE pdrv, /* [IN] Physical drive number */ + const DWORD part[], /* [IN] Partition size */ + void* work /* [IN] Work area */ +); ++
+FR_OK, +FR_DISK_ERR, +FR_NOT_READY, +FR_WRITE_PROTECTED, +FR_INVALID_PARAMETER +
+The f_fdisk() function creates a partition table into the MBR of the physical drive. The partitioning rule is in generic FDISK format, so that it can create upto four primary partitions. Extended partition is not supported. The part[] array with four items specifies how to divide the physical drive. The first item specifies the size of first primary partition and fourth item specifies the fourth primary partition. If the value is less than or equal to 100, it means percentage of the partition in the entire disk space. If it is larger than 100, it means partition size in unit of sector.
+Available when _FS_READOLNY == 0, _USE_MKFS == 1 and _MULTI_PARTITION == 1.
++ /* Volume management table defined by user (required when _MULTI_PARTITION == 1) */ + + PARTITION VolToPart[] = { + {0, 1}, /* Logical drive 0 ==> Physical drive 0, 1st partition */ + {0, 2}, /* Logical drive 1 ==> Physical drive 0, 2nd partition */ + {1, 0} /* Logical drive 2 ==> Physical drive 1, auto detection */ + }; ++
+ /* Initialize a brand-new disk drive mapped to physical drive 0 */ + + FATFS fs; + DWORD plist[] = {50, 50, 0, 0}; /* Divide drive into two partitions */ + BYTE work[_MAX_SS]; + + f_fdisk(0, plist, work); /* Divide physical drive 0 */ + + f_mount(&fs, "0:", 0); /* Register work area to the logical drive 0 */ + f_mkfs("0:", 0, 0); /* Create FAT volume on the logical drive 0. 2nd argument is ignored. */ + f_mount(0, "0:", 0); /* Unregister work area from the logical drive 0 */ + + f_mount(&fs, "1:", 0); /* Give a work area to the logical drive 1 */ + f_mkfs("1:", 0, 0); /* Create FAT volume on the logical drive 1. 2nd argument is ignored. */ + f_mount(0, "1:", 0); /* Unregister work area from the logical drive 1 */ + ++