mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
29 lines
712 B
C++
29 lines
712 B
C++
#include "SdCard.h"
|
|
|
|
#include <Tactility/lvgl/LvglSync.h>
|
|
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
#include <driver/gpio.h>
|
|
|
|
using tt::hal::sdcard::SpiSdCardDevice;
|
|
|
|
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
|
|
GPIO_NUM_17,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
SdCardDevice::MountBehaviour::AtBoot,
|
|
nullptr,
|
|
std::vector<gpio_num_t>(),
|
|
SPI3_HOST
|
|
);
|
|
|
|
auto* spi_controller = device_find_by_name("spi1");
|
|
check(spi_controller, "spi1 not found");
|
|
|
|
return std::make_shared<SpiSdCardDevice>(
|
|
std::move(configuration),
|
|
spi_controller
|
|
);
|
|
}
|