test fork

Dependencies:   SPI_TFTx2 SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2 mbed

Fork of CANary_9341 by Tick Tock

Committer:
TickTock
Date:
Sun Jun 30 17:52:58 2013 +0000
Branch:
Metric
Revision:
109:3e6f0e8fca0d
Change filesystem library.  Got logging and playback working.

Who changed what in which revision?

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