Demonstration of a very simple unix-like shell. Based on integrating both Klaus Bu\'s SDHCFileSystem and the FATFileSystem library out of Thomas Hamilton\'s SDCard program. Result: you get high capacity + a plethora of filesystem functions.

Dependencies:   mbed

Committer:
shimniok
Date:
Tue Oct 11 15:13:42 2011 +0000
Revision:
0:792bddcf799d
Initial

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shimniok 0:792bddcf799d 1 /*---------------------------------------------------------------------------/
shimniok 0:792bddcf799d 2 / FatFs - FAT file system module include file R0.08 (C)ChaN, 2010
shimniok 0:792bddcf799d 3 /----------------------------------------------------------------------------/
shimniok 0:792bddcf799d 4 / FatFs module is a generic FAT file system module for small embedded systems.
shimniok 0:792bddcf799d 5 / This is a free software that opened for education, research and commercial
shimniok 0:792bddcf799d 6 / developments under license policy of following trems.
shimniok 0:792bddcf799d 7 /
shimniok 0:792bddcf799d 8 / Copyright (C) 2010, ChaN, all right reserved.
shimniok 0:792bddcf799d 9 /
shimniok 0:792bddcf799d 10 / * The FatFs module is a free software and there is NO WARRANTY.
shimniok 0:792bddcf799d 11 / * No restriction on use. You can use, modify and redistribute it for
shimniok 0:792bddcf799d 12 / personal, non-profit or commercial product UNDER YOUR RESPONSIBILITY.
shimniok 0:792bddcf799d 13 / * Redistributions of source code must retain the above copyright notice.
shimniok 0:792bddcf799d 14 /
shimniok 0:792bddcf799d 15 /----------------------------------------------------------------------------*/
shimniok 0:792bddcf799d 16
shimniok 0:792bddcf799d 17 //Modified by Thomas Hamilton, Copyright 2010
shimniok 0:792bddcf799d 18
shimniok 0:792bddcf799d 19 #ifndef _FATFS
shimniok 0:792bddcf799d 20 #define _FATFS 8085 /* Revision ID */
shimniok 0:792bddcf799d 21
shimniok 0:792bddcf799d 22 #ifdef __cplusplus
shimniok 0:792bddcf799d 23 extern "C" {
shimniok 0:792bddcf799d 24 #endif
shimniok 0:792bddcf799d 25
shimniok 0:792bddcf799d 26 #include "integer.h" /* Basic integer types */
shimniok 0:792bddcf799d 27 #include "ffconf.h" /* FatFs configuration options */
shimniok 0:792bddcf799d 28
shimniok 0:792bddcf799d 29 #if _FATFS != _FFCONF
shimniok 0:792bddcf799d 30 #error Wrong configuration file (ffconf.h).
shimniok 0:792bddcf799d 31 #endif
shimniok 0:792bddcf799d 32
shimniok 0:792bddcf799d 33
shimniok 0:792bddcf799d 34 /* DBCS code ranges and SBCS extend char conversion table */
shimniok 0:792bddcf799d 35
shimniok 0:792bddcf799d 36 #if _CODE_PAGE == 932 /* Japanese Shift-JIS */
shimniok 0:792bddcf799d 37 #define _DF1S 0x81 /* DBC 1st byte range 1 start */
shimniok 0:792bddcf799d 38 #define _DF1E 0x9F /* DBC 1st byte range 1 end */
shimniok 0:792bddcf799d 39 #define _DF2S 0xE0 /* DBC 1st byte range 2 start */
shimniok 0:792bddcf799d 40 #define _DF2E 0xFC /* DBC 1st byte range 2 end */
shimniok 0:792bddcf799d 41 #define _DS1S 0x40 /* DBC 2nd byte range 1 start */
shimniok 0:792bddcf799d 42 #define _DS1E 0x7E /* DBC 2nd byte range 1 end */
shimniok 0:792bddcf799d 43 #define _DS2S 0x80 /* DBC 2nd byte range 2 start */
shimniok 0:792bddcf799d 44 #define _DS2E 0xFC /* DBC 2nd byte range 2 end */
shimniok 0:792bddcf799d 45
shimniok 0:792bddcf799d 46 #elif _CODE_PAGE == 936 /* Simplified Chinese GBK */
shimniok 0:792bddcf799d 47 #define _DF1S 0x81
shimniok 0:792bddcf799d 48 #define _DF1E 0xFE
shimniok 0:792bddcf799d 49 #define _DS1S 0x40
shimniok 0:792bddcf799d 50 #define _DS1E 0x7E
shimniok 0:792bddcf799d 51 #define _DS2S 0x80
shimniok 0:792bddcf799d 52 #define _DS2E 0xFE
shimniok 0:792bddcf799d 53
shimniok 0:792bddcf799d 54 #elif _CODE_PAGE == 949 /* Korean */
shimniok 0:792bddcf799d 55 #define _DF1S 0x81
shimniok 0:792bddcf799d 56 #define _DF1E 0xFE
shimniok 0:792bddcf799d 57 #define _DS1S 0x41
shimniok 0:792bddcf799d 58 #define _DS1E 0x5A
shimniok 0:792bddcf799d 59 #define _DS2S 0x61
shimniok 0:792bddcf799d 60 #define _DS2E 0x7A
shimniok 0:792bddcf799d 61 #define _DS3S 0x81
shimniok 0:792bddcf799d 62 #define _DS3E 0xFE
shimniok 0:792bddcf799d 63
shimniok 0:792bddcf799d 64 #elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */
shimniok 0:792bddcf799d 65 #define _DF1S 0x81
shimniok 0:792bddcf799d 66 #define _DF1E 0xFE
shimniok 0:792bddcf799d 67 #define _DS1S 0x40
shimniok 0:792bddcf799d 68 #define _DS1E 0x7E
shimniok 0:792bddcf799d 69 #define _DS2S 0xA1
shimniok 0:792bddcf799d 70 #define _DS2E 0xFE
shimniok 0:792bddcf799d 71
shimniok 0:792bddcf799d 72 #elif _CODE_PAGE == 437 /* U.S. (OEM) */
shimniok 0:792bddcf799d 73 #define _DF1S 0
shimniok 0:792bddcf799d 74 #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, \
shimniok 0:792bddcf799d 75 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, \
shimniok 0:792bddcf799d 76 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, \
shimniok 0:792bddcf799d 77 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}
shimniok 0:792bddcf799d 78
shimniok 0:792bddcf799d 79 #elif _CODE_PAGE == 720 /* Arabic (OEM) */
shimniok 0:792bddcf799d 80 #define _DF1S 0
shimniok 0:792bddcf799d 81 #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, \
shimniok 0:792bddcf799d 82 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, \
shimniok 0:792bddcf799d 83 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, \
shimniok 0:792bddcf799d 84 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}
shimniok 0:792bddcf799d 85
shimniok 0:792bddcf799d 86 #elif _CODE_PAGE == 737 /* Greek (OEM) */
shimniok 0:792bddcf799d 87 #define _DF1S 0
shimniok 0:792bddcf799d 88 #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, \
shimniok 0:792bddcf799d 89 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, \
shimniok 0:792bddcf799d 90 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, \
shimniok 0:792bddcf799d 91 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}
shimniok 0:792bddcf799d 92
shimniok 0:792bddcf799d 93 #elif _CODE_PAGE == 775 /* Baltic (OEM) */
shimniok 0:792bddcf799d 94 #define _DF1S 0
shimniok 0:792bddcf799d 95 #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, \
shimniok 0:792bddcf799d 96 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, \
shimniok 0:792bddcf799d 97 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, \
shimniok 0:792bddcf799d 98 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}
shimniok 0:792bddcf799d 99
shimniok 0:792bddcf799d 100 #elif _CODE_PAGE == 850 /* Multilingual Latin 1 (OEM) */
shimniok 0:792bddcf799d 101 #define _DF1S 0
shimniok 0:792bddcf799d 102 #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, \
shimniok 0:792bddcf799d 103 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, \
shimniok 0:792bddcf799d 104 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, \
shimniok 0:792bddcf799d 105 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}
shimniok 0:792bddcf799d 106
shimniok 0:792bddcf799d 107 #elif _CODE_PAGE == 852 /* Latin 2 (OEM) */
shimniok 0:792bddcf799d 108 #define _DF1S 0
shimniok 0:792bddcf799d 109 #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, \
shimniok 0:792bddcf799d 110 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, \
shimniok 0:792bddcf799d 111 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, \
shimniok 0:792bddcf799d 112 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}
shimniok 0:792bddcf799d 113
shimniok 0:792bddcf799d 114 #elif _CODE_PAGE == 855 /* Cyrillic (OEM) */
shimniok 0:792bddcf799d 115 #define _DF1S 0
shimniok 0:792bddcf799d 116 #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, \
shimniok 0:792bddcf799d 117 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, \
shimniok 0:792bddcf799d 118 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, \
shimniok 0:792bddcf799d 119 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}
shimniok 0:792bddcf799d 120
shimniok 0:792bddcf799d 121 #elif _CODE_PAGE == 857 /* Turkish (OEM) */
shimniok 0:792bddcf799d 122 #define _DF1S 0
shimniok 0:792bddcf799d 123 #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, \
shimniok 0:792bddcf799d 124 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, \
shimniok 0:792bddcf799d 125 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, \
shimniok 0:792bddcf799d 126 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}
shimniok 0:792bddcf799d 127
shimniok 0:792bddcf799d 128 #elif _CODE_PAGE == 858 /* Multilingual Latin 1 + Euro (OEM) */
shimniok 0:792bddcf799d 129 #define _DF1S 0
shimniok 0:792bddcf799d 130 #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, \
shimniok 0:792bddcf799d 131 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, \
shimniok 0:792bddcf799d 132 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, \
shimniok 0:792bddcf799d 133 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}
shimniok 0:792bddcf799d 134
shimniok 0:792bddcf799d 135 #elif _CODE_PAGE == 862 /* Hebrew (OEM) */
shimniok 0:792bddcf799d 136 #define _DF1S 0
shimniok 0:792bddcf799d 137 #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, \
shimniok 0:792bddcf799d 138 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, \
shimniok 0:792bddcf799d 139 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, \
shimniok 0:792bddcf799d 140 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}
shimniok 0:792bddcf799d 141
shimniok 0:792bddcf799d 142 #elif _CODE_PAGE == 866 /* Russian (OEM) */
shimniok 0:792bddcf799d 143 #define _DF1S 0
shimniok 0:792bddcf799d 144 #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, \
shimniok 0:792bddcf799d 145 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, \
shimniok 0:792bddcf799d 146 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, \
shimniok 0:792bddcf799d 147 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}
shimniok 0:792bddcf799d 148
shimniok 0:792bddcf799d 149 #elif _CODE_PAGE == 874 /* Thai (OEM, Windows) */
shimniok 0:792bddcf799d 150 #define _DF1S 0
shimniok 0:792bddcf799d 151 #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, \
shimniok 0:792bddcf799d 152 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, \
shimniok 0:792bddcf799d 153 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, \
shimniok 0:792bddcf799d 154 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}
shimniok 0:792bddcf799d 155
shimniok 0:792bddcf799d 156 #elif _CODE_PAGE == 1250 /* Central Europe (Windows) */
shimniok 0:792bddcf799d 157 #define _DF1S 0
shimniok 0:792bddcf799d 158 #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, \
shimniok 0:792bddcf799d 159 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, \
shimniok 0:792bddcf799d 160 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, \
shimniok 0:792bddcf799d 161 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}
shimniok 0:792bddcf799d 162
shimniok 0:792bddcf799d 163 #elif _CODE_PAGE == 1251 /* Cyrillic (Windows) */
shimniok 0:792bddcf799d 164 #define _DF1S 0
shimniok 0:792bddcf799d 165 #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, \
shimniok 0:792bddcf799d 166 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, \
shimniok 0:792bddcf799d 167 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, \
shimniok 0:792bddcf799d 168 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}
shimniok 0:792bddcf799d 169
shimniok 0:792bddcf799d 170 #elif _CODE_PAGE == 1252 /* Latin 1 (Windows) */
shimniok 0:792bddcf799d 171 #define _DF1S 0
shimniok 0:792bddcf799d 172 #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, \
shimniok 0:792bddcf799d 173 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, \
shimniok 0:792bddcf799d 174 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, \
shimniok 0:792bddcf799d 175 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}
shimniok 0:792bddcf799d 176
shimniok 0:792bddcf799d 177 #elif _CODE_PAGE == 1253 /* Greek (Windows) */
shimniok 0:792bddcf799d 178 #define _DF1S 0
shimniok 0:792bddcf799d 179 #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, \
shimniok 0:792bddcf799d 180 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, \
shimniok 0:792bddcf799d 181 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, \
shimniok 0:792bddcf799d 182 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}
shimniok 0:792bddcf799d 183
shimniok 0:792bddcf799d 184 #elif _CODE_PAGE == 1254 /* Turkish (Windows) */
shimniok 0:792bddcf799d 185 #define _DF1S 0
shimniok 0:792bddcf799d 186 #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, \
shimniok 0:792bddcf799d 187 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, \
shimniok 0:792bddcf799d 188 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, \
shimniok 0:792bddcf799d 189 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}
shimniok 0:792bddcf799d 190
shimniok 0:792bddcf799d 191 #elif _CODE_PAGE == 1255 /* Hebrew (Windows) */
shimniok 0:792bddcf799d 192 #define _DF1S 0
shimniok 0:792bddcf799d 193 #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, \
shimniok 0:792bddcf799d 194 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, \
shimniok 0:792bddcf799d 195 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, \
shimniok 0:792bddcf799d 196 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}
shimniok 0:792bddcf799d 197
shimniok 0:792bddcf799d 198 #elif _CODE_PAGE == 1256 /* Arabic (Windows) */
shimniok 0:792bddcf799d 199 #define _DF1S 0
shimniok 0:792bddcf799d 200 #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, \
shimniok 0:792bddcf799d 201 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, \
shimniok 0:792bddcf799d 202 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, \
shimniok 0:792bddcf799d 203 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}
shimniok 0:792bddcf799d 204
shimniok 0:792bddcf799d 205 #elif _CODE_PAGE == 1257 /* Baltic (Windows) */
shimniok 0:792bddcf799d 206 #define _DF1S 0
shimniok 0:792bddcf799d 207 #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, \
shimniok 0:792bddcf799d 208 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, \
shimniok 0:792bddcf799d 209 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, \
shimniok 0:792bddcf799d 210 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}
shimniok 0:792bddcf799d 211
shimniok 0:792bddcf799d 212 #elif _CODE_PAGE == 1258 /* Vietnam (OEM, Windows) */
shimniok 0:792bddcf799d 213 #define _DF1S 0
shimniok 0:792bddcf799d 214 #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, \
shimniok 0:792bddcf799d 215 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, \
shimniok 0:792bddcf799d 216 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, \
shimniok 0:792bddcf799d 217 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}
shimniok 0:792bddcf799d 218
shimniok 0:792bddcf799d 219 #elif _CODE_PAGE == 1 /* ASCII (for only non-LFN cfg) */
shimniok 0:792bddcf799d 220 #define _DF1S 0
shimniok 0:792bddcf799d 221
shimniok 0:792bddcf799d 222 #else
shimniok 0:792bddcf799d 223 #error Unknown code page
shimniok 0:792bddcf799d 224
shimniok 0:792bddcf799d 225 #endif
shimniok 0:792bddcf799d 226
shimniok 0:792bddcf799d 227
shimniok 0:792bddcf799d 228
shimniok 0:792bddcf799d 229 /* Definitions corresponds to volume management */
shimniok 0:792bddcf799d 230
shimniok 0:792bddcf799d 231 #if _MULTI_PARTITION /* Multiple partition configuration */
shimniok 0:792bddcf799d 232 #define LD2PD(drv) (Drives[drv].pd) /* Get physical drive# */
shimniok 0:792bddcf799d 233 #define LD2PT(drv) (Drives[drv].pt) /* Get partition# */
shimniok 0:792bddcf799d 234 typedef struct {
shimniok 0:792bddcf799d 235 BYTE pd; /* Physical drive# */
shimniok 0:792bddcf799d 236 BYTE pt; /* Partition # (0-3) */
shimniok 0:792bddcf799d 237 } PARTITION;
shimniok 0:792bddcf799d 238 extern const PARTITION Drives[]; /* Logical drive# to physical location conversion table */
shimniok 0:792bddcf799d 239
shimniok 0:792bddcf799d 240 #else /* Single partition configuration */
shimniok 0:792bddcf799d 241 #define LD2PD(drv) (drv) /* Physical drive# is equal to the logical drive# */
shimniok 0:792bddcf799d 242 #define LD2PT(drv) 0 /* Always mounts the 1st partition */
shimniok 0:792bddcf799d 243
shimniok 0:792bddcf799d 244 #endif
shimniok 0:792bddcf799d 245
shimniok 0:792bddcf799d 246
shimniok 0:792bddcf799d 247
shimniok 0:792bddcf799d 248 /* Type of path name strings on FatFs API */
shimniok 0:792bddcf799d 249
shimniok 0:792bddcf799d 250 #if _LFN_UNICODE /* Unicode string */
shimniok 0:792bddcf799d 251 #if !_USE_LFN
shimniok 0:792bddcf799d 252 #error _LFN_UNICODE must be 0 in non-LFN cfg.
shimniok 0:792bddcf799d 253 #endif
shimniok 0:792bddcf799d 254 #ifndef _INC_TCHAR
shimniok 0:792bddcf799d 255 typedef WCHAR TCHAR;
shimniok 0:792bddcf799d 256 #define _T(x) L ## x
shimniok 0:792bddcf799d 257 #define _TEXT(x) L ## x
shimniok 0:792bddcf799d 258 #endif
shimniok 0:792bddcf799d 259
shimniok 0:792bddcf799d 260 #else /* ANSI/OEM string */
shimniok 0:792bddcf799d 261 #ifndef _INC_TCHAR
shimniok 0:792bddcf799d 262 typedef char TCHAR;
shimniok 0:792bddcf799d 263 #define _T(x) x
shimniok 0:792bddcf799d 264 #define _TEXT(x) x
shimniok 0:792bddcf799d 265 #endif
shimniok 0:792bddcf799d 266
shimniok 0:792bddcf799d 267 #endif
shimniok 0:792bddcf799d 268
shimniok 0:792bddcf799d 269
shimniok 0:792bddcf799d 270
shimniok 0:792bddcf799d 271 /* Definitions corresponds to file shareing feature */
shimniok 0:792bddcf799d 272
shimniok 0:792bddcf799d 273 #if _FS_SHARE
shimniok 0:792bddcf799d 274 #if _FS_READONLY
shimniok 0:792bddcf799d 275 #error _FS_SHARE must be 0 on R/O cfg.
shimniok 0:792bddcf799d 276 #endif
shimniok 0:792bddcf799d 277 typedef struct {
shimniok 0:792bddcf799d 278 DWORD clu; /* File ID 1, directory */
shimniok 0:792bddcf799d 279 WORD idx; /* File ID 2, index in the directory */
shimniok 0:792bddcf799d 280 WORD ctr; /* File open counter, 0:none, 0x01..0xFF:read open count, 0x100:in write open */
shimniok 0:792bddcf799d 281 } FILESEM;
shimniok 0:792bddcf799d 282 #endif
shimniok 0:792bddcf799d 283
shimniok 0:792bddcf799d 284
shimniok 0:792bddcf799d 285
shimniok 0:792bddcf799d 286 /* File system object structure (FATFS) */
shimniok 0:792bddcf799d 287
shimniok 0:792bddcf799d 288 typedef struct {
shimniok 0:792bddcf799d 289 BYTE fs_type; /* FAT sub-type (0:Not mounted) */
shimniok 0:792bddcf799d 290 BYTE drv; /* Physical drive number */
shimniok 0:792bddcf799d 291 BYTE csize; /* Sectors per cluster (1,2,4...128) */
shimniok 0:792bddcf799d 292 BYTE n_fats; /* Number of FAT copies (1,2) */
shimniok 0:792bddcf799d 293 BYTE wflag; /* win[] dirty flag (1:must be written back) */
shimniok 0:792bddcf799d 294 BYTE fsi_flag; /* fsinfo dirty flag (1:must be written back) */
shimniok 0:792bddcf799d 295 WORD id; /* File system mount ID */
shimniok 0:792bddcf799d 296 WORD n_rootdir; /* Number of root directory entries (FAT12/16) */
shimniok 0:792bddcf799d 297 #if _MAX_SS != 512
shimniok 0:792bddcf799d 298 WORD ssize; /* Bytes per sector (512,1024,2048,4096) */
shimniok 0:792bddcf799d 299 #endif
shimniok 0:792bddcf799d 300 #if _FS_REENTRANT
shimniok 0:792bddcf799d 301 _SYNC_t sobj; /* Identifier of sync object */
shimniok 0:792bddcf799d 302 #endif
shimniok 0:792bddcf799d 303 #if !_FS_READONLY
shimniok 0:792bddcf799d 304 DWORD last_clust; /* Last allocated cluster */
shimniok 0:792bddcf799d 305 DWORD free_clust; /* Number of free clusters */
shimniok 0:792bddcf799d 306 DWORD fsi_sector; /* fsinfo sector (FAT32) */
shimniok 0:792bddcf799d 307 #endif
shimniok 0:792bddcf799d 308 #if _FS_RPATH
shimniok 0:792bddcf799d 309 DWORD cdir; /* Current directory start cluster (0:root) */
shimniok 0:792bddcf799d 310 #endif
shimniok 0:792bddcf799d 311 DWORD n_fatent; /* Number of FAT entries (= number of clusters + 2) */
shimniok 0:792bddcf799d 312 DWORD fsize; /* Sectors per FAT */
shimniok 0:792bddcf799d 313 DWORD fatbase; /* FAT start sector */
shimniok 0:792bddcf799d 314 DWORD dirbase; /* Root directory start sector (FAT32:Cluster#) */
shimniok 0:792bddcf799d 315 DWORD database; /* Data start sector */
shimniok 0:792bddcf799d 316 DWORD winsect; /* Current sector appearing in the win[] */
shimniok 0:792bddcf799d 317 BYTE win[_MAX_SS]; /* Disk access window for Directory, FAT (and Data on tiny cfg) */
shimniok 0:792bddcf799d 318 #if _FS_SHARE
shimniok 0:792bddcf799d 319 FILESEM flsem[_FS_SHARE]; /* File lock semaphores */
shimniok 0:792bddcf799d 320 #endif
shimniok 0:792bddcf799d 321 } FATFS;
shimniok 0:792bddcf799d 322
shimniok 0:792bddcf799d 323
shimniok 0:792bddcf799d 324
shimniok 0:792bddcf799d 325 /* File object structure (FIL) */
shimniok 0:792bddcf799d 326
shimniok 0:792bddcf799d 327 typedef struct {
shimniok 0:792bddcf799d 328 FATFS* fs; /* Pointer to the owner file system object */
shimniok 0:792bddcf799d 329 WORD id; /* Owner file system mount ID */
shimniok 0:792bddcf799d 330 BYTE flag; /* File status flags */
shimniok 0:792bddcf799d 331 BYTE pad1;
shimniok 0:792bddcf799d 332 DWORD fptr; /* File read/write pointer */
shimniok 0:792bddcf799d 333 DWORD fsize; /* File size */
shimniok 0:792bddcf799d 334 DWORD org_clust; /* File start cluster (0 when fsize==0) */
shimniok 0:792bddcf799d 335 DWORD curr_clust; /* Current cluster */
shimniok 0:792bddcf799d 336 DWORD dsect; /* Current data sector */
shimniok 0:792bddcf799d 337 #if !_FS_READONLY
shimniok 0:792bddcf799d 338 DWORD dir_sect; /* Sector containing the directory entry */
shimniok 0:792bddcf799d 339 BYTE* dir_ptr; /* Ponter to the directory entry in the window */
shimniok 0:792bddcf799d 340 #endif
shimniok 0:792bddcf799d 341 #if _USE_FASTSEEK
shimniok 0:792bddcf799d 342 DWORD* cltbl; /* Pointer to the cluster link map table */
shimniok 0:792bddcf799d 343 #endif
shimniok 0:792bddcf799d 344 #if _FS_SHARE
shimniok 0:792bddcf799d 345 UINT lockid; /* File lock ID */
shimniok 0:792bddcf799d 346 #endif
shimniok 0:792bddcf799d 347 #if !_FS_TINY
shimniok 0:792bddcf799d 348 BYTE buf[_MAX_SS]; /* File data read/write buffer */
shimniok 0:792bddcf799d 349 #endif
shimniok 0:792bddcf799d 350 } FAT_FIL;
shimniok 0:792bddcf799d 351
shimniok 0:792bddcf799d 352
shimniok 0:792bddcf799d 353
shimniok 0:792bddcf799d 354 /* Directory object structure (FAT_DIR) */
shimniok 0:792bddcf799d 355
shimniok 0:792bddcf799d 356 typedef struct {
shimniok 0:792bddcf799d 357 FATFS* fs; /* Pointer to the owner file system object */
shimniok 0:792bddcf799d 358 WORD id; /* Owner file system mount ID */
shimniok 0:792bddcf799d 359 WORD index; /* Current read/write index number */
shimniok 0:792bddcf799d 360 DWORD sclust; /* Table start cluster (0:Root dir) */
shimniok 0:792bddcf799d 361 DWORD clust; /* Current cluster */
shimniok 0:792bddcf799d 362 DWORD sect; /* Current sector */
shimniok 0:792bddcf799d 363 BYTE* dir; /* Pointer to the current SFN entry in the win[] */
shimniok 0:792bddcf799d 364 BYTE* fn; /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
shimniok 0:792bddcf799d 365 #if _USE_LFN
shimniok 0:792bddcf799d 366 WCHAR* lfn; /* Pointer to the LFN working buffer */
shimniok 0:792bddcf799d 367 WORD lfn_idx; /* Last matched LFN index number (0xFFFF:No LFN) */
shimniok 0:792bddcf799d 368 #endif
shimniok 0:792bddcf799d 369 } FAT_DIR;
shimniok 0:792bddcf799d 370
shimniok 0:792bddcf799d 371
shimniok 0:792bddcf799d 372
shimniok 0:792bddcf799d 373 /* File status structure (FILINFO) */
shimniok 0:792bddcf799d 374
shimniok 0:792bddcf799d 375 typedef struct {
shimniok 0:792bddcf799d 376 DWORD fsize; /* File size */
shimniok 0:792bddcf799d 377 WORD fdate; /* Last modified date */
shimniok 0:792bddcf799d 378 WORD ftime; /* Last modified time */
shimniok 0:792bddcf799d 379 BYTE fattrib; /* Attribute */
shimniok 0:792bddcf799d 380 TCHAR fname[13]; /* Short file name (8.3 format) */
shimniok 0:792bddcf799d 381 #if _USE_LFN
shimniok 0:792bddcf799d 382 TCHAR* lfname; /* Pointer to the LFN buffer */
shimniok 0:792bddcf799d 383 int lfsize; /* Size of LFN buffer [chrs] */
shimniok 0:792bddcf799d 384 #endif
shimniok 0:792bddcf799d 385 } FILINFO;
shimniok 0:792bddcf799d 386
shimniok 0:792bddcf799d 387
shimniok 0:792bddcf799d 388
shimniok 0:792bddcf799d 389 /* File function return code (FRESULT) */
shimniok 0:792bddcf799d 390
shimniok 0:792bddcf799d 391 typedef enum {
shimniok 0:792bddcf799d 392 FR_OK = 0, /* (0) Succeeded */
shimniok 0:792bddcf799d 393 FR_DISK_ERR, /* (1) A hard error occured in the low level disk I/O layer */
shimniok 0:792bddcf799d 394 FR_INT_ERR, /* (2) Assertion failed */
shimniok 0:792bddcf799d 395 FR_NOT_READY, /* (3) The physical drive cannot work */
shimniok 0:792bddcf799d 396 FR_NO_FILE, /* (4) Could not find the file */
shimniok 0:792bddcf799d 397 FR_NO_PATH, /* (5) Could not find the path */
shimniok 0:792bddcf799d 398 FR_INVALID_NAME, /* (6) The path name format is invalid */
shimniok 0:792bddcf799d 399 FR_DENIED, /* (7) Acces denied due to prohibited access or directory full */
shimniok 0:792bddcf799d 400 FR_EXIST, /* (8) Acces denied due to prohibited access */
shimniok 0:792bddcf799d 401 FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */
shimniok 0:792bddcf799d 402 FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */
shimniok 0:792bddcf799d 403 FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */
shimniok 0:792bddcf799d 404 FR_NOT_ENABLED, /* (12) The volume has no work area */
shimniok 0:792bddcf799d 405 FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume on the physical drive */
shimniok 0:792bddcf799d 406 FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any parameter error */
shimniok 0:792bddcf799d 407 FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */
shimniok 0:792bddcf799d 408 FR_LOCKED, /* (16) The operation is rejected according to the file shareing policy */
shimniok 0:792bddcf799d 409 FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */
shimniok 0:792bddcf799d 410 FR_TOO_MANY_OPEN_FILES /* (18) Number of open files > _FS_SHARE */
shimniok 0:792bddcf799d 411 } FRESULT;
shimniok 0:792bddcf799d 412
shimniok 0:792bddcf799d 413
shimniok 0:792bddcf799d 414
shimniok 0:792bddcf799d 415 /*--------------------------------------------------------------*/
shimniok 0:792bddcf799d 416 /* FatFs module application interface */
shimniok 0:792bddcf799d 417
shimniok 0:792bddcf799d 418 FRESULT f_mount (BYTE, FATFS*); /* Mount/Unmount a logical drive */
shimniok 0:792bddcf799d 419 FRESULT f_open (FAT_FIL*, const TCHAR*, BYTE); /* Open or create a file */
shimniok 0:792bddcf799d 420 FRESULT f_read (FAT_FIL*, void*, UINT, UINT*); /* Read data from a file */
shimniok 0:792bddcf799d 421 FRESULT f_lseek (FAT_FIL*, DWORD); /* Move file pointer of a file object */
shimniok 0:792bddcf799d 422 FRESULT f_close (FAT_FIL*); /* Close an open file object */
shimniok 0:792bddcf799d 423 FRESULT f_opendir (FAT_DIR*, const TCHAR*); /* Open an existing directory */
shimniok 0:792bddcf799d 424 FRESULT f_readdir (FAT_DIR*, FILINFO*); /* Read a directory item */
shimniok 0:792bddcf799d 425 FRESULT f_stat (const TCHAR*, FILINFO*); /* Get file status */
shimniok 0:792bddcf799d 426 #if !_FS_READONLY
shimniok 0:792bddcf799d 427 FRESULT f_write (FAT_FIL*, const void*, UINT, UINT*); /* Write data to a file */
shimniok 0:792bddcf799d 428 FRESULT f_getfree (const TCHAR*, DWORD*, FATFS**); /* Get number of free clusters on the drive */
shimniok 0:792bddcf799d 429 FRESULT f_truncate (FAT_FIL*); /* Truncate file */
shimniok 0:792bddcf799d 430 FRESULT f_sync (FAT_FIL*); /* Flush cached data of a writing file */
shimniok 0:792bddcf799d 431 FRESULT f_unlink (const TCHAR*); /* Delete an existing file or directory */
shimniok 0:792bddcf799d 432 FRESULT f_mkdir (const TCHAR*); /* Create a new directory */
shimniok 0:792bddcf799d 433 FRESULT f_chmod (const TCHAR*, BYTE, BYTE); /* Change attriburte of the file/dir */
shimniok 0:792bddcf799d 434 FRESULT f_utime (const TCHAR*, const FILINFO*); /* Change timestamp of the file/dir */
shimniok 0:792bddcf799d 435 FRESULT f_rename (const TCHAR*, const TCHAR*); /* Rename/Move a file or directory */
shimniok 0:792bddcf799d 436 #endif
shimniok 0:792bddcf799d 437 #if _USE_FORWARD
shimniok 0:792bddcf799d 438 FRESULT f_forward (FAT_FIL*, UINT(*)(const BYTE*,UINT), UINT, UINT*); /* Forward data to the stream */
shimniok 0:792bddcf799d 439 #endif
shimniok 0:792bddcf799d 440 #if _USE_MKFS
shimniok 0:792bddcf799d 441 FRESULT f_mkfs (BYTE, BYTE, UINT); /* Create a file system on the drive */
shimniok 0:792bddcf799d 442 #endif
shimniok 0:792bddcf799d 443 #if _FS_RPATH
shimniok 0:792bddcf799d 444 FRESULT f_chdir (const TCHAR*); /* Change current directory */
shimniok 0:792bddcf799d 445 FRESULT f_chdrive (BYTE); /* Change current drive */
shimniok 0:792bddcf799d 446 #endif
shimniok 0:792bddcf799d 447 #if _USE_STRFUNC
shimniok 0:792bddcf799d 448 int f_putc (TCHAR, FAT_FIL*); /* Put a character to the file */
shimniok 0:792bddcf799d 449 int f_puts (const TCHAR*, FAT_FIL*); /* Put a string to the file */
shimniok 0:792bddcf799d 450 int f_printf (FAT_FIL*, const TCHAR*, ...); /* Put a formatted string to the file */
shimniok 0:792bddcf799d 451 TCHAR* f_gets (TCHAR*, int, FAT_FIL*); /* Get a string from the file */
shimniok 0:792bddcf799d 452 #define f_eof(fp) (((fp)->fptr == (fp)->fsize) ? 1 : 0)
shimniok 0:792bddcf799d 453 #define f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
shimniok 0:792bddcf799d 454 #ifndef EOF
shimniok 0:792bddcf799d 455 #define EOF (-1)
shimniok 0:792bddcf799d 456 #endif
shimniok 0:792bddcf799d 457 #endif
shimniok 0:792bddcf799d 458
shimniok 0:792bddcf799d 459
shimniok 0:792bddcf799d 460
shimniok 0:792bddcf799d 461 /*--------------------------------------------------------------*/
shimniok 0:792bddcf799d 462 /* Additional user defined functions */
shimniok 0:792bddcf799d 463
shimniok 0:792bddcf799d 464 /* RTC function */
shimniok 0:792bddcf799d 465 #if !_FS_READONLY
shimniok 0:792bddcf799d 466 DWORD get_fattime (void);
shimniok 0:792bddcf799d 467 #endif
shimniok 0:792bddcf799d 468
shimniok 0:792bddcf799d 469 /* Unicode support functions */
shimniok 0:792bddcf799d 470 #if _USE_LFN /* Unicode - OEM code conversion */
shimniok 0:792bddcf799d 471 WCHAR ff_convert (WCHAR, UINT); /* OEM-Unicode bidirectional conversion */
shimniok 0:792bddcf799d 472 WCHAR ff_wtoupper (WCHAR); /* Unicode upper-case conversion */
shimniok 0:792bddcf799d 473 #if _USE_LFN == 3 /* Memory functions */
shimniok 0:792bddcf799d 474 void* ff_memalloc (UINT); /* Allocate memory block */
shimniok 0:792bddcf799d 475 void ff_memfree (void*); /* Free memory block */
shimniok 0:792bddcf799d 476 #endif
shimniok 0:792bddcf799d 477 #endif
shimniok 0:792bddcf799d 478
shimniok 0:792bddcf799d 479 /* Sync functions */
shimniok 0:792bddcf799d 480 #if _FS_REENTRANT
shimniok 0:792bddcf799d 481 int ff_cre_syncobj (BYTE, _SYNC_t*);/* Create a sync object */
shimniok 0:792bddcf799d 482 int ff_del_syncobj (_SYNC_t); /* Delete a sync object */
shimniok 0:792bddcf799d 483 int ff_req_grant (_SYNC_t); /* Lock sync object */
shimniok 0:792bddcf799d 484 void ff_rel_grant (_SYNC_t); /* Unlock sync object */
shimniok 0:792bddcf799d 485 #endif
shimniok 0:792bddcf799d 486
shimniok 0:792bddcf799d 487
shimniok 0:792bddcf799d 488
shimniok 0:792bddcf799d 489
shimniok 0:792bddcf799d 490 /*--------------------------------------------------------------*/
shimniok 0:792bddcf799d 491 /* Flags and offset address */
shimniok 0:792bddcf799d 492
shimniok 0:792bddcf799d 493
shimniok 0:792bddcf799d 494 /* File access control and file status flags (FIL.flag) */
shimniok 0:792bddcf799d 495
shimniok 0:792bddcf799d 496 #define FA_READ 0x01
shimniok 0:792bddcf799d 497 #define FA_OPEN_EXISTING 0x00
shimniok 0:792bddcf799d 498 #define FA__ERROR 0x80
shimniok 0:792bddcf799d 499
shimniok 0:792bddcf799d 500 #if !_FS_READONLY
shimniok 0:792bddcf799d 501 #define FA_WRITE 0x02
shimniok 0:792bddcf799d 502 #define FA_CREATE_NEW 0x04
shimniok 0:792bddcf799d 503 #define FA_CREATE_ALWAYS 0x08
shimniok 0:792bddcf799d 504 #define FA_OPEN_ALWAYS 0x10
shimniok 0:792bddcf799d 505 #define FA__WRITTEN 0x20
shimniok 0:792bddcf799d 506 #define FA__DIRTY 0x40
shimniok 0:792bddcf799d 507 #endif
shimniok 0:792bddcf799d 508
shimniok 0:792bddcf799d 509
shimniok 0:792bddcf799d 510 /* FAT sub type (FATFS.fs_type) */
shimniok 0:792bddcf799d 511
shimniok 0:792bddcf799d 512 #define FS_FAT12 1
shimniok 0:792bddcf799d 513 #define FS_FAT16 2
shimniok 0:792bddcf799d 514 #define FS_FAT32 3
shimniok 0:792bddcf799d 515
shimniok 0:792bddcf799d 516
shimniok 0:792bddcf799d 517 /* File attribute bits for directory entry */
shimniok 0:792bddcf799d 518
shimniok 0:792bddcf799d 519 #define AM_RDO 0x01 /* Read only */
shimniok 0:792bddcf799d 520 #define AM_HID 0x02 /* Hidden */
shimniok 0:792bddcf799d 521 #define AM_SYS 0x04 /* System */
shimniok 0:792bddcf799d 522 #define AM_VOL 0x08 /* Volume label */
shimniok 0:792bddcf799d 523 #define AM_LFN 0x0F /* LFN entry */
shimniok 0:792bddcf799d 524 #define AM_DIR 0x10 /* Directory */
shimniok 0:792bddcf799d 525 #define AM_ARC 0x20 /* Archive */
shimniok 0:792bddcf799d 526 #define AM_MASK 0x3F /* Mask of defined bits */
shimniok 0:792bddcf799d 527
shimniok 0:792bddcf799d 528
shimniok 0:792bddcf799d 529 /* Fast seek function */
shimniok 0:792bddcf799d 530 #define CREATE_LINKMAP 0xFFFFFFFF
shimniok 0:792bddcf799d 531
shimniok 0:792bddcf799d 532
shimniok 0:792bddcf799d 533 /* FatFs refers the members in the FAT structures with byte offset instead of
shimniok 0:792bddcf799d 534 / structure member because there are incompatibility of the packing option
shimniok 0:792bddcf799d 535 / between various compilers. */
shimniok 0:792bddcf799d 536
shimniok 0:792bddcf799d 537 #define BS_jmpBoot 0
shimniok 0:792bddcf799d 538 #define BS_OEMName 3
shimniok 0:792bddcf799d 539 #define BPB_BytsPerSec 11
shimniok 0:792bddcf799d 540 #define BPB_SecPerClus 13
shimniok 0:792bddcf799d 541 #define BPB_RsvdSecCnt 14
shimniok 0:792bddcf799d 542 #define BPB_NumFATs 16
shimniok 0:792bddcf799d 543 #define BPB_RootEntCnt 17
shimniok 0:792bddcf799d 544 #define BPB_TotSec16 19
shimniok 0:792bddcf799d 545 #define BPB_Media 21
shimniok 0:792bddcf799d 546 #define BPB_FATSz16 22
shimniok 0:792bddcf799d 547 #define BPB_SecPerTrk 24
shimniok 0:792bddcf799d 548 #define BPB_NumHeads 26
shimniok 0:792bddcf799d 549 #define BPB_HiddSec 28
shimniok 0:792bddcf799d 550 #define BPB_TotSec32 32
shimniok 0:792bddcf799d 551 #define BS_55AA 510
shimniok 0:792bddcf799d 552
shimniok 0:792bddcf799d 553 #define BS_DrvNum 36
shimniok 0:792bddcf799d 554 #define BS_BootSig 38
shimniok 0:792bddcf799d 555 #define BS_VolID 39
shimniok 0:792bddcf799d 556 #define BS_VolLab 43
shimniok 0:792bddcf799d 557 #define BS_FilSysType 54
shimniok 0:792bddcf799d 558
shimniok 0:792bddcf799d 559 #define BPB_FATSz32 36
shimniok 0:792bddcf799d 560 #define BPB_ExtFlags 40
shimniok 0:792bddcf799d 561 #define BPB_FSVer 42
shimniok 0:792bddcf799d 562 #define BPB_RootClus 44
shimniok 0:792bddcf799d 563 #define BPB_FSInfo 48
shimniok 0:792bddcf799d 564 #define BPB_BkBootSec 50
shimniok 0:792bddcf799d 565 #define BS_DrvNum32 64
shimniok 0:792bddcf799d 566 #define BS_BootSig32 66
shimniok 0:792bddcf799d 567 #define BS_VolID32 67
shimniok 0:792bddcf799d 568 #define BS_VolLab32 71
shimniok 0:792bddcf799d 569 #define BS_FilSysType32 82
shimniok 0:792bddcf799d 570
shimniok 0:792bddcf799d 571 #define FSI_LeadSig 0
shimniok 0:792bddcf799d 572 #define FSI_StrucSig 484
shimniok 0:792bddcf799d 573 #define FSI_Free_Count 488
shimniok 0:792bddcf799d 574 #define FSI_Nxt_Free 492
shimniok 0:792bddcf799d 575
shimniok 0:792bddcf799d 576 #define MBR_Table 446
shimniok 0:792bddcf799d 577
shimniok 0:792bddcf799d 578 #define DIR_Name 0
shimniok 0:792bddcf799d 579 #define DIR_Attr 11
shimniok 0:792bddcf799d 580 #define DIR_NTres 12
shimniok 0:792bddcf799d 581 #define DIR_CrtTime 14
shimniok 0:792bddcf799d 582 #define DIR_CrtDate 16
shimniok 0:792bddcf799d 583 #define DIR_FstClusHI 20
shimniok 0:792bddcf799d 584 #define DIR_WrtTime 22
shimniok 0:792bddcf799d 585 #define DIR_WrtDate 24
shimniok 0:792bddcf799d 586 #define DIR_FstClusLO 26
shimniok 0:792bddcf799d 587 #define DIR_FileSize 28
shimniok 0:792bddcf799d 588 #define LDIR_Ord 0
shimniok 0:792bddcf799d 589 #define LDIR_Attr 11
shimniok 0:792bddcf799d 590 #define LDIR_Type 12
shimniok 0:792bddcf799d 591 #define LDIR_Chksum 13
shimniok 0:792bddcf799d 592 #define LDIR_FstClusLO 26
shimniok 0:792bddcf799d 593
shimniok 0:792bddcf799d 594
shimniok 0:792bddcf799d 595
shimniok 0:792bddcf799d 596 /*--------------------------------*/
shimniok 0:792bddcf799d 597 /* Multi-byte word access macros */
shimniok 0:792bddcf799d 598
shimniok 0:792bddcf799d 599 #if _WORD_ACCESS == 1 /* Enable word access to the FAT structure */
shimniok 0:792bddcf799d 600 #define LD_WORD(ptr) (WORD)(*(WORD*)(BYTE*)(ptr))
shimniok 0:792bddcf799d 601 #define LD_DWORD(ptr) (DWORD)(*(DWORD*)(BYTE*)(ptr))
shimniok 0:792bddcf799d 602 #define ST_WORD(ptr,val) *(WORD*)(BYTE*)(ptr)=(WORD)(val)
shimniok 0:792bddcf799d 603 #define ST_DWORD(ptr,val) *(DWORD*)(BYTE*)(ptr)=(DWORD)(val)
shimniok 0:792bddcf799d 604 #else /* Use byte-by-byte access to the FAT structure */
shimniok 0:792bddcf799d 605 #define LD_WORD(ptr) (WORD)(((WORD)*(BYTE*)((ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
shimniok 0:792bddcf799d 606 #define LD_DWORD(ptr) (DWORD)(((DWORD)*(BYTE*)((ptr)+3)<<24)|((DWORD)*(BYTE*)((ptr)+2)<<16)|((WORD)*(BYTE*)((ptr)+1)<<8)|*(BYTE*)(ptr))
shimniok 0:792bddcf799d 607 #define ST_WORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *(BYTE*)((ptr)+1)=(BYTE)((WORD)(val)>>8)
shimniok 0:792bddcf799d 608 #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)
shimniok 0:792bddcf799d 609 #endif
shimniok 0:792bddcf799d 610
shimniok 0:792bddcf799d 611 #ifdef __cplusplus
shimniok 0:792bddcf799d 612 }
shimniok 0:792bddcf799d 613 #endif
shimniok 0:792bddcf799d 614
shimniok 0:792bddcf799d 615 #endif /* _FATFS */