Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.

Dependencies:   Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo

Committer:
shimniok
Date:
Wed Jun 20 14:57:48 2012 +0000
Revision:
0:826c6171fc1b
Updated documentation

Who changed what in which revision?

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