mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
26 lines
614 B
C++
26 lines
614 B
C++
#include "SdCard.h"
|
|
|
|
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
#include <Tactility/lvgl/LvglSync.h>
|
|
|
|
using tt::hal::sdcard::SpiSdCardDevice;
|
|
|
|
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
auto config = std::make_unique<SpiSdCardDevice::Config>(
|
|
GPIO_NUM_42,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
SdCardDevice::MountBehaviour::AtBoot,
|
|
tt::lvgl::getSyncLock(),
|
|
std::vector { GPIO_NUM_39 }
|
|
);
|
|
|
|
auto sdcard = std::make_shared<SpiSdCardDevice>(
|
|
std::move(config)
|
|
);
|
|
|
|
return std::static_pointer_cast<SdCardDevice>(sdcard);
|
|
}
|
|
|