SD Card Interface class. Log raw data bytes to memory addresses of your choice, or format the card and use the FAT file system to write files.

Dependencies:   mbed

Committer:
Blaze513
Date:
Sat Aug 07 18:32:30 2010 +0000
Revision:
1:94c648931f84
Child:
3:210eb67b260c

        

Who changed what in which revision?

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