mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
Adapted from pull request https://github.com/ByteWelder/Tactility/pull/238 - JC2432W328C - ST7789 - CST820 (816) 240x320 - 2.8 inch - ESP32-8048S043C - ST7262 - GT911 800x480 - 4.3 inch - JC8048W550C - ST7262 - GT911 800x480 - 5 inch
32 lines
785 B
C++
32 lines
785 B
C++
#include "YellowSdCard.h"
|
|
|
|
#define TAG "jc2432w328c_sdcard"
|
|
|
|
#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> createYellowSdCard() {
|
|
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);
|
|
}
|
|
|