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

Class for managing files stored in ESP32's PSRAM. More...

#include <PSRAM.h>

Inheritance diagram for esp32_psram::PSRAMClass:
esp32_psram::InMemoryFS< VectorPSRAM< uint8_t >, FilePSRAM >

Public Member Functions

bool begin () override
 Initialize the PSRAM 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 PSRAM) 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...
 
FilePSRAM 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 PSRAM) More...
 

Protected Attributes

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

Detailed Description

Class for managing files stored in ESP32's PSRAM.

This class provides an interface similar to SD.h for managing files that are stored in PSRAM memory rather than on an SD card.

Member Function Documentation

◆ begin()

bool esp32_psram::PSRAMClass::begin ( )
inlineoverridevirtual

Initialize the PSRAM filesystem.

Returns
true if initialization was successful, false otherwise

Implements esp32_psram::InMemoryFS< VectorPSRAM< uint8_t >, FilePSRAM >.

◆ exists()

bool esp32_psram::InMemoryFS< VectorPSRAM< uint8_t > , FilePSRAM >::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< VectorPSRAM< uint8_t > , FilePSRAM >::fileCount ( ) const
inlineinherited

Get the total number of files.

Returns
Number of files in the filesystem

◆ freeBytes()

uint64_t esp32_psram::PSRAMClass::freeBytes ( )
inlineoverridevirtual

Get free space (returns free PSRAM)

Returns
Free PSRAM size in bytes

Implements esp32_psram::InMemoryFS< VectorPSRAM< uint8_t >, FilePSRAM >.

◆ getFirstFileName()

String esp32_psram::InMemoryFS< VectorPSRAM< uint8_t > , FilePSRAM >::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< VectorPSRAM< uint8_t > , FilePSRAM >::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< VectorPSRAM< uint8_t > , FilePSRAM >::mkdir ( const char *  dirname)
inlineinherited

Create a directory (no-op for compatibility)

Parameters
dirnameName of the directory
Returns
Always returns true for compatibility

◆ open()

FilePSRAM esp32_psram::InMemoryFS< VectorPSRAM< uint8_t > , FilePSRAM >::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< VectorPSRAM< uint8_t > , FilePSRAM >::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< VectorPSRAM< uint8_t > , FilePSRAM >::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::PSRAMClass::totalBytes ( )
inlineoverridevirtual

Get total space (returns available PSRAM)

Returns
Total PSRAM size in bytes

Implements esp32_psram::InMemoryFS< VectorPSRAM< uint8_t >, FilePSRAM >.


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