PageRenderTime 36ms CodeModel.GetById 33ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/firmware/src/Motherboard/lib_sd/fat_config.h

http://github.com/makerbot/G3Firmware
C Header | 128 lines | 28 code | 19 blank | 81 comment | 0 complexity | b02be891412b688222b9dc106fdf4242 MD5 | raw file
  1
  2/*
  3 * Copyright (c) 2006-2010 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
 18extern "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 SD_RAW_WRITE_SUPPORT
 39
 40/**
 41 * \ingroup fat_config
 42 * Controls FAT long filename (LFN) support.
 43 *
 44 * Set to 1 to enable LFN support, set to 0 to disable it.
 45 */
 46#define FAT_LFN_SUPPORT 1
 47
 48/**
 49 * \ingroup fat_config
 50 * Controls FAT date and time support.
 51 * 
 52 * Set to 1 to enable FAT date and time stamping support.
 53 */
 54#define FAT_DATETIME_SUPPORT 0
 55
 56/**
 57 * \ingroup fat_config
 58 * Controls FAT32 support.
 59 *
 60 * Set to 1 to enable FAT32 support.
 61 */
 62#define FAT_FAT32_SUPPORT SD_RAW_SDHC
 63
 64/**
 65 * \ingroup fat_config
 66 * Controls updates of directory entries.
 67 *
 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.
 71 */
 72#define FAT_DELAY_DIRENTRY_UPDATE 1
 73
 74/**
 75 * \ingroup fat_config
 76 * Determines the function used for retrieving current date and time.
 77 *
 78 * Define this to the function call which shall be used to retrieve
 79 * current date and time.
 80 *
 81 * \note Used only when FAT_DATETIME_SUPPORT is 1.
 82 *
 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.
 89 */
 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 */
 93void get_datetime(uint16_t* year, uint8_t* month, uint8_t* day, uint8_t* hour, uint8_t* min, uint8_t* sec);
 94
 95/**
 96 * \ingroup fat_config
 97 * Maximum number of filesystem handles.
 98 */
 99#define FAT_FS_COUNT 1
100
101/**
102 * \ingroup fat_config
103 * Maximum number of file handles.
104 */
105#define FAT_FILE_COUNT 1
106
107/**
108 * \ingroup fat_config
109 * Maximum number of directory handles.
110 */
111#define FAT_DIR_COUNT 2
112
113/**
114 * @}
115 */
116
117#if FAT_FAT32_SUPPORT
118    typedef uint32_t cluster_t;
119#else
120    typedef uint16_t cluster_t;
121#endif
122
123#ifdef __cplusplus
124}
125#endif
126
127#endif
128