Du läser för närvarande dokumentationen för:
ECF_Format
The ECF_Format function formats a block device to prepare it to hold files. It will erase all existing data on the block device.
ECF_ErrorCode ECF_Format(
   struct ECF_BlockDriver *pBlockDeviceDriver,
   WORD wClusterSize,
   WORD wFlags
);
Parameters
pBlockDeviceDriver
This is a pointer to the ECF_BlockDriver struct that allows the file system to access your block device.
wClusterSize
This is the desired cluster size. Valid values are 512, 1024, 2048, 4096, 8192, 16384 and 32768.
wFlags
Options to ECF_Format(). Several options can be used and are OR:ed together. Specify only one or none of the ECF_FORMAT_PARTITIONLESS, ECF_FORMAT_CREATE_PARTITION1 and ECF_FORMAT_PARTITIONx flags. If none of these flags is specified, ECF_FORMAT_PARTITIONLESS will be used as the default.
ECF_FORMAT_PARTITIONLESS:
Format this block device without using a partition table. Recommended setting when formatting an internal flash and you only want to use one partition. This is the default.
ECF_FORMAT_CREATE_PARTITION1:
This will clear the partition table, create a partition that occupies the entire block device and format it. Recommended setting when formatting an SD card and you only want to use one partition.
ECF_FORMAT_PARTITION1:
This will format partition 1. The partition must already exist.
ECF_FORMAT_PARTITION2:
This will format partition 2. The partition must already exist.
ECF_FORMAT_PARTITION3:
This will format partition 3. The partition must already exist.
ECF_FORMAT_PARTITION4:
This will format partition 4. The partition must already exist.
ECF_FORMAT_QUICK:
Performs a quick format by not clearing the data area of the disk when formatting. Note: If you are using Trim support, the entire area will always be trimmed regardless of this flag.
ECF_FORMAT_ALIGN:
Aligns the cluster placement to the cluster size. This is useful if you are using flash memory to store your file system. By using this flag and a suitable cluster size you can be sure that each of the clusters is aligned to an even page boundary on your flash. As an example, if you are using a flash with a page size of 4096 bytes it is recommended that you enable the ECF_FORMAT_ALIGN flag and set the cluster size to 4096 for best results.
ECF_FORMAT_ONLY_FAT12:
Will force the FAT12 format. This will possibly waste space and create a FAT12 that is as big as possible. It is useful if you want to make sure the formatted disk is compatible with ECF Lite.
Return value
Returns one of the ECF error codes (ECFERR_SUCCESS on success)
Remarks
ECF_Format will erase all the data on the block device. It needs to be called for an unformatted block device before it can be mounted. You need to specify ECF_OPT_SUPPORT_FORMAT in your Project.h for ECF to compile with support for this function.
Example Code
See ECF_Mount
See also