Implement UI scaling and more (#501)
**New Features** * Runtime font accessors and new symbol fonts for text, launcher, statusbar, and shared icons. * Added font height base setting to device.properties * Text fonts now have 3 sizes: small, default, large **Improvements** * Renamed `UiScale` to `UiDensity` * Statusbar, toolbar and many UI components now compute heights and spacing from fonts/density. * SSD1306 initialization sequence refined for more stable startup. * Multiple image assets replaced by symbol-font rendering. * Many layout improvements related to density, font scaling and icon scaling * Updated folder name capitalization for newer style
@ -1,17 +1,17 @@
|
||||
idf_component_register(
|
||||
INCLUDE_DIRS
|
||||
"Libraries/TactilityC/Include"
|
||||
"Libraries/TactilityKernel/Include"
|
||||
"Libraries/TactilityFreeRtos/Include"
|
||||
"Libraries/lvgl/Include"
|
||||
"Libraries/lvgl-module/Include"
|
||||
"Libraries/TactilityC/include"
|
||||
"Libraries/TactilityKernel/include"
|
||||
"Libraries/TactilityFreeRtos/include"
|
||||
"Libraries/lvgl/include"
|
||||
"Libraries/lvgl-module/include"
|
||||
REQUIRES esp_timer
|
||||
)
|
||||
|
||||
add_prebuilt_library(TactilityC Libraries/TactilityC/Binary/libTactilityC.a)
|
||||
add_prebuilt_library(TactilityKernel Libraries/TactilityKernel/Binary/libTactilityKernel.a)
|
||||
add_prebuilt_library(lvgl Libraries/lvgl/Binary/liblvgl.a)
|
||||
add_prebuilt_library(lvgl-module Libraries/lvgl-module/Binary/liblvgl-module.a)
|
||||
add_prebuilt_library(TactilityC Libraries/TactilityC/binary/libTactilityC.a)
|
||||
add_prebuilt_library(TactilityKernel Libraries/TactilityKernel/binary/libTactilityKernel.a)
|
||||
add_prebuilt_library(lvgl Libraries/lvgl/binary/liblvgl.a)
|
||||
add_prebuilt_library(lvgl-module Libraries/lvgl-module/binary/liblvgl-module.a)
|
||||
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE TactilityC)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE TactilityKernel)
|
||||
|
||||
@ -7,23 +7,13 @@ else ()
|
||||
set(Cyan "")
|
||||
endif ()
|
||||
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/properties.cmake")
|
||||
|
||||
function(INIT_TACTILITY_GLOBALS SDKCONFIG_FILE)
|
||||
get_filename_component(SDKCONFIG_FILE_ABS ${SDKCONFIG_FILE} ABSOLUTE)
|
||||
# Find the device identifier in the sdkconfig file
|
||||
if (NOT EXISTS ${SDKCONFIG_FILE_ABS})
|
||||
message(FATAL_ERROR "sdkconfig file not found:\nMake sure you select a device by running \"python device.py [device-id]\"\n")
|
||||
endif ()
|
||||
file(READ ${SDKCONFIG_FILE_ABS} sdkconfig_text)
|
||||
string(REGEX MATCH "(CONFIG_TT_DEVICE_ID\=\"[^\"]*\")" sdkconfig_device_id "${sdkconfig_text}")
|
||||
if (sdkconfig_device_id STREQUAL "CONFIG_TT_DEVICE_ID=\"\"" OR sdkconfig_device_id STREQUAL "")
|
||||
message(FATAL_ERROR "CONFIG_TT_DEVICE_ID not found in sdkconfig:\nMake sure you select a device with 'python device.py device-id'")
|
||||
endif ()
|
||||
string(LENGTH ${sdkconfig_device_id} sdkconfig_device_id_length)
|
||||
set(id_length 0)
|
||||
# Total length minus chars of 'CONFIG_TT_DEVICE_ID=""'
|
||||
math(EXPR id_length "${sdkconfig_device_id_length} - 22")
|
||||
# Skip 'CONFIG_TT_DEVICE_ID="' then read the relevant (remaining) chars
|
||||
string(SUBSTRING ${sdkconfig_device_id} 21 ${id_length} device_id)
|
||||
GET_PROPERTY_FILE_CONTENT(${SDKCONFIG_FILE} sdkconfig_text)
|
||||
# Get device id
|
||||
GET_PROPERTY_VALUE(sdkconfig_text "CONFIG_TT_DEVICE_ID" device_id)
|
||||
# Validate device id
|
||||
if (NOT device_id MATCHES "^[a-z0-9\-]*$")
|
||||
message(FATAL_ERROR "Device identifier ${device_id} contains invalid characters. Valid characters: a-z 0-9 \"-\"")
|
||||
@ -31,7 +21,8 @@ function(INIT_TACTILITY_GLOBALS SDKCONFIG_FILE)
|
||||
# Output results
|
||||
message("Device identifier: ${Cyan}${device_id}${ColorReset}")
|
||||
set(TACTILITY_DEVICE_PROJECT ${device_id})
|
||||
message("Device project path: ${Cyan}Devices/${TACTILITY_DEVICE_PROJECT}${ColorReset}\n")
|
||||
message("Device project path: ${Cyan}Devices/${TACTILITY_DEVICE_PROJECT}${ColorReset} ")
|
||||
message("")
|
||||
set_property(GLOBAL PROPERTY TACTILITY_DEVICE_PROJECT ${TACTILITY_DEVICE_PROJECT})
|
||||
set_property(GLOBAL PROPERTY TACTILITY_DEVICE_ID ${device_id})
|
||||
endfunction()
|
||||
|
||||
23
Buildscripts/properties.cmake
Normal file
@ -0,0 +1,23 @@
|
||||
function(GET_PROPERTY_VALUE PROPERTIES_CONTENT_VAR KEY_NAME RESULT_VAR)
|
||||
# Search for the key and its value in the properties content
|
||||
# Supports KEY=VALUE, KEY="VALUE", and optional spaces around =
|
||||
# Use parentheses to capture the value
|
||||
# We use ^ and $ with multiline if available, but string(REGEX) doesn't support them easily for lines.
|
||||
# So we look for the key at the beginning of the string or after a newline.
|
||||
if ("${${PROPERTIES_CONTENT_VAR}}" MATCHES "(^|\n)${KEY_NAME}[ \t]*=[ \t]*\"?([^\n\"]*)\"?")
|
||||
set(${RESULT_VAR} "${CMAKE_MATCH_2}" PARENT_SCOPE)
|
||||
else ()
|
||||
message(FATAL_ERROR "Property '${KEY_NAME}' not found in the properties content.")
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
function(GET_PROPERTY_FILE_CONTENT PROPERTY_FILE RESULT_VAR)
|
||||
get_filename_component(PROPERTY_FILE_ABS ${PROPERTY_FILE} ABSOLUTE)
|
||||
# Find the device identifier in the sdkconfig file
|
||||
if (NOT EXISTS ${PROPERTY_FILE_ABS})
|
||||
message(FATAL_ERROR "Property file not found: ${PROPERTY_FILE}\nMake sure you select a device by running \"python device.py [device-id]\"\n")
|
||||
endif ()
|
||||
file(READ ${PROPERTY_FILE_ABS} file_content)
|
||||
set(${RESULT_VAR} "${file_content}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
@ -73,31 +73,31 @@ def main():
|
||||
mappings = [
|
||||
{'src': 'version.txt', 'dst': ''},
|
||||
# TactilityC
|
||||
{'src': 'build/esp-idf/TactilityC/libTactilityC.a', 'dst': 'Libraries/TactilityC/Binary/'},
|
||||
{'src': 'TactilityC/Include/*', 'dst': 'Libraries/TactilityC/Include/'},
|
||||
{'src': 'build/esp-idf/TactilityC/libTactilityC.a', 'dst': 'Libraries/TactilityC/binary/'},
|
||||
{'src': 'TactilityC/Include/*', 'dst': 'Libraries/TactilityC/include/'},
|
||||
{'src': 'TactilityC/CMakeLists.txt', 'dst': 'Libraries/TactilityC/'},
|
||||
{'src': 'TactilityC/LICENSE*.*', 'dst': 'Libraries/TactilityC/'},
|
||||
# TactilityFreeRtos
|
||||
{'src': 'TactilityFreeRtos/Include/**', 'dst': 'Libraries/TactilityFreeRtos/Include/'},
|
||||
{'src': 'TactilityFreeRtos/Include/**', 'dst': 'Libraries/TactilityFreeRtos/include/'},
|
||||
{'src': 'TactilityFreeRtos/CMakeLists.txt', 'dst': 'Libraries/TactilityFreeRtos/'},
|
||||
{'src': 'TactilityFreeRtos/LICENSE*.*', 'dst': 'Libraries/TactilityFreeRtos/'},
|
||||
# TactilityKernel
|
||||
{'src': 'build/esp-idf/TactilityKernel/libTactilityKernel.a', 'dst': 'Libraries/TactilityKernel/Binary/'},
|
||||
{'src': 'TactilityKernel/Include/**', 'dst': 'Libraries/TactilityKernel/Include/'},
|
||||
{'src': 'build/esp-idf/TactilityKernel/libTactilityKernel.a', 'dst': 'Libraries/TactilityKernel/binary/'},
|
||||
{'src': 'TactilityKernel/include/**', 'dst': 'Libraries/TactilityKernel/include/'},
|
||||
{'src': 'TactilityKernel/CMakeLists.txt', 'dst': 'Libraries/TactilityKernel/'},
|
||||
{'src': 'TactilityKernel/LICENSE*.*', 'dst': 'Libraries/TactilityKernel/'},
|
||||
# lvgl-module
|
||||
{'src': 'build/esp-idf/lvgl-module/liblvgl-module.a', 'dst': 'Libraries/lvgl-module/Binary/'},
|
||||
{'src': 'Modules/lvgl-module/Include/**', 'dst': 'Libraries/lvgl-module/Include/'},
|
||||
{'src': 'build/esp-idf/lvgl-module/liblvgl-module.a', 'dst': 'Libraries/lvgl-module/binary/'},
|
||||
{'src': 'Modules/lvgl-module/include/**', 'dst': 'Libraries/lvgl-module/include/'},
|
||||
{'src': 'Modules/lvgl-module/CMakeLists.txt', 'dst': 'Libraries/lvgl-module/'},
|
||||
{'src': 'Modules/lvgl-module/LICENSE*.*', 'dst': 'Libraries/lvgl-module/'},
|
||||
# lvgl (basics)
|
||||
{'src': 'build/esp-idf/lvgl__lvgl/liblvgl__lvgl.a', 'dst': 'Libraries/lvgl/Binary/liblvgl.a'},
|
||||
{'src': 'Libraries/lvgl/lvgl.h', 'dst': 'Libraries/lvgl/Include/'},
|
||||
{'src': 'Libraries/lvgl/lv_version.h', 'dst': 'Libraries/lvgl/Include/'},
|
||||
{'src': 'build/esp-idf/lvgl__lvgl/liblvgl__lvgl.a', 'dst': 'Libraries/lvgl/binary/liblvgl.a'},
|
||||
{'src': 'Libraries/lvgl/lvgl.h', 'dst': 'Libraries/lvgl/include/'},
|
||||
{'src': 'Libraries/lvgl/lv_version.h', 'dst': 'Libraries/lvgl/include/'},
|
||||
{'src': 'Libraries/lvgl/LICENCE*.*', 'dst': 'Libraries/lvgl/'},
|
||||
{'src': 'Libraries/lvgl/src/lv_conf_kconfig.h', 'dst': 'Libraries/lvgl/Include/lv_conf.h'},
|
||||
{'src': 'Libraries/lvgl/src/**/*.h', 'dst': 'Libraries/lvgl/Include/src/'},
|
||||
{'src': 'Libraries/lvgl/src/lv_conf_kconfig.h', 'dst': 'Libraries/lvgl/include/lv_conf.h'},
|
||||
{'src': 'Libraries/lvgl/src/**/*.h', 'dst': 'Libraries/lvgl/include/src/'},
|
||||
# elf_loader
|
||||
{'src': 'Libraries/elf_loader/elf_loader.cmake', 'dst': 'Libraries/elf_loader/'},
|
||||
{'src': 'Libraries/elf_loader/license.txt', 'dst': 'Libraries/elf_loader/'},
|
||||
|
||||
@ -11,8 +11,6 @@ CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y
|
||||
# EmbedTLS
|
||||
CONFIG_MBEDTLS_SSL_PROTO_TLS1_3=y
|
||||
# LVGL
|
||||
CONFIG_LV_FONT_MONTSERRAT_14=y
|
||||
CONFIG_LV_FONT_MONTSERRAT_18=y
|
||||
CONFIG_LV_USE_USER_DATA=y
|
||||
CONFIG_LV_USE_FS_STDIO=y
|
||||
CONFIG_LV_FS_STDIO_LETTER=65
|
||||
|
||||
@ -25,6 +25,8 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
else ()
|
||||
set(TACTILITY_DEVICE_PROJECT "Devices/simulator")
|
||||
set(TACTILITY_DEVICE_ID "simulator")
|
||||
set_property(GLOBAL PROPERTY TACTILITY_DEVICE_PROJECT ${TACTILITY_DEVICE_PROJECT})
|
||||
set_property(GLOBAL PROPERTY TACTILITY_DEVICE_ID ${TACTILITY_DEVICE_ID})
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
@ -37,7 +39,7 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
"Devices/${TACTILITY_DEVICE_PROJECT}"
|
||||
"Drivers"
|
||||
"Modules"
|
||||
"Platforms/PlatformEsp32"
|
||||
"Platforms/platform-esp32"
|
||||
"TactilityKernel"
|
||||
"Tactility"
|
||||
"TactilityC"
|
||||
@ -82,7 +84,7 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
||||
add_subdirectory(TactilityCore)
|
||||
add_subdirectory(TactilityFreeRtos)
|
||||
add_subdirectory(TactilityKernel)
|
||||
add_subdirectory(Platforms/PlatformPosix)
|
||||
add_subdirectory(Platforms/platform-posix)
|
||||
add_subdirectory(Devices/simulator)
|
||||
add_subdirectory(Libraries/cJSON)
|
||||
add_subdirectory(Libraries/lv_screenshot)
|
||||
|
||||
|
Before Width: | Height: | Size: 753 B |
|
Before Width: | Height: | Size: 273 B |
|
Before Width: | Height: | Size: 528 B |
|
Before Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 144 B |
|
Before Width: | Height: | Size: 149 B |
|
Before Width: | Height: | Size: 146 B |
|
Before Width: | Height: | Size: 146 B |
|
Before Width: | Height: | Size: 149 B |
|
Before Width: | Height: | Size: 149 B |
|
Before Width: | Height: | Size: 149 B |
|
Before Width: | Height: | Size: 149 B |
|
Before Width: | Height: | Size: 149 B |
|
Before Width: | Height: | Size: 149 B |
|
Before Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 196 B |
|
Before Width: | Height: | Size: 663 B |
|
Before Width: | Height: | Size: 755 B |
|
Before Width: | Height: | Size: 394 B |
|
Before Width: | Height: | Size: 407 B |
|
Before Width: | Height: | Size: 524 B |
|
Before Width: | Height: | Size: 517 B |
|
Before Width: | Height: | Size: 534 B |
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: bigtreetech,panda-touch.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: cyd,2432s024c.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: cyd,2432s028r.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: cyd,2432s028rv3.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: cyd,2432s032c.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: cyd,4848s040c.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: cyd,8048s043c.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: cyd,e32r28t.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: cyd,e32r32p.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: elecrow,crowpanel-advance-28.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: elecrow,crowpanel-advance-35.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: elecrow,crowpanel-advance-50.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: elecrow,crowpanel-basic-28.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: elecrow,crowpanel-basic-35.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: elecrow,crowpanel-basic-50.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: generic,esp32.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: generic,esp32c6.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: generic,esp32p4.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: generic,esp32s3.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: guition,jc1060p470ciwy.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: guition,jc2432w328c.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: guition,jc3248w535c.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: guition,jc8048w550c.dts
|
||||
|
||||
@ -44,6 +44,6 @@ static std::vector<std::shared_ptr<tt::hal::Device>> createDevices() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -5,6 +5,7 @@ incubating=true
|
||||
|
||||
[apps]
|
||||
launcherAppId=Launcher
|
||||
autoStartAppId=ApWebServer
|
||||
|
||||
[hardware]
|
||||
target=ESP32S3
|
||||
@ -24,3 +25,4 @@ infoMessage=Due to the small size of the screen, the icons don't render properly
|
||||
[lvgl]
|
||||
theme=Mono
|
||||
colorDepth=16
|
||||
uiScale=70
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: heltec,wifi-lora-32-v3.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: lilygo,tdeck.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: lilygo,tdisplay-s3.dts
|
||||
|
||||
@ -19,6 +19,6 @@ static std::vector<std::shared_ptr<tt::hal::Device>> createDevices() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: lilygo,tdisplay.dts
|
||||
|
||||
@ -16,6 +16,6 @@ static std::vector<std::shared_ptr<tt::hal::Device>> createDevices() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: lilygo,tdongle-s3.dts
|
||||
|
||||
@ -3,5 +3,5 @@ file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility esp_lcd ST7796 BQ25896 BQ27220 TCA8418 DRV2605 PwmBacklight driver esp_adc PlatformEsp32
|
||||
REQUIRES Tactility esp_lcd ST7796 BQ25896 BQ27220 TCA8418 DRV2605 PwmBacklight driver esp_adc platform-esp32
|
||||
)
|
||||
|
||||
@ -22,3 +22,4 @@ dpi=227
|
||||
|
||||
[lvgl]
|
||||
colorDepth=16
|
||||
dpi=150
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
bindings: ./
|
||||
dts: lilygo,tlora-pager.dts
|
||||
|
||||
@ -28,6 +28,6 @@ static DeviceVector createDevices() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: m5stack,cardputer-adv.dts
|
||||
|
||||
@ -26,6 +26,6 @@ static DeviceVector createDevices() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: m5stack,cardputer.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: m5stack,core2.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: m5stack,cores3.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: m5stack,papers3.dts
|
||||
|
||||
@ -25,6 +25,6 @@ static DeviceVector createDevices() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: m5stack,stickc-plus.dts
|
||||
|
||||
@ -28,6 +28,6 @@ static DeviceVector createDevices() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: m5stack,stickc-plus2.dts
|
||||
|
||||
@ -20,6 +20,8 @@ dpi=294
|
||||
|
||||
[lvgl]
|
||||
colorDepth=16
|
||||
fontSize=28
|
||||
dpi=250
|
||||
|
||||
[cdn]
|
||||
warningMessage=Only the original hardware variant with the ILI9881C display is supported for now
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: m5stack,tab5.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformPosix
|
||||
- Platforms/platform-posix
|
||||
dts: simulator.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: unphone.dts
|
||||
|
||||
@ -21,6 +21,6 @@ static bool initBoot() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: waveshare,esp32-s3-geek.dts
|
||||
|
||||
@ -20,6 +20,6 @@ static bool initBoot() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: waveshare,s3-lcd-13.dts
|
||||
|
||||
@ -20,6 +20,6 @@ static bool initBoot() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: waveshare,s3-touch-lcd-128.dts
|
||||
|
||||
@ -16,6 +16,6 @@ static std::vector<std::shared_ptr<tt::hal::Device>> createDevices() {
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.uiDensity = UiDensity::Compact,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: waveshare,s3-touch-lcd-147.dts
|
||||
|
||||
@ -21,3 +21,4 @@ dpi=217
|
||||
|
||||
[lvgl]
|
||||
colorDepth=16
|
||||
fontSize=18
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: waveshare,s3-touch-lcd-43.dts
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- Platforms/PlatformEsp32
|
||||
- Platforms/platform-esp32
|
||||
dts: wireless-tag,wt32-sc01-plus.dts
|
||||
|
||||
@ -87,7 +87,6 @@
|
||||
- Remove flex_flow from app_container in Gui.cpp
|
||||
- Files app: copy/cut/paste actions
|
||||
- ElfAppManifest: change name (remove "manifest" as it's confusing), remove icon and title, publish snapshot SDK on CDN
|
||||
- `UiScale` implementation for devices like the CYD 2432S032C
|
||||
- Bug: CYD 2432S032C screen rotation fails due to touch driver issue
|
||||
- Calculator app should show regular text input field on non-touch devices that have a keyboard (Cardputer, T-Lora Pager)
|
||||
- Allow for WSAD keys to navigate LVGL (this is extra nice for cardputer, but just handy in general)
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
static const auto LOGGER = tt::Logger("Ssd1306Display");
|
||||
|
||||
// SSD1306 commands
|
||||
#define SSD1306_CMD_SET_CLOCK 0xD5
|
||||
#define SSD1306_CMD_SET_CHARGE_PUMP 0x8D
|
||||
#define SSD1306_CMD_SET_SEGMENT_REMAP 0xA0
|
||||
#define SSD1306_CMD_SET_COM_SCAN_DIR 0xC0
|
||||
@ -20,11 +21,17 @@ static const auto LOGGER = tt::Logger("Ssd1306Display");
|
||||
#define SSD1306_CMD_SET_CONTRAST 0x81
|
||||
#define SSD1306_CMD_SET_PRECHARGE 0xD9
|
||||
#define SSD1306_CMD_SET_VCOMH_DESELECT 0xDB
|
||||
#define SSD1306_CMD_DISPLAY_INVERT 0xA6
|
||||
#define SSD1306_CMD_DISPLAY_NORMAL 0xA6
|
||||
#define SSD1306_CMD_DISPLAY_INVERT 0xA7
|
||||
#define SSD1306_CMD_DISPLAY_OFF 0xAE
|
||||
#define SSD1306_CMD_DISPLAY_ON 0xAF
|
||||
#define SSD1306_CMD_SET_MEMORY_ADDR_MODE 0x20
|
||||
#define SSD1306_CMD_SET_MEMORY_MODE 0x20
|
||||
#define SSD1306_CMD_SET_COLUMN_RANGE 0x21
|
||||
#define SSD1306_CMD_SET_PAGE_RANGE 0x22
|
||||
#define SSD1306_CMD_SET_MULTIPLEX 0xA8
|
||||
#define SSD1306_CMD_SET_OFFSET 0xD3
|
||||
#define SSD1306_CMD_STOP_SCROLL 0x2E
|
||||
#define SSD1306_CMD_SET_SCAN_DIRECTION_REVERSED 0xC8
|
||||
|
||||
// Helper to send I2C commands directly
|
||||
static bool ssd1306_i2c_send_cmd(i2c_port_t port, uint8_t addr, uint8_t cmd) {
|
||||
@ -40,15 +47,20 @@ static bool ssd1306_i2c_send_cmd(i2c_port_t port, uint8_t addr, uint8_t cmd) {
|
||||
bool Ssd1306Display::createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) {
|
||||
const esp_lcd_panel_io_i2c_config_t io_config = {
|
||||
.dev_addr = configuration->deviceAddress,
|
||||
.on_color_trans_done = nullptr,
|
||||
.user_ctx = nullptr,
|
||||
.control_phase_bytes = 1,
|
||||
.dc_bit_offset = 6,
|
||||
.lcd_cmd_bits = 0,
|
||||
.lcd_param_bits = 0,
|
||||
.flags = {
|
||||
.dc_low_on_data = false,
|
||||
.disable_control_phase = false,
|
||||
},
|
||||
.scl_speed_hz = 0
|
||||
};
|
||||
|
||||
if (esp_lcd_new_panel_io_i2c((esp_lcd_i2c_bus_handle_t)configuration->port, &io_config, &ioHandle) != ESP_OK) {
|
||||
if (esp_lcd_new_panel_io_i2c(static_cast<esp_lcd_i2c_bus_handle_t>(configuration->port), &io_config, &ioHandle) != ESP_OK) {
|
||||
LOGGER.error("Failed to create IO handle");
|
||||
return false;
|
||||
}
|
||||
@ -78,6 +90,7 @@ bool Ssd1306Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_l
|
||||
esp_lcd_panel_dev_config_t panel_config = {
|
||||
.reset_gpio_num = GPIO_NUM_NC, // Already handled above
|
||||
.color_space = ESP_LCD_COLOR_SPACE_MONOCHROME,
|
||||
.data_endian = LCD_RGB_DATA_ENDIAN_BIG,
|
||||
.bits_per_pixel = 1, // Must be 1 for monochrome
|
||||
.flags = {
|
||||
.reset_active_high = false,
|
||||
@ -106,22 +119,18 @@ bool Ssd1306Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_l
|
||||
LOGGER.info("Sending Heltec V3 custom init sequence");
|
||||
|
||||
// Display off while configuring
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xAE);
|
||||
vTaskDelay(pdMS_TO_TICKS(10)); // Important: let display stabilize after turning off
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_DISPLAY_OFF);
|
||||
|
||||
// Set oscillator frequency (MUST come early in sequence)
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xD5);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x80);
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_CLOCK);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xF0); // ~96 Hz
|
||||
|
||||
// Set multiplex ratio
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xA8);
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_MULTIPLEX);
|
||||
ssd1306_i2c_send_cmd(port, addr, configuration->verticalResolution - 1);
|
||||
|
||||
// Set display offset
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xD3);
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_OFFSET);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x00);
|
||||
|
||||
// Set display start line
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x40);
|
||||
|
||||
// Enable charge pump (required for Heltec V3 - must be before memory mode)
|
||||
@ -129,14 +138,13 @@ bool Ssd1306Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_l
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x14); // Enable
|
||||
|
||||
// Horizontal addressing mode
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_MEMORY_ADDR_MODE);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x00);
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_MEMORY_MODE);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x00); // Horizontal addressing
|
||||
|
||||
// Segment remap (0xA1 for Heltec V3 orientation)
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_SEGMENT_REMAP | 0x01);
|
||||
|
||||
// COM scan direction (0xC8 = reversed)
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xC8);
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_SCAN_DIRECTION_REVERSED );
|
||||
|
||||
// COM pin configuration
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_COM_PIN_CFG);
|
||||
@ -146,26 +154,30 @@ bool Ssd1306Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_l
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x02); // Sequential COM pin config for 32-row displays
|
||||
}
|
||||
|
||||
// Contrast (0xCF = bright, good for Heltec OLED)
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_CONTRAST);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xCF);
|
||||
|
||||
// Precharge period (0xF1 for Heltec OLED)
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_PRECHARGE);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xF1);
|
||||
|
||||
// VCOMH deselect level
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_VCOMH_DESELECT);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x40);
|
||||
|
||||
// Normal display mode (not inverse/all-on)
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xA6);
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_COLUMN_RANGE);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0);
|
||||
ssd1306_i2c_send_cmd(port, addr, configuration->horizontalResolution - 1);
|
||||
|
||||
// Invert display (0xA7)
|
||||
// This is what your old working driver did unconditionally
|
||||
ssd1306_i2c_send_cmd(port, addr, 0xA7);
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_SET_PAGE_RANGE);
|
||||
ssd1306_i2c_send_cmd(port, addr, 0);
|
||||
if (configuration->verticalResolution == 64)
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x7);
|
||||
else if (configuration->verticalResolution == 32)
|
||||
ssd1306_i2c_send_cmd(port, addr, 0x3);
|
||||
else
|
||||
check(false, "Not supported");
|
||||
|
||||
// Display ON
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_DISPLAY_INVERT);
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_STOP_SCROLL);
|
||||
ssd1306_i2c_send_cmd(port, addr, SSD1306_CMD_DISPLAY_ON);
|
||||
|
||||
vTaskDelay(pdMS_TO_TICKS(100)); // Let display stabilize
|
||||
|
||||
@ -25,7 +25,7 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES} "${GENERATED_DIR}/devicetree.c"
|
||||
REQUIRES Tactility TactilityC TactilityKernel PlatformEsp32 ${TACTILITY_DEVICE_PROJECT}
|
||||
REQUIRES Tactility TactilityC TactilityKernel platform-esp32 ${TACTILITY_DEVICE_PROJECT}
|
||||
)
|
||||
|
||||
else ()
|
||||
@ -39,7 +39,7 @@ else ()
|
||||
hal-device-module
|
||||
lvgl-module
|
||||
Simulator
|
||||
PlatformPosix
|
||||
platform-posix
|
||||
SDL2::SDL2-static SDL2-static
|
||||
)
|
||||
|
||||
|
||||
@ -17,7 +17,43 @@ menu "Tactility App"
|
||||
help
|
||||
The applications that gives access to other application.
|
||||
This is the first thing that starts after the boot screen.
|
||||
The user can override it from a boot.properties file.
|
||||
The user can override it with a boot.properties file
|
||||
config TT_LVGL_FONT_SIZE_SMALL
|
||||
int "Small font size"
|
||||
default 10
|
||||
range 8 200
|
||||
help
|
||||
Small font size in pixels
|
||||
config TT_LVGL_FONT_SIZE_DEFAULT
|
||||
int "Default font size"
|
||||
default 14
|
||||
range 8 200
|
||||
help
|
||||
Default font size in pixels
|
||||
config TT_LVGL_FONT_SIZE_LARGE
|
||||
int "Large font size"
|
||||
default 18
|
||||
range 8 200
|
||||
help
|
||||
Large font size in pixels
|
||||
config TT_LVGL_STATUSBAR_ICON_SIZE
|
||||
int "Statusbar icon size"
|
||||
default 20
|
||||
range 0 200
|
||||
help
|
||||
Statusbar icon size in pixels
|
||||
config TT_LVGL_LAUNCHER_ICON_SIZE
|
||||
int "Launcher icon size"
|
||||
default 20
|
||||
range 0 200
|
||||
help
|
||||
Launcher icon size in pixels
|
||||
config TT_LVGL_SHARED_ICON_SIZE
|
||||
int "Shared icon size"
|
||||
default 16
|
||||
range 0 200
|
||||
help
|
||||
Shared icon size in pixels
|
||||
config TT_AUTO_START_APP_ID
|
||||
string "Auto Start App ID"
|
||||
default ""
|
||||
|
||||
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/../../Buildscripts/module.cmake")
|
||||
|
||||
file(GLOB_RECURSE SOURCE_FILES "Source/*.c*")
|
||||
file(GLOB_RECURSE SOURCE_FILES "source/*.c*")
|
||||
|
||||
list(APPEND REQUIRES_LIST
|
||||
TactilityKernel
|
||||
@ -16,6 +16,6 @@ endif ()
|
||||
|
||||
tactility_add_module(hal-device-module
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS Include/
|
||||
INCLUDE_DIRS include/
|
||||
REQUIRES ${REQUIRES_LIST}
|
||||
)
|
||||
|
||||