ATmega8GPSLoggerBasismodul
20131018
|
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 |
#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 MBR_SECTOR 0 |
Definition at line 97 of file fat16.h.
Referenced by InitFat16().
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_().
unsigned char CreateDirectoryEntry | ( | unsigned char * | fname, |
unsigned int | cluster, | ||
File * | file, | ||
unsigned char | attrib | ||
) |
Definition at line 687 of file fat16.c.
References DirEntry::attribute, afile::directory_index, afile::directory_sector, FileBuffer, DirEntry::name, PossibleRootEntries, RootDirectory, SDC_GetSector, SDC_PutSector, DirEntry::size, and DirEntry::startcluster.
Referenced by fopen_().
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().
unsigned char fexist_ | ( | unsigned char * | fname, |
File * | file | ||
) |
int fflush_ | ( | File * | file | ) |
Definition at line 159 of file fat16.c.
References afile::byte_index, afile::cluster_pointer, DirEntry::date, afile::directory_index, afile::directory_sector, FileBuffer, afile::filesize, afile::mode, SDC_GetSector, SDC_PutSector, afile::sector_index, DirEntry::size, and DirEntry::time.
Referenced by fclose_().
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_().
char* fgets_ | ( | char * | s, |
int | count, | ||
File * | file | ||
) |
Definition at line 463 of file fat16.c.
References fgetchar_().
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_().
unsigned char fopen_ | ( | unsigned char * | fname, |
char | mode, | ||
File * | file | ||
) |
Definition at line 97 of file fat16.c.
References _FILE, afile::attribute, afile::byte_index, afile::cluster_pointer, CreateDirectoryEntry(), afile::directory_index, afile::directory_sector, afile::fileposition, afile::filesize, FindNextFreeCluster(), FirstDataCluster, fseek_(), afile::mode, ScanSubDirectories(), afile::sector_in_buffer, afile::sector_index, SectorsPerCluster, SeekDirectoryEntry(), SeperateFileName(), and afile::start_cluster.
Referenced by fexist_(), and main().
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_().
unsigned char fputs_ | ( | File * | file, |
char * | string | ||
) |
Definition at line 443 of file fat16.c.
References fputchar_().
Referenced by main().
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.
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_().
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.
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().
unsigned int GetFatSectorIndex | ( | File * | file | ) |
Definition at line 664 of file fat16.c.
References GetFatClusterOffset().
Referenced by AppendCluster().
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().
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().
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_().
unsigned char SeekDirectoryEntry | ( | unsigned char * | fname, |
File * | file | ||
) |
Definition at line 736 of file fat16.c.
References afile::attribute, DirEntry::attribute, afile::cluster_pointer, afile::directory_index, afile::directory_sector, FileBuffer, afile::filesize, FirstDataCluster, GetNextCluster(), DirEntry::name, SDC_GetSector, SectorsPerCluster, DirEntry::size, afile::start_cluster, and DirEntry::startcluster.
Referenced by fopen_(), and ScanSubDirectories().
void SeperateFileName | ( | unsigned char * | fname, |
unsigned char * | name | ||
) |
unsigned char FileBuffer[512] |
Definition at line 55 of file fat16.c.
Referenced by AppendCluster(), CreateDirectoryEntry(), fflush_(), fgetchar_(), FindNextFreeCluster(), fputchar_(), fseek_(), GetNextCluster(), InitFat16(), and SeekDirectoryEntry().
File myfile |
unsigned char SectorsPerCluster |
Definition at line 113 of file fat16.h.
Referenced by AppendCluster(), fgetchar_(), fopen_(), fputchar_(), fseek_(), GetFatClusterOffset(), GetNextCluster(), InitFat16(), and SeekDirectoryEntry().