updated chan_fatfs

Dependents:   HARP2 HARP3

Fork of chan_fatfs by Eli Hughes

Committer:
tylerjw
Date:
Fri Dec 28 17:12:02 2012 +0000
Revision:
8:1f9748c6b865
Parent:
4:f88948891a05
Added f_size() macro, not tested!!!

Who changed what in which revision?

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