- Implemented Elecrow Crowpanel Basic 5.0" - Implemented Elecrow Crowpanel Advance 5.0" - Implemented CYD 2432S032C - Fix for CYD 4848S040C rendering drift (lower transfer speed) - Fix for SD card locking mechanism for various boards
30 lines
742 B
C++
30 lines
742 B
C++
#include "CydSdCard.h"
|
|
|
|
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
#include <Tactility/lvgl/LvglSync.h>
|
|
|
|
#define SDCARD_SPI_HOST SPI3_HOST
|
|
#define SDCARD_PIN_CS GPIO_NUM_5
|
|
|
|
using tt::hal::sdcard::SpiSdCardDevice;
|
|
|
|
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
auto* configuration = new SpiSdCardDevice::Config(
|
|
SDCARD_PIN_CS,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
SdCardDevice::MountBehaviour::AtBoot,
|
|
std::make_shared<tt::Mutex>(),
|
|
std::vector<gpio_num_t>(),
|
|
SDCARD_SPI_HOST
|
|
);
|
|
|
|
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
);
|
|
|
|
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
}
|
|
|