mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-04-18 09:25:06 +00:00
Converted SDMMC drivers
This commit is contained in:
parent
9331422a66
commit
cd0e3fc569
@ -1,5 +1,4 @@
|
||||
#include "devices/Power.h"
|
||||
#include "devices/SdCard.h"
|
||||
#include "devices/Display.h"
|
||||
|
||||
#include <ButtonControl.h>
|
||||
@ -11,7 +10,6 @@ using namespace tt::hal;
|
||||
|
||||
static std::vector<std::shared_ptr<tt::hal::Device>> createDevices() {
|
||||
return {
|
||||
createSdCard(),
|
||||
createDisplay(),
|
||||
std::make_shared<Power>(),
|
||||
ButtonControl::createOneButtonControl(0)
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
#include "SdCard.h"
|
||||
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/hal/sdcard/SdmmcDevice.h>
|
||||
|
||||
using tt::hal::sdcard::SdmmcDevice;
|
||||
|
||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
||||
auto configuration = std::make_unique<SdmmcDevice::Config>(
|
||||
SD_DIO_SCLK, //CLK
|
||||
SD_DIO_CMD, //CMD
|
||||
SD_DIO_DATA0, //D0
|
||||
SD_DIO_NC, //D1
|
||||
SD_DIO_NC, //D2
|
||||
SD_DIO_NC, //D3
|
||||
SdCardDevice::MountBehaviour::AtBoot,
|
||||
SD_DIO_BUS_WIDTH
|
||||
);
|
||||
|
||||
return std::make_shared<SdmmcDevice>(
|
||||
std::move(configuration)
|
||||
);
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <driver/gpio.h>
|
||||
|
||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
||||
|
||||
using tt::hal::sdcard::SdCardDevice;
|
||||
|
||||
constexpr auto SD_DIO_CMD = GPIO_NUM_11;
|
||||
constexpr auto SD_DIO_SCLK = GPIO_NUM_12;
|
||||
constexpr auto SD_DIO_DATA0 = GPIO_NUM_13;
|
||||
constexpr auto SD_DIO_NC = GPIO_NUM_NC;
|
||||
constexpr auto SD_DIO_BUS_WIDTH = 1;
|
||||
|
||||
std::shared_ptr<SdCardDevice> createSdCard();
|
||||
@ -3,6 +3,7 @@
|
||||
#include <tactility/bindings/root.h>
|
||||
#include <tactility/bindings/esp32_gpio.h>
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_sdmmc.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
|
||||
/ {
|
||||
@ -21,4 +22,12 @@
|
||||
pin-miso = <&gpio0 4 GPIO_FLAG_NONE>;
|
||||
pin-sclk = <&gpio0 1 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
sdmmc0 {
|
||||
compatible = "espressif,esp32-sdmmc";
|
||||
pin-clk = <&gpio0 12 GPIO_FLAG_NONE>;
|
||||
pin-cmd = <&gpio0 11 GPIO_FLAG_NONE>;
|
||||
pin-d0 = <&gpio0 13 GPIO_FLAG_NONE>;
|
||||
bus-width = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#include "devices/Display.h"
|
||||
#include "devices/SdCard.h"
|
||||
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
#include <PwmBacklight.h>
|
||||
@ -10,7 +9,6 @@ using namespace tt::hal;
|
||||
static DeviceVector createDevices() {
|
||||
return {
|
||||
createDisplay(),
|
||||
createSdCard(),
|
||||
ButtonControl::createOneButtonControl(0)
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
#include "SdCard.h"
|
||||
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/hal/sdcard/SdmmcDevice.h>
|
||||
|
||||
using tt::hal::sdcard::SdmmcDevice;
|
||||
|
||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
||||
auto configuration = std::make_unique<SdmmcDevice::Config>(
|
||||
GPIO_NUM_36, //CLK
|
||||
GPIO_NUM_35, //CMD
|
||||
GPIO_NUM_37, //D0
|
||||
GPIO_NUM_33, //D1
|
||||
GPIO_NUM_38, //D2
|
||||
GPIO_NUM_34, //D3
|
||||
SdCardDevice::MountBehaviour::AtBoot
|
||||
);
|
||||
|
||||
return std::make_shared<SdmmcDevice>(
|
||||
std::move(configuration)
|
||||
);
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
||||
|
||||
using tt::hal::sdcard::SdCardDevice;
|
||||
|
||||
std::shared_ptr<SdCardDevice> createSdCard();
|
||||
@ -3,6 +3,7 @@
|
||||
#include <tactility/bindings/root.h>
|
||||
#include <tactility/bindings/esp32_gpio.h>
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_sdmmc.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
|
||||
@ -30,6 +31,17 @@
|
||||
pin-sclk = <&gpio0 12 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
sdmmc0 {
|
||||
compatible = "espressif,esp32-sdmmc";
|
||||
pin-clk = <&gpio0 36 GPIO_FLAG_NONE>;
|
||||
pin-cmd = <&gpio0 35 GPIO_FLAG_NONE>;
|
||||
pin-d0 = <&gpio0 37 GPIO_FLAG_NONE>;
|
||||
pin-d1 = <&gpio0 33 GPIO_FLAG_NONE>;
|
||||
pin-d2 = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
pin-d3 = <&gpio0 34 GPIO_FLAG_NONE>;
|
||||
bus-width = <4>;
|
||||
};
|
||||
|
||||
uart0 {
|
||||
compatible = "espressif,esp32-uart";
|
||||
port = <UART_NUM_0>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user