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

Class for managing files stored in ESP32's High Memory: Use the HIMEM object instead instaniating this class directly. More...

#include <HIMEM.h>

Public Member Functions

bool begin ()
 Initialize the HIMEM filesystem. More...
 
bool exists (const char *filename)
 Check if a file exists in HIMEM. More...
 
uint64_t freeBytes ()
 Get free space (returns free HIMEM) 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 in HIMEM. More...
 
bool remove (const char *filename)
 Remove a file from HIMEM. More...
 
bool rmdir (const char *dirname)
 Remove a directory (no-op for compatibility) More...
 
uint64_t totalBytes ()
 Get total space (returns available HIMEM) More...
 

Detailed Description

Class for managing files stored in ESP32's High Memory: Use the HIMEM object instead instaniating this class directly.

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 ( )
inline

Initialize the HIMEM filesystem.

Returns
true if initialization was successful, false otherwise

◆ exists()

bool esp32_psram::HIMEMClass::exists ( const char *  filename)
inline

Check if a file exists in HIMEM.

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

◆ freeBytes()

uint64_t esp32_psram::HIMEMClass::freeBytes ( )
inline

Get free space (returns free HIMEM)

Returns
Free HIMEM size in bytes

◆ mkdir()

bool esp32_psram::HIMEMClass::mkdir ( const char *  dirname)
inline

Create a directory (no-op for compatibility)

Parameters
dirnameName of the directory
Returns
Always returns true for compatibility

◆ open()

FileHIMEM esp32_psram::HIMEMClass::open ( const char *  filename,
uint8_t  mode 
)
inline

Open a file in HIMEM.

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

◆ remove()

bool esp32_psram::HIMEMClass::remove ( const char *  filename)
inline

Remove a file from HIMEM.

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

◆ rmdir()

bool esp32_psram::HIMEMClass::rmdir ( const char *  dirname)
inline

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 ( )
inline

Get total space (returns available HIMEM)

Returns
Total HIMEM size in bytes

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