mirror of
https://github.com/suchmememanyskill/CYD-Klipper.git
synced 2026-03-21 05:33:24 +00:00
3248S035C Vertical
This commit is contained in:
66
CYD-Klipper/boards/esp32-3248S035C-vertical.json
Normal file
66
CYD-Klipper/boards/esp32-3248S035C-vertical.json
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32_out.ld"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DUSER_SETUP_LOADED=1",
|
||||||
|
"-DST7796_DRIVER=1",
|
||||||
|
"-DTFT_BL=27",
|
||||||
|
"-DTFT_BACKLIGHT_ON=HIGH",
|
||||||
|
"-DTFT_MISO=12",
|
||||||
|
"-DTFT_MOSI=13",
|
||||||
|
"-DTFT_SCLK=14",
|
||||||
|
"-DTFT_CS=15",
|
||||||
|
"-DTFT_DC=2",
|
||||||
|
"-DTFT_RST=-1",
|
||||||
|
"-DLOAD_GCLD=1",
|
||||||
|
"-DSPI_FREQUENCY=80000000",
|
||||||
|
"-DSPI_READ_FREQUENCY=20000000",
|
||||||
|
"-DSPI_TOUCH_FREQUENCY=2500000",
|
||||||
|
"-DTOUCH_CS=-1",
|
||||||
|
|
||||||
|
"-DCYD_SCREEN_HEIGHT_PX=480",
|
||||||
|
"-DCYD_SCREEN_WIDTH_PX=320",
|
||||||
|
"-DCYD_SCREEN_GAP_PX=10",
|
||||||
|
"-DCYD_SCREEN_MIN_BUTTON_HEIGHT_PX=45",
|
||||||
|
"-DCYD_SCREEN_MIN_BUTTON_WIDTH_PX=45",
|
||||||
|
"-DCYD_SCREEN_FONT=lv_font_montserrat_16",
|
||||||
|
"-DCYD_SCREEN_FONT_SMALL=lv_font_montserrat_12",
|
||||||
|
"-DCYD_SCREEN_SIDEBAR_SIZE_PX=50",
|
||||||
|
"-DCYD_SCREEN_DRIVER_ESP32_3248S035C=1",
|
||||||
|
"-DCYD_SCREEN_DISABLE_TOUCH_CALIBRATION=1",
|
||||||
|
"-DCYD_SCREEN_VERTICAL=1",
|
||||||
|
"-DCYD_SCREEN_NO_TEMP_SCROLL=1"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "40000000L",
|
||||||
|
"flash_mode": "dio",
|
||||||
|
"mcu": "esp32",
|
||||||
|
"variant": "esp32"
|
||||||
|
},
|
||||||
|
"connectivity": [
|
||||||
|
"wifi",
|
||||||
|
"bluetooth",
|
||||||
|
"ethernet",
|
||||||
|
"can"
|
||||||
|
],
|
||||||
|
"debug": {
|
||||||
|
"openocd_board": "esp-wroom-32.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": [
|
||||||
|
"arduino",
|
||||||
|
"espidf"
|
||||||
|
],
|
||||||
|
"name": "esp32-3248S035C-V",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "4MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 4194304,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 460800
|
||||||
|
},
|
||||||
|
"url": "https://www.aliexpress.com/item/1005004632953455.html",
|
||||||
|
"vendor": "Sunton"
|
||||||
|
}
|
||||||
@@ -46,6 +46,17 @@ lib_deps =
|
|||||||
plageoj/UrlEncode@^1.0.1
|
plageoj/UrlEncode@^1.0.1
|
||||||
erriez/ErriezCRC32 @ ^1.0.1
|
erriez/ErriezCRC32 @ ^1.0.1
|
||||||
|
|
||||||
|
[env:esp32-3248S035C-V]
|
||||||
|
board = esp32-3248S035C-vertical
|
||||||
|
lib_deps =
|
||||||
|
SPI
|
||||||
|
https://github.com/suchmememanyskill/lvgl
|
||||||
|
https://github.com/Bodmer/TFT_eSPI.git
|
||||||
|
https://github.com/OperatorB/gt911-arduino-fixed-reset.git
|
||||||
|
bblanchon/ArduinoJson@^7.0.0
|
||||||
|
plageoj/UrlEncode@^1.0.1
|
||||||
|
erriez/ErriezCRC32 @ ^1.0.1
|
||||||
|
|
||||||
[env:esp32-2432S024C-SD]
|
[env:esp32-2432S024C-SD]
|
||||||
board = esp32-2432S024C-smartdisplay
|
board = esp32-2432S024C-smartdisplay
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
#ifdef CYD_SCREEN_DRIVER_ESP32_3248S035C
|
#ifdef CYD_SCREEN_DRIVER_ESP32_3248S035C
|
||||||
#include "../screen_driver.h"
|
#include "../screen_driver.h"
|
||||||
|
|
||||||
#ifdef CYD_SCREEN_VERTICAL
|
|
||||||
#error "Vertical screen not supported with the ESP32_3248S035C driver"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
#include <TAMC_GT911.h>
|
#include <TAMC_GT911.h>
|
||||||
#include <TFT_eSPI.h>
|
#include <TFT_eSPI.h>
|
||||||
@@ -107,14 +103,13 @@ void screen_setup()
|
|||||||
{
|
{
|
||||||
// Initialize the touchscreen
|
// Initialize the touchscreen
|
||||||
tp.begin();
|
tp.begin();
|
||||||
tp.setRotation(ROTATION_NORMAL);
|
|
||||||
// Initialize LVGL
|
// Initialize LVGL
|
||||||
lv_init();
|
lv_init();
|
||||||
// Initialize the display
|
// Initialize the display
|
||||||
tft.init();
|
tft.init();
|
||||||
ledcSetup(0, 5000, 12);
|
ledcSetup(0, 5000, 12);
|
||||||
ledcAttachPin(TFT_BL, 0);
|
ledcAttachPin(TFT_BL, 0);
|
||||||
tft.setRotation(global_config.rotate_screen ? 3 : 1);
|
|
||||||
tft.fillScreen(TFT_BLACK);
|
tft.fillScreen(TFT_BLACK);
|
||||||
set_invert_display();
|
set_invert_display();
|
||||||
LED_init();
|
LED_init();
|
||||||
@@ -122,8 +117,22 @@ void screen_setup()
|
|||||||
lv_disp_draw_buf_init(&draw_buf, buf, NULL, TFT_WIDTH * TFT_HEIGHT / 10);
|
lv_disp_draw_buf_init(&draw_buf, buf, NULL, TFT_WIDTH * TFT_HEIGHT / 10);
|
||||||
static lv_disp_drv_t disp_drv;
|
static lv_disp_drv_t disp_drv;
|
||||||
lv_disp_drv_init(&disp_drv);
|
lv_disp_drv_init(&disp_drv);
|
||||||
disp_drv.hor_res = TFT_HEIGHT;
|
|
||||||
disp_drv.ver_res = TFT_WIDTH;
|
|
||||||
|
#ifdef CYD_SCREEN_VERTICAL
|
||||||
|
disp_drv.hor_res = TFT_WIDTH;
|
||||||
|
disp_drv.ver_res = TFT_HEIGHT;
|
||||||
|
tp.setRotation(2);
|
||||||
|
tft.setRotation(global_config.rotate_screen ? 2 : 0);
|
||||||
|
#else
|
||||||
|
disp_drv.hor_res = TFT_HEIGHT;
|
||||||
|
disp_drv.ver_res = TFT_WIDTH;
|
||||||
|
|
||||||
|
tft.setRotation(global_config.rotate_screen ? 3 : 1);
|
||||||
|
tp.setRotation(ROTATION_NORMAL);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
disp_drv.flush_cb = screen_lv_flush;
|
disp_drv.flush_cb = screen_lv_flush;
|
||||||
disp_drv.draw_buf = &draw_buf;
|
disp_drv.draw_buf = &draw_buf;
|
||||||
lv_disp_drv_register(&disp_drv);
|
lv_disp_drv_register(&disp_drv);
|
||||||
|
|||||||
@@ -225,13 +225,14 @@ void create_stat_text_block(lv_obj_t * root, const char* label, lv_event_cb_t va
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stats_panel_init(lv_obj_t* panel) {
|
void stats_panel_init(lv_obj_t* panel) {
|
||||||
auto panel_width = CYD_SCREEN_PANEL_WIDTH_PX / 2 - CYD_SCREEN_GAP_PX * 3;
|
auto panel_width = CYD_SCREEN_PANEL_WIDTH_PX / 2 - CYD_SCREEN_GAP_PX * 2;
|
||||||
|
|
||||||
lv_obj_t * left_panel = lv_create_empty_panel(panel);
|
lv_obj_t * left_panel = lv_create_empty_panel(panel);
|
||||||
lv_obj_set_size(left_panel, panel_width, CYD_SCREEN_PANEL_HEIGHT_PX - CYD_SCREEN_GAP_PX * 2);
|
lv_obj_set_size(left_panel, panel_width, CYD_SCREEN_PANEL_HEIGHT_PX - CYD_SCREEN_GAP_PX * 2);
|
||||||
lv_layout_flex_column(left_panel);
|
lv_layout_flex_column(left_panel);
|
||||||
lv_obj_set_flex_align(left_panel, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
lv_obj_set_flex_align(left_panel, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||||
lv_obj_align(left_panel, LV_ALIGN_TOP_LEFT, CYD_SCREEN_GAP_PX, CYD_SCREEN_GAP_PX);
|
lv_obj_align(left_panel, LV_ALIGN_TOP_LEFT, CYD_SCREEN_GAP_PX, CYD_SCREEN_GAP_PX);
|
||||||
|
lv_obj_clear_flag(left_panel, LV_OBJ_FLAG_SCROLLABLE);
|
||||||
|
|
||||||
create_stat_text_block(left_panel, "Position:", label_pos);
|
create_stat_text_block(left_panel, "Position:", label_pos);
|
||||||
|
|
||||||
|
|||||||
@@ -225,20 +225,10 @@ static void set_bed_target_temp_chart(lv_event_t * e){
|
|||||||
lv_chart_set_next_value(chart, series, printer.bed_target_temp);
|
lv_chart_set_next_value(chart, series, printer.bed_target_temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void temp_panel_init(lv_obj_t * panel){
|
void create_charts(lv_obj_t * root)
|
||||||
|
{
|
||||||
const auto element_width = CYD_SCREEN_PANEL_WIDTH_PX - CYD_SCREEN_GAP_PX * 2;
|
const auto element_width = CYD_SCREEN_PANEL_WIDTH_PX - CYD_SCREEN_GAP_PX * 2;
|
||||||
root_panel = panel;
|
lv_obj_t * chart = lv_chart_create(root);
|
||||||
edit_mode = false;
|
|
||||||
|
|
||||||
lv_obj_t * root_temp_panel = lv_create_empty_panel(panel);
|
|
||||||
lv_obj_set_size(root_temp_panel, CYD_SCREEN_PANEL_WIDTH_PX, CYD_SCREEN_PANEL_HEIGHT_PX);
|
|
||||||
lv_obj_align(root_temp_panel, LV_ALIGN_TOP_RIGHT, 0, 0);
|
|
||||||
lv_obj_set_style_pad_all(root_temp_panel, CYD_SCREEN_GAP_PX, 0);
|
|
||||||
lv_layout_flex_column(root_temp_panel);
|
|
||||||
lv_obj_set_flex_align(root_temp_panel, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_END, LV_FLEX_ALIGN_CENTER);
|
|
||||||
lv_obj_set_scrollbar_mode(root_temp_panel, LV_SCROLLBAR_MODE_OFF);
|
|
||||||
|
|
||||||
lv_obj_t * chart = lv_chart_create(root_temp_panel);
|
|
||||||
lv_obj_set_size(chart, element_width - CYD_SCREEN_MIN_BUTTON_WIDTH_PX, CYD_SCREEN_MIN_BUTTON_HEIGHT_PX * 3);
|
lv_obj_set_size(chart, element_width - CYD_SCREEN_MIN_BUTTON_WIDTH_PX, CYD_SCREEN_MIN_BUTTON_HEIGHT_PX * 3);
|
||||||
lv_chart_set_type(chart, LV_CHART_TYPE_LINE);
|
lv_chart_set_type(chart, LV_CHART_TYPE_LINE);
|
||||||
lv_chart_set_point_count(chart, 120);
|
lv_chart_set_point_count(chart, 120);
|
||||||
@@ -261,16 +251,16 @@ void temp_panel_init(lv_obj_t * panel){
|
|||||||
lv_obj_add_event_cb(chart, set_bed_temp_chart, LV_EVENT_MSG_RECEIVED, ser4);
|
lv_obj_add_event_cb(chart, set_bed_temp_chart, LV_EVENT_MSG_RECEIVED, ser4);
|
||||||
lv_obj_add_event_cb(chart, set_chart_range, LV_EVENT_MSG_RECEIVED, NULL);
|
lv_obj_add_event_cb(chart, set_chart_range, LV_EVENT_MSG_RECEIVED, NULL);
|
||||||
lv_msg_subscribe_obj(DATA_PRINTER_DATA, chart, NULL);
|
lv_msg_subscribe_obj(DATA_PRINTER_DATA, chart, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
lv_obj_t * single_screen_panel = lv_create_empty_panel(root_temp_panel);
|
void create_temp_buttons(lv_obj_t * root, lv_obj_t * panel)
|
||||||
lv_obj_set_size(single_screen_panel, element_width, CYD_SCREEN_PANEL_HEIGHT_PX - CYD_SCREEN_GAP_PX * 2 - CYD_SCREEN_GAP_PX / 2);
|
{
|
||||||
lv_layout_flex_column(single_screen_panel);
|
const auto element_width = CYD_SCREEN_PANEL_WIDTH_PX - CYD_SCREEN_GAP_PX * 2;
|
||||||
|
|
||||||
lv_obj_t * temp_rows[2] = {0};
|
lv_obj_t * temp_rows[2] = {0};
|
||||||
lv_obj_t * button_temp_rows[2] = {0};
|
lv_obj_t * button_temp_rows[2] = {0};
|
||||||
|
|
||||||
for (int tempIter = 0; tempIter < 2; tempIter++){
|
for (int tempIter = 0; tempIter < 2; tempIter++){
|
||||||
temp_rows[tempIter] = lv_create_empty_panel(single_screen_panel);
|
temp_rows[tempIter] = lv_create_empty_panel(root);
|
||||||
lv_layout_flex_column(temp_rows[tempIter]);
|
lv_layout_flex_column(temp_rows[tempIter]);
|
||||||
lv_obj_set_size(temp_rows[tempIter], element_width, LV_SIZE_CONTENT);
|
lv_obj_set_size(temp_rows[tempIter], element_width, LV_SIZE_CONTENT);
|
||||||
|
|
||||||
@@ -306,9 +296,40 @@ void temp_panel_init(lv_obj_t * panel){
|
|||||||
lv_label_set_text(label, "Set");
|
lv_label_set_text(label, "Set");
|
||||||
lv_obj_center(label);
|
lv_obj_center(label);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lv_obj_t * gap = lv_create_empty_panel(single_screen_panel);
|
void temp_panel_init(lv_obj_t * panel){
|
||||||
lv_obj_set_flex_grow(gap, 1);
|
const auto element_width = CYD_SCREEN_PANEL_WIDTH_PX - CYD_SCREEN_GAP_PX * 2;
|
||||||
|
root_panel = panel;
|
||||||
|
edit_mode = false;
|
||||||
|
|
||||||
|
lv_obj_t * root_temp_panel = lv_create_empty_panel(panel);
|
||||||
|
lv_obj_set_size(root_temp_panel, CYD_SCREEN_PANEL_WIDTH_PX, CYD_SCREEN_PANEL_HEIGHT_PX);
|
||||||
|
lv_obj_align(root_temp_panel, LV_ALIGN_TOP_RIGHT, 0, 0);
|
||||||
|
lv_obj_set_style_pad_all(root_temp_panel, CYD_SCREEN_GAP_PX, 0);
|
||||||
|
lv_layout_flex_column(root_temp_panel);
|
||||||
|
lv_obj_set_flex_align(root_temp_panel, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_END, LV_FLEX_ALIGN_CENTER);
|
||||||
|
lv_obj_set_scrollbar_mode(root_temp_panel, LV_SCROLLBAR_MODE_OFF);
|
||||||
|
|
||||||
|
#ifndef CYD_SCREEN_NO_TEMP_SCROLL
|
||||||
|
create_charts(root_temp_panel);
|
||||||
|
|
||||||
|
lv_obj_t * single_screen_panel = lv_create_empty_panel(root_temp_panel);
|
||||||
|
lv_obj_set_size(single_screen_panel, element_width, CYD_SCREEN_PANEL_HEIGHT_PX - CYD_SCREEN_GAP_PX * 2 - CYD_SCREEN_GAP_PX / 2);
|
||||||
|
lv_layout_flex_column(single_screen_panel);
|
||||||
|
#else
|
||||||
|
lv_obj_clear_flag(root_temp_panel, LV_OBJ_FLAG_SCROLLABLE);
|
||||||
|
lv_obj_t * single_screen_panel = root_temp_panel;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
create_temp_buttons(single_screen_panel, panel);
|
||||||
|
|
||||||
|
#ifdef CYD_SCREEN_NO_TEMP_SCROLL
|
||||||
|
create_charts(single_screen_panel);
|
||||||
|
#else
|
||||||
|
lv_obj_t * gap = lv_create_empty_panel(single_screen_panel);
|
||||||
|
lv_obj_set_flex_grow(gap, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
lv_obj_t * one_above_bottom_panel = lv_create_empty_panel(single_screen_panel);
|
lv_obj_t * one_above_bottom_panel = lv_create_empty_panel(single_screen_panel);
|
||||||
lv_obj_set_size(one_above_bottom_panel, element_width, CYD_SCREEN_MIN_BUTTON_HEIGHT_PX);
|
lv_obj_set_size(one_above_bottom_panel, element_width, CYD_SCREEN_MIN_BUTTON_HEIGHT_PX);
|
||||||
|
|||||||
@@ -91,6 +91,7 @@
|
|||||||
<option selected value="esp32-2432S028R">ESP32-2432S028 (2.8" Resistive)</option>
|
<option selected value="esp32-2432S028R">ESP32-2432S028 (2.8" Resistive)</option>
|
||||||
<option value="esp32-2432S032C-SD">ESP32-2432S032 (3.2" Capacitive)</option>
|
<option value="esp32-2432S032C-SD">ESP32-2432S032 (3.2" Capacitive)</option>
|
||||||
<option value="esp32-3248S035C">ESP32-3248S035 (3.5" Capacitive)</option>
|
<option value="esp32-3248S035C">ESP32-3248S035 (3.5" Capacitive)</option>
|
||||||
|
<option value="esp32-3248S035C-V">ESP32-3248S035 (3.5" Capacitive) Vertical Orientation</option>
|
||||||
<option value="esp32-4827S043C-SD">ESP32-4827S043 (4.3" 480x270 Capacitive)</option>
|
<option value="esp32-4827S043C-SD">ESP32-4827S043 (4.3" 480x270 Capacitive)</option>
|
||||||
<option value="esp32-8048S043C-SD">ESP32-8048S043 (4.3" 800x480 Capacitive)</option>
|
<option value="esp32-8048S043C-SD">ESP32-8048S043 (4.3" 800x480 Capacitive)</option>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user