arduino-audio-tools
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VFS_SDMMC Class Reference

ESP32 Virtual File System for SDMMC. The default mount point is "/sdcard" DRAFT implementation: not tested see https://github.com/espressif/esp-idf/blob/master/examples/storage/sd_card/sdmmc/README.md. More...

#include <VFS_SDMMC.h>

Inheritance diagram for VFS_SDMMC:
VFS

Public Types

enum class  BusWidth { Byte1 = 1 , Byte4 = 4 }
 
enum class  Speed { HS , UHS_SDR , UHS_DDR }
 

Public Member Functions

 VFS_SDMMC (const char *mountPoint="/sdmmc")
 
 VFS_SDMMC (int pinClk, int pinCmd, int pinD0, int pinD1, int pinD2=-1, int pinD3=-1, const char *mountPoint="/sdmmc")
 
bool begin ()
 mount the file systems
 
void end ()
 unmount the file system
 
bool exists (const char *path)
 
bool exists (const std::string &path)
 
bool mkdir (const char *path)
 
bool mkdir (const std::string &path)
 
const charmountPoint ()
 provides the actual mount point
 
VFSFile open (const char *file, FileMode mode=VFS_FILE_READ)
 
VFSFile open (const std::string &path, FileMode mode=VFS_FILE_READ)
 
bool remove (const char *path)
 
bool remove (const std::string &path)
 
bool rename (const char *pathFrom, const char *pathTo)
 
bool rename (const std::string &pathFrom, const std::string &pathTo)
 
bool rmdir (const char *path)
 
bool rmdir (const std::string &path)
 
void setBusWidth (BusWidth bits)
 
void setClk (int pin)
 
void setCmd (int pin)
 
void setD0 (int pin)
 
void setD1 (int pin)
 
void setD2 (int pin)
 
void setD3 (int pin)
 
void setMountPoint (const char *mp)
 provide the mount point (root directory for the file system)
 
void setPins (int pinClk, int pinCmd, int pinD0, int pinD1, int pinD2=-1, int pinD3=-1)
 
void setSpeed (Speed speed)
 

Protected Member Functions

const charexpand (const char *file)
 expands the file name with the mount point
 

Protected Attributes

size_t allocation_unit_size = 16 * 1024
 
BusWidth bus_width = BusWidth::Byte4
 
sdmmc_card_tcard = nullptr
 
sdmmc_host_t host
 
int max_files = 5
 
const charmount_point = "/"
 
gpio_num_t pin_clk = (gpio_num_t) 14
 
gpio_num_t pin_cmd = (gpio_num_t) 15
 
gpio_num_t pin_d0 = (gpio_num_t) 2
 
gpio_num_t pin_d1 = (gpio_num_t) 4
 
gpio_num_t pin_d2 = (gpio_num_t) 12
 
gpio_num_t pin_d3 = (gpio_num_t) 13
 
sd_pwr_ctrl_handle_t pwr_ctrl_handle
 
Speed speed = Speed::HS
 
Str tmp
 

Detailed Description

ESP32 Virtual File System for SDMMC. The default mount point is "/sdcard" DRAFT implementation: not tested see https://github.com/espressif/esp-idf/blob/master/examples/storage/sd_card/sdmmc/README.md.

Author
Phil Schatzmann

Member Enumeration Documentation

◆ BusWidth

Enumerator
Byte1 
Byte4 

◆ Speed

enum class Speed
strong
Enumerator
HS 
UHS_SDR 
UHS_DDR 

Constructor & Destructor Documentation

◆ VFS_SDMMC() [1/2]

VFS_SDMMC ( const char mountPoint = "/sdmmc")
inline

◆ VFS_SDMMC() [2/2]

VFS_SDMMC ( int  pinClk,
int  pinCmd,
int  pinD0,
int  pinD1,
int  pinD2 = -1,
int  pinD3 = -1,
const char mountPoint = "/sdmmc" 
)
inline

Member Function Documentation

◆ begin()

bool begin ( )
inlinevirtual

mount the file systems

< SD High speed (limited by clock divider)

< MMC 100MHz speed

< MMC 50MHz speed

Reimplemented from VFS.

◆ end()

void end ( )
inlinevirtual

unmount the file system

Reimplemented from VFS.

◆ exists() [1/2]

bool exists ( const char path)
inlineinherited

◆ exists() [2/2]

bool exists ( const std::string &  path)
inlineinherited

◆ expand()

const char * expand ( const char file)
inlineprotectedinherited

expands the file name with the mount point

◆ mkdir() [1/2]

bool mkdir ( const char path)
inlineinherited

◆ mkdir() [2/2]

bool mkdir ( const std::string &  path)
inlineinherited

◆ mountPoint()

const char * mountPoint ( )
inlineinherited

provides the actual mount point

◆ open() [1/2]

VFSFile open ( const char file,
FileMode  mode = VFS_FILE_READ 
)
inlineinherited

◆ open() [2/2]

VFSFile open ( const std::string &  path,
FileMode  mode = VFS_FILE_READ 
)
inlineinherited

◆ remove() [1/2]

bool remove ( const char path)
inlineinherited

◆ remove() [2/2]

bool remove ( const std::string &  path)
inlineinherited

◆ rename() [1/2]

bool rename ( const char pathFrom,
const char pathTo 
)
inlineinherited

◆ rename() [2/2]

bool rename ( const std::string &  pathFrom,
const std::string &  pathTo 
)
inlineinherited

◆ rmdir() [1/2]

bool rmdir ( const char path)
inlineinherited

◆ rmdir() [2/2]

bool rmdir ( const std::string &  path)
inlineinherited

◆ setBusWidth()

void setBusWidth ( BusWidth  bits)
inline

◆ setClk()

void setClk ( int  pin)
inline

◆ setCmd()

void setCmd ( int  pin)
inline

◆ setD0()

void setD0 ( int  pin)
inline

◆ setD1()

void setD1 ( int  pin)
inline

◆ setD2()

void setD2 ( int  pin)
inline

◆ setD3()

void setD3 ( int  pin)
inline

◆ setMountPoint()

void setMountPoint ( const char mp)
inlinevirtual

provide the mount point (root directory for the file system)

Reimplemented from VFS.

◆ setPins()

void setPins ( int  pinClk,
int  pinCmd,
int  pinD0,
int  pinD1,
int  pinD2 = -1,
int  pinD3 = -1 
)
inline

◆ setSpeed()

void setSpeed ( Speed  speed)
inline

Member Data Documentation

◆ allocation_unit_size

size_t allocation_unit_size = 16 * 1024
protected

◆ bus_width

BusWidth bus_width = BusWidth::Byte4
protected

◆ card

sdmmc_card_t* card = nullptr
protected

◆ host

sdmmc_host_t host
protected

◆ max_files

int max_files = 5
protected

◆ mount_point

const char* mount_point = "/"
protectedinherited

◆ pin_clk

gpio_num_t pin_clk = (gpio_num_t) 14
protected

◆ pin_cmd

gpio_num_t pin_cmd = (gpio_num_t) 15
protected

◆ pin_d0

gpio_num_t pin_d0 = (gpio_num_t) 2
protected

◆ pin_d1

gpio_num_t pin_d1 = (gpio_num_t) 4
protected

◆ pin_d2

gpio_num_t pin_d2 = (gpio_num_t) 12
protected

◆ pin_d3

gpio_num_t pin_d3 = (gpio_num_t) 13
protected

◆ pwr_ctrl_handle

sd_pwr_ctrl_handle_t pwr_ctrl_handle
protected

◆ speed

Speed speed = Speed::HS
protected

◆ tmp

Str tmp
protectedinherited

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