From 818f773c491937730e929d85da7b26a80f9b4289 Mon Sep 17 00:00:00 2001 From: cqc Date: Sun, 1 Feb 2026 23:28:52 +0100 Subject: [PATCH] using ESP-IDF v5.5.2 with ESP32-C6-Touch-AMOLED-2.06 --- .gitignore | 9 ++++++++ CMakeLists.txt | 8 +++++++ README.md | 13 ++++++++++++ main/CMakeLists.txt | 14 +++++++++++++ main/component.mk | 5 +++++ main/idf_component.yml | 7 +++++++ main/main.c | 26 +++++++++++++++++++++++ partitions.csv | 6 ++++++ sdkconfig.defaults | 47 ++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 135 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 main/CMakeLists.txt create mode 100644 main/component.mk create mode 100644 main/idf_component.yml create mode 100644 main/main.c create mode 100644 partitions.csv create mode 100644 sdkconfig.defaults diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f02caf --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ + +# esp-idf stuff +build/ +managed_components/ +sdkconfig +dependencies.lock + +.#* +*~ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d943aad --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,8 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +add_compile_options(-Wno-format) +project(lvgl_demo_v9) diff --git a/README.md b/README.md index 5f9089a..ecfe861 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,23 @@ # freeside minimap +This branch targets esp32c6 waveshare watch board: https://www.waveshare.com/esp32-c6-touch-amoled-2.06.htm?sku=32769 +``` +wget https://github.com/espressif/idf-im-ui/releases/download/v0.7.1/eim-cli-linux-x64.zip +unzip eim-cli-linux-x64.zip +./eim install +source "/home/$USER/.espressif/tools/activate_idf_v5.5.2.sh" +idf.py set-target esp32c6 +idf.py build +idf.py flash +``` # todo - part selection - esp32-s3? + - c6 does 802.11ax, probably better + - c6 is riscv so it's "cool" + - does micropython run on c6, yes - screen - 128x128 color oled? - input device diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt new file mode 100644 index 0000000..2876445 --- /dev/null +++ b/main/CMakeLists.txt @@ -0,0 +1,14 @@ +set(LV_DEMO_DIR ../managed_components/lvgl__lvgl/demos) +file(GLOB_RECURSE LV_DEMOS_SOURCES ${LV_DEMO_DIR}/*.c) + +idf_component_register( + SRCS main.c ${LV_DEMOS_SOURCES} + INCLUDE_DIRS . ${LV_DEMO_DIR}) + +idf_component_get_property(LVGL_LIB lvgl__lvgl COMPONENT_LIB) +target_compile_options( + ${LVGL_LIB} + PRIVATE + -DLV_LVGL_H_INCLUDE_SIMPLE + -DLV_USE_DEMO_MUSIC +) diff --git a/main/component.mk b/main/component.mk new file mode 100644 index 0000000..0b9d758 --- /dev/null +++ b/main/component.mk @@ -0,0 +1,5 @@ +# +# "main" pseudo-component makefile. +# +# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) + diff --git a/main/idf_component.yml b/main/idf_component.yml new file mode 100644 index 0000000..d32dc1c --- /dev/null +++ b/main/idf_component.yml @@ -0,0 +1,7 @@ +## IDF Component Manager Manifest File +dependencies: + waveshare/esp32_c6_touch_amoled_2_06: + version: "*" + lvgl/lvgl: + version: "9.2.0" + public: true diff --git a/main/main.c b/main/main.c new file mode 100644 index 0000000..63cbf40 --- /dev/null +++ b/main/main.c @@ -0,0 +1,26 @@ +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "nvs_flash.h" +#include "nvs.h" +#include "esp_log.h" +#include "esp_err.h" +#include "esp_check.h" +#include "esp_memory_utils.h" +#include "lvgl.h" +#include "bsp/esp-bsp.h" +#include "bsp/display.h" +#include "lv_demos.h" + +void app_main(void) +{ + + bsp_display_start(); + + bsp_display_lock(0); + + //lv_demo_music(); + // lv_demo_benchmark(); + lv_demo_widgets(); + + bsp_display_unlock(); +} diff --git a/partitions.csv b/partitions.csv new file mode 100644 index 0000000..9f62e3b --- /dev/null +++ b/partitions.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild +nvs, data, nvs, 0x9000, 0x6000, +phy_init, data, phy, 0xf000, 0x1000, +factory, app, factory, , 8M, +storage, data, spiffs, , 7M, diff --git a/sdkconfig.defaults b/sdkconfig.defaults new file mode 100644 index 0000000..0d8e3d1 --- /dev/null +++ b/sdkconfig.defaults @@ -0,0 +1,47 @@ +# This file was generated using idf.py save-defconfig. It can be edited manually. +# Espressif IoT Development Framework (ESP-IDF) 5.4.0 Project Minimal Configuration +# +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_COMPILER_OPTIMIZATION_PERF=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y +CONFIG_SPIRAM_RODATA=y +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y + +CONFIG_BSP_I2C_NUM=0 + +CONFIG_FREERTOS_HZ=1000 +CONFIG_LV_USE_CLIB_MALLOC=y +CONFIG_LV_USE_CLIB_STRING=y +CONFIG_LV_USE_CLIB_SPRINTF=y +CONFIG_LV_DEF_REFR_PERIOD=15 +CONFIG_LV_OS_FREERTOS=y +CONFIG_LV_DRAW_SW_DRAW_UNIT_CNT=2 +CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM=y +CONFIG_LV_FONT_MONTSERRAT_12=y +CONFIG_LV_FONT_MONTSERRAT_16=y +CONFIG_LV_FONT_MONTSERRAT_18=y +CONFIG_LV_FONT_MONTSERRAT_20=y +CONFIG_LV_FONT_MONTSERRAT_22=y +CONFIG_LV_FONT_MONTSERRAT_24=y +CONFIG_LV_FONT_MONTSERRAT_26=y +CONFIG_LV_USE_FONT_COMPRESSED=y +CONFIG_LV_TXT_BREAK_CHARS=" ,.;:-_" +CONFIG_LV_USE_SYSMON=y +CONFIG_LV_USE_PERF_MONITOR=y +CONFIG_LV_USE_IMGFONT=y +CONFIG_LV_USE_DEMO_WIDGETS=y +CONFIG_LV_USE_DEMO_BENCHMARK=y +CONFIG_LV_USE_DEMO_RENDER=y +CONFIG_LV_USE_DEMO_SCROLL=y +CONFIG_LV_USE_DEMO_STRESS=y +CONFIG_LV_USE_DEMO_TRANSFORM=y +CONFIG_LV_USE_DEMO_MUSIC=y +CONFIG_LV_DEMO_MUSIC_AUTO_PLAY=y +CONFIG_LV_USE_DEMO_FLEX_LAYOUT=y +CONFIG_LV_USE_DEMO_MULTILANG=y +CONFIG_IDF_EXPERIMENTAL_FEATURES=y