discoverpixy
|
Data Structures | |
struct | FILE_DATE_STRUCT |
struct | FILE_TIME_STRUCT |
struct | FILE_STRUCT |
struct | DIRECTORY_STRUCT |
struct | FILE_HANDLE |
Enumerations | |
enum | FILE_ATTRIBUTES { F_RDO = 0x01, F_HID = 0x02, F_SYS = 0x04, F_DIR = 0x10, F_ARC = 0x20 } |
enum | FILE_STATUS { F_OK, F_EOF, F_EACCESS, F_INVALIDPARAM, F_DISKERROR } |
Functions | |
bool | filesystem_init () |
DIRECTORY_STRUCT * | filesystem_dir_open (const char *path) |
void | filesystem_dir_close (DIRECTORY_STRUCT *dir) |
FILE_HANDLE * | filesystem_file_open (const char *filename) |
void | filesystem_file_close (FILE_HANDLE *handle) |
FILE_STATUS | filesystem_file_seek (FILE_HANDLE *handle, uint32_t offset) |
FILE_STATUS | filesystem_file_read (FILE_HANDLE *handle, uint8_t *buf, uint32_t size) |
FILE_STATUS | filesystem_file_write (FILE_HANDLE *handle, uint8_t *buf, uint32_t size) |
The Filesystem Module provides access to files and directories of a the native filesystem.
enum FILE_ATTRIBUTES |
File Attributes used by implementation See http://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#attributes for detailed description
Definition at line 32 of file filesystem.h.
enum FILE_STATUS |
Enum to represent the success or error-code of the filesystem_file_* functions
Definition at line 90 of file filesystem.h.
void filesystem_dir_close | ( | DIRECTORY_STRUCT * | dir | ) |
Closes a previously opened directory. Free's all allocated resources.
dir | A Pointer to a DIRECTORY_STRUCT obtained by filesystem_dir_open(). |
Definition at line 28 of file filesystem.c.
DIRECTORY_STRUCT* filesystem_dir_open | ( | const char * | path | ) |
Opens a directory and returns a structure which contains all files/subdirectories.
path | The absolute path to the directory to open/read |
Definition at line 23 of file filesystem.c.
void filesystem_file_close | ( | FILE_HANDLE * | handle | ) |
Closes a file.
handle | The FILE_HANDLE obtained by filesystem_file_open() |
Definition at line 38 of file filesystem.c.
FILE_HANDLE* filesystem_file_open | ( | const char * | filename | ) |
Opens a file for read/writing.
filename | The absolute file path |
Definition at line 33 of file filesystem.c.
FILE_STATUS filesystem_file_read | ( | FILE_HANDLE * | handle, |
uint8_t * | buf, | ||
uint32_t | size | ||
) |
Reads some bytes from an open file.
handle | The FILE_HANDLE obtained by filesystem_file_open() |
buf | The Buffer to write the bytes to |
size | The number of bytes to read |
Definition at line 48 of file filesystem.c.
FILE_STATUS filesystem_file_seek | ( | FILE_HANDLE * | handle, |
uint32_t | offset | ||
) |
Set's the read/write position to a new position
handle | The FILE_HANDLE obtained by filesystem_file_open() |
offset | The new read/write position in bytes (absolute). |
Definition at line 43 of file filesystem.c.
FILE_STATUS filesystem_file_write | ( | FILE_HANDLE * | handle, |
uint8_t * | buf, | ||
uint32_t | size | ||
) |
Writes some bytes to a open file.
handle | The FILE_HANDLE obtained by filesystem_file_open() |
buf | The Buffer to take the bytes from |
size | The number of bytes to write |
Definition at line 53 of file filesystem.c.
bool filesystem_init | ( | ) |
Initializes the filesystem. Call this method before using any filesystem_* functions
Definition at line 18 of file filesystem.c.