SdFat.h File Reference

#include <avr/pgmspace.h>
#include "Sd2Card.h"
#include "FatStructs.h"
#include "Print.h"
Include dependency graph for SdFat.h:

subjects

class   SdFile
  Access FAT16 and FAT32 files on SD and SDHC cards. More...
union   cache_t
  Cache for an SD data block. More...
class   SdVolume
  Access FAT16 and FAT32 volumes on SD and SDHC cards. More...

Defines

#define  SD_FAT_PRINT_SUPPORT   1
#define  LS_DATE   1
#define  LS_SIZE   2
#define  LS_R   4
#define  O_READ   0X01
#define  O_RDONLY   O_READ
#define  O_WRITE   0X02
#define  O_WRONLY   O_WRITE
#define  O_RDWR   (O_READ | O_WRITE)
#define  O_ACCMODE   (O_READ | O_WRITE)
#define  O_APPEND   0X04
#define  O_SYNC   0X08
#define  O_CREAT   0X10
#define  O_EXCL   0X20
#define  O_TRUNC   0X40
#define  T_ACCESS   1
#define  T_CREATE   2
#define  T_WRITE   4
#define  FAT_DATE(year, month, day)   ((year) - 1980) << 9 | (month) << 5 | (day)
#define  FAT_YEAR(fatDate)   1980 + ((fatDate) >> 9)
#define  FAT_MONTH(fatDate)   ((fatDate) >> 5) & 0XF
#define  FAT_DAY(fatDate)   (fatDate) & 0X1F
#define  FAT_TIME(hour, minute, second)   (hour) << 11 | (minute) << 5 | (second) >> 1
#define  FAT_HOUR(fatTime)   (fatTime) >> 11
#define  FAT_MINUTE(fatTime)   ((fatTime) >> 5) & 0X3F
#define  FAT_SECOND(fatTime)   2*((fatTime) & 0X1F)
#define  FAT_DEFAULT_DATE   FAT_DATE(2000, 1, 1)
#define  FAT_DEFAULT_TIME   FAT_TIME(0, 0, 0)
#define  FAT_FILE_TYPE_CLOSED   0
#define  FAT_FILE_TYPE_NORMAL   1
#define  FAT_FILE_TYPE_ROOT16   2
#define  FAT_FILE_TYPE_ROOT32   3
#define  FAT_FILE_TYPE_SUBDIR   4
#define  FAT_FILE_TYPE_MIN_DIR   FAT_FILE_TYPE_ROOT16

Detailed Description

SdFile and SdVolume subjects


Define Documentation

#define FAT_DATE ( year,
month,
day   )     ((year) - 1980) << 9 | (month) << 5 | (day)

date field for FAT directory entry

#define FAT_DAY ( fatDate   )     (fatDate) & 0X1F

day part of FAT directory date field

#define FAT_DEFAULT_DATE   FAT_DATE(2000, 1, 1)

Default date for file timestamps is 1 Jan 2000

#define FAT_DEFAULT_TIME   FAT_TIME(0, 0, 0)

Default time for file timestamp is midnight

#define FAT_FILE_TYPE_CLOSED   0

This SdFile has not been opened.

#define FAT_FILE_TYPE_MIN_DIR   FAT_FILE_TYPE_ROOT16

Test value for directory type

#define FAT_FILE_TYPE_NORMAL   1

SdFile for a file

#define FAT_FILE_TYPE_ROOT16   2

SdFile for a FAT16 root directory

#define FAT_FILE_TYPE_ROOT32   3

SdFile for a FAT32 root directory

#define FAT_FILE_TYPE_SUBDIR   4

SdFile for a subdirectory

#define FAT_HOUR ( fatTime   )     (fatTime) >> 11

hour part of FAT directory time field

#define FAT_MINUTE ( fatTime   )     ((fatTime) >> 5) & 0X3F

minute part of FAT directory time field

#define FAT_MONTH ( fatDate   )     ((fatDate) >> 5) & 0XF

month part of FAT directory date field

#define FAT_SECOND ( fatTime   )     2*((fatTime) & 0X1F)

second part of FAT directory time field

#define FAT_TIME ( hour,
minute,
second   )     (hour) << 11 | (minute) << 5 | (second) >> 1

time field for FAT directory entry

#define FAT_YEAR ( fatDate   )     1980 + ((fatDate) >> 9)

year part of FAT directory date field

#define LS_DATE   1

ls() flag to print modify date

#define LS_R   4

ls() flag for recursive list of subdirectories

#define LS_SIZE   2

ls() flag to print file size

#define O_ACCMODE   (O_READ | O_WRITE)

open() oflag mask for access modes

#define O_APPEND   0X04

The file offset shall be set to the end of the file prior to each write.

#define O_CREAT   0X10

create the file if nonexistent

#define O_EXCL   0X20

If O_CREAT and O_EXCL are set, open() shall fail if the file exists

#define O_RDONLY   O_READ

open() oflag - same as O_READ

#define O_RDWR   (O_READ | O_WRITE)

open() oflag for reading and writing

#define O_READ   0X01

open() oflag for reading

#define O_SYNC   0X08

synchronous writes - call sync() after each write

#define O_TRUNC   0X40

truncate the file to zero length

#define O_WRITE   0X02

open() oflag for write

#define O_WRONLY   O_WRITE

open() oflag - same as O_WRITE

#define SD_FAT_PRINT_SUPPORT   1

Arduino Print support if not zero

#define T_ACCESS   1

set the file's last access date

#define T_CREATE   2

set the file's creation date and time

#define T_WRITE   4

Set the file's write date and time


Generated on Wed Dec 23 08:22:21 2009 for SdFat by  doxygen 1.6.1