00001 00002 /* 00003 * Copyright (c) 2006-2010 by Roland Riegel <feedback@roland-riegel.de> 00004 * 00005 * This file is free software; you can redistribute it and/or modify 00006 * it under the terms of either the GNU General Public License version 2 00007 * or the GNU Lesser General Public License version 2.1, both as 00008 * published by the Free Software Foundation. 00009 */ 00010 00011 #ifndef FAT_CONFIG_H 00012 #define FAT_CONFIG_H 00013 00014 #include <stdint.h> 00015 #include "sd_raw_config.h" 00016 00017 #ifdef __cplusplus 00018 extern "C" 00019 { 00020 #endif 00021 00022 /** 00023 * \addtogroup fat 00024 * 00025 * @{ 00026 */ 00027 /** 00028 * \file 00029 * FAT configuration (license: GPLv2 or LGPLv2.1) 00030 */ 00031 00032 /** 00033 * \ingroup fat_config 00034 * Controls FAT write support. 00035 * 00036 * Set to 1 to enable FAT write support, set to 0 to disable it. 00037 */ 00038 #define FAT_WRITE_SUPPORT SD_RAW_WRITE_SUPPORT 00039 00040 /** 00041 * \ingroup fat_config 00042 * Controls FAT long filename (LFN) support. 00043 * 00044 * Set to 1 to enable LFN support, set to 0 to disable it. 00045 */ 00046 #define FAT_LFN_SUPPORT 1 00047 00048 /** 00049 * \ingroup fat_config 00050 * Controls FAT date and time support. 00051 * 00052 * Set to 1 to enable FAT date and time stamping support. 00053 */ 00054 #define FAT_DATETIME_SUPPORT 0 00055 00056 /** 00057 * \ingroup fat_config 00058 * Controls FAT32 support. 00059 * 00060 * Set to 1 to enable FAT32 support. 00061 */ 00062 #define FAT_FAT32_SUPPORT SD_RAW_SDHC 00063 00064 /** 00065 * \ingroup fat_config 00066 * Controls updates of directory entries. 00067 * 00068 * Set to 1 to delay directory entry updates until the file is closed. 00069 * This can boost performance significantly, but may cause data loss 00070 * if the file is not properly closed. 00071 */ 00072 #define FAT_DELAY_DIRENTRY_UPDATE 0 00073 00074 /** 00075 * \ingroup fat_config 00076 * Determines the function used for retrieving current date and time. 00077 * 00078 * Define this to the function call which shall be used to retrieve 00079 * current date and time. 00080 * 00081 * \note Used only when FAT_DATETIME_SUPPORT is 1. 00082 * 00083 * \param[out] year Pointer to a \c uint16_t which receives the current year. 00084 * \param[out] month Pointer to a \c uint8_t which receives the current month. 00085 * \param[out] day Pointer to a \c uint8_t which receives the current day. 00086 * \param[out] hour Pointer to a \c uint8_t which receives the current hour. 00087 * \param[out] min Pointer to a \c uint8_t which receives the current minute. 00088 * \param[out] sec Pointer to a \c uint8_t which receives the current sec. 00089 */ 00090 #define fat_get_datetime(year, month, day, hour, min, sec) \ 00091 get_datetime(year, month, day, hour, min, sec) 00092 /* forward declaration for the above */ 00093 void get_datetime(uint16_t* year, uint8_t* month, uint8_t* day, uint8_t* hour, uint8_t* min, uint8_t* sec); 00094 00095 /** 00096 * \ingroup fat_config 00097 * Maximum number of filesystem handles. 00098 */ 00099 #define FAT_FS_COUNT 1 00100 00101 /** 00102 * \ingroup fat_config 00103 * Maximum number of file handles. 00104 */ 00105 #define FAT_FILE_COUNT 1 00106 00107 /** 00108 * \ingroup fat_config 00109 * Maximum number of directory handles. 00110 */ 00111 #define FAT_DIR_COUNT 2 00112 00113 /** 00114 * @} 00115 */ 00116 00117 #if FAT_FAT32_SUPPORT 00118 typedef uint32_t cluster_t; 00119 #else 00120 typedef uint16_t cluster_t; 00121 #endif 00122 00123 #ifdef __cplusplus 00124 } 00125 #endif 00126 00127 #endif 00128
1.5.6