]> git.sur5r.net Git - freertos/blob - FreeRTOS-Labs/Source/FreeRTOS-Plus-FAT/include/ff_format.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Source / FreeRTOS-Plus-FAT / include / ff_format.h
1 /*\r
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
5  *\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
12  *\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
15  *\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
22  *\r
23  * https://www.FreeRTOS.org\r
24  *\r
25  */\r
26 \r
27 /**\r
28  *      @file           ff_format.c\r
29  *      @ingroup        FORMAT\r
30  *\r
31  **/\r
32 \r
33 \r
34 #ifndef _FF_FORMAT_H_\r
35 #define _FF_FORMAT_H_\r
36 \r
37 #ifdef  __cplusplus\r
38 extern "C" {\r
39 #endif\r
40 \r
41 \r
42 #ifndef PLUS_FAT_H\r
43         #error this header will be included from "plusfat.h"\r
44 #endif\r
45 \r
46 /*---------- PROTOTYPES */\r
47 /* PUBLIC (Interfaces): */\r
48 \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
53 } eSizeType_t;\r
54 \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
64 \r
65 FF_Error_t FF_Partition( FF_Disk_t *pxDisk, FF_PartitionParameters_t *pParams );\r
66 \r
67 FF_Error_t FF_Format( FF_Disk_t *pxDisk, BaseType_t xPartitionNumber, BaseType_t xPreferFAT16, BaseType_t xSmallClusters );\r
68 \r
69 /* Private : */\r
70 \r
71 #ifdef  __cplusplus\r
72 } /* extern "C" */\r
73 #endif\r
74 \r
75 #endif\r