mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
Waveshare GEEK (#413)
This commit is contained in:
parent
0df6b78bd6
commit
c7c9618f48
9
.github/workflows/build-firmware.yml
vendored
9
.github/workflows/build-firmware.yml
vendored
@ -15,6 +15,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
board: [
|
||||
{ id: btt-panda-touch, arch: esp32s3 },
|
||||
{ id: cyd-2432s024c, arch: esp32 },
|
||||
{ id: cyd-2432s028r, arch: esp32 },
|
||||
{ id: cyd-2432s028rv3, arch: esp32 },
|
||||
@ -44,11 +45,11 @@ jobs:
|
||||
{ id: m5stack-stickc-plus, arch: esp32 },
|
||||
{ id: m5stack-stickc-plus2, arch: esp32 },
|
||||
{ id: unphone, arch: esp32s3 },
|
||||
{ id: waveshare-s3-touch-lcd-43, arch: esp32s3 },
|
||||
{ id: waveshare-s3-touch-lcd-147, arch: esp32s3 },
|
||||
{ id: waveshare-s3-touch-lcd-128, arch: esp32s3 },
|
||||
{ id: waveshare-esp32-s3-geek, arch: esp32s3 },
|
||||
{ id: waveshare-s3-lcd-13, arch: esp32s3 },
|
||||
{ id: btt-panda-touch, arch: esp32s3 }
|
||||
{ id: waveshare-s3-touch-lcd-128, arch: esp32s3 },
|
||||
{ id: waveshare-s3-touch-lcd-147, arch: esp32s3 },
|
||||
{ id: waveshare-s3-touch-lcd-43, arch: esp32s3 }
|
||||
]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
7
Boards/waveshare-esp32-s3-geek/CMakeLists.txt
Normal file
7
Boards/waveshare-esp32-s3-geek/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility ButtonControl ST7789 PwmBacklight driver
|
||||
)
|
||||
99
Boards/waveshare-esp32-s3-geek/Source/Configuration.cpp
Normal file
99
Boards/waveshare-esp32-s3-geek/Source/Configuration.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
#include "devices/Display.h"
|
||||
#include "devices/SdCard.h"
|
||||
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <PwmBacklight.h>
|
||||
#include <ButtonControl.h>
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
static DeviceVector createDevices() {
|
||||
return {
|
||||
createDisplay(),
|
||||
createSdCard(),
|
||||
ButtonControl::createOneButtonControl(0)
|
||||
};
|
||||
}
|
||||
|
||||
static bool initBoot() {
|
||||
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
|
||||
}
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.createDevices = createDevices,
|
||||
.i2c = {
|
||||
//I2C Header
|
||||
i2c::Configuration {
|
||||
.name = "Main",
|
||||
.port = I2C_NUM_0,
|
||||
.initMode = i2c::InitMode::Disabled,
|
||||
.isMutable = false,
|
||||
.config = (i2c_config_t) {
|
||||
.mode = I2C_MODE_MASTER,
|
||||
.sda_io_num = GPIO_NUM_16,
|
||||
.scl_io_num = GPIO_NUM_17,
|
||||
.sda_pullup_en = true,
|
||||
.scl_pullup_en = true,
|
||||
.master = {
|
||||
.clk_speed = 400000
|
||||
},
|
||||
.clk_flags = 0
|
||||
}
|
||||
}
|
||||
},
|
||||
.spi {
|
||||
// Display
|
||||
spi::Configuration {
|
||||
.device = SPI2_HOST,
|
||||
.dma = SPI_DMA_DISABLED,
|
||||
.config = {
|
||||
.mosi_io_num = GPIO_NUM_11,
|
||||
.miso_io_num = GPIO_NUM_NC,
|
||||
.sclk_io_num = GPIO_NUM_12,
|
||||
.quadwp_io_num = GPIO_NUM_NC,
|
||||
.quadhd_io_num = GPIO_NUM_NC,
|
||||
.data4_io_num = GPIO_NUM_NC,
|
||||
.data5_io_num = GPIO_NUM_NC,
|
||||
.data6_io_num = GPIO_NUM_NC,
|
||||
.data7_io_num = GPIO_NUM_NC,
|
||||
.data_io_default_level = false,
|
||||
.max_transfer_sz = LCD_SPI_TRANSFER_SIZE_LIMIT,
|
||||
.flags = 0,
|
||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
||||
.intr_flags = 0
|
||||
},
|
||||
.initMode = spi::InitMode::ByTactility,
|
||||
.isMutable = false,
|
||||
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
|
||||
}
|
||||
},
|
||||
.uart {
|
||||
//UART Header
|
||||
uart::Configuration {
|
||||
.name = "UART0",
|
||||
.port = UART_NUM_0,
|
||||
.rxPin = GPIO_NUM_44,
|
||||
.txPin = GPIO_NUM_43,
|
||||
.rtsPin = GPIO_NUM_NC,
|
||||
.ctsPin = GPIO_NUM_NC,
|
||||
.rxBufferSize = 1024,
|
||||
.txBufferSize = 1024,
|
||||
.config = {
|
||||
.baud_rate = 115200,
|
||||
.data_bits = UART_DATA_8_BITS,
|
||||
.parity = UART_PARITY_DISABLE,
|
||||
.stop_bits = UART_STOP_BITS_1,
|
||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
||||
.rx_flow_ctrl_thresh = 0,
|
||||
.source_clk = UART_SCLK_DEFAULT,
|
||||
.flags = {
|
||||
.allow_pd = 0,
|
||||
.backup_before_sleep = 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
32
Boards/waveshare-esp32-s3-geek/Source/devices/Display.cpp
Normal file
32
Boards/waveshare-esp32-s3-geek/Source/devices/Display.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include "Display.h"
|
||||
|
||||
#include <PwmBacklight.h>
|
||||
#include <St7789Display.h>
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
St7789Display::Configuration panel_configuration = {
|
||||
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
|
||||
.verticalResolution = LCD_VERTICAL_RESOLUTION,
|
||||
.gapX = 52,
|
||||
.gapY = 40,
|
||||
.swapXY = false,
|
||||
.mirrorX = true,
|
||||
.mirrorY = true,
|
||||
.invertColor = true,
|
||||
.bufferSize = LCD_BUFFER_SIZE,
|
||||
.touch = nullptr,
|
||||
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
|
||||
.resetPin = LCD_PIN_RESET,
|
||||
.lvglSwapBytes = false
|
||||
};
|
||||
|
||||
auto spi_configuration = std::make_shared<St7789Display::SpiConfiguration>(St7789Display::SpiConfiguration {
|
||||
.spiHostDevice = LCD_SPI_HOST,
|
||||
.csPin = LCD_PIN_CS,
|
||||
.dcPin = LCD_PIN_DC,
|
||||
.pixelClockFrequency = 62'500'000,
|
||||
.transactionQueueDepth = 10
|
||||
});
|
||||
|
||||
return std::make_shared<St7789Display>(panel_configuration, spi_configuration);
|
||||
}
|
||||
19
Boards/waveshare-esp32-s3-geek/Source/devices/Display.h
Normal file
19
Boards/waveshare-esp32-s3-geek/Source/devices/Display.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <memory>
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/spi_common.h>
|
||||
|
||||
constexpr auto LCD_SPI_HOST = SPI2_HOST;
|
||||
constexpr auto LCD_PIN_CS = GPIO_NUM_10;
|
||||
constexpr auto LCD_PIN_DC = GPIO_NUM_8;
|
||||
constexpr auto LCD_PIN_RESET = GPIO_NUM_9;
|
||||
constexpr auto LCD_PIN_BACKLIGHT = GPIO_NUM_7;
|
||||
constexpr auto LCD_HORIZONTAL_RESOLUTION = 135;
|
||||
constexpr auto LCD_VERTICAL_RESOLUTION = 240;
|
||||
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 3;
|
||||
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;
|
||||
constexpr auto LCD_SPI_TRANSFER_SIZE_LIMIT = LCD_BUFFER_SIZE * LV_COLOR_DEPTH / 8;
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
||||
22
Boards/waveshare-esp32-s3-geek/Source/devices/SdCard.cpp
Normal file
22
Boards/waveshare-esp32-s3-geek/Source/devices/SdCard.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#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)
|
||||
);
|
||||
}
|
||||
7
Boards/waveshare-esp32-s3-geek/Source/devices/SdCard.h
Normal file
7
Boards/waveshare-esp32-s3-geek/Source/devices/SdCard.h
Normal file
@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
||||
|
||||
using tt::hal::sdcard::SdCardDevice;
|
||||
|
||||
std::shared_ptr<SdCardDevice> createSdCard();
|
||||
21
Boards/waveshare-esp32-s3-geek/device.properties
Normal file
21
Boards/waveshare-esp32-s3-geek/device.properties
Normal file
@ -0,0 +1,21 @@
|
||||
[general]
|
||||
vendor=Waveshare
|
||||
name=ESP32 S3 GEEK
|
||||
incubating=true
|
||||
|
||||
[hardware]
|
||||
target=ESP32S3
|
||||
flashSize=16MB
|
||||
spiRam=true
|
||||
spiRamMode=QUAD
|
||||
spiRamSpeed=120M
|
||||
tinyUsb=true
|
||||
esptoolFlashFreq=120M
|
||||
|
||||
[display]
|
||||
size=1.14"
|
||||
shape=rectangle
|
||||
dpi=143
|
||||
|
||||
[lvgl]
|
||||
colorDepth=16
|
||||
@ -11,6 +11,8 @@ menu "Tactility App"
|
||||
default TT_BOARD_CUSTOM
|
||||
config TT_BOARD_CUSTOM
|
||||
bool "Custom"
|
||||
config TT_BOARD_BTT_PANDA_TOUCH
|
||||
bool "BigTreeTech Panda Touch"
|
||||
config TT_BOARD_CYD_2432S024C
|
||||
bool "CYD 2432S024C"
|
||||
config TT_BOARD_CYD_2432S028R
|
||||
@ -67,6 +69,8 @@ menu "Tactility App"
|
||||
bool "M5Stack StickC Plus2"
|
||||
config TT_BOARD_UNPHONE
|
||||
bool "unPhone"
|
||||
config TT_BOARD_WAVESHARE_ESP32_S3_GEEK
|
||||
bool "Waveshare ESP32 S3 GEEK"
|
||||
config TT_BOARD_WAVESHARE_S3_TOUCH_43
|
||||
bool "Waveshare ESP32 S3 Touch LCD 4.3"
|
||||
config TT_BOARD_WAVESHARE_S3_TOUCH_LCD_147
|
||||
@ -75,8 +79,7 @@ menu "Tactility App"
|
||||
bool "Waveshare ESP32 S3 Touch LCD 1.28"
|
||||
config TT_BOARD_WAVESHARE_S3_LCD_13
|
||||
bool "Waveshare ESP32 S3 LCD 1.3"
|
||||
config TT_BOARD_BTT_PANDA_TOUCH
|
||||
bool "BigTreeTech Panda Touch"
|
||||
|
||||
help
|
||||
Select a board/hardware configuration.
|
||||
Use TT_BOARD_CUSTOM if you will manually configure the board in your project.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user