mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
- Create `Include/` folder for all main projects - Fix some issues here and there (found while moving things) - All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
30 lines
675 B
C++
30 lines
675 B
C++
#include "YellowSdCard.h"
|
|
|
|
#define TAG "twodotfour_sdcard"
|
|
|
|
#include <Tactility/lvgl/LvglSync.h>
|
|
#include <Tactility/hal/SpiSdCard.h>
|
|
|
|
#define SDCARD_SPI_HOST SPI3_HOST
|
|
#define SDCARD_PIN_CS GPIO_NUM_5
|
|
|
|
std::shared_ptr<SdCard> createYellowSdCard() {
|
|
auto* configuration = new tt::hal::SpiSdCard::Config(
|
|
SDCARD_PIN_CS,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
SdCard::MountBehaviour::AtBoot,
|
|
nullptr,
|
|
std::vector<gpio_num_t>(),
|
|
SDCARD_SPI_HOST
|
|
);
|
|
|
|
auto* sdcard = (SdCard*) new SpiSdCard(
|
|
std::unique_ptr<SpiSdCard::Config>(configuration)
|
|
);
|
|
|
|
return std::shared_ptr<SdCard>(sdcard);
|
|
}
|
|
|