mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
- Implement SPI devices in dts files for all devices - Removed `tt::hal::spi` HAL and its configurations - Fix for devicetree generator "boolean" support - Remove unused custom locks in all `DisplayDevice` implementations - Fixed some bugs with devices - Updated XPT2046 driver - Fix for `WifiEsp` deadlock - Export a lot of new `math.h` symbols with `tt_init.cpp` - Created `SpiDeviceLock` in `TactilityCore` as a wrapper for kernel SPI locking - Improved `TactilityKernel` SPI driver.
35 lines
939 B
C++
35 lines
939 B
C++
#include "Sdcard.h"
|
|
|
|
#include <tactility/device.h>
|
|
|
|
#include <Tactility/lvgl/LvglSync.h>
|
|
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
|
|
using tt::hal::sdcard::SpiSdCardDevice;
|
|
|
|
constexpr auto TDECK_SDCARD_PIN_CS = GPIO_NUM_39;
|
|
constexpr auto TDECK_LCD_PIN_CS = GPIO_NUM_12;
|
|
constexpr auto TDECK_RADIO_PIN_CS = GPIO_NUM_9;
|
|
|
|
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
|
|
TDECK_SDCARD_PIN_CS,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
SdCardDevice::MountBehaviour::AtBoot,
|
|
tt::lvgl::getSyncLock(),
|
|
std::vector {
|
|
TDECK_RADIO_PIN_CS,
|
|
TDECK_LCD_PIN_CS
|
|
}
|
|
);
|
|
|
|
::Device* spiController = device_find_by_name("spi0");
|
|
check(spiController != nullptr, "spi0 not found");
|
|
return std::make_shared<SpiSdCardDevice>(
|
|
std::move(configuration),
|
|
spiController
|
|
);
|
|
}
|