Skip to content

Commit 6212454

Browse files
authored
WT32 SC01 Plus (ByteWelder#416)
1 parent 8de88dd commit 6212454

File tree

13 files changed

+596
-2
lines changed

13 files changed

+596
-2
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ jobs:
6666
{ id: waveshare-s3-lcd-13, arch: esp32s3 },
6767
{ id: waveshare-s3-touch-lcd-128, arch: esp32s3 },
6868
{ id: waveshare-s3-touch-lcd-147, arch: esp32s3 },
69-
{ id: waveshare-s3-touch-lcd-43, arch: esp32s3 }
69+
{ id: waveshare-s3-touch-lcd-43, arch: esp32s3 },
70+
{ id: wireless-tag-wt32-sc01-plus, arch: esp32s3 }
7071
]
7172
runs-on: ubuntu-latest
7273
needs: [ BuildSdk ]
@@ -114,4 +115,4 @@ jobs:
114115
CDN_TOKEN_VALUE: ${{ secrets.CDN_TOKEN_VALUE }}
115116
uses: ./.github/actions/publish-firmware
116117
with:
117-
cdn_version: stable
118+
cdn_version: stable
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
2+
3+
idf_component_register(
4+
SRCS ${SOURCE_FILES}
5+
INCLUDE_DIRS "Source"
6+
REQUIRES Tactility ST7796-i8080 PwmBacklight FT6x36 driver vfs fatfs
7+
)
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#include "devices/Display.h"
2+
#include "devices/SdCard.h"
3+
4+
#include <Tactility/hal/Configuration.h>
5+
#include <Tactility/lvgl/LvglSync.h>
6+
#include <PwmBacklight.h>
7+
8+
using namespace tt::hal;
9+
10+
static DeviceVector createDevices() {
11+
return {
12+
createDisplay(),
13+
createSdCard()
14+
};
15+
}
16+
17+
static bool initBoot() {
18+
return driver::pwmbacklight::init(GPIO_NUM_45);
19+
}
20+
21+
extern const Configuration hardwareConfiguration = {
22+
.initBoot = initBoot,
23+
.createDevices = createDevices,
24+
.i2c = {
25+
i2c::Configuration {
26+
.name = "Internal",
27+
.port = I2C_NUM_0,
28+
.initMode = i2c::InitMode::ByTactility,
29+
.isMutable = false,
30+
.config = (i2c_config_t) {
31+
.mode = I2C_MODE_MASTER,
32+
.sda_io_num = GPIO_NUM_6,
33+
.scl_io_num = GPIO_NUM_5,
34+
.sda_pullup_en = true,
35+
.scl_pullup_en = true,
36+
.master = {
37+
.clk_speed = 400000
38+
},
39+
.clk_flags = 0
40+
}
41+
}
42+
},
43+
.spi {
44+
// SD card
45+
spi::Configuration {
46+
.device = SPI2_HOST,
47+
.dma = SPI_DMA_CH_AUTO,
48+
.config = {
49+
.mosi_io_num = GPIO_NUM_40,
50+
.miso_io_num = GPIO_NUM_38,
51+
.sclk_io_num = GPIO_NUM_39,
52+
.quadwp_io_num = GPIO_NUM_NC,
53+
.quadhd_io_num = GPIO_NUM_NC,
54+
.data4_io_num = GPIO_NUM_NC,
55+
.data5_io_num = GPIO_NUM_NC,
56+
.data6_io_num = GPIO_NUM_NC,
57+
.data7_io_num = GPIO_NUM_NC,
58+
.data_io_default_level = false,
59+
.max_transfer_sz = 32768,
60+
.flags = 0,
61+
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
62+
.intr_flags = 0
63+
},
64+
.initMode = spi::InitMode::ByTactility,
65+
.isMutable = false,
66+
.lock = nullptr // No custom lock needed
67+
}
68+
}
69+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#include "Display.h"
2+
3+
#include <PwmBacklight.h>
4+
#include <Ft6x36Touch.h>
5+
#include <St7796i8080Display.h>
6+
7+
constexpr auto LCD_HORIZONTAL_RESOLUTION = 320;
8+
constexpr auto LCD_VERTICAL_RESOLUTION = 480;
9+
10+
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
11+
auto configuration = std::make_unique<Ft6x36Touch::Configuration>(
12+
I2C_NUM_0,
13+
GPIO_NUM_7,
14+
LCD_HORIZONTAL_RESOLUTION,
15+
LCD_VERTICAL_RESOLUTION
16+
);
17+
18+
auto touch = std::make_shared<Ft6x36Touch>(std::move(configuration));
19+
return std::static_pointer_cast<tt::hal::touch::TouchDevice>(touch);
20+
}
21+
22+
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
23+
auto configuration = St7796i8080Display::Configuration(
24+
GPIO_NUM_NC, //CS
25+
GPIO_NUM_0, //RS
26+
GPIO_NUM_47, //WR
27+
{ GPIO_NUM_9, GPIO_NUM_46, GPIO_NUM_3, GPIO_NUM_8,
28+
GPIO_NUM_18, GPIO_NUM_17, GPIO_NUM_16, GPIO_NUM_15 }, // D0..D7
29+
GPIO_NUM_4, //RESET
30+
GPIO_NUM_45 //BL
31+
);
32+
33+
configuration.mirrorX = true;
34+
configuration.horizontalResolution = LCD_HORIZONTAL_RESOLUTION;
35+
configuration.verticalResolution = LCD_VERTICAL_RESOLUTION;
36+
configuration.touch = createTouch();
37+
configuration.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
38+
39+
auto display = std::make_shared<St7796i8080Display>(configuration);
40+
return display;
41+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#pragma once
2+
3+
#include <Tactility/hal/display/DisplayDevice.h>
4+
5+
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include "SdCard.h"
2+
3+
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
4+
#include <Tactility/lvgl/LvglSync.h>
5+
6+
using tt::hal::sdcard::SpiSdCardDevice;
7+
8+
std::shared_ptr<SdCardDevice> createSdCard() {
9+
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
10+
GPIO_NUM_41,
11+
GPIO_NUM_NC,
12+
GPIO_NUM_NC,
13+
GPIO_NUM_NC,
14+
SdCardDevice::MountBehaviour::AtBoot,
15+
tt::lvgl::getSyncLock(),
16+
std::vector<gpio_num_t>(),
17+
SPI2_HOST
18+
);
19+
20+
return std::make_shared<SpiSdCardDevice>(
21+
std::move(configuration)
22+
);
23+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#pragma once
2+
3+
#include "Tactility/hal/sdcard/SdCardDevice.h"
4+
5+
using tt::hal::sdcard::SdCardDevice;
6+
7+
std::shared_ptr<SdCardDevice> createSdCard();
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[general]
2+
vendor=Wireless Tag
3+
name=WT32 SC01 Plus
4+
5+
[hardware]
6+
target=ESP32S3
7+
flashSize=16MB
8+
spiRam=true
9+
spiRamMode=QUAD
10+
spiRamSpeed=80M
11+
tinyUsb=true
12+
esptoolFlashFreq=80M
13+
14+
[display]
15+
size=3.5"
16+
shape=rectangle
17+
dpi=139
18+
19+
[lvgl]
20+
colorDepth=16
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
idf_component_register(
2+
SRC_DIRS "Source"
3+
INCLUDE_DIRS "Source"
4+
REQUIRES Tactility EspLcdCompat esp_lcd_st7796 driver
5+
)

Drivers/ST7796-i8080/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ST7796
2+
3+
A basic ESP32 LVGL driver for ST7796 parallel i8080 displays.

0 commit comments

Comments
 (0)