- Added CONFIG_TT_BOARD_CYD_2432S028R in Kconfig. - Included support for CYD2432S028R in Boards.h and board.cmake. - Updated Xpt2046Touch driver to use configuration->spiDevice instead of SPI2_HOST when creating the SPI handle. - Note: SD card is not working on this board yet. This commit introduces full support for the CYD-2432S028R board and improves the touchscreen driver flexibility by allowing dynamic SPI device configuration. SD card functionality still needs to be implemented.
27 lines
711 B
C++
27 lines
711 B
C++
#include "YellowSdCard.h"
|
|
#include "YellowConstants.h"
|
|
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
#include <Tactility/lvgl/LvglSync.h>
|
|
|
|
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);
|
|
}
|
|
|