SAMV71 Xplained Ultra Software Package 1.0

ff.h

00001 /*---------------------------------------------------------------------------/
00002 /  FatFs - FAT file system module include file  R0.10b    (C)ChaN, 2014
00003 /----------------------------------------------------------------------------/
00004 / FatFs module is a generic FAT file system module for small embedded systems.
00005 / This is a free software that opened for education, research and commercial
00006 / developments under license policy of following terms.
00007 /
00008 /  Copyright (C) 2014, ChaN, all right reserved.
00009 /
00010 / * The FatFs module is a free software and there is NO WARRANTY.
00011 / * No restriction on use. You can use, modify and redistribute it for
00012 /   personal, non-profit or commercial product UNDER YOUR RESPONSIBILITY.
00013 / * Redistributions of source code must retain the above copyright notice.
00014 /
00015 /----------------------------------------------------------------------------*/
00016 
00017 #ifndef _FATFS
00018 #define _FATFS    8051    /* Revision ID */
00019 
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00024 #include "integer.h"    /* Basic integer types */
00025 #include "ffconf.h"        /* FatFs configuration options */
00026 
00027 #if _FATFS != _FFCONF
00028 #error Wrong configuration file (ffconf.h).
00029 #endif
00030 
00031 /* Moved DBCS code from ff.c, by ATMEL */
00032 /* DBCS code ranges and SBCS extend char conversion table */
00033 
00034 #if _CODE_PAGE == 932    /* Japanese Shift-JIS */
00035 #define _DF1S    0x81    /* DBC 1st byte range 1 start */
00036 #define _DF1E    0x9F    /* DBC 1st byte range 1 end */
00037 #define _DF2S    0xE0    /* DBC 1st byte range 2 start */
00038 #define _DF2E    0xFC    /* DBC 1st byte range 2 end */
00039 #define _DS1S    0x40    /* DBC 2nd byte range 1 start */
00040 #define _DS1E    0x7E    /* DBC 2nd byte range 1 end */
00041 #define _DS2S    0x80    /* DBC 2nd byte range 2 start */
00042 #define _DS2E    0xFC    /* DBC 2nd byte range 2 end */
00043 
00044 #elif _CODE_PAGE == 936    /* Simplified Chinese GBK */
00045 #define _DF1S    0x81
00046 #define _DF1E    0xFE
00047 #define _DS1S    0x40
00048 #define _DS1E    0x7E
00049 #define _DS2S    0x80
00050 #define _DS2E    0xFE
00051 
00052 #elif _CODE_PAGE == 949    /* Korean */
00053 #define _DF1S    0x81
00054 #define _DF1E    0xFE
00055 #define _DS1S    0x41
00056 #define _DS1E    0x5A
00057 #define _DS2S    0x61
00058 #define _DS2E    0x7A
00059 #define _DS3S    0x81
00060 #define _DS3E    0xFE
00061 
00062 #elif _CODE_PAGE == 950    /* Traditional Chinese Big5 */
00063 #define _DF1S    0x81
00064 #define _DF1E    0xFE
00065 #define _DS1S    0x40
00066 #define _DS1E    0x7E
00067 #define _DS2S    0xA1
00068 #define _DS2E    0xFE
00069 
00070 #elif _CODE_PAGE == 437    /* U.S. (OEM) */
00071 #define _DF1S    0
00072 #define _EXCVT {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F,0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
00073                 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00074                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00075                 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00076 
00077 #elif _CODE_PAGE == 720    /* Arabic (OEM) */
00078 #define _DF1S    0
00079 #define _EXCVT {0x80,0x81,0x45,0x41,0x84,0x41,0x86,0x43,0x45,0x45,0x45,0x49,0x49,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x49,0x49,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
00080                 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00081                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00082                 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00083 
00084 #elif _CODE_PAGE == 737    /* Greek (OEM) */
00085 #define _DF1S    0
00086 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x96,0x97,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \
00087                 0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0xAA,0x92,0x93,0x94,0x95,0x96,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00088                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00089                 0x97,0xEA,0xEB,0xEC,0xE4,0xED,0xEE,0xE7,0xE8,0xF1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00090 
00091 #elif _CODE_PAGE == 775    /* Baltic (OEM) */
00092 #define _DF1S    0
00093 #define _EXCVT {0x80,0x9A,0x91,0xA0,0x8E,0x95,0x8F,0x80,0xAD,0xED,0x8A,0x8A,0xA1,0x8D,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0x95,0x96,0x97,0x97,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
00094                 0xA0,0xA1,0xE0,0xA3,0xA3,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00095                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xB5,0xB6,0xB7,0xB8,0xBD,0xBE,0xC6,0xC7,0xA5,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00096                 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE3,0xE8,0xE8,0xEA,0xEA,0xEE,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00097 
00098 #elif _CODE_PAGE == 850    /* Multilingual Latin 1 (OEM) */
00099 #define _DF1S    0
00100 #define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
00101                 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00102                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00103                 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00104 
00105 #elif _CODE_PAGE == 852    /* Latin 2 (OEM) */
00106 #define _DF1S    0
00107 #define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F,0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0x9F, \
00108                 0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xB8,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBD,0xBF, \
00109                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00110                 0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF}
00111 
00112 #elif _CODE_PAGE == 855    /* Cyrillic (OEM) */
00113 #define _DF1S    0
00114 #define _EXCVT {0x81,0x81,0x83,0x83,0x85,0x85,0x87,0x87,0x89,0x89,0x8B,0x8B,0x8D,0x8D,0x8F,0x8F,0x91,0x91,0x93,0x93,0x95,0x95,0x97,0x97,0x99,0x99,0x9B,0x9B,0x9D,0x9D,0x9F,0x9F, \
00115                 0xA1,0xA1,0xA3,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAB,0xAB,0xAD,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB6,0xB6,0xB8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, \
00116                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xDD,0xD9,0xDA,0xDB,0xDC,0xDD,0xE0,0xDF, \
00117                 0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE,0xEF,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFD,0xFE,0xFF}
00118 
00119 #elif _CODE_PAGE == 857    /* Turkish (OEM) */
00120 #define _DF1S    0
00121 #define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0x98,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x98,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9E, \
00122                 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA6,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00123                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00124                 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xDE,0x59,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00125 
00126 #elif _CODE_PAGE == 858    /* Multilingual Latin 1 + Euro (OEM) */
00127 #define _DF1S    0
00128 #define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
00129                 0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00130                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00131                 0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00132 
00133 #elif _CODE_PAGE == 862    /* Hebrew (OEM) */
00134 #define _DF1S    0
00135 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
00136                 0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00137                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00138                 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00139 
00140 #elif _CODE_PAGE == 866    /* Russian (OEM) */
00141 #define _DF1S    0
00142 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
00143                 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00144                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00145                 0x90,0x91,0x92,0x93,0x9d,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00146 
00147 #elif _CODE_PAGE == 874    /* Thai (OEM, Windows) */
00148 #define _DF1S    0
00149 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
00150                 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00151                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00152                 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00153 
00154 #elif _CODE_PAGE == 1250 /* Central Europe (Windows) */
00155 #define _DF1S    0
00156 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
00157                 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, \
00158                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00159                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
00160 
00161 #elif _CODE_PAGE == 1251 /* Cyrillic (Windows) */
00162 #define _DF1S    0
00163 #define _EXCVT {0x80,0x81,0x82,0x82,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
00164                 0xA0,0xA2,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, \
00165                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00166                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF}
00167 
00168 #elif _CODE_PAGE == 1252 /* Latin 1 (Windows) */
00169 #define _DF1S    0
00170 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0xAd,0x9B,0x8C,0x9D,0xAE,0x9F, \
00171                 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00172                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00173                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
00174 
00175 #elif _CODE_PAGE == 1253 /* Greek (Windows) */
00176 #define _DF1S    0
00177 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
00178                 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00179                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xA2,0xB8,0xB9,0xBA, \
00180                 0xE0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xFB,0xBC,0xFD,0xBF,0xFF}
00181 
00182 #elif _CODE_PAGE == 1254 /* Turkish (Windows) */
00183 #define _DF1S    0
00184 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x9E,0x9F, \
00185                 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00186                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00187                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
00188 
00189 #elif _CODE_PAGE == 1255 /* Hebrew (Windows) */
00190 #define _DF1S    0
00191 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
00192                 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00193                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00194                 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
00195 
00196 #elif _CODE_PAGE == 1256 /* Arabic (Windows) */
00197 #define _DF1S    0
00198 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, \
00199                 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00200                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00201                 0x41,0xE1,0x41,0xE3,0xE4,0xE5,0xE6,0x43,0x45,0x45,0x45,0x45,0xEC,0xED,0x49,0x49,0xF0,0xF1,0xF2,0xF3,0x4F,0xF5,0xF6,0xF7,0xF8,0x55,0xFA,0x55,0x55,0xFD,0xFE,0xFF}
00202 
00203 #elif _CODE_PAGE == 1257 /* Baltic (Windows) */
00204 #define _DF1S    0
00205 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
00206                 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, \
00207                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00208                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
00209 
00210 #elif _CODE_PAGE == 1258 /* Vietnam (OEM, Windows) */
00211 #define _DF1S    0
00212 #define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0xAC,0x9D,0x9E,0x9F, \
00213                 0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
00214                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
00215                 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xEC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xFE,0x9F}
00216 
00217 #elif _CODE_PAGE == 1    /* ASCII (for only non-LFN cfg) */
00218 #define _DF1S    0
00219 
00220 #else
00221 #error Unknown code page
00222 
00223 #endif
00224 
00225 
00226 
00227 /* Definitions of volume management */
00228 
00229 #if _MULTI_PARTITION        /* Multiple partition configuration */
00230 typedef struct {
00231     BYTE pd;    /* Physical drive number */
00232     BYTE pt;    /* Partition: 0:Auto detect, 1-4:Forced partition) */
00233 } PARTITION;
00234 extern PARTITION VolToPart[];    /* Volume - Partition resolution table */
00235 #define LD2PD(vol) (VolToPart[vol].pd)    /* Get physical drive number */
00236 #define LD2PT(vol) (VolToPart[vol].pt)    /* Get partition index */
00237 
00238 #else                            /* Single partition configuration */
00239 #define LD2PD(vol) (BYTE)(vol)    /* Each logical drive is bound to the same physical drive number */
00240 #define LD2PT(vol) 0            /* Find first valid partition or in SFD */
00241 
00242 #endif
00243 
00244 
00245 
00246 /* Type of path name strings on FatFs API */
00247 
00248 #if _LFN_UNICODE            /* Unicode string */
00249 #if !_USE_LFN
00250 #error _LFN_UNICODE must be 0 at non-LFN cfg.
00251 #endif
00252 #ifndef _INC_TCHAR
00253 typedef WCHAR TCHAR;
00254 #define _T(x) L ## x
00255 #define _TEXT(x) L ## x
00256 #endif
00257 
00258 #else                        /* ANSI/OEM string */
00259 #ifndef _INC_TCHAR
00260 typedef char TCHAR;
00261 #define _T(x) x
00262 #define _TEXT(x) x
00263 #endif
00264 
00265 #endif
00266 
00267 
00268 
00269 /* File system object structure (FATFS) */
00270 
00271 typedef struct {
00272     BYTE    fs_type;        /* FAT sub-type (0:Not mounted) */
00273     BYTE    drv;            /* Physical drive number */
00274     BYTE    csize;            /* Sectors per cluster (1,2,4...128) */
00275     BYTE    n_fats;            /* Number of FAT copies (1 or 2) */
00276     BYTE    wflag;            /* win[] flag (b0:dirty) */
00277     BYTE    fsi_flag;        /* FSINFO flags (b7:disabled, b0:dirty) */
00278     WORD    id;                /* File system mount ID */
00279     WORD    n_rootdir;        /* Number of root directory entries (FAT12/16) */
00280 #if _MAX_SS != _MIN_SS
00281     WORD    ssize;            /* Bytes per sector (512, 1024, 2048 or 4096) */
00282 #endif
00283 #if _FS_REENTRANT
00284     _SYNC_t    sobj;            /* Identifier of sync object */
00285 #endif
00286 #if !_FS_READONLY
00287     DWORD    last_clust;        /* Last allocated cluster */
00288     DWORD    free_clust;        /* Number of free clusters */
00289 #endif
00290 #if _FS_RPATH
00291     DWORD    cdir;            /* Current directory start cluster (0:root) */
00292 #endif
00293     DWORD    n_fatent;        /* Number of FAT entries, = number of clusters + 2 */
00294     DWORD    fsize;            /* Sectors per FAT */
00295     DWORD    volbase;        /* Volume start sector */
00296     DWORD    fatbase;        /* FAT start sector */
00297     DWORD    dirbase;        /* Root directory start sector (FAT32:Cluster#) */
00298     DWORD    database;        /* Data start sector */
00299     DWORD    winsect;        /* Current sector appearing in the win[] */
00300     BYTE    win[_MAX_SS];    /* Disk access window for Directory, FAT (and file data at tiny cfg) */
00301 } FATFS;
00302 
00303 
00304 
00305 /* File object structure (FIL) */
00306 
00307 typedef struct {
00308     FATFS*    fs;                /* Pointer to the related file system object (**do not change order**) */
00309     WORD    id;                /* Owner file system mount ID (**do not change order**) */
00310     BYTE    flag;            /* Status flags */
00311     BYTE    err;            /* Abort flag (error code) */
00312     DWORD    fptr;            /* File read/write pointer (Zeroed on file open) */
00313     DWORD    fsize;            /* File size */
00314     DWORD    sclust;            /* File start cluster (0:no cluster chain, always 0 when fsize is 0) */
00315     DWORD    clust;            /* Current cluster of fpter (not valid when fprt is 0) */
00316     DWORD    dsect;            /* Sector number appearing in buf[] (0:invalid) */
00317 #if !_FS_READONLY
00318     DWORD    dir_sect;        /* Sector number containing the directory entry */
00319     BYTE*    dir_ptr;        /* Pointer to the directory entry in the win[] */
00320 #endif
00321 #if _USE_FASTSEEK
00322     DWORD*    cltbl;            /* Pointer to the cluster link map table (Nulled on file open) */
00323 #endif
00324 #if _FS_LOCK
00325     UINT    lockid;            /* File lock ID origin from 1 (index of file semaphore table Files[]) */
00326 #endif
00327 #if !_FS_TINY
00328     BYTE    buf[_MAX_SS];    /* File private data read/write window */
00329 #endif
00330 } FIL;
00331 
00332 
00333 
00334 /* Directory object structure (DIR) */
00335 
00336 typedef struct {
00337     FATFS*    fs;                /* Pointer to the owner file system object (**do not change order**) */
00338     WORD    id;                /* Owner file system mount ID (**do not change order**) */
00339     WORD    index;            /* Current read/write index number */
00340     DWORD    sclust;            /* Table start cluster (0:Root dir) */
00341     DWORD    clust;            /* Current cluster */
00342     DWORD    sect;            /* Current sector */
00343     BYTE*    dir;            /* Pointer to the current SFN entry in the win[] */
00344     BYTE*    fn;                /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
00345 #if _FS_LOCK
00346     UINT    lockid;            /* File lock ID (index of file semaphore table Files[]) */
00347 #endif
00348 #if _USE_LFN
00349     WCHAR*    lfn;            /* Pointer to the LFN working buffer */
00350     WORD    lfn_idx;        /* Last matched LFN index number (0xFFFF:No LFN) */
00351 #endif
00352 } DIR;
00353 
00354 
00355 
00356 /* File status structure (FILINFO) */
00357 
00358 typedef struct {
00359     DWORD    fsize;            /* File size */
00360     WORD    fdate;            /* Last modified date */
00361     WORD    ftime;            /* Last modified time */
00362     BYTE    fattrib;        /* Attribute */
00363     TCHAR    fname[13];        /* Short file name (8.3 format) */
00364 #if _USE_LFN
00365     TCHAR*    lfname;            /* Pointer to the LFN buffer */
00366     UINT     lfsize;            /* Size of LFN buffer in TCHAR */
00367 #endif
00368 } FILINFO;
00369 
00370 
00371 
00372 /* File function return code (FRESULT) */
00373 
00374 typedef enum {
00375     FR_OK = 0,                /* (0) Succeeded */
00376     FR_DISK_ERR,            /* (1) A hard error occurred in the low level disk I/O layer */
00377     FR_INT_ERR,                /* (2) Assertion failed */
00378     FR_NOT_READY,            /* (3) The physical drive cannot work */
00379     FR_NO_FILE,                /* (4) Could not find the file */
00380     FR_NO_PATH,                /* (5) Could not find the path */
00381     FR_INVALID_NAME,        /* (6) The path name format is invalid */
00382     FR_DENIED,                /* (7) Access denied due to prohibited access or directory full */
00383     FR_EXIST,                /* (8) Access denied due to prohibited access */
00384     FR_INVALID_OBJECT,        /* (9) The file/directory object is invalid */
00385     FR_WRITE_PROTECTED,        /* (10) The physical drive is write protected */
00386     FR_INVALID_DRIVE,        /* (11) The logical drive number is invalid */
00387     FR_NOT_ENABLED,            /* (12) The volume has no work area */
00388     FR_NO_FILESYSTEM,        /* (13) There is no valid FAT volume */
00389     FR_MKFS_ABORTED,        /* (14) The f_mkfs() aborted due to any parameter error */
00390     FR_TIMEOUT,                /* (15) Could not get a grant to access the volume within defined period */
00391     FR_LOCKED,                /* (16) The operation is rejected according to the file sharing policy */
00392     FR_NOT_ENOUGH_CORE,        /* (17) LFN working buffer could not be allocated */
00393     FR_TOO_MANY_OPEN_FILES,    /* (18) Number of open files > _FS_SHARE */
00394     FR_INVALID_PARAMETER    /* (19) Given parameter is invalid */
00395 } FRESULT;
00396 
00397 
00398 
00399 /*--------------------------------------------------------------*/
00400 /* FatFs module application interface                           */
00401 
00402 FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode);                /* Open or create a file */
00403 FRESULT f_close (FIL* fp);                                            /* Close an open file object */
00404 FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br);            /* Read data from a file */
00405 FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw);    /* Write data to a file */
00406 FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf);    /* Forward data to the stream */
00407 FRESULT f_lseek (FIL* fp, DWORD ofs);                                /* Move file pointer of a file object */
00408 FRESULT f_truncate (FIL* fp);                                        /* Truncate file */
00409 FRESULT f_sync (FIL* fp);                                            /* Flush cached data of a writing file */
00410 FRESULT f_opendir (DIR* dp, const TCHAR* path);                        /* Open a directory */
00411 FRESULT f_closedir (DIR* dp);                                        /* Close an open directory */
00412 FRESULT f_readdir (DIR* dp, FILINFO* fno);                            /* Read a directory item */
00413 FRESULT f_mkdir (const TCHAR* path);                                /* Create a sub directory */
00414 FRESULT f_unlink (const TCHAR* path);                                /* Delete an existing file or directory */
00415 FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new);    /* Rename/Move a file or directory */
00416 FRESULT f_stat (const TCHAR* path, FILINFO* fno);                    /* Get file status */
00417 FRESULT f_chmod (const TCHAR* path, BYTE value, BYTE mask);            /* Change attribute of the file/dir */
00418 FRESULT f_utime (const TCHAR* path, const FILINFO* fno);            /* Change times-tamp of the file/dir */
00419 FRESULT f_chdir (const TCHAR* path);                                /* Change current directory */
00420 FRESULT f_chdrive (const TCHAR* path);                                /* Change current drive */
00421 FRESULT f_getcwd (TCHAR* buff, UINT len);                            /* Get current directory */
00422 FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs);    /* Get number of free clusters on the drive */
00423 FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn);    /* Get volume label */
00424 FRESULT f_setlabel (const TCHAR* label);                            /* Set volume label */
00425 FRESULT f_mount (FATFS* fs, const TCHAR* path, BYTE opt);            /* Mount/Unmount a logical drive */
00426 FRESULT f_mkfs (const TCHAR* path, BYTE sfd, UINT au);                /* Create a file system on the volume */
00427 FRESULT f_fdisk (BYTE pdrv, const DWORD szt[], void* work);            /* Divide a physical drive into some partitions */
00428 int f_putc (TCHAR c, FIL* fp);                                        /* Put a character to the file */
00429 int f_puts (const TCHAR* str, FIL* cp);                                /* Put a string to the file */
00430 int f_printf (FIL* fp, const TCHAR* str, ...);                        /* Put a formatted string to the file */
00431 TCHAR* f_gets (TCHAR* buff, int len, FIL* fp);                        /* Get a string from the file */
00432 
00433 #define f_eof(fp) (((fp)->fptr == (fp)->fsize) ? 1 : 0)
00434 #define f_error(fp) ((fp)->err)
00435 #define f_tell(fp) ((fp)->fptr)
00436 #define f_size(fp) ((fp)->fsize)
00437 
00438 #ifndef EOF
00439 #define EOF (-1)
00440 #endif
00441 
00442 
00443 
00444 
00445 /*--------------------------------------------------------------*/
00446 /* Additional user defined functions                            */
00447 
00448 /* RTC function */
00449 #if !_FS_READONLY
00450 DWORD get_fattime (void);
00451 #endif
00452 
00453 /* Unicode support functions */
00454 #if _USE_LFN                            /* Unicode - OEM code conversion */
00455 WCHAR ff_convert (WCHAR chr, UINT dir);    /* OEM-Unicode bidirectional conversion */
00456 WCHAR ff_wtoupper (WCHAR chr);            /* Unicode upper-case conversion */
00457 #if _USE_LFN == 3                        /* Memory functions */
00458 void* ff_memalloc (UINT msize);            /* Allocate memory block */
00459 void ff_memfree (void* mblock);            /* Free memory block */
00460 #endif
00461 #endif
00462 
00463 /* Sync functions */
00464 #if _FS_REENTRANT
00465 int ff_cre_syncobj (BYTE vol, _SYNC_t* sobj);    /* Create a sync object */
00466 int ff_req_grant (_SYNC_t sobj);                /* Lock sync object */
00467 void ff_rel_grant (_SYNC_t sobj);                /* Unlock sync object */
00468 int ff_del_syncobj (_SYNC_t sobj);                /* Delete a sync object */
00469 #endif
00470 
00471 
00472 
00473 
00474 /*--------------------------------------------------------------*/
00475 /* Flags and offset address                                     */
00476 
00477 
00478 /* File access control and file status flags (FIL.flag) */
00479 
00480 #define FA_READ             0x01
00481 #define FA_OPEN_EXISTING    0x00
00482 
00483 #if !_FS_READONLY
00484 #define FA_WRITE            0x02
00485 #define FA_CREATE_NEW       0x04
00486 #define FA_CREATE_ALWAYS    0x08
00487 #define FA_OPEN_ALWAYS      0x10
00488 #define FA__WRITTEN         0x20
00489 #define FA__DIRTY           0x40
00490 #endif
00491 
00492 
00493 /* FAT sub type (FATFS.fs_type) */
00494 
00495 #define FS_FAT12    1
00496 #define FS_FAT16    2
00497 #define FS_FAT32    3
00498 
00499 
00500 /* File attribute bits for directory entry */
00501 
00502 #define AM_RDO    0x01    /* Read only */
00503 #define AM_HID    0x02    /* Hidden */
00504 #define AM_SYS    0x04    /* System */
00505 #define AM_VOL    0x08    /* Volume label */
00506 #define AM_LFN    0x0F    /* LFN entry */
00507 #define AM_DIR    0x10    /* Directory */
00508 #define AM_ARC    0x20    /* Archive */
00509 #define AM_MASK    0x3F    /* Mask of defined bits */
00510 
00511 
00512 /* Fast seek feature */
00513 #define CREATE_LINKMAP    0xFFFFFFFF
00514 
00515 
00516 
00517 /*--------------------------------*/
00518 /* Multi-byte word access macros  */
00519 
00520 #if _WORD_ACCESS == 1    /* Enable word access to the FAT structure */
00521 #define LD_WORD(ptr)         (WORD)(*(WORD*)(BYTE*)(ptr))
00522 #define LD_DWORD(ptr)        (DWORD)(*(DWORD*)(BYTE*)(ptr))
00523 #define ST_WORD(ptr,val)     *(WORD*)(BYTE*)(ptr)=(WORD)(val)
00524 #define ST_DWORD(ptr,val)    *(DWORD*)(BYTE*)(ptr)=(DWORD)(val)
00525 #else                    /* Use byte-by-byte access to the FAT structure */
00526 #define LD_WORD(ptr)         (WORD)(((WORD)*((BYTE*)(ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
00527 #define LD_DWORD(ptr)        (DWORD)(((DWORD)*((BYTE*)(ptr)+3)<<24)|((DWORD)*((BYTE*)(ptr)+2)<<16)|((WORD)*((BYTE*)(ptr)+1)<<8)|*(BYTE*)(ptr))
00528 #define ST_WORD(ptr,val)     *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8)
00529 #define ST_DWORD(ptr,val)    *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8); *((BYTE*)(ptr)+2)=(BYTE)((DWORD)(val)>>16); *((BYTE*)(ptr)+3)=(BYTE)((DWORD)(val)>>24)
00530 #endif
00531 
00532 #ifdef __cplusplus
00533 }
00534 #endif
00535 
00536 #endif /* _FATFS */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines