SAM4S-EK_FreeRTOS+FAT-SL  1.0
An example project to test the functionality of FreeRTOS+FAT-SL using SD card as data storage medium
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
volume.h
Go to the documentation of this file.
1 /*
2  * FreeRTOS+FAT SL V1.0.1 (C) 2014 HCC Embedded
3  *
4  * The FreeRTOS+FAT SL license terms are different to the FreeRTOS license
5  * terms.
6  *
7  * FreeRTOS+FAT SL uses a dual license model that allows the software to be used
8  * under a standard GPL open source license, or a commercial license. The
9  * standard GPL license (unlike the modified GPL license under which FreeRTOS
10  * itself is distributed) requires that all software statically linked with
11  * FreeRTOS+FAT SL is also distributed under the same GPL V2 license terms.
12  * Details of both license options follow:
13  *
14  * - Open source licensing -
15  * FreeRTOS+FAT SL is a free download and may be used, modified, evaluated and
16  * distributed without charge provided the user adheres to version two of the
17  * GNU General Public License (GPL) and does not remove the copyright notice or
18  * this text. The GPL V2 text is available on the gnu.org web site, and on the
19  * following URL: http://www.FreeRTOS.org/gpl-2.0.txt.
20  *
21  * - Commercial licensing -
22  * Businesses and individuals who for commercial or other reasons cannot comply
23  * with the terms of the GPL V2 license must obtain a commercial license before
24  * incorporating FreeRTOS+FAT SL into proprietary software for distribution in
25  * any form. Commercial licenses can be purchased from
26  * http://shop.freertos.org/fat_sl and do not require any source files to be
27  * changed.
28  *
29  * FreeRTOS+FAT SL is distributed in the hope that it will be useful. You
30  * cannot use FreeRTOS+FAT SL unless you agree that you use the software 'as
31  * is'. FreeRTOS+FAT SL is provided WITHOUT ANY WARRANTY; without even the
32  * implied warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
33  * PARTICULAR PURPOSE. Real Time Engineers Ltd. and HCC Embedded disclaims all
34  * conditions and terms, be they implied, expressed, or statutory.
35  *
36  * http://www.FreeRTOS.org
37  * http://www.FreeRTOS.org/FreeRTOS-Plus
38  *
39  */
40 
41 #ifndef __VOLUME_H
42 #define __VOLUME_H
43 
44 #include "config_fat_sl.h"
45 
46 #include "ver_fat_sl.h"
47 #if VER_FAT_SL_MAJOR != 5 || VER_FAT_SL_MINOR != 2
48  #error Incompatible FAT_SL version number!
49 #endif
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 
56 typedef struct
57 {
58  unsigned char sector_per_cluster;
59  unsigned char number_of_FATs;
60  unsigned char media_descriptor;
61  unsigned long rootcluster;
62  unsigned long sector_per_FAT;
63  unsigned long sector_per_FAT32;
64  unsigned long serial_number;
65 } F_BOOTRECORD;
66 
67 
68 typedef struct
69 {
70  unsigned long sector; /*start sector*/
71  unsigned long num; /*number of sectors*/
72 } F_SECTOR;
73 
74 
75 typedef struct
76 {
77  unsigned char state;
82 
83  unsigned long actsector;
84  unsigned long fatsector;
85 
86  unsigned long lastalloccluster;
87  unsigned char modified;
88  char cwd[F_MAXPATH]; /*current working folder in this volume*/
89  unsigned char mediatype;
90  unsigned long maxcluster;
91 } F_VOLUME;
92 
93 
94 enum
95 {
96 /* 0 */
98 
100 
102 };
103 
104 
105 extern F_VOLUME gl_volume;
106 extern F_FILE gl_file;
107 extern char gl_sector[F_SECTOR_SIZE]; /* actual sector */
108 
109 unsigned char _f_getvolume ( void );
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif /* ifndef __VOLUME_H */
unsigned long sector
Definition: volume.h:70
unsigned char modified
Definition: volume.h:87
F_FILE gl_file
Definition: volume.c:61
unsigned long sector_per_FAT
Definition: volume.h:62
F_SECTOR firstfat
Definition: volume.h:79
unsigned long fatsector
Definition: volume.h:84
unsigned long actsector
Definition: volume.h:83
unsigned long serial_number
Definition: volume.h:64
F_BOOTRECORD bootrecord
Definition: volume.h:78
unsigned char _f_getvolume(void)
Definition: volume.c:719
unsigned char sector_per_cluster
Definition: volume.h:58
unsigned long sector_per_FAT32
Definition: volume.h:63
#define F_MAXPATH
Definition: config_fat_sl.h:59
unsigned long lastalloccluster
Definition: volume.h:86
unsigned char mediatype
Definition: volume.h:89
#define F_SECTOR_SIZE
Definition: config_fat_sl.h:57
F_SECTOR _tdata
Definition: volume.h:81
unsigned long num
Definition: volume.h:71
F_SECTOR root
Definition: volume.h:80
F_VOLUME gl_volume
Definition: volume.c:60
unsigned char media_descriptor
Definition: volume.h:60
unsigned long maxcluster
Definition: volume.h:90
unsigned char number_of_FATs
Definition: volume.h:59
char gl_sector[F_SECTOR_SIZE]
Definition: volume.c:62
unsigned long rootcluster
Definition: volume.h:61
Definition: fat_sl.h:107
unsigned char state
Definition: volume.h:77