Files
vertushka_arduino/vertushka_esp32s3/vertushka_esp32s3.ino
T
anor c28362bfdf feat: v5.0 шаг 1 — минимальный скетч ESP32-S3 + LVGL для VIEWE 466x466
Дисплей оживает, на экране 'Vertushka v5.0' белым по чёрному.
BSP: ESP32_Display_Panel 1.0.4 + LVGL 8.4.0 + lvgl_v8_port от VIEWE.
Board: BOARD_VIEWE_UEDX46460015_MD50ET в supported_conf.
Guard от boot loop: при ошибке init — Serial-loop вместо assert.

Заливать через esptool с --before usb_reset (DTR/RTS reset не работает
без BOOT-кнопки на USB-test переходнике).
2026-04-27 12:27:03 +10:00

58 lines
2.0 KiB
Arduino
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Вертушка v5.0 — VIEWE UEDX46460015-MD50ESP32 (ESP32-S3, 466×466 LVGL).
*
* Шаг 1: минимальный скетч — на экране большое слово "Вертушка".
* После того как дисплей оживёт, добавим дугу, ступени, ESC, энкодер.
*
* Сборка: Arduino IDE / arduino-cli, FQBN: esp32:esp32:esp32s3
* - PSRAM = OPI PSRAM
* - USB CDC On Boot = Enabled
* - Flash Size = 16MB
* - Partition Scheme = 16M Flash (3MB APP/9.9MB FATFS)
*/
#include <Arduino.h>
#include <esp_display_panel.hpp>
#include <lvgl.h>
#include "lvgl_v8_port.h"
using namespace esp_panel::drivers;
using namespace esp_panel::board;
void setup() {
Serial.begin(115200);
delay(100);
Serial.println("=== Vertushka v5.0 boot (ESP32-S3 + LVGL) ===");
// BSP — берёт всё из esp_panel_board_supported_conf.h (BOARD_VIEWE_UEDX46460015_MD50ET)
Board *board = new Board();
if (!board->init() || !board->begin()) {
// Не уходим в boot loop — оставляем USB-CDC живым, чтобы можно было перезалить
Serial.println("Board init failed — staying alive for upload");
while (true) { delay(500); Serial.println("waiting for upload..."); }
}
Serial.println("Board ok");
// LVGL порт от VIEWE (display + touch + tick)
assert(lvgl_port_init(board->getLCD(), board->getTouch()));
Serial.println("LVGL port ok");
// Минимальный UI: чёрный фон, центральный текст
lvgl_port_lock(-1);
lv_obj_t *scr = lv_scr_act();
lv_obj_set_style_bg_color(scr, lv_color_hex(0x000000), 0);
lv_obj_t *label = lv_label_create(scr);
lv_label_set_text(label, "Vertushka v5.0");
lv_obj_set_style_text_color(label, lv_color_hex(0xFFFFFF), 0);
lv_obj_set_style_text_font(label, &lv_font_montserrat_24, 0);
lv_obj_center(label);
lvgl_port_unlock();
Serial.println("UI ready");
}
void loop() {
delay(100);
}