123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- #ifndef __SDFS_H__
- #define __SDFS_H__
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #ifndef FS_SEEK_SET
- #define FS_SEEK_SET 0
- #endif
- #ifndef FS_SEEK_CUR
- #define FS_SEEK_CUR 1
- #endif
- #ifndef FS_SEEK_END
- #define FS_SEEK_END 2
- #endif
- #define _SDFS_VOL_STRS "NOR","SD","NAND",
- struct sd_file
- {
- int start;
- int size;
- int readptr;
- unsigned char storage_id;
- unsigned char file_id;
- };
- struct sd_dir
- {
- const unsigned char fname[12];
- int offset;
- int size;
- unsigned int reserved[2];
- unsigned int checksum;
- };
- struct sd_file * sd_fopen (const char *filename);
- void sd_fclose(struct sd_file *sd_file);
- int sd_fread(struct sd_file *sd_file, void *buffer, int len);
- int sd_ftell(struct sd_file *sd_file);
- int sd_fseek(struct sd_file *sd_file, int offset, unsigned char whence);
- int sd_fsize(const char *filename);
- int sd_fmap(const char *filename, void** addr, int *len);
- #endif
|