- Supported multiple drive system. - Changed some APIs for multiple drive system. - Added f_mkfs().
		
			
				
	
	
		
			71 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			71 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 | |
| <html lang="en">
 | |
| <head>
 | |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 | |
| <meta http-equiv="Content-Style-Type" content="text/css">
 | |
| <link rel="up" title="FatFs" href="../00index_e.html">
 | |
| <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
 | |
| <title>FatFs - f_mkfs</title>
 | |
| </head>
 | |
| 
 | |
| <body>
 | |
| 
 | |
| <div class="para">
 | |
| <h2>f_mkfs</h2>
 | |
| <p>The f_mkfs fucntion creates a file system on the drive.</p>
 | |
| <pre>
 | |
| FRESULT f_mkfs (
 | |
|   BYTE  <em>Drive</em>,            /* Logical drive number */
 | |
|   BYTE  <em>PartitioningRule</em>, /* Partitioning rule */
 | |
|   BYTE  <em>AllocSize</em>         /* Allocation unit size */
 | |
| );
 | |
| </pre>
 | |
| </div>
 | |
| 
 | |
| <div class="para">
 | |
| <h4>Parameters</h4>
 | |
| <dl class="par">
 | |
| <dt>Drive</dt>
 | |
| <dd>Logical drive number (0-9) to be formatted.</dd>
 | |
| <dt>PartitioningRule</dt>
 | |
| <dd>When 0 is given, a partition table is created into first sector on the drive and then the file system is created on the partition. This is called FDISK format. When 1 is given, the file system starts from the first sector without partition table. This is often called super floppy (SFD) format.</dd>
 | |
| <dt>AllocSize</dt>
 | |
| <dd>Specifies allocation unit size (number of sectors per cluster). The value must be power of 2 in range of from 1 to 64.</dd>
 | |
| </dl>
 | |
| </div>
 | |
| 
 | |
| <div class="para">
 | |
| <h4>Return Values</h4>
 | |
| <dl class="ret">
 | |
| <dt>FR_OK (0)</dt>
 | |
| <dd>The function succeeded.</dd>
 | |
| <dt>FR_INVALID_DRIVE</dt>
 | |
| <dd>The drive number is invalid.</dd>
 | |
| <dt>FR_NOT_READY</dt>
 | |
| <dd>The drive cannot work due to any reason.</dd>
 | |
| <dt>FR_WRITE_PROTECTED</dt>
 | |
| <dd>The drive is write protected.</dd>
 | |
| <dt>FR_RW_ERROR</dt>
 | |
| <dd>The function failed due to a write error in the low level disk I/O.</dd>
 | |
| <dt>FR_MKFS_ABORTED</dt>
 | |
| <dd>The function aborted before start in format due to a reason as follows.
 | |
| <ul>
 | |
| <li>The disk size is too small.</li>
 | |
| <li>Invalid parameter was given to any parameter.</li>
 | |
| <li>Not allowable cluster size for this drive. This can occure when number of clusters becomes around 0xFF7 and 0xFFF7.</li>
 | |
| </ul>
 | |
| </dd>
 | |
| </dl>
 | |
| </div>
 | |
| 
 | |
| <div class="para">
 | |
| <h4>Description</h4>
 | |
| <p>The f_mkfs function creates a FAT file system on the drive. There are two partitioning rules, FDISK and SFD, for removable media. It can be selected with a parameter and FDISK format is recommended for most case. The FAT type, FAT12/FAT16/FAT32, is determined by only how many clusters on the drive and nothing else, according to FAT specification. Thus which FAT type is selected, is depends on the drive size and specified cluster size.</p>
 | |
| <p>This function is supported on only FatFs with _USE_MKFS option.<p>
 | |
| </div>
 | |
| 
 | |
| 
 | |
| <p class="foot"><a href="../00index_e.html">Return</a></p>
 | |
| </body>
 | |
| </html>
 |