ESP32 PSRAM Library
Public Member Functions | Protected Attributes | List of all members
esp32_psram::HIMEMClass Class Reference

Class for managing files stored in ESP32's High Memory (HIMEM) More...

#include <HIMEM.h>

Inheritance diagram for esp32_psram::HIMEMClass:
esp32_psram::InMemoryFS< VectorHIMEM< uint8_t >, FileHIMEM >

Public Member Functions

bool begin () override
 Initialize the HIMEM filesystem. More...
 
bool exists (const char *filename)
 Check if a file exists. More...
 
size_t fileCount () const
 Get the total number of files. More...
 
uint64_t freeBytes () override
 Get free space (returns free HIMEM) More...
 
String getFirstFileName ()
 Get the first file in the filesystem. More...
 
String getNextFileName (const char *currentFileName)
 Get the name of the next file after the specified file. More...
 
bool mkdir (const char *dirname)
 Create a directory (no-op for compatibility) More...
 
FileHIMEM open (const char *filename, uint8_t mode)
 Open a file. More...
 
bool remove (const char *filename)
 Remove a file. More...
 
bool rmdir (const char *dirname)
 Remove a directory (no-op for compatibility) More...
 
uint64_t totalBytes () override
 Get total space (returns available HIMEM) More...
 

Protected Attributes

std::map< std::string, VectorHIMEM< uint8_t > > fileData
 
bool initialized
 

Detailed Description

Class for managing files stored in ESP32's High Memory (HIMEM)

This class provides an interface similar to SD.h for managing files that are stored in HIMEM memory (beyond the 4MB boundary) rather than on an SD card. HIMEM offers larger storage capacity but slightly slower access than regular PSRAM.

Member Function Documentation

◆ begin()

bool esp32_psram::HIMEMClass::begin ( )
inlineoverridevirtual

Initialize the HIMEM filesystem.

Returns
true if initialization was successful, false otherwise

Implements esp32_psram::InMemoryFS< VectorHIMEM< uint8_t >, FileHIMEM >.

◆ exists()

bool esp32_psram::InMemoryFS< VectorHIMEM< uint8_t > , FileHIMEM >::exists ( const char *  filename)
inlineinherited

Check if a file exists.

Parameters
filenameName of the file to check
Returns
true if the file exists, false otherwise

◆ fileCount()

size_t esp32_psram::InMemoryFS< VectorHIMEM< uint8_t > , FileHIMEM >::fileCount ( ) const
inlineinherited

Get the total number of files.

Returns
Number of files in the filesystem

◆ freeBytes()

uint64_t esp32_psram::HIMEMClass::freeBytes ( )
inlineoverridevirtual

Get free space (returns free HIMEM)

Returns
Free HIMEM size in bytes

Implements esp32_psram::InMemoryFS< VectorHIMEM< uint8_t >, FileHIMEM >.

◆ getFirstFileName()

String esp32_psram::InMemoryFS< VectorHIMEM< uint8_t > , FileHIMEM >::getFirstFileName ( )
inlineinherited

Get the first file in the filesystem.

Returns
Name of the first file, or empty string if there are no files

◆ getNextFileName()

String esp32_psram::InMemoryFS< VectorHIMEM< uint8_t > , FileHIMEM >::getNextFileName ( const char *  currentFileName)
inlineinherited

Get the name of the next file after the specified file.

Parameters
currentFileNameName of the current file
Returns
Name of the next file, or empty string if there are no more files

◆ mkdir()

bool esp32_psram::InMemoryFS< VectorHIMEM< uint8_t > , FileHIMEM >::mkdir ( const char *  dirname)
inlineinherited

Create a directory (no-op for compatibility)

Parameters
dirnameName of the directory
Returns
Always returns true for compatibility

◆ open()

FileHIMEM esp32_psram::InMemoryFS< VectorHIMEM< uint8_t > , FileHIMEM >::open ( const char *  filename,
uint8_t  mode 
)
inlineinherited

Open a file.

Parameters
filenameName of the file to open
modeMode to open the file in (FILE_READ, FILE_WRITE, etc.)
Returns
A file object for the opened file

◆ remove()

bool esp32_psram::InMemoryFS< VectorHIMEM< uint8_t > , FileHIMEM >::remove ( const char *  filename)
inlineinherited

Remove a file.

Parameters
filenameName of the file to remove
Returns
true if the file was removed, false otherwise

◆ rmdir()

bool esp32_psram::InMemoryFS< VectorHIMEM< uint8_t > , FileHIMEM >::rmdir ( const char *  dirname)
inlineinherited

Remove a directory (no-op for compatibility)

Parameters
dirnameName of the directory
Returns
Always returns true for compatibility

◆ totalBytes()

uint64_t esp32_psram::HIMEMClass::totalBytes ( )
inlineoverridevirtual

Get total space (returns available HIMEM)

Returns
Total HIMEM size in bytes

Implements esp32_psram::InMemoryFS< VectorHIMEM< uint8_t >, FileHIMEM >.


The documentation for this class was generated from the following file: