Selaa lähdekoodia

lv_port_arduino structure

sfxsfl 3 vuotta sitten
vanhempi
sitoutus
c4a8168f8b

+ 21 - 0
lv_port_arduino/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2021 fvanroie
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 2 - 0
lv_port_arduino/README.md

@@ -0,0 +1,2 @@
+# lv_port_arduino
+ LVGL ported to Arduino

+ 197 - 0
lv_port_arduino/platformio.ini

@@ -0,0 +1,197 @@
+; MIT License - Copyright (c) 2019-2021 Francis Van Roie
+; For full license information read the LICENSE file in the project folder
+;
+; PlatformIO Project Configuration File
+;
+; Please visit documentation for the other options and examples
+; http://docs.platformio.org/page/projectconf.html
+
+
+;**************************************************************
+;          Common project settings
+;**************************************************************
+[platformio]
+extra_configs =
+    user_setups/lcd_config.ini
+    ; --  Put active [env] files in this dir to be included in the build menu
+    user_setups/active/*.ini
+    ; --  Add customizations to this file only:
+    platformio_override.ini
+
+default_envs =
+    ; Uncomment the needed environments in platformio_override.ini
+    ; You can also create new environments in in platformio_override.ini
+    ${override.extra_default_envs}
+
+[override]
+; -- By default there are no ${override.build_flags} set
+; -- to use it, copy the platformio_override.ini file from the template
+build_flags =
+extra_default_envs =
+
+
+;***************************************************
+;          Common environment settings
+;***************************************************
+[env]
+upload_speed = 921600
+monitor_speed = 74880
+
+build_flags =
+	-D PIOENV=\"${PIOENV}\"
+    -Os          ; Code Size Optimization
+    ;-Og           ; Code Debug Optimization
+    ;-w           ; Suppress warnings
+    -D CORE_DEBUG_LEVEL=0           ; 0=Silent, 1=Errors, 2=Warnings
+    -I include    ; include lv_conf.h from this folder
+    ; -- littlevgl build options ------------------------------
+    -D LV_CONF_INCLUDE_SIMPLE       ; for lvgl
+    -D LV_LVGL_H_INCLUDE_SIMPLE     ; for lv_drivers
+    -D LV_COMP_CONF_INCLUDE_SIMPLE  ; for components
+    -D LV_DEMO_CONF_INCLUDE_SIMPLE  ; for demo examples
+    ; -- ESP build options ------------------------------------
+    -D SPIFFS_TEMPORAL_FD_CACHE     ; speedup opening recent files
+    ; -- App build options ----------------------------
+    -D APP_VER_MAJ=0
+    -D APP_VER_MIN=0
+    -D APP_VER_REV=1
+    ; -- Override build options -------------------------------
+    ${override.build_flags}
+
+; -- Shared library dependencies in all environments
+; Warning : don't put comments after github links => causes infinite download loop
+lib_deps =
+    ; lvgl/lvgl@^8.0.1                ; from PIO library
+    ;git+https://github.com/lvgl/lvgl.git
+    ; bodmer/TFT_eSPI@^2.3.70
+    ;git+https://github.com/Bodmer/TFT_eSPI.git
+
+src_filter = +<*> -<.git/> +<examples/> -<test/> -<tests/>
+
+
+; -- Platform specific build flags
+[esp32]
+framework = arduino
+platform = espressif32@^3.3.1
+
+board_upload.flash_size=4MB
+board_upload.maximum_size = 4194304
+board_build.partitions = user_setups/esp32/partitions_4MB.csv
+board_build.filesystem = littlefs
+;board_build.embed_files =
+;    data/edit.htm.gz
+
+; ----- crash reporter
+monitor_filters = esp32_exception_decoder
+
+; ----- debugger
+check_tool = cppcheck
+check_flags = --enable=all
+debug_tool = esp-prog
+debug_init_break = tbreak setup
+
+build_flags =
+    ${env.build_flags}
+; -- lvgl build options -----------------------------
+    -D LV_MEM_SIZE=49152U           ; 48 kB lvgl memory
+    -D LV_ATTRIBUTE_FAST_MEM=IRAM_ATTR
+    -D LV_ATTRIBUTE_TASK_HANDLER=IRAM_ATTR
+    ;-D LV_FS_PC_PATH="//littlefs"   ; this needs to match the vfs mount pount
+    -D LODEPNG_NO_COMPILE_ALLOCATORS ; use PSram functions
+    -D LV_LOG_TRACE_TIMER=1
+; -- tft_espi build options ------------------------
+    ;-D USE_DMA_TO_TFT
+; -- LittleFS build options ------------------------
+	;-D CONFIG_LITTLEFS_FOR_IDF_3_2  ; obsolete in IDF 3.3
+  -I.pio/libdeps/lvgl/examples
+
+lib_ignore =
+    GxTFT
+    XPT2046_Touchscreen
+    Adafruit TouchScreen
+    Adafruit BusIO
+    Adafruit GFX Library
+    sstaub/Ticker
+    lv_drv_fsmc_ili9341
+    lv_drivers
+    AXP192
+
+lib_deps =
+    LittleFS_esp32
+    git+https://github.com/lvgl/lv_lib_png.git
+    lvgl/lv_examples@^8.0.0                ; from PIO library
+
+; Enable PSram support
+ps_ram =
+    -DBOARD_HAS_PSRAM
+    -mfix-esp32-psram-cache-issue
+
+extra_scripts =
+    tools/littlefsbuilder.py
+    tools/esp_merge_bin.py
+    tools/analyze_elf.py
+;    ${env.extra_scripts}
+;    tools/copy_partitions.py
+
+; -- The ESP32 has 2 SPI Hardware Busses available to use:
+vspi =
+    -D TFT_MISO=19
+    -D TFT_MOSI=23
+    -D TFT_SCLK=18
+hspi =
+    -D TFT_MISO=12
+    -D TFT_MOSI=13
+    -D TFT_SCLK=14
+
+[esp8266]
+framework = arduino
+platform = espressif8266
+
+board_build.f_flash = 40000000L
+board_build.flash_mode = dout
+; board_build.ldscript = eagle.flash.4m2m.ld  ; 2Mb Spiffs
+board_build.ldscript = ${PROJECT_DIR}\linker\local.eagle.flash.ld
+
+board_build.filesystem = littlefs 
+board_build.f_cpu = 160000000L ; set frequency to 160MHz
+
+; ----- crash reporter
+monitor_filters = esp8266_exception_decoder
+
+build_flags=
+    -D ATOMIC_FS_UPDATE                ; enabled compressed ota updates
+; -- lwIP Variant -----------------------------------
+    ;-D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
+    -D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
+; -- lvgl build options -----------------------------
+    -D LV_MEM_SIZE=12288U              ; 12kB lvgl memory
+    -D LV_ATTRIBUTE_FAST_MEM=
+    -D LV_ATTRIBUTE_TASK_HANDLER=
+
+extra_scripts = tools/copy_fw.py    ; tools/pre:extra_script.py
+
+lib_ignore =
+    ESP32 BLE Arduino
+    GxTFT
+    sstaub/Ticker
+    lv_drv_fsmc_ili9341
+    AXP192
+
+lib_deps =
+
+
+[stm32f4]
+framework = arduino
+platform = ststm32
+build_flags=
+    -I include/stm32f4
+    -D IRAM_ATTR=                      ; No IRAM_ATTR available on STM32
+    -D ICACHE_RAM_ATTR=
+    -D STM32
+; -- lvgl build options -----------------------------
+    -D LV_MEM_SIZE=20480U              ; 20kB lvgl memory
+
+lib_deps =
+    ; sstaub/Ticker @ ^3.2.0
+    ; stm32duino/STM32duino LwIP @ ^2.1.2
+    ;https://github.com/stm32duino/LwIP.git

+ 106 - 0
lv_port_arduino/platformio_override.ini

@@ -0,0 +1,106 @@
+; USAGE: Copy this file and rename it to platformio_override.ini
+;
+; The platformio_override.ini file is not overwritten or monitored by git
+; ONLY edit platformio_override.ini to make local changes to the parameters
+
+[platformio]
+extra_configs =
+    ; Uncomment or edit the lines to show more User Setups in the PIO sidebar
+    ; user_setups/darwin_sdl/*.ini
+    ; user_setups/esp32/*.ini
+    user_setups/esp8266/*.ini
+    ; user_setups/linux_sdl/*.ini
+    ; user_setups/stm32f4xx/*.ini
+    ; user_setups/win32/*.ini
+
+[override]
+; -- Hasp config options --------------------------------------
+build_flags =
+; -- Uncomment the next line to use the file include/user_config_override.h settings
+;    -DUSE_CONFIG_OVERRIDE
+
+;region -- Default Build Environments : Used when Build All ---
+extra_default_envs =
+    ; Uncomment specific environments or create extra:
+    ; arduitouch-esp32_ili9341
+    ; d1-mini-esp32_ili9341
+    ; d1-mini-esp8266_ili9341
+    esp12e_ili9341
+    ; d132-unoshield
+    ; esp12e-st7735
+    ; esp32dev-mrb3511
+    ; esp32dev-ili9488
+    ; lanbon_l8
+    ; lolin-d32-pro_ili9341
+    ; my_custom_build
+    ; nodemcu32s-raspi
+    ; wt32-sc01
+    ; ttgo_esp32_poe-ili9341
+;endregion
+
+;region -- Define your local COM ports for each environment ---
+[env:d1-mini-esp32_ili9341]
+monitor_port = COM6       ; Change to the correct port
+upload_port = ${env:d1-mini-esp32_ili9341.monitor_port}
+
+[env:d1-mini-esp8266_ili9341]
+monitor_port = COM5       ; Change to the correct port
+upload_port = ${env:d1-mini-esp8266_ili9341.monitor_port}
+
+[env:esp12e_ili9341]
+monitor_port = COM5       ; Change to the correct port
+monitor_rts = 0
+monitor_dtr = 0
+upload_port = ${env:d1-mini-esp8266_ili9341.monitor_port}
+
+[env:esp32dev-mrb3511]
+monitor_port = COM3       ; Change to the correct port
+upload_port = ${env:esp32dev-mrb3511.monitor_port}
+
+[env:d132-unoshield]
+monitor_port = COM9       ; Change to the correct port
+;upload_port = ${$env:d132-unoshield.monitor_port}
+upload_port = 192.168.4.4 ; IP of the ESP
+upload_protocol = espota  ; Use ArduinoOTA after flashing over serial
+upload_flags = --port=3232 ; --auth=haspadmin   ; OTA password
+
+[env:ttgo_esp32_poe-ili9341]
+monitor_port = COM9       ; Change to the correct port
+;upload_port = ${env:ttgo_esp32_poe-ili9341.monitor_port}
+upload_port = 192.168.4.5 ; IP of the ESP
+upload_protocol = espota  ; Use ArduinoOTA after flashing over serial
+upload_flags = --port=3232 ; --auth=haspadmin   ; OTA password
+
+[env:lolin-d32-pro_ili9341]
+monitor_port = COM5       ; Change to the correct port
+upload_port = ${env:lolin-d32-pro_ili9341.monitor_port}
+;endregion
+
+;region -- Custom Environment configuration example -----------------
+[env:my_custom_build]
+extends = esp32
+board = nodemcu-32s
+
+upload_port = COM12     ; To change the port, use platform_override.ini
+monitor_port = COM12    ; To change the port, use platform_override.ini
+
+board_build.partitions = user_setups/esp32/partitions_4MB.csv ; default.csv
+
+debug_tool = esp-prog
+debug_init_break = tbreak setup
+build_flags =
+    ${env.build_flags}
+    ${esp32.build_flags}
+;region -- TFT_eSPI build options -----------------------------------
+    ${lcd.lolin24}
+    ${esp32.vspi}        ; Use VSPI hardware SPI bus
+    -D TFT_DC=5
+    -D TFT_CS=26 
+    -D TFT_RST=-1        ; RST
+    -D TFT_BCKL=22       ; None, configurable via web UI (e.g. 21)
+    -D TOUCH_CS=17       ; (can also be 22 or 16)
+; -- Options ----------------------------------------
+    -D HASP_USE_TELNET=1
+;endregion
+
+;endregion