|
Open Model Railroad Network (OpenMRN)
|
Specialization of Serial SPIFFS driver for TI driverlib devices. More...
#include <TiSPIFFS.hxx>
Public Member Functions | |
| TiSPIFFS (size_t physical_address, size_t size_on_disk, size_t logical_block_size, size_t logical_page_size, size_t max_num_open_descriptors=16, size_t cache_pages=8, std::function< void()> post_format_hook=nullptr) | |
| Constructor. | |
| ~TiSPIFFS () | |
| Destructor. | |
Public Member Functions inherited from SPIFFS | |
| void | mount (const char *mount_point) override |
| Mount the file system. | |
| void | format () override |
| Format the file system, all data will be lost. | |
| bool | is_any_dirty () |
| void | flush_cache () |
| Performs a sync on all files that have had a write but no fsync call since then. | |
Public Member Functions inherited from FileSystem | |
| FileSystem () | |
| Constructor. | |
| virtual | ~FileSystem () |
| Destructor. | |
Private Member Functions | |
| int32_t | flash_read (uint32_t addr, uint32_t size, uint8_t *dst) override |
| SPIFFS callback to read flash, in context. | |
| int32_t | flash_write (uint32_t addr, uint32_t size, uint8_t *src) override |
| SPIFFS callback to write flash, in context. | |
| int32_t | flash_erase (uint32_t addr, uint32_t size) override |
| SPIFFS callback to erase flash, in context. | |
| DISALLOW_COPY_AND_ASSIGN (TiSPIFFS) | |
Additional Inherited Members | |
Static Public Member Functions inherited from SPIFFS | |
| static void | extern_lock (struct spiffs_t *fs) |
| Provide mutex lock. | |
| static void | extern_unlock (struct spiffs_t *fs) |
| Provide mutex unlock. | |
Static Public Member Functions inherited from FileSystem | |
| static int | open (struct _reent *reent, const char *path, int flags, int mode) |
| Open a file or device. | |
| static int | close (struct _reent *reent, int fd) |
| Close a file or device. | |
| static int | unlink (struct _reent *reent, const char *path) |
| Remove a file. | |
| static int | stat (struct _reent *reent, const char *path, struct stat *stat) |
| Get the status information of a file or device. | |
| static int | fsync (int fd) |
| Synchronize (flush) a file to disk. | |
| static int | closedir (DIR *dirp) |
| Close a directory. | |
| static DIR * | opendir (const char *name) |
| Open a directory. | |
| static struct dirent * | readdir (DIR *dirp) |
| Read the next entry in a directory. | |
Static Public Member Functions inherited from FileIO | |
| static ssize_t | read (struct _reent *reent, int fd, void *buf, size_t count) |
| Read from a file or device. | |
| static ssize_t | write (struct _reent *reent, int fd, const void *buf, size_t count) |
| Write to a file or device. | |
| static _off_t | lseek (struct _reent *reent, int fd, _off_t offset, int whence) |
| Change the offset index of a file or device. | |
| static int | fstat (struct _reent *reent, int fd, struct stat *stat) |
| Get the status information of a file or device. | |
| static int | ioctl (int fd, unsigned long int key, unsigned long data) |
| Request and ioctl transaction. | |
| static int | fcntl (int fd, int cmd, unsigned long data) |
| Manipulate a file descriptor. | |
| static bool | is_device (int fd) |
| Test if the file descriptor belongs to a device. | |
Protected Member Functions inherited from SPIFFS | |
| SPIFFS (size_t physical_address, size_t size_on_disk, size_t erase_block_size, size_t logical_block_size, size_t logical_page_size, size_t max_num_open_descriptors=16, size_t cache_pages=8, std::function< void()> post_format_hook=nullptr) | |
| Constructor. | |
| ~SPIFFS () | |
| Destructor. | |
| void | unmount () |
| Flushes caches and unmounts the filesystem. | |
Protected Member Functions inherited from FileIO | |
| FileIO (const char *name) | |
| Constructor. | |
| virtual | ~FileIO () |
| Destructor. | |
| virtual int | ioctl (File *file, unsigned long int key, unsigned long data) |
| Request an ioctl transaction. | |
| virtual int | fcntl (File *file, int cmd, unsigned long data) |
| Manipulate a file descriptor. | |
| virtual bool | select (File *file, int mode) |
| Device select method. | |
Static Protected Member Functions inherited from SPIFFS | |
| static int | flash_read (struct spiffs_t *fs, unsigned addr, unsigned size, uint8_t *dst) |
| SPIFFS callback to read flash. | |
| static int | flash_write (struct spiffs_t *fs, unsigned addr, unsigned size, uint8_t *src) |
| SPIFFS callback to write flash. | |
| static int | flash_erase (struct spiffs_t *fs, unsigned addr, unsigned size) |
| SPIFFS callback to erase flash. | |
Static Protected Member Functions inherited from FileIO | |
| static int | fd_alloc (void) |
| Allocate a free file descriptor. | |
| static void | fd_free (int fd) |
| Free up a file descriptor. | |
| static File * | file_lookup (int fd) |
| Looks up a reference to a File corresponding to a given file descriptor. | |
| static int | fd_lookup (File *file) |
| Looks up a file descriptor corresponding to a given File reference. | |
Protected Attributes inherited from SPIFFS | |
| spiffs * | fs_ |
| file system instance metadata | |
Protected Attributes inherited from FileIO | |
| const char * | name |
| device name | |
Static Protected Attributes inherited from FileIO | |
| static const unsigned int | numOpenFiles = 20 |
| static File | files [] |
| File descriptor pool. | |
| static OSMutex | mutex |
| mutual exclusion for fileio | |
Specialization of Serial SPIFFS driver for TI driverlib devices.
| ERASE_PAGE_SIZE | size of an erase page in FLASH |
Definition at line 44 of file TiSPIFFS.hxx.
|
inline |
Constructor.
Definition at line 48 of file TiSPIFFS.hxx.
Destructor.
Definition at line 59 of file TiSPIFFS.hxx.
|
overrideprivatevirtual |
SPIFFS callback to erase flash, in context.
| addr | adddress location to erase |
| size | size of erase region in bytes |
Implements SPIFFS.
Definition at line 74 of file TiSPIFFSImpl.hxx.
|
overrideprivatevirtual |
SPIFFS callback to read flash, in context.
| addr | adddress location to read |
| size | size of read in bytes |
| dst | destination buffer for read |
Implements SPIFFS.
Definition at line 48 of file TiSPIFFSImpl.hxx.
|
overrideprivatevirtual |
SPIFFS callback to write flash, in context.
| addr | adddress location to write |
| size | size of write in bytes |
| src | source buffer for write |
Implements SPIFFS.
Definition at line 62 of file TiSPIFFSImpl.hxx.