ATmega8GPSLoggerBasismodul  20131018
fat16.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  afile
 
struct  DirEntry
 
struct  FatEntry
 

Macros

#define MBR_SECTOR   0
 
#define _UNUSED   1
 
#define _ARCHIVE   2
 
#define _READ_ONLY   4
 
#define _SYSTEM   8
 
#define _DIRECTORY   16
 
#define _FILE   32
 

Typedefs

typedef struct afile File
 

Functions

unsigned char InitFat16 (void)
 
unsigned char fopen_ (unsigned char *fname, char mode, File *file)
 
int fflush_ (File *file)
 
void fclose_ (File *file)
 
unsigned long fread_ (void *buffer, unsigned long size, unsigned long count, File *file)
 
unsigned long fwrite_ (void *buffer, unsigned long size, unsigned long count, File *file)
 
int fseek_ (File *file, long offset, int origin)
 
int fgetchar_ (File *file)
 
unsigned char fputchar_ (File *file, char c)
 
unsigned char fputs_ (File *file, char *string)
 
char * fgets_ (char *s, int count, File *file)
 
int rename (char *oldname, char *newname)
 
unsigned char fexist_ (unsigned char *fname, File *file)
 
unsigned char CreateDirectoryEntry (unsigned char *fname, unsigned int cluster, File *file, unsigned char attrib)
 
unsigned int FindNextFreeCluster (File *file)
 
unsigned char SeekDirectoryEntry (unsigned char *fname, File *file)
 
void SeperateFileName (unsigned char *fname, unsigned char *name)
 
unsigned char ScanSubDirectories (unsigned char *fname, File *file)
 
unsigned int GetNextCluster (File *file)
 
unsigned char AppendCluster (File *file)
 
unsigned int GetFatClusterOffset (File *file)
 
unsigned int GetFatSectorIndex (File *file)
 

Variables

unsigned char SectorsPerCluster
 
unsigned char FileBuffer [512]
 
File myfile
 

Macro Definition Documentation

#define _ARCHIVE   2

Definition at line 99 of file fat16.h.

#define _DIRECTORY   16

Definition at line 102 of file fat16.h.

Referenced by ScanSubDirectories().

#define _FILE   32

Definition at line 103 of file fat16.h.

Referenced by fopen_(), and ScanSubDirectories().

#define _READ_ONLY   4

Definition at line 100 of file fat16.h.

#define _SYSTEM   8

Definition at line 101 of file fat16.h.

#define _UNUSED   1

Definition at line 98 of file fat16.h.

#define MBR_SECTOR   0

Definition at line 97 of file fat16.h.

Referenced by InitFat16().

Typedef Documentation

typedef struct afile File

Function Documentation

unsigned char AppendCluster ( File file)

Definition at line 614 of file fat16.c.

References afile::cluster_pointer, FileAllocationTable, FileBuffer, FindNextFreeCluster(), FirstDataCluster, GetFatClusterOffset(), GetFatSectorIndex(), FatEntry::next_cluster, SDC_GetSector, SDC_PutSector, and SectorsPerCluster.

Referenced by fputchar_().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char CreateDirectoryEntry ( unsigned char *  fname,
unsigned int  cluster,
File file,
unsigned char  attrib 
)
void fclose_ ( File file)

Definition at line 195 of file fat16.c.

References afile::attribute, afile::byte_index, afile::cluster_pointer, afile::directory_index, afile::directory_sector, fflush_(), afile::fileposition, afile::filesize, afile::mode, afile::sector_in_buffer, afile::sector_index, and afile::start_cluster.

Referenced by fexist_(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char fexist_ ( unsigned char *  fname,
File file 
)

Definition at line 505 of file fat16.c.

References fclose_(), and fopen_().

Here is the call graph for this function:

int fflush_ ( File file)
int fgetchar_ ( File file)

Definition at line 356 of file fat16.c.

References afile::byte_index, afile::cluster_pointer, FileBuffer, afile::filesize, GetNextCluster(), SDC_GetSector, afile::sector_in_buffer, afile::sector_index, and SectorsPerCluster.

Referenced by fgets_(), and fread_().

Here is the call graph for this function:

Here is the caller graph for this function:

char* fgets_ ( char *  s,
int  count,
File file 
)

Definition at line 463 of file fat16.c.

References fgetchar_().

Here is the call graph for this function:

unsigned int FindNextFreeCluster ( File file)

Definition at line 574 of file fat16.c.

References FileAllocationTable, FileBuffer, FatEntry::next_cluster, SDC_GetSector, SDC_PutSector, afile::sector_in_buffer, and SectorsPerFat.

Referenced by AppendCluster(), and fopen_().

Here is the caller graph for this function:

unsigned char fopen_ ( unsigned char *  fname,
char  mode,
File file 
)
unsigned char fputchar_ ( File file,
char  c 
)

Definition at line 400 of file fat16.c.

References AppendCluster(), afile::byte_index, afile::cluster_pointer, FileBuffer, afile::fileposition, afile::filesize, SDC_PutSector, afile::sector_index, and SectorsPerCluster.

Referenced by fputs_(), and fwrite_().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char fputs_ ( File file,
char *  string 
)

Definition at line 443 of file fat16.c.

References fputchar_().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long fread_ ( void *  buffer,
unsigned long  size,
unsigned long  count,
File file 
)

Definition at line 221 of file fat16.c.

References fgetchar_(), and DirEntry::size.

Here is the call graph for this function:

int fseek_ ( File file,
long  offset,
int  origin 
)

Definition at line 286 of file fat16.c.

References afile::byte_index, afile::cluster_pointer, FileBuffer, afile::fileposition, afile::filesize, GetNextCluster(), SDC_GetSector, afile::sector_index, SectorsPerCluster, and afile::start_cluster.

Referenced by fopen_().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long fwrite_ ( void *  buffer,
unsigned long  size,
unsigned long  count,
File file 
)

Definition at line 254 of file fat16.c.

References fputchar_(), and DirEntry::size.

Here is the call graph for this function:

unsigned int GetFatClusterOffset ( File file)

Definition at line 646 of file fat16.c.

References afile::cluster_pointer, FirstDataCluster, and SectorsPerCluster.

Referenced by AppendCluster(), and GetFatSectorIndex().

Here is the caller graph for this function:

unsigned int GetFatSectorIndex ( File file)

Definition at line 664 of file fat16.c.

References GetFatClusterOffset().

Referenced by AppendCluster().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int GetNextCluster ( File file)

Definition at line 526 of file fat16.c.

References afile::cluster_pointer, FileAllocationTable, FileBuffer, FirstDataCluster, RootDirectory, SDC_GetSector, afile::sector_in_buffer, and SectorsPerCluster.

Referenced by fgetchar_(), fseek_(), and SeekDirectoryEntry().

Here is the caller graph for this function:

unsigned char InitFat16 ( void  )

Definition at line 71 of file fat16.c.

References FatCopies, FileAllocationTable, FileBuffer, FirstDataCluster, FirstPartitionSector, MBR_SECTOR, PossibleRootEntries, ReservedSectors, RootDirectory, SDC_GetSector, SectorsPerCluster, and SectorsPerFat.

Referenced by main().

Here is the caller graph for this function:

int rename ( char *  oldname,
char *  newname 
)
unsigned char ScanSubDirectories ( unsigned char *  fname,
File file 
)

Definition at line 790 of file fat16.c.

References _DIRECTORY, _FILE, afile::attribute, afile::cluster_pointer, RootDirectory, and SeekDirectoryEntry().

Referenced by fopen_().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned char SeekDirectoryEntry ( unsigned char *  fname,
File file 
)
void SeperateFileName ( unsigned char *  fname,
unsigned char *  name 
)

Definition at line 854 of file fat16.c.

Referenced by fopen_().

Here is the caller graph for this function:

Variable Documentation

File myfile
unsigned char SectorsPerCluster