2 * FreeRTOS+FAT build 191128 - Note: FreeRTOS+FAT is still in the lab!
\r
3 * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
4 * Authors include James Walmsley, Hein Tibosch and Richard Barry
\r
6 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
7 * this software and associated documentation files (the "Software"), to deal in
\r
8 * the Software without restriction, including without limitation the rights to
\r
9 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
10 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
11 * subject to the following conditions:
\r
13 * The above copyright notice and this permission notice shall be included in all
\r
14 * copies or substantial portions of the Software.
\r
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
23 * https://www.FreeRTOS.org
\r
34 #ifndef _FF_FORMAT_H_
\r
35 #define _FF_FORMAT_H_
\r
43 #error this header will be included from "plusfat.h"
\r
46 /*---------- PROTOTYPES */
\r
47 /* PUBLIC (Interfaces): */
\r
49 typedef enum _FF_SizeType {
\r
50 eSizeIsQuota, /* Assign a quotum (sum of xSizes is free, all disk space will be allocated) */
\r
51 eSizeIsPercent, /* Assign a percentage of the available space (sum of xSizes must be <= 100) */
\r
52 eSizeIsSectors, /* Assign fixed number of sectors (sum of xSizes must be < ulSectorCount) */
\r
55 typedef struct _FF_PartitionParameters {
\r
56 uint32_t ulSectorCount; /* Total number of sectors on the disk, including hidden/reserved */
\r
57 /* Must be obtained from the block driver */
\r
58 uint32_t ulHiddenSectors; /* Keep at least these initial sectors free */
\r
59 uint32_t ulInterSpace; /* Number of sectors to keep free between partitions (when 0 -> 2048) */
\r
60 BaseType_t xSizes[ ffconfigMAX_PARTITIONS ]; /* E.g. 80, 20, 0, 0 (see eSizeType) */
\r
61 BaseType_t xPrimaryCount; /* The number of partitions that must be "primary" */
\r
62 eSizeType_t eSizeType;
\r
63 } FF_PartitionParameters_t;
\r
65 FF_Error_t FF_Partition( FF_Disk_t *pxDisk, FF_PartitionParameters_t *pParams );
\r
67 FF_Error_t FF_Format( FF_Disk_t *pxDisk, BaseType_t xPartitionNumber, BaseType_t xPreferFAT16, BaseType_t xSmallClusters );
\r