PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
#include <PropWare/filesystem/fat/fatfs.h>
Public Types | |
enum | ErrorCode { NO_ERROR = 0, BEG_ERROR = Filesystem::END_ERROR + 1, EMPTY_FAT_ENTRY = BEG_ERROR, INVALID_FAT_APPEND, TOO_MANY_FATS, BAD_SECTORS_PER_CLUSTER, READING_PAST_EOC, PARTITION_DOES_NOT_EXIST, UNSUPPORTED_FILESYSTEM, END_ERROR = UNSUPPORTED_FILESYSTEM } |
Public Member Functions | |
FatFS (const BlockStorage &driver, uint8_t fatBuffer[]=HALF_K_DATA_BUFFER1, const Printer &logger=pwOut) | |
Constructor. More... | |
~FatFS () | |
Destructor. Unmounts the filesystem and flushes all buffers. | |
PropWare::ErrorCode | mount (uint8_t buffer[]=HALF_K_DATA_BUFFER2, const uint8_t partition=0) |
PropWare::ErrorCode | unmount () |
uint8_t | get_fs_type () |
Determine whether the mounted filesystem is FAT16 or FAT32. More... | |
Static Public Member Functions | |
static void | print_error_str (const Printer &printer, const ErrorCode err) |
If an error occurs, this method can be used to determine what that error actually means. More... | |
Static Public Attributes | |
static const int | FOLDER_ID = INT32_MAX |
Friends | |
class | FatFile |
class | FatFileReader |
class | FatFileWriter |
FAT 16/32 filesystem driver - can be used with SD cards or any other PropWare::BlockStorage device
PropWare::FatFS::FatFS | ( | const BlockStorage & | driver, |
uint8_t | fatBuffer[] = HALF_K_DATA_BUFFER1 , |
||
const Printer & | logger = pwOut |
||
) |
Constructor.
[in] | *driver | Address of a the driver which is capable of reading the physical hardware. Commonly, this would be an instance of PropWare::SD, but one could potentially write a driver for a floppy disk or CD driver or any other block storage device |
[in] | fatBuffer[] | Byte array that can be used to store blocks of the file allocation table (FAT) used during mounting, file searching, and file expansion. |
[in] | *logger | Useful for debugging, a logger can be given to help determine when something goes wrong. All code using the logger will be optimized out by GCC so long as you only call public method |
buffer[]
parameter is only valid when using a SD card or other PropWare::BlockStorage
driver with a block size of 512-bytes or less. uint8_t PropWare::FatFS::get_fs_type | ( | ) |
|
virtual |
buffer[]
parameter is only valid when using a SD card or other PropWare::BlockStorage
driver with a block size of 512-bytes or less. Implements PropWare::Filesystem.
|
staticinherited |
If an error occurs, this method can be used to determine what that error actually means.
[in] | printer | Where the error should be printed |
[in] | err | The error code that was thrown |
Definition at line 78 of file filesystem.h.
|
virtual |
Implements PropWare::Filesystem.
Definition at line 136 of file fatfs.h.