arduino-emulator
Loading...
Searching...
No Matches
SD_MMC.h
1/*
2 SD_MMC.h
3 Copyright (c) 2026 Phil Schatzmann. All right reserved.
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14*/
15#pragma once
16#include "DirectoryFS.h"
17
21#ifndef SD_MMC_ROOT
22# define SD_MMC_ROOT "."
23#endif
24
29class SDMMCFS : public DirectoryFS {
30 public:
31 SDMMCFS() : DirectoryFS("SD_MMC_ROOT", SD_MMC_ROOT) {}
32
33 bool setPins(int clk, int cmd, int d0, int d1 = -1, int d2 = -1, int d3 = -1) { return true; }
34
35 bool begin(const char* mountpoint = "/sdcard", bool mode1bit = false,
36 bool format_if_mount_failed = false, int sdmmc_frequency = 20000,
37 uint8_t maxOpenFiles = 5) {
38 return beginRoot();
39 }
40
41 uint64_t cardSize() { return totalBytes(); }
42};
43
44inline SDMMCFS SD_MMC;
bool beginRoot()
Determines the root directory: the environment variable or the default.
Definition DirectoryFS.h:35
ESP32 compatible SD_MMC which is a directory of the computer: SD_MMC.open("/test.txt") opens SD_MMC_R...
Definition SD_MMC.h:29