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(ESP_PLATFORM) || defined(ROO_TESTING))
4
5
#include "driver/sdmmc_types.h"
6
#include "hal/gpio_types.h"
7
#include "hal/spi_types.h"
8
#include "
roo_io/fs/esp32/base_vfs_filesystem.h
"
9
10
namespace
roo_io
{
11
12
// For use with esp-idf.
13
//
14
// You can use it in Arduino, as long as you don't have other Arduino devices on
15
// the same SPI bus. Otherwise, use "roo_io/fs/esp32/arduino/sdfs.h" instead.
16
class
SdSpiFs
:
public
BaseEsp32VfsFilesystem
{
17
public
:
18
void
setCsPin
(
uint8_t
cs_pin
) {
cs_pin_
= (
gpio_num_t
)
cs_pin
; }
19
void
setSpiHost
(
spi_host_device_t
spi_host
) {
spi_host_
=
spi_host
; }
20
21
MediaPresence checkMediaPresence()
override
;
22
23
protected
:
24
friend
SdSpiFs
CreateSdSpiFs
();
25
26
MountImpl::MountResult mountImpl(std::function<
void
()>
unmount_fn
)
override
;
27
28
SdSpiFs
(
uint8_t
cs_pin
= -1,
spi_host_device_t
spi_host
=
SPI2_HOST
,
29
uint32_t
freq
= 20000000);
30
31
void
unmountImpl()
override
;
32
33
private
:
34
gpio_num_t
cs_pin_
;
35
36
spi_host_device_t
spi_host_
;
37
38
std::string
mount_base_path_
;
39
sdmmc_card_t
*
card_
;
40
};
41
42
extern
SdSpiFs
SDSPI
;
43
44
}
// namespace roo_io
45
46
#endif
// (defined(ESP_PLATFORM) || defined(ROO_TESTING))
base_vfs_filesystem.h
roo_io
Definition
byte.h:6
roo_io::basic_string_view
roo::basic_string_view< CharT, Traits > basic_string_view
Definition
string_view.h:8
temp_repos
roo_io
src
roo_io
fs
esp32
esp-idf
sdspi.h
Generated by
1.9.8