Storage Class Reference

#include <storage.hpp>

Static Public Member Functions

static FileSystemObjectgetFlashDrive ()
 
static FileSystemObjectgetSDDrive ()
 
static FRESULT copy (const char *pExistingFile, const char *pNewFile, unsigned int *pReadTime=0, unsigned int *pWriteTime=0, unsigned int *pBytesTransferred=0)
 
static FRESULT read (const char *pFilename, void *pData, unsigned int bytesToRead, unsigned int offset=0)
 
static FRESULT write (const char *pFilename, void *pData, unsigned int bytesToWrite, unsigned int offset=0)
 
static FRESULT append (const char *pFilename, const void *pData, unsigned int bytesToAppend, unsigned int offset=0)
 

Detailed Description

Storage class contains the File System Objects

This class contains the File System Objects for the SD Card and SPI Flash. There are mainly two functionalities provided:

  • File IO (Read/Write/Append)
  • File System Object manipulation (Mount/Format etc).

The FileSystemObject can only be obtained from this class that provides further access to the drive system.

Member Function Documentation

FRESULT Storage::append ( const char *  pFilename,
const void *  pData,
unsigned int  bytesToAppend,
unsigned int  offset = 0 
)
static

Appends an existing file (creates a new file if it doesn't exist)

Parameters
pFilenameThe filename to append data to
pDataThe buffer to write the file data from
bytesToAppendNumber of bytes to append
offsetIf offset is non-zero, data is written to this offset. If offset is not specified or zero, data is appended at the end of the file.
FRESULT Storage::copy ( const char *  pExistingFile,
const char *  pNewFile,
unsigned int *  pReadTime = 0,
unsigned int *  pWriteTime = 0,
unsigned int *  pBytesTransferred = 0 
)
static

Copies a file

Parameters
pExistingFileExisting file name
pNewFileNew file name
pReadTimeOptional: Provide pointer to get the time taken to read the file
pWriteTimeOptional: Provide pointer to get the time taken to write the file
pBytesTransferredOptional: Provide pointer to get number of bytes transferred
static FileSystemObject& Storage::getFlashDrive ( )
inlinestatic
Returns
Single Flash Drive Object Reference
static FileSystemObject& Storage::getSDDrive ( )
inlinestatic
Returns
Single SD Card Drive Object reference
FRESULT Storage::read ( const char *  pFilename,
void *  pData,
unsigned int  bytesToRead,
unsigned int  offset = 0 
)
static

Reads an existing file

Parameters
pFilenameThe filename to read
pDataThe buffer to save the file data
bytesToReadNumber of bytes to read
offsetOptional Parameter: file offset to read data from
FRESULT Storage::write ( const char *  pFilename,
void *  pData,
unsigned int  bytesToWrite,
unsigned int  offset = 0 
)
static

Writes an existing file.

Parameters
pFilenameThe filename to write
pDataThe buffer to write the file data from
bytesToWriteNumber of bytes to write
offsetOptional Parameter: file offset to write data to file

The documentation for this class was generated from the following files:
  • /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L4_IO/storage.hpp
  • /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L4_IO/src/storage.cpp