mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-19 03:13:14 +00:00
To avoid keeping track of a list that maps board project names to board ids. Because of this change, we don't have to manually edit `boards.cmake` anymore when adding a new board.
29 lines
712 B
C++
29 lines
712 B
C++
#include "SdCard.h"
|
|
|
|
#include <Tactility/lvgl/LvglSync.h>
|
|
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
|
|
constexpr auto CORES3_SDCARD_PIN_CS = GPIO_NUM_4;
|
|
constexpr auto CORES3_LCD_PIN_CS = GPIO_NUM_3;
|
|
|
|
using tt::hal::sdcard::SpiSdCardDevice;
|
|
|
|
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
|
|
CORES3_SDCARD_PIN_CS,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
SdCardDevice::MountBehaviour::AtBoot,
|
|
tt::lvgl::getSyncLock(),
|
|
std::vector {
|
|
CORES3_LCD_PIN_CS
|
|
},
|
|
SPI3_HOST
|
|
);
|
|
|
|
return std::make_shared<SpiSdCardDevice>(
|
|
std::move(configuration)
|
|
);
|
|
}
|