Drop BeRTOS SD and FAT modules
[rmslog.git] / FAT16 / fat_config.h
1
2 /*
3  * Copyright (c) 2006-2009 by Roland Riegel <feedback@roland-riegel.de>
4  *
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.
9  */
10
11 #ifndef FAT_CONFIG_H
12 #define FAT_CONFIG_H
13
14 #include <stdint.h>
15 #include "sd_raw_config.h"
16
17 #ifdef __cplusplus
18 extern "C"
19 {
20 #endif
21
22 /**
23  * \addtogroup fat
24  *
25  * @{
26  */
27 /**
28  * \file
29  * FAT configuration (license: GPLv2 or LGPLv2.1)
30  */
31
32 /**
33  * \ingroup fat_config
34  * Controls FAT write support.
35  *
36  * Set to 1 to enable FAT write support, set to 0 to disable it.
37  */
38 #define FAT_WRITE_SUPPORT 1
39
40 /**
41  * \ingroup fat_config
42  * Controls FAT date and time support.
43  * 
44  * Set to 1 to enable FAT date and time stamping support.
45  */
46 #define FAT_DATETIME_SUPPORT 0
47
48 /**
49  * \ingroup fat_config
50  * Controls FAT32 support.
51  *
52  * Set to 1 to enable FAT32 support.
53  */
54 #define FAT_FAT32_SUPPORT SD_RAW_SDHC
55 //#define FAT_FAT32_SUPPORT 1
56
57 /**
58  * \ingroup fat_config
59  * Determines the function used for retrieving current date and time.
60  *
61  * Define this to the function call which shall be used to retrieve
62  * current date and time.
63  *
64  * \note Used only when FAT_DATETIME_SUPPORT is 1.
65  *
66  * \param[out] year Pointer to a \c uint16_t which receives the current year.
67  * \param[out] month Pointer to a \c uint8_t which receives the current month.
68  * \param[out] day Pointer to a \c uint8_t which receives the current day.
69  * \param[out] hour Pointer to a \c uint8_t which receives the current hour.
70  * \param[out] min Pointer to a \c uint8_t which receives the current minute.
71  * \param[out] sec Pointer to a \c uint8_t which receives the current sec.
72  */
73 #define fat_get_datetime(year, month, day, hour, min, sec) \
74     get_datetime(year, month, day, hour, min, sec)
75 /* forward declaration for the above */
76 void get_datetime(uint16_t* year, uint8_t* month, uint8_t* day, uint8_t* hour, uint8_t* min, uint8_t* sec);
77
78 /**
79  * \ingroup fat_config
80  * Maximum number of filesystem handles.
81  */
82 #define FAT_FS_COUNT 1
83
84 /**
85  * \ingroup fat_config
86  * Maximum number of file handles.
87  */
88 #define FAT_FILE_COUNT 1
89
90 /**
91  * \ingroup fat_config
92  * Maximum number of directory handles.
93  */
94 #define FAT_DIR_COUNT 2
95
96 /**
97  * @}
98  */
99
100 #if FAT_FAT32_SUPPORT
101     typedef uint32_t cluster_t;
102 #else
103     typedef uint16_t cluster_t;
104 #endif
105
106 #ifdef __cplusplus
107 }
108 #endif
109
110 #endif
111