- 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`)
32 lines
765 B
C++
32 lines
765 B
C++
#include "TdeckSdCard.h"
|
|
|
|
#include <Tactility/lvgl/LvglSync.h>
|
|
#include <Tactility/hal/SpiSdCard.h>
|
|
|
|
#include <esp_vfs_fat.h>
|
|
|
|
#define TDECK_SDCARD_PIN_CS GPIO_NUM_39
|
|
#define TDECK_LCD_PIN_CS GPIO_NUM_12
|
|
#define TDECK_RADIO_PIN_CS GPIO_NUM_9
|
|
|
|
std::shared_ptr<SdCard> createTdeckSdCard() {
|
|
auto* configuration = new tt::hal::SpiSdCard::Config(
|
|
TDECK_SDCARD_PIN_CS,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
SdCard::MountBehaviour::AtBoot,
|
|
tt::lvgl::getLvglSyncLockable(),
|
|
{
|
|
TDECK_RADIO_PIN_CS,
|
|
TDECK_LCD_PIN_CS
|
|
}
|
|
);
|
|
|
|
auto* sdcard = (SdCard*) new SpiSdCard(
|
|
std::unique_ptr<SpiSdCard::Config>(configuration)
|
|
);
|
|
|
|
return std::shared_ptr<SdCard>(sdcard);
|
|
}
|