UbixOS  2.0
fat_opts.h
Go to the documentation of this file.
1 #ifndef __FAT_OPTS_H__
2 #define __FAT_OPTS_H__
3 
4 #ifdef FATFS_USE_CUSTOM_OPTS_FILE
5  #include "fat_custom.h"
6 #endif
7 
8 //-------------------------------------------------------------
9 // Configuration
10 //-------------------------------------------------------------
11 
12 // Is the processor little endian (1) or big endian (0)
13 #ifndef FATFS_IS_LITTLE_ENDIAN
14 #define FATFS_IS_LITTLE_ENDIAN 1
15 #endif
16 
17 // Max filename Length
18 #ifndef FATFS_MAX_LONG_FILENAME
19 #define FATFS_MAX_LONG_FILENAME 260
20 #endif
21 
22 // Max open files (reduce to lower memory requirements)
23 #ifndef FATFS_MAX_OPEN_FILES
24 #define FATFS_MAX_OPEN_FILES 64
25 #endif
26 
27 // Number of sectors per FAT_BUFFER (min 1)
28 #ifndef FAT_BUFFER_SECTORS
29 #define FAT_BUFFER_SECTORS 1
30 #endif
31 
32 // Max FAT sectors to buffer (min 1)
33 // (mem used is FAT_BUFFERS * FAT_BUFFER_SECTORS * FAT_SECTOR_SIZE)
34 #ifndef FAT_BUFFERS
35 #define FAT_BUFFERS 1
36 #endif
37 
38 // Size of cluster chain cache (can be undefined)
39 // Mem used = FAT_CLUSTER_CACHE_ENTRIES * 4 * 2
40 // Improves access speed considerably
41 //#define FAT_CLUSTER_CACHE_ENTRIES 128
42 
43 // Include support for writing files (1 / 0)?
44 #ifndef FATFS_INC_WRITE_SUPPORT
45 #define FATFS_INC_WRITE_SUPPORT 1
46 #endif
47 
48 // Support long filenames (1 / 0)?
49 // (if not (0) only 8.3 format is supported)
50 #ifndef FATFS_INC_LFN_SUPPORT
51 #define FATFS_INC_LFN_SUPPORT 1
52 #endif
53 
54 // Support directory listing (1 / 0)?
55 #ifndef FATFS_DIR_LIST_SUPPORT
56 #define FATFS_DIR_LIST_SUPPORT 1
57 #endif
58 
59 // Support time/date (1 / 0)?
60 #ifndef FATFS_INC_TIME_DATE_SUPPORT
61 #define FATFS_INC_TIME_DATE_SUPPORT 0
62 #endif
63 
64 // Include support for formatting disks (1 / 0)?
65 #ifndef FATFS_INC_FORMAT_SUPPORT
66 #define FATFS_INC_FORMAT_SUPPORT 1
67 #endif
68 
69 // Sector size used
70 #define FAT_SECTOR_SIZE 512
71 
72 // Printf output (directory listing / debug)
73 #ifndef FAT_PRINTF
74 // Don't include stdio, but there is a printf function available
75 #ifdef FAT_PRINTF_NOINC_STDIO
76  extern int printf(const char* ctrl1, ... );
77  #define FAT_PRINTF(a) printf a
78  // Include stdio to use printf
79  #else
80 // #include <stdio.h>
81 #define FAT_PRINTF(a) kprintf a
82 #endif
83 #endif
84 
85 // Time/Date support requires time.h
86 #if FATFS_INC_TIME_DATE_SUPPORT
87  #include <time.h>
88 #endif
89 
90 #endif
time.h