Skip to content

Commit dc166df

Browse files
committed
CYD-JC3248W535C
1 parent 0d8c0a3 commit dc166df

File tree

16 files changed

+812
-33
lines changed

16 files changed

+812
-33
lines changed

.github/workflows/build-firmware.yml

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- main
6+
- cyd-jc3248w535c
67
tags:
78
- v*
89
pull_request:
@@ -15,39 +16,7 @@ jobs:
1516
strategy:
1617
matrix:
1718
board: [
18-
{ id: cyd-2432s024c, arch: esp32 },
19-
{ id: cyd-2432s028r, arch: esp32 },
20-
{ id: cyd-2432s028rv3, arch: esp32 },
21-
{ id: cyd-e32r28t, arch: esp32 },
22-
{ id: cyd-e32r32p, arch: esp32 },
23-
{ id: cyd-2432s032c, arch: esp32 },
24-
{ id: cyd-jc2432w328c, arch: esp32 },
25-
{ id: cyd-8048s043c, arch: esp32s3 },
26-
{ id: cyd-jc8048w550c, arch: esp32s3 },
27-
{ id: cyd-4848s040c, arch: esp32s3 },
28-
{ id: elecrow-crowpanel-advance-28, arch: esp32s3 },
29-
{ id: elecrow-crowpanel-advance-35, arch: esp32s3 },
30-
{ id: elecrow-crowpanel-advance-50, arch: esp32s3 },
31-
{ id: elecrow-crowpanel-basic-28, arch: esp32 },
32-
{ id: elecrow-crowpanel-basic-35, arch: esp32 },
33-
{ id: elecrow-crowpanel-basic-50, arch: esp32s3 },
34-
{ id: lilygo-tdeck, arch: esp32s3 },
35-
{ id: lilygo-tdongle-s3, arch: esp32s3 },
36-
{ id: lilygo-tdisplay-s3, arch: esp32s3 },
37-
{ id: lilygo-tlora-pager, arch: esp32s3 },
38-
{ id: lilygo-tdisplay, arch: esp32 },
39-
{ id: m5stack-cardputer, arch: esp32s3 },
40-
{ id: m5stack-cardputer-adv, arch: esp32s3 },
41-
{ id: m5stack-core2, arch: esp32 },
42-
{ id: m5stack-cores3, arch: esp32s3 },
43-
{ id: m5stack-stickc-plus, arch: esp32 },
44-
{ id: m5stack-stickc-plus2, arch: esp32 },
45-
{ id: unphone, arch: esp32s3 },
46-
{ id: waveshare-s3-touch-lcd-43, arch: esp32s3 },
47-
{ id: waveshare-s3-touch-lcd-147, arch: esp32s3 },
48-
{ id: waveshare-s3-touch-lcd-128, arch: esp32s3 },
49-
{ id: waveshare-s3-lcd-13, arch: esp32s3 },
50-
{ id: btt-panda-touch, arch: esp32s3 }
19+
{ id: cyd-jc3248w535c, arch: esp32s3 }
5120
]
5221
runs-on: ubuntu-latest
5322
steps:
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 Axs15231b PwmBacklight driver vfs fatfs
7+
)
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
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+
#define SPI_TRANSFER_SIZE_LIMIT 320 * 16 / 8
11+
12+
static DeviceVector createDevices() {
13+
return {
14+
createDisplay(),
15+
createSdCard()
16+
};
17+
}
18+
19+
static bool initBoot() {
20+
return driver::pwmbacklight::init(GPIO_NUM_1);
21+
}
22+
23+
extern const Configuration hardwareConfiguration = {
24+
.initBoot = initBoot,
25+
.createDevices = createDevices,
26+
.i2c = {
27+
//Touch
28+
i2c::Configuration {
29+
.name = "Internal",
30+
.port = I2C_NUM_0,
31+
.initMode = i2c::InitMode::ByTactility,
32+
.isMutable = true,
33+
.config = (i2c_config_t) {
34+
.mode = I2C_MODE_MASTER,
35+
.sda_io_num = GPIO_NUM_4,
36+
.scl_io_num = GPIO_NUM_8,
37+
.sda_pullup_en = true,
38+
.scl_pullup_en = true,
39+
.master = {
40+
.clk_speed = 400000
41+
},
42+
.clk_flags = 0
43+
}
44+
},
45+
//P3 (JST SH 1.0)/ P4 (JST SH 1.25) headers - GND 3.3V IO17 IO18
46+
i2c::Configuration {
47+
.name = "External",
48+
.port = I2C_NUM_1,
49+
.initMode = i2c::InitMode::Disabled,
50+
.isMutable = true,
51+
.config = (i2c_config_t) {
52+
.mode = I2C_MODE_MASTER,
53+
.sda_io_num = GPIO_NUM_17,
54+
.scl_io_num = GPIO_NUM_18,
55+
.sda_pullup_en = false,
56+
.scl_pullup_en = false,
57+
.master = {
58+
.clk_speed = 400000
59+
},
60+
.clk_flags = 0
61+
}
62+
}
63+
},
64+
.spi {
65+
//Display
66+
spi::Configuration {
67+
.device = SPI2_HOST,
68+
.dma = SPI_DMA_CH_AUTO,
69+
.config = {
70+
.data0_io_num = GPIO_NUM_21,
71+
.data1_io_num = GPIO_NUM_48,
72+
.sclk_io_num = GPIO_NUM_47,
73+
.data2_io_num = GPIO_NUM_40,
74+
.data3_io_num = GPIO_NUM_39,
75+
.data4_io_num = -1,
76+
.data5_io_num = -1,
77+
.data6_io_num = -1,
78+
.data7_io_num = -1,
79+
.data_io_default_level = false,
80+
.max_transfer_sz = SPI_TRANSFER_SIZE_LIMIT,
81+
.flags = 0,
82+
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
83+
.intr_flags = 0
84+
},
85+
.initMode = spi::InitMode::ByTactility,
86+
.isMutable = false,
87+
.lock = tt::lvgl::getSyncLock()
88+
},
89+
//SD Card
90+
spi::Configuration {
91+
.device = SPI3_HOST,
92+
.dma = SPI_DMA_CH_AUTO,
93+
.config = {
94+
.mosi_io_num = GPIO_NUM_11,
95+
.miso_io_num = GPIO_NUM_13,
96+
.sclk_io_num = GPIO_NUM_12,
97+
.quadwp_io_num = -1,
98+
.quadhd_io_num = -1,
99+
.data4_io_num = 0,
100+
.data5_io_num = 0,
101+
.data6_io_num = 0,
102+
.data7_io_num = 0,
103+
.data_io_default_level = false,
104+
.max_transfer_sz = 8192,
105+
.flags = 0,
106+
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
107+
.intr_flags = 0
108+
},
109+
.initMode = spi::InitMode::ByTactility,
110+
.isMutable = false,
111+
.lock = nullptr
112+
}
113+
},
114+
.uart {
115+
//P1 header, JST SH 1.25, 5V / TXD (43) / RXD (44) / GND
116+
uart::Configuration {
117+
.name = "UART0",
118+
.port = UART_NUM_0,
119+
.rxPin = GPIO_NUM_44,
120+
.txPin = GPIO_NUM_43,
121+
.rtsPin = GPIO_NUM_NC,
122+
.ctsPin = GPIO_NUM_NC,
123+
.rxBufferSize = 1024,
124+
.txBufferSize = 1024,
125+
.config = {
126+
.baud_rate = 115200,
127+
.data_bits = UART_DATA_8_BITS,
128+
.parity = UART_PARITY_DISABLE,
129+
.stop_bits = UART_STOP_BITS_1,
130+
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
131+
.rx_flow_ctrl_thresh = 0,
132+
.source_clk = UART_SCLK_DEFAULT,
133+
.flags = {
134+
.allow_pd = 0,
135+
.backup_before_sleep = 0,
136+
}
137+
}
138+
}
139+
}
140+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#include "Display.h"
2+
3+
#include <PwmBacklight.h>
4+
#include <Axs15231bDisplay.h>
5+
#include <Axs15231bTouch.h>
6+
7+
#define JC3248W535C_LCD_DRAW_BUFFER_SIZE 320 * 480
8+
9+
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
10+
auto configuration = std::make_unique<Axs15231bTouch::Configuration>(
11+
I2C_NUM_0,
12+
320,
13+
480,
14+
false,
15+
false,
16+
false
17+
);
18+
19+
return std::make_shared<Axs15231bTouch>(std::move(configuration));
20+
}
21+
22+
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
23+
auto touch = createTouch();
24+
25+
auto configuration = std::make_unique<Axs15231bDisplay::Configuration>(
26+
SPI2_HOST,
27+
GPIO_NUM_45,
28+
GPIO_NUM_NC,
29+
GPIO_NUM_NC,
30+
GPIO_NUM_38,
31+
320,
32+
480,
33+
touch,
34+
false,
35+
false,
36+
false,
37+
false,
38+
JC3248W535C_LCD_DRAW_BUFFER_SIZE
39+
);
40+
41+
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
42+
43+
auto display = std::make_shared<Axs15231bDisplay>(std::move(configuration));
44+
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
45+
}
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/lvgl/LvglSync.h>
4+
#include <Tactility/hal/sdcard/SpiSdCardDevice.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_10,
11+
GPIO_NUM_NC,
12+
GPIO_NUM_NC,
13+
GPIO_NUM_NC,
14+
SdCardDevice::MountBehaviour::AtBoot,
15+
std::make_shared<tt::Mutex>(),
16+
std::vector<gpio_num_t>(),
17+
SPI3_HOST
18+
);
19+
20+
return std::make_shared<SpiSdCardDevice>(
21+
std::move(configuration)
22+
);
23+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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();
8+

Drivers/Axs15231b/CMakeLists.txt

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_axs15231b driver
5+
)

Drivers/Axs15231b/README.md

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

0 commit comments

Comments
 (0)