3 * Copyright (c) 2006-2012 by Roland Riegel <feedback@roland-riegel.de>
5 * This file is free software; you can redistribute it and/or modify
6 * it under the terms of either the GNU General Public License version 2
7 * or the GNU Lesser General Public License version 2.1, both as
8 * published by the Free Software Foundation.
15 #include "sd_raw_config.h"
29 * FAT configuration (license: GPLv2 or LGPLv2.1)
34 * Controls FAT write support.
36 * Set to 1 to enable FAT write support, set to 0 to disable it.
38 #define FAT_WRITE_SUPPORT SD_RAW_WRITE_SUPPORT
42 * Controls FAT long filename (LFN) support.
44 * Set to 1 to enable LFN support, set to 0 to disable it.
46 #define FAT_LFN_SUPPORT 1
50 * Controls FAT date and time support.
52 * Set to 1 to enable FAT date and time stamping support.
54 #define FAT_DATETIME_SUPPORT 0
58 * Controls FAT32 support.
60 * Set to 1 to enable FAT32 support.
62 #define FAT_FAT32_SUPPORT SD_RAW_SDHC
66 * Controls updates of directory entries.
68 * Set to 1 to delay directory entry updates until the file is closed.
69 * This can boost performance significantly, but may cause data loss
70 * if the file is not properly closed.
72 #define FAT_DELAY_DIRENTRY_UPDATE 0
76 * Determines the function used for retrieving current date and time.
78 * Define this to the function call which shall be used to retrieve
79 * current date and time.
81 * \note Used only when FAT_DATETIME_SUPPORT is 1.
83 * \param[out] year Pointer to a \c uint16_t which receives the current year.
84 * \param[out] month Pointer to a \c uint8_t which receives the current month.
85 * \param[out] day Pointer to a \c uint8_t which receives the current day.
86 * \param[out] hour Pointer to a \c uint8_t which receives the current hour.
87 * \param[out] min Pointer to a \c uint8_t which receives the current minute.
88 * \param[out] sec Pointer to a \c uint8_t which receives the current sec.
90 #define fat_get_datetime(year, month, day, hour, min, sec) \
91 get_datetime(year, month, day, hour, min, sec)
92 /* forward declaration for the above */
93 void get_datetime(uint16_t* year, uint8_t* month, uint8_t* day, uint8_t* hour, uint8_t* min, uint8_t* sec);
97 * Maximum number of filesystem handles.
99 #define FAT_FS_COUNT 1
102 * \ingroup fat_config
103 * Maximum number of file handles.
105 #define FAT_FILE_COUNT 1
108 * \ingroup fat_config
109 * Maximum number of directory handles.
111 #define FAT_DIR_COUNT 2
117 #if FAT_FAT32_SUPPORT
118 typedef uint32_t cluster_t;
120 typedef uint16_t cluster_t;