roo_io
API Documentation for roo_io
Loading...
Searching...
No Matches
sdspi.h
Go to the documentation of this file.
1#pragma once
2
3#if (defined ESP32 && defined ARDUINO)
4
5#include <functional>
6#include <string>
7
8#include "SPI.h"
12#include "sd_diskio.h"
13
14namespace roo_io {
15
16// Exposes the roo_io::Filesystem interface over the native ESP32 Arduino SD
17// implementation, using the VFS API and Posix interface to the file system.
18// This is very similar to "roo_io/fs/arduino/sdfs.h", but uses the lower-level
19// sd_diskio interface directly, instead of going through the Arduino SD object.
21 public:
23 void setSPI(decltype(::SPI)& spi) { spi_ = &spi; }
24
25 MediaPresence checkMediaPresence() override;
26
27 protected:
29
31 uint32_t freq = 20000000);
32
33 MountImpl::MountResult mountImpl(std::function<void()> unmount_fn) override;
34
35 void unmountImpl() override;
36
38
39 decltype(::SPI)* spi_;
40
42};
43
45
46} // namespace roo_io
47
48#endif
Definition byte.h:6
roo::basic_string_view< CharT, Traits > basic_string_view
Definition string_view.h:8