Compare commits

..

94 Commits

Author SHA1 Message Date
fvanroie
71cefbee82 Remove Sunton 2.2" 2025-04-14 22:57:18 +02:00
fvanroie
36e86af846 Remove Sunton 2.2" 2025-04-14 22:36:29 +02:00
fvanroie
4bdd77956f Update ace.js to 1.39.1 2025-03-28 21:17:49 +01:00
fvanroie
4c04b93ea0 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2025-03-17 19:59:15 +01:00
fvanroie
4c71062cf1
Merge pull request #879 from Szetya/master
TTGO T-Display S3 Touch
2025-03-14 12:16:28 +01:00
fvanroie
9dffb1ff22
Update build.yaml 2025-03-12 23:53:36 +01:00
fvanroie
8a17fbbf8a
Merge pull request #880 from yetanothercarbot/twatch
Update T-Watch support (add PMIC support)
2025-03-12 13:15:00 +01:00
yetanothercarbot
d5b8f83850 Update T-Watch support (add PMIC support) 2025-03-12 19:50:24 +10:00
Szetya
5ef28aad33
Update touch_driver_cst816.cpp 2025-03-10 18:51:05 +01:00
Szetya
2f7505debb
Add files via upload
CST816 library add
2025-03-10 18:31:02 +01:00
Szetya
5cc1fda908
Add files via upload
CST816 touch driver add
2025-03-10 18:29:51 +01:00
Szetya
cc50dbf59f
Add files via upload 2025-03-10 18:25:52 +01:00
Szetya
38bd749f98
Update platformio_override-template.ini
T-Display S3 touch added
2025-03-10 18:25:20 +01:00
fvanroie
945e06da9f
Merge pull request #869 from plord12/master
Tweak settings for ESP32-8048S050 so that display works.
2025-02-24 13:57:31 +01:00
Peter Lord
e3ae1e6abf Tweak settings for ESP32-8048S050 so that display works.
See https://github.com/HASwitchPlate/openHASP/issues/868 and https://github.com/HASwitchPlate/openHASP/discussions/861
2025-02-23 22:19:09 +00:00
fvanroie
1ffd94a6bd
Merge pull request #863 from HASwitchPlate/l10n_master
New Crowdin updates
2025-02-14 00:48:15 +01:00
fvanroie
4584e907f9 New translations en_us.h (Russian) 2025-02-14 00:46:37 +01:00
fvanroie
c25aa50cb2 New translations en.json (Russian) 2025-02-14 00:46:36 +01:00
fvanroie
e5794ab6e1 New translations en_us.h (Russian) 2025-02-14 00:12:15 +01:00
fvanroie
72e7fdcbed New translations en.json (Russian) 2025-02-14 00:12:14 +01:00
fvanroie
1a92656d3f
Merge pull request #862 from xek/tinloaf/master
Add support for sunton esp32-2432s024{r,c}
2025-02-13 23:57:49 +01:00
Grzegorz Grasza
1ebd9e29fe Working esp32-2432s024r_4MB support
The original configuration displayed only part
of the screen. The needed modification was to
switch width and height and integrate more
flags already used by the capacitive version of
this board.
2025-02-13 21:16:07 +01:00
Lukas Barth
7c7c65acc4 Add sunton esp32-2432s024{r,c} 2025-02-08 11:54:14 +01:00
fvanroie
74063e285f
Merge pull request #851 from Garag/fix_Sunton_ESP32-8048S043C_touch
Sunton ESP32-8048S043C touch size adapted to screen size
2025-01-13 23:21:51 +01:00
Garag
31ca81e274 touch size adapted to screen size 2025-01-13 21:00:50 +01:00
fvanroie
f663d16cb6 Update ace.js 1.37.3 2025-01-07 16:47:55 +01:00
fvanroie
48884ee986
Merge pull request #841 from vorbeiei/test
fix STMPE610 touchscreen ghost touches
2024-12-25 19:40:45 +01:00
alex
9a59ede939 Merge branch 'test' of https://github.com/vorbeiei/openHASP into test 2024-12-25 17:47:35 +01:00
alex
c3a3222e4a stmpe610 fix ghost touches 2024-12-25 17:45:17 +01:00
fvanroie
3eda5a4225 Fix for #839 2024-12-23 17:13:27 +01:00
fvanroie
bddbc3cb39 Add esp32-2432s022c_4MB 2024-12-23 15:21:22 +01:00
fvanroie
ad85ba63d9 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-12-23 15:19:53 +01:00
fvanroie
001bc637df
Merge pull request #838 from bennydiamond/feature/esp32-2432s022c_support
Initial support for Guition ESP32-2432S022C
2024-12-22 13:53:42 +01:00
psyko_chewbacca
1e85b3cd46 Initial support for Guiton ESP32-2432S022C 2024-12-22 00:42:09 -05:00
fvanroie
1340ce19bb Update ace.js to 1.37.0 2024-12-17 21:51:41 +01:00
fvanroie
7e5762d2ef Better solution for #830 and #836 2024-12-14 22:47:49 +01:00
fvanroie
de60c0af49 Add missing SPI_FREQUENCY #836 2024-12-14 22:21:39 +01:00
fvanroie
154a8ff638 Check if SPI_FREQUENCY is defined #153 2024-12-14 22:02:22 +01:00
fvanroie
e815e31a5a Remove default SPI_FREQUENCY if not set #153 2024-12-14 21:58:22 +01:00
fvanroie
78a3b38829 Fix duplicate response headers #834 2024-12-14 16:55:41 +01:00
fvanroie
62154fb35b
Merge pull request #833 from vorbeiei/test
add config for huzza32 v2 with original featherwing
2024-12-14 00:21:17 +01:00
vorbeiei
70c262ebae
add config for huzza32 v2 with featherwing v1 2024-12-13 21:47:29 +01:00
fvanroie
f1c588c5a4 Update to rc15 2024-12-12 02:53:58 +01:00
fvanroie
36f9256162
Merge pull request #831 from marsman7/lovyangfx_tft_offset
add lovyangfx custom offset for tft
2024-12-08 01:28:49 +01:00
marsman7
b251756059 add ini file for waveshare ESP32-S3 1.69inch CTP 2024-12-07 23:34:19 +01:00
marsman7
7ced77a7a9 add lovyangfx custom offset for tft 2024-12-07 22:21:27 +01:00
fvanroie
0dce321aa5 Remove HASP_USE_HA #813 2024-12-07 03:43:15 +01:00
fvanroie
0c82612e8e Update toubuntu-24.04 2024-12-07 03:11:33 +01:00
fvanroie
fea7be0700 Add lanbon_l9 #830 2024-12-07 02:16:11 +01:00
fvanroie
a67bcc3fc0 Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-12-07 02:14:44 +01:00
fvanroie
12ec1a11b3
Merge pull request #830 from lylavoie/Lanbon_L9
merge Lanbon L9
2024-12-07 02:08:47 +01:00
Lincoln Lavoie
113b6838f2
Working setup for Lanbon L9
* Changed to Arduino_ESP32PAR8 bus driver.
* Fixed touch driver options, added missing port settings.
* Increased frequency of i2c to 400kHz.
2024-12-06 16:01:00 -05:00
Lincoln Lavoie
c89d10dd90
Updated settings for the Lanbon L9
* Fixed the TFT driver, bad reference to gfx object.
* Added setting for GFX parallel driver speed.
* Corrected touch drive to FT6336.
2024-12-05 23:08:22 -05:00
fvanroie
d8ee62ba7c
Merge pull request #829 from marsman7/fix-compiling_error_with_hasp_use_custom_0
Fix compiling errors when HASP_USE_CUSTOM set to zero
2024-12-04 13:25:40 +01:00
marsman7
932805d3bd Fix compiling errors when HASP_USE_CUSTOM set to zero 2024-12-03 21:37:06 +01:00
fvanroie
9a3e9c03b8
Merge pull request #826 from Llgok/master
The addition of support for T-Panel (verified)
2024-11-21 15:39:14 +01:00
fvanroie
81d35626ae
Update _esp32s3.ini 2024-11-21 15:38:45 +01:00
LILYGO_L
52861a6a5d The addition of support for T-Panel (verified). 2024-11-21 14:21:53 +08:00
fvanroie
5f29881e12 Update ace.js to 1.36.5 2024-11-14 21:59:12 +01:00
fvanroie
355e1dbdda Add ws_esp32_s3_touch_lcd_4p3 2024-11-07 20:50:42 +01:00
fvanroie
a771438a08 Add esp32-2432s028_v2 #396 2024-10-12 23:57:34 +02:00
fvanroie
a52ed04f1e Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-10-12 23:38:44 +02:00
fvanroie
769f283b3c Add esp32-2432s028_v2 #396 2024-10-12 23:38:41 +02:00
fvanroie
8b329dff77
Merge pull request #812 from LarsMichelsen/master
Fix support for Adafruit HUZZAH32 V2 ESP32 Featherwing 3.5 V2
2024-10-12 01:10:42 +02:00
Lars Michelsen
735b4a170b Fix support for Adafruit HUZZAH32 V2 ESP32 Featherwing 3.5 V2
* The board of "env:huzzah32-v2-featherwing-35-v2" was changed to
  adafruit_feather_esp32_v2

  Previously it was pointing to the v1 board. See also:

  V1: https://github.com/platformio/platform-espressif32/blob/develop/boards/featheresp32.json
  V2: https://github.com/platformio/platform-espressif32/blob/develop/boards/adafruit_feather_esp32_v2.json

* Fixed the port numbers
* hasp_gpio_type_t::BUTTON had to be renamed because adafruit_feather_esp32_v2/pins_arduino.h
  defines a macro named BUTTON.
2024-10-11 21:08:41 +02:00
fvanroie
e42b27f67a LV_MEM_CUSTOM default allocators use PSram when available #810 2024-10-08 22:35:01 +02:00
fvanroie
31a1272c5e Fix dropdown text when show_selected=0 2024-10-08 20:00:41 +02:00
fvanroie
22b9d894dc Merge branch 'master' of https://github.com/HASwitchPlate/openHASP 2024-10-05 00:55:23 +02:00
fvanroie
b55efe007d Add Lanbon L9 for testing 2024-10-05 00:51:03 +02:00
fvanroie
3047420676
Merge pull request #807 from shubham-vunet/driver-Approach2
Add Lilygo T-Panel v1.2 Pinmap and Drivers (WIP, Touchscreen not implemented)
2024-10-02 19:47:32 +02:00
Shubham Sharma
f61f0bdfa5
Fix code 2024-10-02 22:28:51 +05:30
Shubham Sharma
0f64a3b0f4 Add "Lilygo T-Panel v1.2" pinmap and touch screen 2024-10-02 21:17:45 +05:30
fvanroie
80a9ddb3ea Downgrade platform 2024-09-01 16:21:18 +02:00
fvanroie
ff83c7717c Test platform 5.4.0 for rc14 #643 2024-08-31 23:43:08 +02:00
fvanroie
53bd328178 Update ace.js to 1.36.2 2024-08-30 17:19:14 +02:00
fvanroie
52259a34a0 Update ace.js to 1.36.1 2024-08-29 23:07:19 +02:00
fvanroie
707078560d Disable useSoftTabs #788 2024-08-29 15:58:44 +02:00
fvanroie
b44e8e4951
Merge pull request #793 from HASwitchPlate/l10n_master
New Crowdin updates
2024-08-29 00:55:12 +02:00
fvanroie
1e0b85b3e4 New translations en.json (Swedish) 2024-08-29 00:32:09 +02:00
fvanroie
be3f934df0
Merge pull request #792 from HASwitchPlate/l10n_master
New Crowdin updates
2024-08-28 23:14:11 +02:00
fvanroie
24c39a4b71 New translations en_us.h (Swedish) 2024-08-28 23:04:50 +02:00
fvanroie
37758b1b26
Merge pull request #790 from HASwitchPlate/l10n_master
New Crowdin updates
2024-08-28 21:56:27 +02:00
fvanroie
be953b904a New translations en.json (Swedish) 2024-08-28 21:49:56 +02:00
fvanroie
b83276bca0 New translations en_us.h (Swedish) 2024-08-28 12:33:53 +02:00
fvanroie
f0506d185d New translations en.json (Swedish) 2024-08-28 12:33:52 +02:00
fvanroie
4809ac3915 New translations en.json (Swedish) 2024-08-28 09:53:27 +02:00
fvanroie
4d2aa8d8e0 New translations en_us.h (Swedish) 2024-08-28 01:45:50 +02:00
fvanroie
4b89d9ca52 New translations en.json (Swedish) 2024-08-28 01:45:49 +02:00
fvanroie
84ec6d125c
Merge pull request #789 from HASwitchPlate/l10n_master
New Crowdin updates
2024-08-27 23:58:06 +02:00
fvanroie
391401b3a3 New translations en.json (Spanish) 2024-08-27 23:55:05 +02:00
fvanroie
5cbb92d617 New translations en_us.h (Swedish) 2024-08-27 23:44:52 +02:00
fvanroie
e799a01bc5 New translations en.json (Swedish) 2024-08-27 23:44:51 +02:00
fvanroie
825f5c6da5 New translations en.json (Spanish) 2024-08-27 23:44:50 +02:00
fvanroie
08dd9c5004 Obsolete workflows 2024-08-26 02:47:24 +02:00
85 changed files with 16483 additions and 227 deletions

View File

@ -15,6 +15,7 @@ on:
jobs:
build_esp32:
runs-on: ubuntu-latest
#runs-on: ubuntu-24.04
strategy:
fail-fast: false
@ -37,7 +38,7 @@ jobs:
- out: guition
env: esp32-s3-4848s040_16MB -e guition-jc4827w543c_4MB
- out: lanbon
env: lanbon_l8
env: lanbon_l8 -e lanbon_l9
- out: lilygo-ttgo
env: "lilygo-lily-pi_st7796 -e lilygo-lily-pi_ili9481 -e ttgo-t7-v1_5_ili9341_4MB -e ttgo-t7-v1_5_ili9341_16MB"
- out: lolin
@ -51,9 +52,9 @@ jobs:
- out: seeed-studios
env: "sensecap-indicator-d1_8MB"
- out: sunton
env: "esp32-2432s028r_4MB -e esp32-2432s028r-ili9342_4MB -e esp32-2432s032c_4MB -e esp32-3248s035c_4MB -e esp32-3248s035r_4MB -e sunton-4827s043c_16MB -e sunton-8048s043c_16MB -e sunton-8048s050c_16MB -e sunton-8048s070c_16MB"
env: "esp32-2432s028r_4MB -e esp32-2432s028r-ili9342_4MB -e esp32-2432s028r_v2_4MB -e esp32-2432s032c_4MB -e esp32-3248s035c_4MB -e esp32-3248s035r_4MB -e sunton-4827s043c_16MB -e sunton-8048s043c_16MB -e sunton-8048s050c_16MB -e sunton-8048s070c_16MB"
- out: waveshare
env: "esp32-one_ili9486 -e esp32-one_st7796"
env: "esp32-one_ili9486 -e esp32-one_st7796 -e ws_esp32_s3_touch_lcd_4p3"
- out: wireless-tag
env: "wt32-sc01_4MB -e wt32-sc01_16MB -e wt-86-32-3zw1 -e wt32-sc01-plus_8MB -e wt32-sc01-plus_16MB"
- out: yeacreate

View File

@ -1,4 +1,4 @@
name: Build branch
name: Build Linux (Obsolete)
on:
workflow_dispatch:

View File

@ -3,7 +3,7 @@ on:
# types: [created]
workflow_dispatch:
name: Create Release
name: Create Release (Obsolete)
jobs:
build:

View File

@ -0,0 +1,43 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_ESP32S3_DEV",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "ESP32-S3-FLASH-16MB",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 921600
},
"url": "null",
"vendor": "null"
}

View File

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.35.3/ace.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.35.3/theme-monokai.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.35.3/mode-html.js"></script><script type="module" src="/static/main.js?COMMIT_HASH"></script><script src="/static/script.js?COMMIT_HASH"></script><title>openHASP File Editor</title><link rel="stylesheet" href="/static/vars.css?COMMIT_HASH"><link rel="stylesheet" href="/static/style.css?COMMIT_HASH"><link rel="icon" href="/static/logo.svg?COMMIT_HASH" type="image/svg+xml"><link href="https://fonts.cdnfonts.com/css/jetbrains-mono" rel="stylesheet"><link href="https://fonts.cdnfonts.com/css/source-code-pro" rel="stylesheet"><style>ul{list-style-type:none;padding-left:20px}ul>li{white-space:nowrap}.inact:hover{cursor:default}.item:hover{cursor:pointer;background-color:#dadaff}.item>span:nth-child(2):hover{text-decoration:underline}.selitem>div{background-color:#ccf}.selitem>div:hover{background-color:#ccf}</style></head><body v-cloak v-scope @vue:mounted="mounted"><div class="container__editor" onmousedown="hidectx()"><div class="container__left"><div id="tree"><div class="item bold"><span class="fi fa-flash" title="/"></span><span>L:</span></div></div></div><div class="resizer" id="dragMe"></div><div class="container__right"><div class="toolbar"><input type="file" id="upload" name="upload" multiple="multiple" hidden><span class="left"><button id="home">Home</button><button onclick='upload(_("tree"),"/")'>Upload</button><button id="save" disabled="disabled">Save</button></span><div class="right"><input id="page" type="number" min="1" max="12" class="number"><button id="load">Reload Pages</button><button id="init">Clear Pages</button></div><span class="left"><button id="cut" disabled="disabled">Cut</button><button id="copy" disabled="disabled">Copy</button><button id="paste" disabled="disabled">Paste</button></span><span id="name"></span><span class="left"><button id="undo" disabled="disabled">Undo</button><button id="redo" disabled="disabled">Redo</button></span><span class="left"><select id="font"><option>JetBrains Mono</option><option selected="selected">Source Code Pro</option><input id="fontsize" type="number" step="any" min="9" max="40" value="12"></span></div><div id="editor" class="container__bottom"></div><div id="preview" class="container__bottom"></div><iframe id="download-frame"></iframe></div><div id="ctx" onmousedown="event.stopPropagation()"><ul><li><span class="icon file"></span>New File</li><li><span class="icon upload"></span>Upload Files</li><li><span class="icon edit"></span>Edit</li><li><span class="icon eye"></span>Preview</li><li><span class="icon download"></span>Download</li><li><span class="icon trash"></span>Delete</li></ul></div></div><div id="toast"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.39.1/ace.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.39.1/theme-monokai.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.39.1/mode-html.js"></script><script type="module" src="/static/main.js?COMMIT_HASH"></script><script src="/static/script.js?COMMIT_HASH"></script><title>openHASP File Editor</title><link rel="stylesheet" href="/static/vars.css?COMMIT_HASH"><link rel="stylesheet" href="/static/style.css?COMMIT_HASH"><link rel="icon" href="/static/logo.svg?COMMIT_HASH" type="image/svg+xml"><link href="https://fonts.cdnfonts.com/css/jetbrains-mono" rel="stylesheet"><link href="https://fonts.cdnfonts.com/css/source-code-pro" rel="stylesheet"><style>ul{list-style-type:none;padding-left:20px}ul>li{white-space:nowrap}.inact:hover{cursor:default}.item:hover{cursor:pointer;background-color:#dadaff}.item>span:nth-child(2):hover{text-decoration:underline}.selitem>div{background-color:#ccf}.selitem>div:hover{background-color:#ccf}</style></head><body v-cloak v-scope @vue:mounted="mounted"><div class="container__editor" onmousedown="hidectx()"><div class="container__left"><div id="tree"><div class="item bold"><span class="fi fa-flash" title="/"></span><span>L:</span></div></div></div><div class="resizer" id="dragMe"></div><div class="container__right"><div class="toolbar"><input type="file" id="upload" name="upload" multiple="multiple" hidden><span class="left"><button id="home">Home</button><button onclick='upload(_("tree"),"/")'>Upload</button><button id="save" disabled="disabled">Save</button></span><div class="right"><input id="page" type="number" min="1" max="12" class="number"><button id="load">Reload Pages</button><button id="init">Clear Pages</button></div><span class="left"><button id="cut" disabled="disabled">Cut</button><button id="copy" disabled="disabled">Copy</button><button id="paste" disabled="disabled">Paste</button></span><span id="name"></span><span class="left"><button id="undo" disabled="disabled">Undo</button><button id="redo" disabled="disabled">Redo</button></span><span class="left"><select id="font"><option>JetBrains Mono</option><option selected="selected">Source Code Pro</option><input id="fontsize" type="number" step="any" min="9" max="40" value="12"></span></div><div id="editor" class="container__bottom"></div><div id="preview" class="container__bottom"></div><iframe id="download-frame"></iframe></div><div id="ctx" onmousedown="event.stopPropagation()"><ul><li><span class="icon file"></span>New File</li><li><span class="icon upload"></span>Upload Files</li><li><span class="icon edit"></span>Edit</li><li><span class="icon eye"></span>Preview</li><li><span class="icon download"></span>Download</li><li><span class="icon trash"></span>Delete</li></ul></div></div><div id="toast"></div></body></html>

View File

@ -15,18 +15,18 @@
"theme": "Tema de IU",
"color1": "Color Primario",
"color2": "Color Secundario",
"pages": "Diseño inicial",
"pages": "Diseño Inicial",
"font": "Fuente por Defecto",
"startpage": "Página inicial",
"startdim": "Brillo inicial"
"startpage": "Página de Inicio",
"startdim": "Brillo Inicial"
},
"screenshot": {
"title": "Captura de pantalla",
"btn": "Captura de pantalla",
"nav": "Captura de pantalla",
"prev": "Página Previa",
"title": "Captura de Pantalla",
"btn": "Captura de Pantalla",
"nav": "Captura de Pantalla",
"prev": "Prev Página",
"next": "Siguiente Página",
"refresh": "Refrescar"
"refresh": "Actualizar"
},
"info": {
"title": "Información",
@ -36,16 +36,16 @@
"config": {
"title": "Configuración",
"btn": "Configuración",
"nav": "Configuración"
"nav": "Configuraciones"
},
"ota": {
"title": "Actualización de firmware",
"btn": "Actualización de firmware",
"title": "Actualización de Firmware",
"btn": "Actualización de Firmware",
"nav": "Firmware",
"submit": "Actualizar Firmware",
"file": "Archivo Firmware",
"url": "URL del firmware",
"redirect": "Seguir redirecciones",
"url": "URL del Firmware",
"redirect": "Sigue Redirecciones",
"never": "Nunca",
"strict": "Estricto",
"always": "Siempre"
@ -56,10 +56,10 @@
"nav": "Editor de Archivos"
},
"reset": {
"title": "Restaurar conf de fábrica",
"btn": "Restaurar conf de fábrica",
"title": "Reconfiguración de Fábrica",
"btn": "Restaurar conf de Fábrica",
"warning": "Aviso",
"message": "Este proceso restablecerá todos los ajustes a los valores por defecto. El flash interno se borrará y el dispositivo se reiniciará. Puede que necesite conectarse al AP WiFi mostrado en el panel para reconfigurar el dispositivo antes de volver a acceder a él.",
"message": "Este proceso restablecerá todos los ajustes a los valores predeterminados. El flash interno se borrará y el dispositivo se reiniciará. Es posible que necesite conectarse al AP WiFi mostrado en el panel para reconfigurar el dispositivo antes de volver a acceder a él.",
"fileloss": "¡TODOS LOS ARCHIVOS SERÁN PERDIDOS!"
},
"reboot": {
@ -81,8 +81,8 @@
"apache2": "Licencia Apache2"
},
"wifi": {
"title": "Ajustes Wifi",
"btn": "Ajustes Wifi",
"title": "Ajustes WiFi",
"btn": "Ajustes WiFi",
"ssid": "SSID"
},
"wg": {
@ -97,7 +97,7 @@
"mqtt": {
"title": "Ajustes MQTT",
"btn": "Ajustes MQTT",
"name": "Nombre de equipo",
"name": "Nombre del Host",
"group": "Nombre del Grupo",
"host": "Broker",
"port": "Puerto",
@ -124,9 +124,9 @@
},
"gpio": "Ajustes GPIO",
"debug": {
"title": "Ajustes de depuración",
"btn": "Ajustes de depuración",
"baud": "Baudios",
"title": "Ajustes de Depuración",
"btn": "Ajustes de Depuración",
"baud": "Tasa Baudios",
"tele": "Periodo de Tele",
"ansi": "Usar códigos ANSI",
"host": "Servidor Syslog",
@ -139,9 +139,9 @@
"title": "Ajustes de Tiempo",
"btn": "Ajustes de Tiempo",
"region": "Región",
"zone": "Zona horaria",
"tz": "Zona horaria",
"ntp": "Servidores NTP"
"zone": "Zona Horaria",
"tz": "Zona Horaria",
"ntp": "Servidor NTP"
},
"region": {
"etc": "Etcetera ",
@ -149,7 +149,7 @@
"af": "Africa ",
"as": "Asia ",
"au": "Australia ",
"aq": "Antarctica ",
"aq": "Antártida ",
"eu": "Europa ",
"na": "América del Norte ",
"sa": "América del Sur ",

162
data/ru_RU.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Русский",
"home": {
"title": "Главное меню",
"btn": "Главное меню",
"nav": "Домой"
},
"save": "Сохранить настройки",
"user": "Имя пользователя",
"pass": "Пароль",
"hasp": {
"title": "Оформление",
"btn": "Настройка оформления",
"theme": "Тема интерфейса",
"color1": "Основной цвет",
"color2": "Вторичный цвет",
"pages": "Начальный макет",
"font": "Шрифт по умолчанию",
"startpage": "Стартовая страница",
"startdim": "Ярокость при запуске"
},
"screenshot": {
"title": "Скриншот",
"btn": "Скриншот",
"nav": "Скиншот",
"prev": "Предыдущая страница",
"next": "Следующая страница",
"refresh": "Обновить"
},
"info": {
"title": "Информация",
"btn": "Информация",
"nav": "Информация"
},
"config": {
"title": "Настройки",
"btn": "Настройки",
"nav": "Настройки"
},
"ota": {
"title": "Обновление прошивки",
"btn": "Обновление прошивки",
"nav": "Прошивка",
"submit": "Обновление прошивки",
"file": "Файл прошивки",
"url": "URL прошивки",
"redirect": "Разрешить редиректы",
"never": "Никогда",
"strict": "Строго",
"always": "Всегда"
},
"editor": {
"title": "Редактор файлов",
"btn": "Редактор файлов",
"nav": "Редактор файлов"
},
"reset": {
"title": "Сброс на заводские настройки",
"btn": "Сброс на заводские настройки",
"warning": "Предупреждение",
"message": "Этот процесс вернет все настройки к значениям по умолчанию. Внутренняя флэш-память будет очищена и устройство перезапустится. Возможно, вам придется подключиться к точке доступа Wi-Fi, отображаемой на панели, чтобы перенастроить устройство перед повторным доступом к нему.",
"fileloss": "ВСЕ ФАЙЛЫ БУДУТ ПОТЕРЯНЫ!"
},
"reboot": {
"title": "Перезагрузка...",
"btn": "Перезагрузка",
"nav": "Перезагрузка",
"message": "Устройство перезагружается."
},
"about": {
"credits": "Based on the previous work of the following open source developers:",
"copyright": "Copyright ",
"rights": "All rights reserved.",
"clause1": "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:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "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.",
"mit": "Лицензия MIT",
"bsd": "Лицезия BSD",
"freebsd": "Лицензия FreeBSD",
"apache2": "Лицензия Apache2"
},
"wifi": {
"title": "Настройка WiFi",
"btn": "Настройка WiFi",
"ssid": "SSID"
},
"wg": {
"title": "Настройки WireGuard",
"btn": "Настройки WireGuard",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "Настройки MQTT",
"btn": "Настройки MQTT",
"name": "Имя хоста",
"group": "Имя группы",
"host": "Брокер",
"port": "Порт",
"node_t": "Node Topic",
"group_t": "Group Topic",
"broadcast_t": "Broadcast Topic",
"hass_t": "HA LWT Topic"
},
"http": {
"title": "Настройки HTTP",
"btn": "Настройки HTTP"
},
"ftp": {
"title": "Настройки FTP",
"btn": "Настройкаи FTP",
"port": "FTP порт",
"pasv": "Пароль"
},
"gui": {
"title": "Настройки экрана",
"btn": "Настройки экрана",
"antiburn": "Прдеотвращение выгорания",
"calibrate": "Калибровка"
},
"gpio": "Настройки GPIO",
"debug": {
"title": "Настройки отладки",
"btn": "Настройки отладки",
"baud": "Baudrate",
"tele": "Tele период",
"ansi": "Использовать кодировку ANSI",
"host": "Сервер Syslog",
"port": "Порт Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Объект"
},
"time": {
"title": "Настройки времени",
"btn": "Настройки времени",
"region": "Регион",
"zone": "Часовой пояс",
"tz": "Часовой пояс",
"ntp": "Сервер NTP"
},
"region": {
"etc": "Прочие ",
"continents": "Континент ",
"af": "Африка ",
"as": "Азия ",
"au": "Австралия ",
"aq": "Антарктика ",
"eu": "Европа ",
"na": "Северная Америка ",
"sa": "Южна Америка ",
"islands": "Острова ",
"at": "Атлантический океан ",
"in": "Индийский океан ",
"pa": "Тихий океан "
}
}
}

File diff suppressed because one or more lines are too long

162
data/sv_SE.json Normal file
View File

@ -0,0 +1,162 @@
{
"en": {
"language": "Svenska",
"home": {
"title": "Huvudmeny",
"btn": "Huvudmeny",
"nav": "Hem"
},
"save": "Spara Inställningar",
"user": "Användarnamn",
"pass": "Lösenord",
"hasp": {
"title": "HASP Design",
"btn": "HASP Design",
"theme": "UI Tema",
"color1": "Primärfärg",
"color2": "Sekundärfärg",
"pages": "Starta Layout",
"font": "Standardtypsnitt",
"startpage": "Startsida",
"startdim": "Startljusstyrka"
},
"screenshot": {
"title": "Skärmbild",
"btn": "Skärmbild",
"nav": "Skärmbild",
"prev": "Föregående Sida",
"next": "Nästa Sida",
"refresh": "Uppdatera"
},
"info": {
"title": "Information",
"btn": "Information",
"nav": "Information"
},
"config": {
"title": "Inställningar",
"btn": "Konfiguration",
"nav": "Inställningar"
},
"ota": {
"title": "Firmware-uppdatering",
"btn": "Firmware-uppdatering",
"nav": "Firmware",
"submit": "Uppdatera Firmware",
"file": "Firmware-fil",
"url": "Firmware URL",
"redirect": "Följ omdirigeringar",
"never": "Aldrig",
"strict": "Strikt",
"always": "Alltid"
},
"editor": {
"title": "Filredigerare",
"btn": "Filredigerare",
"nav": "Filredigerare"
},
"reset": {
"title": "Fabriksåterställning",
"btn": "Fabriksåterställning",
"warning": "Varning",
"message": "Denna process kommer att återställa alla inställningar till standardvärden. Det interna minnet kommer att raderas och enheten startas om. Du kan behöva ansluta till WiFi AP som visas på panelen för att konfigurera om enheten innan du öppnar den igen.",
"fileloss": "ALLA FILLER KOMMER ATT FÖRLORAS!"
},
"reboot": {
"title": "Startar om...",
"btn": "Omstart",
"nav": "Omstart",
"message": "Enheten startar om."
},
"about": {
"credits": "Baserat på det tidigare arbetet av följande utvecklare av öppen källkod:",
"copyright": "Copyright ",
"rights": "Alla rättigheter förbehållna.",
"clause1": "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:",
"clause2": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"clause3": "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.",
"mit": "MIT Licens",
"bsd": "BSD Licens",
"freebsd": "FreeBSD Licens",
"apache2": "Apache2 Licens"
},
"wifi": {
"title": "Inställningar för WiFi",
"btn": "Inställningar för WiFi",
"ssid": "SSID"
},
"wg": {
"title": "Inställningar för WireGuard",
"btn": "Inställningar för WireGuard",
"vpnip": "VPN IP-adress",
"privkey": "Privat nyckel",
"host": "Fjärr-IP",
"port": "Fjärrport",
"pubkey": "Publik fjärrnyckel"
},
"mqtt": {
"title": "MQTT Inställningar",
"btn": "MQTT Inställningar",
"name": "Servernamn",
"group": "Gruppnamn",
"host": "Broker",
"port": "Port",
"node_t": "Nod topic",
"group_t": "Grupp topic",
"broadcast_t": "Broadcast topic",
"hass_t": "HA LWT topic"
},
"http": {
"title": "HTTP Inställningar",
"btn": "HTTP Inställningar"
},
"ftp": {
"title": "FTP Inställningar",
"btn": "FTP Inställningar",
"port": "FTP Port",
"pasv": "Passiv port"
},
"gui": {
"title": "Bildskärmsinställningar",
"btn": "Bildskärmsinställningar",
"antiburn": "Antiburn",
"calibrate": "Kalibrera"
},
"gpio": "GPIO Inställningar",
"debug": {
"title": "Debug Inställningar",
"btn": "Debug Inställningar",
"baud": "Datahastighet",
"tele": "Telemetri period",
"ansi": "Använd ANSI-kod",
"host": "Syslog server",
"port": "Syslog port",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facilitet"
},
"time": {
"title": "Tidsinställningar",
"btn": "Tidsinställningar",
"region": "Region",
"zone": "Tidszon",
"tz": "Tidszon",
"ntp": "NTP-servrar"
},
"region": {
"etc": "Etcetera ",
"continents": "Kontinenter ",
"af": "Afrika ",
"as": "Asien ",
"au": "Australien ",
"aq": "Antarktis",
"eu": "Europa ",
"na": "Nordamerika ",
"sa": "Sydamerika ",
"islands": "Öar ",
"at": "Atlanten ",
"in": "Indiska oceanen ",
"pa": "Stilla havet "
}
}
}

View File

@ -116,8 +116,8 @@ typedef int16_t lv_coord_t;
# define LV_MEM_AUTO_DEFRAG 1
#else /*LV_MEM_CUSTOM*/
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
#define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
#define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#define LV_MEM_CUSTOM_ALLOC hasp_malloc /*Wrapper to malloc*/
#define LV_MEM_CUSTOM_FREE hasp_free /*Wrapper to free*/
#endif /*LV_MEM_CUSTOM*/
#ifndef LV_VDB_SIZE

View File

@ -105,8 +105,8 @@ typedef int16_t lv_coord_t;
# define LV_MEM_AUTO_DEFRAG 1
#else /*LV_MEM_CUSTOM*/
# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
# define LV_MEM_CUSTOM_ALLOC hasp_malloc /*Wrapper to malloc*/
# define LV_MEM_CUSTOM_FREE hasp_free /*Wrapper to free*/
#endif /*LV_MEM_CUSTOM*/
/* Use the standard memcpy and memset instead of LVGL's own functions.

View File

@ -148,7 +148,6 @@
**************************************************/
//#define HASP_USE_MDNS 0 // Disable MDNS
//#define HASP_USE_CUSTOM 1 // Enable compilation of custom code from /src/custom
//#define HASP_USE_HA // Enable Home Assistant auto-discovery
//#define HASP_START_CONSOLE 0 // Disable starting of serial console at boot
//#define HASP_START_TELNET 0 // Disable starting of telnet service at boot
//#define HASP_START_HTTP 0 // Disable starting of web interface at boot

View File

@ -265,6 +265,136 @@ static const uint8_t st7701_sensecap_indicator_init_operations[] = {
DELAY, 120,
};
static const uint8_t st7701_t_panel_init_operations[] = {
BEGIN_WRITE,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x13,
WRITE_C8_D8, 0xEF, 0x08,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x10,
WRITE_C8_D16, 0xC0, 0x3B, 0x00,
WRITE_C8_D16, 0xC1, 0x0B, 0x02,
WRITE_COMMAND_8, 0xC2,
WRITE_BYTES, 3, 0x30, 0x02, 0x37,
WRITE_C8_D8, 0xCC, 0x10,
WRITE_COMMAND_8, 0xB0, // Positive Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x0F, 0x16, 0x0E,
0x11, 0x07, 0x09, 0x09,
0x08, 0x23, 0x05, 0x11,
0x0F, 0x28, 0x2D, 0x18,
WRITE_COMMAND_8, 0xB1, // Negative Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x0F, 0x16, 0x0E,
0x11, 0x07, 0x09, 0x08,
0x09, 0x23, 0x05, 0x11,
0x0F, 0x28, 0x2D, 0x18,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x11,
WRITE_C8_D8, 0xB0, 0x4D,
WRITE_C8_D8, 0xB1, 0x33,
WRITE_C8_D8, 0xB2, 0x87,
WRITE_C8_D8, 0xB5, 0x4B,
WRITE_C8_D8, 0xB7, 0x8C,
WRITE_C8_D8, 0xB8, 0x20,
WRITE_C8_D8, 0xC1, 0x78,
WRITE_C8_D8, 0xC2, 0x78,
WRITE_C8_D8, 0xD0, 0x88,
WRITE_COMMAND_8, 0xE0,
WRITE_BYTES, 3, 0x00, 0x00, 0x02,
WRITE_COMMAND_8, 0xE1,
WRITE_BYTES, 11,
0x02, 0xF0, 0x00, 0x00,
0x03, 0xF0, 0x00, 0x00,
0x00, 0x44, 0x44,
WRITE_COMMAND_8, 0xE2,
WRITE_BYTES, 12,
0x10, 0x10, 0x40, 0x40,
0xF2, 0xF0, 0x00, 0x00,
0xF2, 0xF0, 0x00, 0x00,
WRITE_COMMAND_8, 0xE3,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE4, 0x44, 0x44,
WRITE_COMMAND_8, 0xE5,
WRITE_BYTES, 16,
0x07, 0xEF, 0xF0, 0xF0,
0x09, 0xF1, 0xF0, 0xF0,
0x03, 0xF3, 0xF0, 0xF0,
0x05, 0xED, 0xF0, 0xF0,
WRITE_COMMAND_8, 0xE6,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE7, 0x44, 0x44,
WRITE_COMMAND_8, 0xE8,
WRITE_BYTES, 16,
0x08, 0xF0, 0xF0, 0xF0,
0x0A, 0xF2, 0xF0, 0xF0,
0x04, 0xF4, 0xF0, 0xF0,
0x06, 0xEE, 0xF0, 0xF0,
WRITE_COMMAND_8, 0xEB,
WRITE_BYTES, 7,
0x00, 0x00, 0xE4, 0xE4,
0x44, 0x88, 0x40,
WRITE_C8_D16, 0xEC, 0x78, 0x00,
WRITE_COMMAND_8, 0xED,
WRITE_BYTES, 16,
0x20, 0xF9, 0x87, 0x76,
0x65, 0x54, 0x4F, 0xFF,
0xFF, 0xF4, 0x45, 0x56,
0x67, 0x78, 0x9F, 0x02,
WRITE_COMMAND_8, 0xEF,
WRITE_BYTES, 6,
0x10, 0x0D, 0x04, 0x08,
0x3F, 0x1F,
// WRITE_C8_D8, 0xCD, 0x05,//Test
WRITE_C8_D8, 0x3A, 0x55,
WRITE_C8_D8, 0x36, 0x08,
WRITE_COMMAND_8, 0x11,
// WRITE_COMMAND_8, 0xFF,//Test
// WRITE_BYTES, 5,
// 0x77, 0x01, 0x00, 0x00,
// 0x12,
// WRITE_C8_D8, 0xD1, 0x81,//Test
// WRITE_C8_D8, 0xD2, 0x08,//Test
WRITE_COMMAND_8, 0x29, // Display On
// WRITE_C8_D8, 0x35, 0x00,//Test
// WRITE_C8_D8, 0xCE, 0x04,//Test
// WRITE_COMMAND_8, 0xF2,//Test
// WRITE_BYTES, 4,
// 0xF0, 0xA3, 0xA3, 0x71,
END_WRITE};
class Arduino_RGB_Display_Mod : public Arduino_GFX{
public:

View File

@ -293,10 +293,9 @@ uint8_t FtpServer::handleFTP() {
void FtpServer::clientConnected()
{
// DEBUG_PRINTLN( F(" Client connected!") );
client.print(F("220 ---")); client.print(welcomeMessage); client.println(F(" ---"));
// client.print(F("220---")); client.print(welcomeMessage); client.println(F(" ---"));
// client.println(F("220--- By Renzo Mischianti ---"));
// client.print(F("220 -- Version ")); client.print(FTP_SERVER_VERSION); client.println(F(" --"));
client.print (F("220--- ")); client.print(welcomeMessage); client.println(F(" ---"));
// client.println(F(" -- By Renzo Mischianti --"));
client.print (F("220 -- Version ")); client.print(FTP_SERVER_VERSION);
iCL = 0;
if (FtpServer::_callback) {
FtpServer::_callback(FTP_CONNECT, free(), capacity());

24
lib/cst816t/LICENSE Normal file
View File

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
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 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.
For more information, please refer to <https://unlicense.org>

145
lib/cst816t/README.md Normal file
View File

@ -0,0 +1,145 @@
# cst816t capacitive touch ic
[![cst816t touch screen](extras/P169H002-CTP-small.jpg)](https://github.com/koendv/cst816t/raw/master/extras/P169H002-CTP.jpg)
This is an Arduino library for the cst816t capacitive touch ic. The cst816t capacitive touch ic is able to decode clicks, double clicks, swipes and long press in hardware. Tested on stm32duino.
The cst816t runs on voltages from 1.8V to 3.3V. Do not connect the cst816t to 5V arduinos such as Arduino UNO. Connecting the cst816t to 5V will probably damage the device.
Hardware requirements:
- power supply 2.8V to 3.6V
- power supply ripple <= 50mv;
- logic level 1.8V to 3.3V
- i2c rate 10Khz to 400Khz
## Use
Code for the cst816t consists of a setup, done once, and a loop, done repeatedly.
## Setup
The cst816t touch sensor needs an I2C bus, a reset pin and a interrupt pin:
```
#include <Wire.h>
#include "cst816t.h"
TwoWire Wire2(TP_SDA, TP_SCL);
cst816t touchpad(Wire2, TP_RST, TP_IRQ);
```
The ic can run in four modes: touch, change, fast, motion.
### mode touch
```
void setup() {
touchpad.begin(mode_touch);
}
```
In mode _touch_, if a finger touches the display the ic sends an interrupt every 10ms. After receiving the interrupt, you can read updated touch coordinates and finger count. All processing is done on the mcu.
### mode change
```
void setup() {
touchpad.begin(mode_change);
}
```
In mode _change_ the ic sends an interrupt when the finger changes position. Compared to mode touch, the number of interrupts is more moderate.
### mode fast
```
void setup() {
touchpad.begin(mode_fast);
}
```
In mode _fast_ the ic sends an interrupt when the finger has completed one of the following movements: single click, swipe up, swipe down, swipe left, swipe right.
Touch response is fast because there is no need to wait to distinguish between single click, double click and long press.
### mode motion
```
void setup() {
touchpad.begin(mode_motion);
}
```
In mode _motion_ the ic sends an interrupt when the finger has completed the following movements: single click, **double click**, swipe up, swipe down, swipe left, swipe right, **long press**. All processing is done in the cst816 touch ic. The processing in the mcu is minimal.
## Loop
Test repeatedly if there is an update from the touch panel. If there is an update from the touch panel, read gesture, (x, y) coordinates, and number of fingers touching the display.
```
void loop() {
if (touchpad.available()) {
switch (touchpad.gesture_id) {
case GESTURE_NONE:
Serial.print("NONE");
break;
case GESTURE_SWIPE_DOWN:
Serial.print("SWIPE DOWN");
break;
case GESTURE_SWIPE_UP:
Serial.print("SWIPE UP");
break;
case GESTURE_SWIPE_LEFT:
Serial.print("SWIPE LEFT");
break;
case GESTURE_SWIPE_RIGHT:
Serial.print("SWIPE RIGHT");
break;
case GESTURE_SINGLE_CLICK:
Serial.print("SINGLE CLICK");
break;
case GESTURE_DOUBLE_CLICK:
Serial.print("DOUBLE CLICK");
break;
case GESTURE_LONG_PRESS:
Serial.print("LONG PRESS");
break;
default:
Serial.print("UNKNOWN ");
break;
}
Serial.print("at (");
Serial.print(touchpad.x);
Serial.print(", ");
Serial.print(touchpad.y);
Serial.print(") fingers: ");
Serial.println(touchpad.finger_num);
}
}
```
## Examples
The library comes with three example Arduino sketches: touchme, smartwatch, and lvgl. To compile the examples, use [stm32duino](https://github.com/stm32duino/Arduino_Core_STM32/wiki).
### touchme
A simple sketch that uses the CST816T touch sensor. When the display is touched, the (x, y) coordinates and the action - click or swipe - are printed on the serial port.
### smartwatch
A small Arduino sketch for the [P169H002-CTP](https://www.google.com/search?q=P169H002-CTP) smartwatch display. The P169H002-CTP is a 1.69 inch 240x280 lcd display with an ST7789 lcd driver and a CST816T touch sensor. The sketch prints a text - "click" or "swipe" - on the spot where the display is touched.
### lvgl
[LVGL](http://www.lvgl.io) (Light and Versatile Graphics Library) is a graphics library for embedded systems. An Arduino sketch is given which draws a button on a P169H002-CTP display.
This lvgl example uses the Adafruit GFX library. For improved speed, you may wish to check if there is a library that is more optimized for the processor you use.
## Links
Arduino libraries for ST7789 tft driver:
- [Adafruit ST7789](https://github.com/adafruit/Adafruit-ST7735-Library/)
- [TFT_eSPI](https://github.com/Bodmer/TFT_eSPI)
- [ST7789-STM32](https://github.com/Floyd-Fish/ST7789-STM32)
- [ST7789-STM32-uGUI](https://github.com/deividAlfa/ST7789-STM32-uGUI)
[Schematic](extras/Schematic_drawing_2023-06-21.pdf
) for the P169H002-CTP display. VCC = 3.3V. The ambient light sensor is used to set display intensity.
The P169H002-CTP display is available from [Aliexpress](https://www.aliexpress.com/item/1005005238299349.html).

View File

@ -0,0 +1,128 @@
/* lvgl demo on P169H002-CTP display */
#include <SPI.h>
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <Wire.h>
#include "cst816t.h" // capacitive touch
/* Note: in lv_conf.h: set lv_tick to Arduino millis() */
#include <lvgl.h>
// display
#define TFT_X 240
#define TFT_Y 280
#define TFT_CS PB1
#define TFT_RST PA4
#define TFT_DC PB0
#define TFT_MOSI PB15
#define TFT_SCLK PB13
#define TFT_LED PA8
// touch
#define TP_SDA PB11
#define TP_SCL PB10
#define TP_RST PA15
#define TP_IRQ PB3
TwoWire Wire2(TP_SDA, TP_SCL);
cst816t touchpad(Wire2, TP_RST, TP_IRQ);
SPIClass SPI_1(PB15, PB14, PB13);
Adafruit_ST7789 tft = Adafruit_ST7789(&SPI_1, TFT_CS, TFT_DC, TFT_RST);
static lv_disp_draw_buf_t disp_buf;
static lv_color_t buf_1[TFT_X * 10];
static lv_color_t buf_2[TFT_X * 10];
static lv_disp_drv_t disp_drv;
static lv_indev_drv_t indev_drv;
/* lvgl display output */
/* Using Adafruit display driver. Depending upon architecture, other drivers may be faster. */
void disp_flush_cb(lv_disp_drv_t* disp_drv, const lv_area_t* area, lv_color_t* color_p) {
uint32_t w = 1 + area->x2 - area->x1;
uint32_t h = 1 + area->y2 - area->y1;
uint32_t len = w * h;
tft.startWrite();
tft.setAddrWindow(area->x1, area->y1, w, h);
tft.writePixels(&color_p->full, len);
tft.endWrite();
lv_disp_flush_ready(disp_drv);
}
/* lvgl touchpad input */
void touchpad_input_read(lv_indev_drv_t* drv, lv_indev_data_t* data) {
static uint32_t tp_x = 0;
static uint32_t tp_y = 0;
static uint32_t tp_fingers = 0;
if (touchpad.available()) {
tp_x = touchpad.x;
tp_y = touchpad.y;
tp_fingers = touchpad.finger_num;
}
data->point.x = tp_x;
data->point.y = tp_y;
if (tp_fingers != 0) data->state = LV_INDEV_STATE_PRESSED;
else data->state = LV_INDEV_STATE_RELEASED;
}
/* lvgl button callback */
void btn_event_cb(lv_event_t* e) {
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t* btn = lv_event_get_target(e);
if (code == LV_EVENT_CLICKED) {
static uint8_t cnt = 0;
cnt++;
/*Get the first child of the button which is the label and change its text*/
lv_obj_t* label = lv_obj_get_child(btn, 0);
lv_label_set_text_fmt(label, "Button %d", cnt);
}
}
void setup() {
Serial.begin(9600);
Serial.println("boot");
analogWriteResolution(8);
analogWrite(TFT_LED, 127); // display backlight at 50%
tft.init(240, 280); // Init ST7789 280x240
tft.fillScreen(ST77XX_BLACK);
tft.setTextColor(ST77XX_WHITE);
tft.setRotation(2);
touchpad.begin(mode_change);
/* display */
lv_init();
lv_disp_draw_buf_init(&disp_buf, buf_1, buf_2, TFT_X * 10);
lv_disp_drv_init(&disp_drv);
disp_drv.draw_buf = &disp_buf;
disp_drv.flush_cb = disp_flush_cb;
disp_drv.hor_res = TFT_X;
disp_drv.ver_res = TFT_Y;
lv_disp_t* disp;
disp = lv_disp_drv_register(&disp_drv);
/* touchpad */
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = touchpad_input_read;
lv_indev_t* my_indev = lv_indev_drv_register(&indev_drv);
/* button */
lv_obj_t* btn = lv_btn_create(lv_scr_act());
lv_obj_center(btn);
lv_obj_set_size(btn, 120, 50);
lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_ALL, NULL);
lv_obj_t* label = lv_label_create(btn);
lv_label_set_text(label, "Button");
lv_obj_center(label);
}
void loop() {
lv_timer_handler();
}

View File

@ -0,0 +1,87 @@
/*
demo of P168H002-CTP display.
*/
#include <SPI.h>
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <Wire.h>
#include "cst816t.h" // capacitive touch
// display
#define TFT_X 240
#define TFT_Y 280
#define TFT_CS PB1
#define TFT_RST PA4
#define TFT_DC PB0
#define TFT_MOSI PB15
#define TFT_SCLK PB13
#define TFT_LED PA8
// touch
#define TP_SDA PB11
#define TP_SCL PB10
#define TP_RST PA15
#define TP_IRQ PB3
TwoWire Wire2(TP_SDA, TP_SCL);
cst816t touchpad(Wire2, TP_RST, TP_IRQ);
SPIClass SPI_1(PB15, PB14, PB13);
Adafruit_ST7789 tft = Adafruit_ST7789(&SPI_1, TFT_CS, TFT_DC, TFT_RST);
void setup() {
Serial.begin(9600);
Serial.println("boot");
analogWriteResolution(8);
analogWrite(TFT_LED, 127); // display backlight at 50%
tft.init(240, 280); // Init ST7789 280x240
tft.fillScreen(ST77XX_BLACK);
tft.setTextColor(ST77XX_WHITE);
tft.setTextSize(0);
tft.setRotation(2);
touchpad.begin(mode_motion);
tft.setCursor(TFT_X / 2, TFT_Y / 2);
tft.println(touchpad.version());
}
void loop() {
if (touchpad.available()) {
tft.setCursor(touchpad.x, touchpad.y);
tft.fillScreen(ST77XX_BLACK);
switch (touchpad.gesture_id) {
case GESTURE_NONE:
tft.print("NONE");
break;
case GESTURE_SWIPE_DOWN:
tft.print("SWIPE DOWN");
break;
case GESTURE_SWIPE_UP:
tft.print("SWIPE UP");
break;
case GESTURE_SWIPE_LEFT:
tft.print("SWIPE LEFT");
break;
case GESTURE_SWIPE_RIGHT:
tft.print("SWIPE RIGHT");
break;
case GESTURE_SINGLE_CLICK:
tft.print("SINGLE CLICK");
break;
case GESTURE_DOUBLE_CLICK:
tft.print("DOUBLE CLICK");
break;
case GESTURE_LONG_PRESS:
tft.print("LONG PRESS");
break;
default:
tft.print("?");
break;
}
}
}

View File

@ -0,0 +1,23 @@
/* demo for the CST816T capacitive touch ic */
#include <Wire.h>
#include "cst816t.h"
#define TP_SDA PB11
#define TP_SCL PB10
#define TP_RST PA15
#define TP_IRQ PB3
TwoWire Wire2(TP_SDA, TP_SCL);
cst816t touchpad(Wire2, TP_RST, TP_IRQ);
void setup() {
// decode everything: single click, double click, long press, swipe up, swipe down, swipe left, swipe right
touchpad.begin(mode_motion);
Serial.println(touchpad.version());
}
void loop() {
if (touchpad.available())
Serial.println(touchpad.state());
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,11 @@
name=cst816t
version=1.5.1
author=koendv
maintainer=koendv
sentence=cst816t capacitive touch screen
paragraph=An Arduino library for the cst816t capacitive touch screen IC
category=Other
url=https://github.com/koendv/cst816t
architectures=*
includes=cst816t.h

203
lib/cst816t/src/cst816t.cpp Normal file
View File

@ -0,0 +1,203 @@
/* CST816T capacitive touch-screen driver.
Koen De Vleeschauwer, 2023
Literature:
DS-CST816T-V2.2.pdf datasheet
AN-CST816T-v1.pdf register description
CST78XX-V1.0.pdf firmware upgrade how-to
*/
#include "cst816t.h"
#include <stdint.h>
#define CST816T_ADDRESS 0x15
#define REG_GESTURE_ID 0x01
#define REG_FINGER_NUM 0x02
#define REG_XPOS_H 0x03
#define REG_XPOS_L 0x04
#define REG_YPOS_H 0x05
#define REG_YPOS_L 0x06
#define REG_CHIP_ID 0xA7
#define REG_PROJ_ID 0xA8
#define REG_FW_VERSION 0xA9
#define REG_FACTORY_ID 0xAA
#define REG_SLEEP_MODE 0xE5
#define REG_IRQ_CTL 0xFA
#define REG_LONG_PRESS_TICK 0xEB
#define REG_MOTION_MASK 0xEC
#define REG_DIS_AUTOSLEEP 0xFE
#define MOTION_MASK_CONTINUOUS_LEFT_RIGHT 0b100
#define MOTION_MASK_CONTINUOUS_UP_DOWN 0b010
#define MOTION_MASK_DOUBLE_CLICK 0b001
#define IRQ_EN_TOUCH 0x40
#define IRQ_EN_CHANGE 0x20
#define IRQ_EN_MOTION 0x10
#define IRQ_EN_LONGPRESS 0x01
static bool tp_event = false;
static void tp_isr() {
tp_event = true;
}
cst816t::cst816t(TwoWire &_wire, int8_t _rst, int8_t _irq)
: wire(_wire) {
rst = _rst;
irq = _irq;
chip_id = 0;
firmware_version = 0;
tp_event = false;
gesture_id = 0;
finger_num = 0;
x = 0;
y = 0;
}
bool cst816t::begin(touchpad_mode tp_mode) {
uint8_t dta[4];
pinMode(irq, INPUT);
if (rst >= 0) {
pinMode(rst, OUTPUT);
digitalWrite(rst, HIGH);
delay(100);
digitalWrite(rst, LOW);
delay(10);
digitalWrite(rst, HIGH);
delay(100);
}
wire.begin();
if (i2c_read(CST816T_ADDRESS, REG_CHIP_ID, dta, sizeof(dta))) {
Serial.println("i2c error");
return false; // Sikertelen inicializálás
}
chip_id = dta[0];
firmware_version = dta[3];
uint8_t irq_en = 0x0;
uint8_t motion_mask = 0x0;
switch (tp_mode) {
case mode_touch:
irq_en = IRQ_EN_TOUCH;
break;
case mode_change:
irq_en = IRQ_EN_CHANGE;
break;
case mode_fast:
irq_en = IRQ_EN_MOTION;
break;
case mode_motion:
irq_en = IRQ_EN_MOTION | IRQ_EN_LONGPRESS;
motion_mask = MOTION_MASK_DOUBLE_CLICK;
break;
default:
return false; // Érvénytelen mód esetén sikertelen inicializálás
}
if (i2c_write(CST816T_ADDRESS, REG_IRQ_CTL, &irq_en, 1) ||
i2c_write(CST816T_ADDRESS, REG_MOTION_MASK, &motion_mask, 1)) {
Serial.println("i2c write error");
return false;
}
attachInterrupt(digitalPinToInterrupt(irq), tp_isr, FALLING);
// Disable auto sleep
uint8_t dis_auto_sleep = 0xFF;
if (i2c_write(CST816T_ADDRESS, REG_DIS_AUTOSLEEP, &dis_auto_sleep, 1)) {
Serial.println("Failed to disable auto sleep");
return false;
}
return true; // Sikeres inicializálás
}
bool cst816t::available() {
uint8_t dta[6];
if (tp_event && !i2c_read(CST816T_ADDRESS, REG_GESTURE_ID, dta, sizeof(dta))) {
tp_event = false;
gesture_id = dta[0];
finger_num = dta[1];
x = (((uint16_t)dta[2] & 0x0f) << 8) | (uint16_t)dta[3];
y = (((uint16_t)dta[4] & 0x0f) << 8) | (uint16_t)dta[5];
return true;
}
return false;
}
uint8_t cst816t::i2c_read(uint16_t addr, uint8_t reg_addr, uint8_t *reg_data, uint32_t length) {
wire.beginTransmission(addr);
wire.write(reg_addr);
if (wire.endTransmission(true)) return -1;
wire.requestFrom((uint8_t)addr, (size_t)length, (bool)true);
for (int i = 0; i < length; i++) {
*reg_data++ = wire.read();
}
return 0;
}
uint8_t cst816t::i2c_write(uint8_t addr, uint8_t reg_addr, const uint8_t *reg_data, uint32_t length) {
wire.beginTransmission(addr);
wire.write(reg_addr);
for (int i = 0; i < length; i++) {
wire.write(*reg_data++);
}
if (wire.endTransmission(true)) return -1;
return 0;
}
String cst816t::version() {
String tp_version;
switch (chip_id) {
case CHIPID_CST716: tp_version = "CST716"; break;
case CHIPID_CST816S: tp_version = "CST816S"; break;
case CHIPID_CST816T: tp_version = "CST816T"; break;
case CHIPID_CST816D: tp_version = "CST816D"; break;
default:
tp_version = "? 0x" + String(chip_id, HEX);
break;
}
tp_version += " firmware " + String(firmware_version);
return tp_version;
}
String cst816t::state() {
String s;
switch (gesture_id) {
case GESTURE_NONE:
s = "NONE";
break;
case GESTURE_SWIPE_DOWN:
s = "SWIPE DOWN";
break;
case GESTURE_SWIPE_UP:
s = "SWIPE UP";
break;
case GESTURE_SWIPE_LEFT:
s = "SWIPE LEFT";
break;
case GESTURE_SWIPE_RIGHT:
s = "SWIPE RIGHT";
break;
case GESTURE_SINGLE_CLICK:
s = "SINGLE CLICK";
break;
case GESTURE_DOUBLE_CLICK:
s = "DOUBLE CLICK";
break;
case GESTURE_LONG_PRESS:
s = "LONG PRESS";
break;
default:
s = "UNKNOWN 0x";
s += String(gesture_id, HEX);
break;
}
s += '\t' + String(x) + '\t' + String(y);
return s;
}

56
lib/cst816t/src/cst816t.h Normal file
View File

@ -0,0 +1,56 @@
#ifndef _CST816T_H_
#define _CST816T_H_
#include <Arduino.h>
#include <Wire.h>
#include <stdint.h>
#define CHIPID_CST716 0x20
#define CHIPID_CST816S 0xB4
#define CHIPID_CST816T 0xB5
#define CHIPID_CST816D 0xB6
#define GESTURE_NONE 0x00
#define GESTURE_SWIPE_UP 0x01
#define GESTURE_SWIPE_DOWN 0x02
#define GESTURE_SWIPE_LEFT 0x03
#define GESTURE_SWIPE_RIGHT 0x04
#define GESTURE_SINGLE_CLICK 0x05
#define GESTURE_DOUBLE_CLICK 0x0B
#define GESTURE_LONG_PRESS 0x0C
enum touchpad_mode {
mode_touch,
mode_change,
mode_fast,
mode_motion
};
class cst816t {
public:
cst816t(TwoWire &_wire, int8_t _rst, int8_t _irq);
/*
mode_touch: interrupt every 10ms when a touch is detected
mode_change: interrupt when a touch change is detected
mode_fast: interrupt when a click or swipe is detected
mode_motion: interrupt when a click, swipe, double click, or long press is detected
*/
bool begin(touchpad_mode tp_mode = mode_change);
bool available();
String version();
String state();
uint8_t chip_id;
uint8_t firmware_version;
uint8_t gesture_id;
uint8_t finger_num;
uint16_t x;
uint16_t y;
private:
TwoWire& wire;
int8_t rst;
int8_t irq;
uint8_t i2c_read(uint16_t addr, uint8_t reg_addr, uint8_t *reg_data, uint32_t length);
uint8_t i2c_write(uint8_t addr, uint8_t reg_addr, const uint8_t *reg_data, uint32_t length);
};
#endif

View File

@ -75,7 +75,7 @@ build_flags =
-D HASP_VER_MAJ=0
-D HASP_VER_MIN=7
;-D HASP_VER_REV=4
-D HASP_VER_REV=0-rc13
-D HASP_VER_REV=0-rc15
;-D HASP_VER_REV=4-rc1
${override.build_flags}

View File

@ -82,6 +82,8 @@ extra_default_envs =
; yeacreate-nscreen32
; wz2432r028
; ws_esp32_s3_touch_lcd_4p3
; ttgo-t-display-s3_st7789_16MB
; ttgo-t-display-s3_st7789_touch_16MB
;endregion
;region -- Define your local COM ports for each environment ---

View File

@ -13,7 +13,7 @@
#include "hasplib.h"
#if defined(HASP_USE_CUSTOM) && false // <-- set this to true in your code
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0 && false // <-- set this to true in your code
#include "hasp_debug.h"

View File

@ -6,7 +6,7 @@
#include "hasplib.h"
#if defined(HASP_USE_CUSTOM) && false // <-- set this to true in your code
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0 && false // <-- set this to true in your code
#include "hasp_debug.h"

View File

@ -9,7 +9,7 @@
#define HASP_CUSTOM_H
#include "hasplib.h"
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
/* This function is called at boot */
void custom_setup();

View File

@ -451,6 +451,11 @@ long Esp32Device::get_uptime()
#elif defined(M5STACK) || defined(M5STACKLGFX)
#warning Building for M5Stack core2
#include "dev/esp32/m5stackcore2.h"
#elif defined(TWATCH)
#warning Building for TTGo T-Watch
#include "dev/esp32/twatch.h"
#else
dev::Esp32Device haspDevice;
#endif

View File

@ -86,6 +86,8 @@ class Esp32Device : public BaseDevice {
#elif defined(M5STACK) || defined (M5STACKLGFX)
// #warning Building for M5Stack core2
#include "m5stackcore2.h"
#elif defined(TWATCH)
#include "twatch.h"
#else
using dev::Esp32Device;
extern dev::Esp32Device haspDevice;

39
src/dev/esp32/twatch.cpp Normal file
View File

@ -0,0 +1,39 @@
#include "twatch.h"
#if defined(TWATCH)
#include "Wire.h"
#include "dev/esp32/esp32.h"
/*
* This covers the TWatch 2019 and 2020 PMIC. Only the init function is implemented
* because the TWatch 2020 v1 variant has not just the backlight connected to LDO2,
* but also the power for the display controller. This shouldn't get regulated down
* or be switched off (since the latter would require display being re-inited) so we
* don't let the user switch it off.
*
* This *could* get fixed, by detecting hardware type and changing behaviour, but
* this device isn't particularly common and OpenHASP probably isn't the proper tool
* for this hardware. It's nice to have some support though.
*/
namespace dev {
void TWatch::init(void) {
Wire.begin();
Wire.beginTransmission(53);
Wire.write(0x12);
Wire.write(0b00000110); // Enable LDO2, DC-DC3, disable others
Wire.endTransmission();
// Section set LDO2 to 3.3V
uint8_t ldo_ctrl = ~0;
Wire.beginTransmission(53);
Wire.write(0x28);
Wire.write(ldo_ctrl);
Wire.endTransmission();
}
}
dev::TWatch haspDevice;
#endif

20
src/dev/esp32/twatch.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef HASP_DEVICE_TWATCH
#define HASP_DEVICE_TWATCH
#if defined(TWATCH)
#include "esp32.h"
namespace dev {
class TWatch : public Esp32Device {
public:
void init() override;
};
}
using dev::TWatch;
extern dev::TWatch haspDevice;
#endif
#endif

View File

@ -113,6 +113,12 @@
#ifndef SPI_READ_FREQUENCY
#define SPI_READ_FREQUENCY 0
#endif
#ifndef TFT_OFFSET_X
#define TFT_OFFSET_X 0
#endif
#ifndef TFT_OFFSET_Y
#define TFT_OFFSET_Y 0
#endif
#ifndef TFT_OFFSET_ROTATION
#define TFT_OFFSET_ROTATION 0
#endif

View File

@ -25,7 +25,34 @@ void ArduinoGfx::init(int w, int h)
{
LOG_TRACE(TAG_TFT, F(D_SERVICE_STARTING));
#if(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(LILYGO_T_RGB)
#if(TFT_WIDTH == 170) && (TFT_HEIGHT == 320)
Arduino_DataBus* bus = new Arduino_ESP32PAR8(TFT_DC, TFT_CS, TFT_WR, TFT_RD, TFT_D0, TFT_D1, TFT_D2, TFT_D3, TFT_D4,
TFT_D5, TFT_D6, TFT_D7);
tft = new Arduino_ST7789(bus, TFT_RST /* RST */, TFT_ROTATION /* rotation */, true /* IPS */, TFT_WIDTH /* width */,
TFT_HEIGHT /* height */, 35 /* col offset 1 */, 0 /* row offset 1 */,
35 /* col offset 2 */, 0 /* row offset 2 */
);
tft->begin(SPI_FREQUENCY); // Used for SPI displays
#elif(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(LILYGO_T_PANEL)
Wire.begin(17, 18);
Arduino_DataBus* bus = new Arduino_XL9535SWSPI(17 /* SDA */, 18 /* SCL */, -1 /* XL PWD */, 17 /* XL CS */,
15 /* XL SCK */, 16 /* XL MOSI */, &Wire);
Arduino_ESP32RGBPanel* rgbpanel = new Arduino_ESP32RGBPanel(
-1 /* DE */, TFT_VSYNC /* VSYNC */, TFT_HSYNC /* HSYNC */, TFT_PCLK /* PCLK */, TFT_B0 /* B0 */,
TFT_B1 /* B1 */, TFT_B2 /* B2 */, TFT_B3 /* B3 */, TFT_B4 /* B4 */, TFT_G0 /* G0 */, TFT_G1 /* G1 */,
TFT_G2 /* G2 */, TFT_G3 /* G3 */, TFT_G4 /* G4 */, TFT_G5 /* G5 */, TFT_R0 /* R0 */, TFT_R1 /* R1 */,
TFT_R2 /* R2 */, TFT_R3 /* R3 */, TFT_R4 /* R4 */, 1 /* hsync_polarity */, 20 /* hsync_front_porch */,
2 /* hsync_pulse_width */, 0 /* hsync_back_porch */, 1 /* vsync_polarity */, 30 /* vsync_front_porch */,
8 /* vsync_pulse_width */, 1 /* vsync_back_porch */, 10 /* pclk_active_neg */, 6000000L /* prefer_speed */,
false /* useBigEndian */, 0 /* de_idle_high*/, 0 /* pclk_idle_high */);
tft = new Arduino_RGB_Display(TFT_WIDTH /* width */, TFT_HEIGHT /* height */, rgbpanel, 0 /* rotation */,
true /* auto_flush */, bus, -1 /* RST */, st7701_t_panel_init_operations,
sizeof(st7701_t_panel_init_operations));
tft->begin(GFX_NOT_DEFINED); // Used for RFB displays
#elif(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(LILYGO_T_RGB)
Wire.begin(8 /* SDA */, 48 /* SCL */, 800000L /* speed */);
Arduino_DataBus* bus = new Arduino_XL9535SWSPI(8 /* SDA */, 48 /* SCL */, 2 /* XL PWD */, 3 /* XL CS */,
5 /* XL SCK */, 4 /* XL MOSI */);
@ -35,8 +62,9 @@ void ArduinoGfx::init(int w, int h)
6 /* B1 */, 5 /* B2 */, 3 /* B3 */, 2 /* B4 */, 1 /* hsync_polarity */, 50 /* hsync_front_porch */,
1 /* hsync_pulse_width */, 30 /* hsync_back_porch */, 1 /* vsync_polarity */, 20 /* vsync_front_porch */,
1 /* vsync_pulse_width */, 30 /* vsync_back_porch */, 1 /* pclk_active_neg */);
tft = new Arduino_RGB_Display(w, h, rgbpanel, 0 /* rotation */, TFT_AUTO_FLUSH, bus, TFT_RST,
tft = new Arduino_RGB_Display(w, h, rgbpanel, 0 /* rotation */, TFT_AUTO_FLUSH, bus, TFT_RST,
st7701_type4_init_operations, sizeof(st7701_type4_init_operations));
tft->begin(GFX_NOT_DEFINED); // Used for RFB displays
#elif(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(SENSECAP_INDICATOR_D1)
Wire.begin(TOUCH_SDA, TOUCH_SCL, I2C_TOUCH_FREQUENCY);
@ -44,14 +72,16 @@ void ArduinoGfx::init(int w, int h)
pinMode(TFT_MOSI, OUTPUT);
pinMode(TFT_MISO, OUTPUT);
Arduino_DataBus* bus = new Arduino_PCA9535SWSPI(TOUCH_SDA, TOUCH_SCL, 5 /* XL PWD */, 4 /* XL CS */,
TFT_SCLK /* XL SCK */, TFT_MOSI /* XL MOSI */, &Wire);
TFT_SCLK /* XL SCK */, TFT_MOSI /* XL MOSI */, &Wire);
Arduino_ESP32RGBPanel* rgbpanel = new Arduino_ESP32RGBPanel(
TFT_DE, TFT_VSYNC, TFT_HSYNC, TFT_PCLK, TFT_R0, TFT_R1, TFT_R2, TFT_R3, TFT_R4, TFT_G0, TFT_G1, TFT_G2, TFT_G3,
TFT_G4, TFT_G5, TFT_B0, TFT_B1, TFT_B2, TFT_B3, TFT_B4, TFT_HSYNC_POLARITY, TFT_HSYNC_FRONT_PORCH,
TFT_HSYNC_PULSE_WIDTH, TFT_HSYNC_BACK_PORCH, TFT_VSYNC_POLARITY, TFT_VSYNC_FRONT_PORCH, TFT_VSYNC_PULSE_WIDTH,
TFT_VSYNC_BACK_PORCH);
tft = new Arduino_RGB_Display(w, h, rgbpanel, 0 /* rotation */, TFT_AUTO_FLUSH, bus, TFT_RST,
st7701_sensecap_indicator_init_operations, sizeof(st7701_sensecap_indicator_init_operations));
st7701_sensecap_indicator_init_operations,
sizeof(st7701_sensecap_indicator_init_operations));
tft->begin(GFX_NOT_DEFINED); // Used for RFB displays
#elif(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(GC9503V_DRIVER)
Arduino_DataBus* bus = new Arduino_SWSPI(TFT_DC, TFT_CS, TFT_SCLK, TFT_MOSI, TFT_MISO);
@ -62,6 +92,7 @@ void ArduinoGfx::init(int w, int h)
TFT_VSYNC_BACK_PORCH);
tft = new Arduino_RGB_Display(w, h, rgbpanel, 0 /* rotation */, TFT_AUTO_FLUSH, bus, TFT_RST,
gc9503v_type1_init_operations, sizeof(gc9503v_type1_init_operations));
tft->begin(GFX_NOT_DEFINED); // Used for RFB displays
#elif(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(ST7701_DRIVER) && defined(ST7701_4848S040)
Arduino_DataBus* bus = new Arduino_SWSPI(TFT_DC, TFT_CS, TFT_SCLK, TFT_MOSI, TFT_MISO);
@ -73,6 +104,8 @@ void ArduinoGfx::init(int w, int h)
tft = new Arduino_RGB_Display(w, h, rgbpanel, 0 /* rotation */, TFT_AUTO_FLUSH, bus, TFT_RST,
st7701_4848S040_init_operations, sizeof(st7701_4848S040_init_operations));
tft->begin(GFX_NOT_DEFINED); // Used for RFB displays
#elif(TFT_WIDTH == 480) && (TFT_HEIGHT == 480) && defined(ST7701_DRIVER)
/* More data bus class: https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class */
Arduino_DataBus* bus = new Arduino_SWSPI(TFT_DC, TFT_CS, TFT_SCLK, TFT_MOSI, TFT_MISO);
@ -85,10 +118,13 @@ void ArduinoGfx::init(int w, int h)
/* More display class: https://github.com/moononournation/Arduino_GFX/wiki/Display-Class */
tft = new Arduino_RGB_Display(w, h, rgbpanel, 0 /* rotation */, TFT_AUTO_FLUSH, bus, TFT_RST,
st7701_type1_init_operations, sizeof(st7701_type1_init_operations));
tft->begin(GFX_NOT_DEFINED); // Used for RFB displays
#elif(TFT_WIDTH == 480) && (TFT_HEIGHT == 272) && defined(NV3041A_DRIVER)
Arduino_DataBus* bus = new Arduino_ESP32QSPI(TFT_CS, TFT_SCK, TFT_D0, TFT_D1, TFT_D2, TFT_D3);
Arduino_GFX* g = new Arduino_NV3041A(bus, TFT_RST, TFT_ROTATION, TFT_IPS);
tft = g;
tft = new Arduino_NV3041A(bus, TFT_RST, TFT_ROTATION, TFT_IPS);
tft->begin(GFX_NOT_DEFINED); // Used for RFB displays
#elif 1
/* Reset is not implemented in the panel */
if(TFT_RST != GFX_NOT_DEFINED) {
@ -107,15 +143,11 @@ void ArduinoGfx::init(int w, int h)
TFT_HSYNC_PULSE_WIDTH, TFT_HSYNC_BACK_PORCH, TFT_VSYNC_POLARITY, TFT_VSYNC_FRONT_PORCH, TFT_VSYNC_PULSE_WIDTH,
TFT_VSYNC_BACK_PORCH, TFT_PCLK_ACTIVE_NEG, TFT_PREFER_SPEED);
Arduino_RGB_Display_Mod* gfx = new Arduino_RGB_Display_Mod(TFT_WIDTH, TFT_HEIGHT, bus);
tft = gfx;
tft = new Arduino_RGB_Display_Mod(TFT_WIDTH, TFT_HEIGHT, bus);
tft->begin(GFX_NOT_DEFINED); // Used for RFB displays
// fb = ((Arduino_RGBPanel_Mod*)tft)->getFramebuffer();
#endif
/* TFT init */
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
tft->begin(GFX_NOT_DEFINED);
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
// tft.setSwapBytes(true); /* set endianness */
LOG_INFO(TAG_TFT, F(D_SERVICE_STARTED));
}

View File

@ -95,9 +95,8 @@ static lgfx::Bus_Parallel8* init_parallel_8_bus(Preferences* prefs, int8_t data_
cfg.pin_wr = prefs->getInt("wr", TFT_WR);
cfg.pin_rs = prefs->getInt("rs", TFT_DC);
#ifndef CONFIG_IDF_TARGET_ESP32C3
cfg.freq_write = prefs->getUInt("write_freq", SPI_FREQUENCY);
#endif
cfg.freq_write = prefs->getUInt("write_freq", SPI_FREQUENCY);
#endif
#if !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C3)
uint8_t port = prefs->getUInt("i2s_port", 0);
@ -205,8 +204,8 @@ static void configure_panel(lgfx::Panel_Device* panel, Preferences* prefs)
cfg.memory_width = prefs->getUInt("memory_width", cfg.panel_width); // Maximum width supported by driver IC
cfg.memory_height = prefs->getUInt("memory_height", cfg.panel_height); // Maximum height supported by driver IC
cfg.offset_x = prefs->getUInt("offset_x", 0); // Amount of offset in the X direction of the panel
cfg.offset_y = prefs->getUInt("offset_y", 0); // Amount of offset in the Y direction of the panel
cfg.offset_x = prefs->getUInt("offset_x", TFT_OFFSET_X); // Amount of offset in the X direction of the panel
cfg.offset_y = prefs->getUInt("offset_y", TFT_OFFSET_Y); // Amount of offset in the Y direction of the panel
cfg.offset_rotation =
prefs->getUInt("offset_rotation", TFT_OFFSET_ROTATION); // Offset of the rotation 0 ~ 7 (4 ~ 7 is upside down)
@ -381,6 +380,32 @@ lgfx::ITouch* _init_touch(Preferences* preferences)
}
#endif
#if TOUCH_DRIVER == 0x0820
{ // タッチスクリーン制御の設定を行います。(必要なければ削除)
auto touch = new lgfx::Touch_FT5x06();
auto cfg = touch->config();
cfg.x_min = 0; // The minimum X value obtained from the touchscreen (raw value).
cfg.x_max = TFT_WIDTH - 1; // The maximum X value obtained from the touchscreen (raw value).
cfg.y_min = 0; // The minimum Y value obtained from the touchscreen (raw value).
cfg.y_max = TFT_HEIGHT - 1; // The maximum Y value obtained from the touchscreen (raw value).
cfg.bus_shared = true; // If using a common bus with the screen, set it to true.
cfg.offset_rotation = TOUCH_OFFSET_ROTATION; // Adjustment when the display orientation does not match the touch orientation. Set in values from 0 to 7.
// I2C接続の場合
cfg.i2c_port = I2C_TOUCH_PORT; // 使用するI2Cを選択 (0 or 1)
cfg.i2c_addr = I2C_TOUCH_ADDRESS; // I2Cデバイスアドレス番号
cfg.pin_sda = TOUCH_SDA; // SDAが接続されているピン番号
cfg.pin_scl = TOUCH_SCL; // SCLが接続されているピン番号
cfg.pin_int = TOUCH_IRQ; // INTが接続されているピン番号
cfg.freq = I2C_TOUCH_FREQUENCY; // I2Cクロックを設定
touch->config(cfg);
return touch;
}
#endif
#if TOUCH_DRIVER == 0x6336
{
auto touch = new lgfx::Touch_FT5x06();
@ -717,7 +742,7 @@ void LovyanGfx::init(int w, int h)
cfg.dummy_read_bits = 1;
cfg.readable = true;
cfg.invert = INVERT_COLORS;
cfg.rgb_order = false;
cfg.rgb_order = (TFT_RGB_ORDER != 0); // true if the red and blue of the panel are swapped
cfg.dlen_16bit = false;
cfg.bus_shared = false;
_panel_instance->config(cfg);
@ -805,6 +830,73 @@ void LovyanGfx::init(int w, int h)
cfg.pin_mosi = TOUCH_MOSI;
cfg.pin_miso = TOUCH_MISO;
cfg.pin_cs = TOUCH_CS;
_touch_instance->config(cfg);
_panel_instance->setTouch(_touch_instance);
}
#elif defined(ESP32_2432S022C)
//pinMode(PWR_EN, OUTPUT);
//digitalWrite(PWR_EN, HIGH);
auto _panel_instance = new lgfx::Panel_ST7789();
auto _bus_instance = new lgfx::Bus_Parallel8();
auto _touch_instance = new lgfx::Touch_CST816S();
{
auto cfg = _bus_instance->config();
cfg.freq_write = 16000000;
cfg.pin_wr = TFT_WR;
cfg.pin_rd = TFT_RD;
cfg.pin_rs = TFT_DC; // D/C
cfg.pin_d0 = TFT_D0;
cfg.pin_d1 = TFT_D1;
cfg.pin_d2 = TFT_D2;
cfg.pin_d3 = TFT_D3;
cfg.pin_d4 = TFT_D4;
cfg.pin_d5 = TFT_D5;
cfg.pin_d6 = TFT_D6;
cfg.pin_d7 = TFT_D7;
_bus_instance->config(cfg);
_panel_instance->setBus(_bus_instance);
}
{
auto cfg = _panel_instance->config();
cfg.pin_cs = TFT_CS;
cfg.pin_rst = TFT_RST;
cfg.pin_busy = TFT_BUSY;
cfg.memory_width = TFT_WIDTH;
cfg.memory_height = TFT_HEIGHT;
cfg.panel_width = TFT_WIDTH;
cfg.panel_height = TFT_HEIGHT;
cfg.offset_x = 0;
cfg.offset_y = 0;
cfg.offset_rotation = TFT_ROTATION;
cfg.dummy_read_pixel = 8;
cfg.dummy_read_bits = 1;
cfg.readable = true;
cfg.invert = false;
cfg.rgb_order = false;
cfg.dlen_16bit = false;
cfg.bus_shared = false;
_panel_instance->config(cfg);
}
{
auto cfg = _touch_instance->config();
cfg.x_min = 0;
cfg.x_max = TFT_WIDTH;
cfg.y_min = 0;
cfg.y_max = TFT_HEIGHT;
cfg.pin_int = TOUCH_IRQ;
cfg.bus_shared = true;
cfg.offset_rotation = 0;
cfg.i2c_port = I2C_TOUCH_PORT;
cfg.i2c_addr = I2C_TOUCH_ADDRESS;
cfg.pin_sda = TOUCH_SDA;
cfg.pin_scl = TOUCH_SCL;
cfg.freq = I2C_TOUCH_FREQUENCY;
_touch_instance->config(cfg);
_panel_instance->setTouch(_touch_instance);
}

View File

@ -1,107 +1,113 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_BASE_TOUCH_DRIVER_H
#define HASP_BASE_TOUCH_DRIVER_H
#ifdef ARDUINO
#include <Arduino.h>
#endif
#include "hasplib.h"
#include "lvgl.h"
namespace dev {
class BaseTouch {
public:
void init(int w, int h)
{}
// void loop()
// {}
void show_info()
{}
void set_rotation(uint8_t rotation)
{}
void set_invert(bool invert_display)
{}
IRAM_ATTR bool read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
{
data->state = LV_INDEV_STATE_REL;
return false;
}
void calibrate(uint16_t* calData)
{}
void set_calibration(uint16_t* calData)
{}
bool is_driver_pin(uint8_t)
{
return false;
}
const char* get_touch_model()
{
return "";
}
};
} // namespace dev
#ifndef TOUCH_DRIVER
#define TOUCH_DRIVER -1 // No Touch
#endif
#if TOUCH_DRIVER == 0x2046 && defined(USER_SETUP_LOADED)
#warning Building for TFT_eSPI XPT2046
//#include "touch_driver_xpt2046.h"
#include "touch_driver_tftespi.h"
#elif TOUCH_DRIVER == 0x2046 && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX XPT2046
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x0911 && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX GT911
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x6336 && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX FT6336
#include "touch_driver_lovyangfx.h"
#elif defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x5206
#warning Building for FT5206
#include "touch_driver_ft5206.h"
#elif TOUCH_DRIVER == 0x6336
#warning Building for FT6336
#include "touch_driver_ft6336u.h"
#elif TOUCH_DRIVER == 0x0610
#warning Building for STMPE610
#include "touch_driver_stmpe610.h"
#elif TOUCH_DRIVER == 0x0911
#warning Building for GT911
#include "touch_driver_gt911.h"
#elif TOUCH_DRIVER == 0x0ADC
#warning Building for analog touch
#include "touch_driver_analog.h"
#elif TOUCH_DRIVER == 0x1680
#warning Building for GSL1680
#include "touch_driver_gslx680.h"
#elif TOUCH_DRIVER == 0x2007
#warning Building for TSC2007
#include "touch_driver_tsc2007.h"
#elif defined(LGFX_USE_V1)
#warning Building for LovyanGfx Touch
#include "touch_driver_lovyangfx.h"
#else
#warning Building for Generic Touch
using dev::BaseTouch;
extern dev::BaseTouch haspTouch;
// IRAM_ATTR bool touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
// {
// data->state = LV_INDEV_STATE_REL;
// return false;
// }
#endif
#endif
// #elif TOUCH_DRIVER == 0x2046B
// touched = XPT2046_getXY(&normal_x, &normal_y, true);
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_BASE_TOUCH_DRIVER_H
#define HASP_BASE_TOUCH_DRIVER_H
#ifdef ARDUINO
#include <Arduino.h>
#endif
#include "hasplib.h"
#include "lvgl.h"
namespace dev {
class BaseTouch {
public:
void init(int w, int h)
{}
// void loop()
// {}
void show_info()
{}
void set_rotation(uint8_t rotation)
{}
void set_invert(bool invert_display)
{}
IRAM_ATTR bool read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
{
data->state = LV_INDEV_STATE_REL;
return false;
}
void calibrate(uint16_t* calData)
{}
void set_calibration(uint16_t* calData)
{}
bool is_driver_pin(uint8_t)
{
return false;
}
const char* get_touch_model()
{
return "";
}
};
} // namespace dev
#ifndef TOUCH_DRIVER
#define TOUCH_DRIVER -1 // No Touch
#endif
#if TOUCH_DRIVER == 0x2046 && defined(USER_SETUP_LOADED)
#warning Building for TFT_eSPI XPT2046
//#include "touch_driver_xpt2046.h"
#include "touch_driver_tftespi.h"
#elif TOUCH_DRIVER == 0x2046 && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX XPT2046
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x0911 && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX GT911
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x6336 && defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX FT6336
#include "touch_driver_lovyangfx.h"
#elif defined(LGFX_USE_V1) && defined(HASP_USE_LGFX_TOUCH)
#warning Building for LovyanGFX
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x5206
#warning Building for FT5206
#include "touch_driver_ft5206.h"
#elif TOUCH_DRIVER == 0x6336
#warning Building for FT6336
#include "touch_driver_ft6336u.h"
#elif TOUCH_DRIVER == 0x0610
#warning Building for STMPE610
#include "touch_driver_stmpe610.h"
#elif TOUCH_DRIVER == 0x0911
#warning Building for GT911
#include "touch_driver_gt911.h"
#elif TOUCH_DRIVER == 0x0ADC
#warning Building for analog touch
#include "touch_driver_analog.h"
#elif TOUCH_DRIVER == 0x1680
#warning Building for GSL1680
#include "touch_driver_gslx680.h"
#elif TOUCH_DRIVER == 0x2007
#warning Building for TSC2007
#include "touch_driver_tsc2007.h"
#elif defined(LGFX_USE_V1)
#warning Building for LovyanGfx Touch
#include "touch_driver_lovyangfx.h"
#elif TOUCH_DRIVER == 0x3240
#warning Building for CST3240
#include "touch_driver_cst3240.h"
#elif TOUCH_DRIVER == 0x816
#warning Building for CST816S
#include "touch_driver_cst816.h"
#else
#warning Building for Generic Touch
using dev::BaseTouch;
extern dev::BaseTouch haspTouch;
// IRAM_ATTR bool touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
// {
// data->state = LV_INDEV_STATE_REL;
// return false;
// }
#endif
#endif
// #elif TOUCH_DRIVER == 0x2046B
// touched = XPT2046_getXY(&normal_x, &normal_y, true);

View File

@ -0,0 +1,72 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#if defined(ARDUINO) && (TOUCH_DRIVER == 0x3240) && !defined(HASP_USE_LGFX_TOUCH)
#include <Arduino.h>
#include "ArduinoLog.h"
#include "hasp_conf.h"
#include "touch_driver_cst3240.h"
#include <Wire.h>
#include "TouchLib.h"
#include "touch_driver.h" // base class
#include "touch_helper.h" // i2c scanner
#include "../../hasp/hasp.h" // for hasp_sleep_state
extern uint8_t hasp_sleep_state;
TouchLib touch(Wire, TOUCH_SDA, TOUCH_SCL, I2C_TOUCH_ADDRESS);
namespace dev {
IRAM_ATTR bool TouchCst3240::read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
{
touch.read();
TP_Point t = touch.getPoint(0);
if((touch.getPointNum() == 1) && (t.pressure > 0) && (t.state != 0)) {
if(hasp_sleep_state != HASP_SLEEP_OFF) hasp_update_sleep_state(); // update Idle
#ifdef TOUCH_WIDTH
data->point.x = map(t.x, 0, TOUCH_WIDTH - 1, 0, TFT_WIDTH - 1);
#else
data->point.x = t.x;
#endif
#ifdef TOUCH_HEIGHT
data->point.y = map(t.y, 0, TOUCH_HEIGHT - 1, 0, TFT_HEIGHT - 1);
#else
data->point.y = t.y;
#endif
data->state = LV_INDEV_STATE_PR;
hasp_set_sleep_offset(0); // Reset the offset
} else {
data->state = LV_INDEV_STATE_REL;
}
/*Return `false` because we are not buffering and no more data to read*/
return false;
}
void TouchCst3240::init(int w, int h)
{
Wire.begin(TOUCH_SDA, TOUCH_SCL, (uint32_t)I2C_TOUCH_FREQUENCY);
if(touch.init() == true) {
LOG_INFO(TAG_DRVR, "CST3240 %s (480x480)", D_SERVICE_STARTED);
} else {
LOG_WARNING(TAG_DRVR, "CST3240 %s", D_SERVICE_START_FAILED);
}
Wire.begin(TOUCH_SDA, TOUCH_SCL, (uint32_t)I2C_TOUCH_FREQUENCY);
touch_scan(Wire); // The address could change during begin, so scan afterwards
}
} // namespace dev
dev::TouchCst3240 haspTouch;
#endif // ARDUINO

View File

@ -0,0 +1,26 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_CST3240_TOUCH_DRIVER_H
#define HASP_CST3240_TOUCH_DRIVER_H
#ifdef ARDUINO
#include "lvgl.h"
#include "touch_driver.h"
namespace dev {
class TouchCst3240 : public BaseTouch {
public:
IRAM_ATTR bool read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data);
void init(int w, int h);
};
} // namespace dev
using dev::TouchCst3240;
extern dev::TouchCst3240 haspTouch;
#endif // ARDUINO
#endif // HASP_CST3240_TOUCH_DRIVER_H

View File

@ -0,0 +1,70 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#if defined(ARDUINO) && (TOUCH_DRIVER == 0x816)
#include <Arduino.h>
#include "ArduinoLog.h"
#include "hasp_conf.h"
#include "touch_driver_cst816.h"
#include <Wire.h>
#include "cst816t.h"
#include "touch_driver.h" // base class
#include "touch_helper.h" // i2c scanner
#include "../../hasp/hasp.h" // for hasp_sleep_state
extern uint8_t hasp_sleep_state;
cst816t touchpad(Wire, TOUCH_RST, TOUCH_IRQ);
namespace dev {
IRAM_ATTR bool TouchCst816::read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
{
if(touchpad.available()) {
if(hasp_sleep_state != HASP_SLEEP_OFF) hasp_update_sleep_state(); // update Idle
//LOG_INFO(TAG_DRVR, "CST816 touched x:%d, y:%d", touchpad.x, touchpad.y);
#ifdef TOUCH_WIDTH
data->point.x = map(touchpad.x, 0, TOUCH_WIDTH - 1, 0, TFT_WIDTH - 1);
#else
data->point.x = touchpad.x;
#endif
#ifdef TOUCH_HEIGHT
data->point.y = map(touchpad.y, 0, TOUCH_HEIGHT - 1, 0, TFT_HEIGHT - 1);
#else
data->point.y = touchpad.y;
#endif
data->state = LV_INDEV_STATE_PR;
hasp_set_sleep_offset(0); // Reset the offset
} else {
data->state = LV_INDEV_STATE_REL;
}
/*Return `false` because we are not buffering and no more data to read*/
return false;
}
void TouchCst816::init(int w, int h)
{
Wire.begin(TOUCH_SDA, TOUCH_SCL, (uint32_t)I2C_TOUCH_FREQUENCY);
if(touchpad.begin(mode_touch) == true) {
LOG_INFO(TAG_DRVR, "CST816 %s (170X320)", D_SERVICE_STARTED);
} else {
LOG_WARNING(TAG_DRVR, "CST816 %s", D_SERVICE_START_FAILED);
}
Wire.begin(TOUCH_SDA, TOUCH_SCL, (uint32_t)I2C_TOUCH_FREQUENCY);
touch_scan(Wire); // The address could change during begin, so scan afterwards
}
} // namespace dev
dev::TouchCst816 haspTouch;
#endif // ARDUINO

View File

@ -0,0 +1,27 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_CST816_TOUCH_DRIVER_H
#define HASP_CST816_TOUCH_DRIVER_H
#ifdef ARDUINO
#include "lvgl.h"
#include "touch_driver.h"
namespace dev {
class TouchCst816 : public BaseTouch {
public:
IRAM_ATTR bool read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data);
void init(int w, int h);
};
} // namespace dev
using dev::TouchCst816;
extern dev::TouchCst816 haspTouch;
#endif // ARDUINO
#endif // HASP_CST816_TOUCH_DRIVER_H

View File

@ -29,8 +29,7 @@ bool touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data)
data->state = LV_INDEV_STATE_REL;
// while touched, but the state is released => read next point
while(data->state == LV_INDEV_STATE_REL && stmpe610_touchpanel.touched()) {
while(data->state == LV_INDEV_STATE_REL && !stmpe610_touchpanel.bufferEmpty()) {
TS_Point point = stmpe610_touchpanel.getPoint();
Log.trace(TAG_DRVR, F("STMPE610: x=%i y=%i z=%i"), point.x, point.y, point.z);

View File

@ -111,7 +111,8 @@ lv_font_t* hasp_get_font(uint8_t fontid)
*/
HASP_ATTRIBUTE_FAST_MEM void hasp_update_sleep_state()
{
if(hasp_first_touch_state) return; // don't update sleep when first touch is still active
// Don't fast exit, see issue #839
// if(hasp_first_touch_state) return; // don't update sleep when first touch is still active
uint32_t idle = lv_disp_get_inactive_time(lv_disp_get_default()) / 1000;
idle += sleepTimeOffset; // To force a specific state

View File

@ -1751,6 +1751,7 @@ static hasp_attribute_type_t attribute_common_text(lv_obj_t* obj, uint16_t attr_
{LV_HASP_LABEL, ATTR_TEXT, my_label_set_text, my_label_get_text},
{LV_HASP_LABEL, ATTR_TEMPLATE, my_obj_set_template, my_obj_get_template},
{LV_HASP_CHECKBOX, ATTR_TEXT, lv_checkbox_set_text, lv_checkbox_get_text},
{LV_HASP_DROPDOWN, ATTR_TEXT, my_dropdown_set_text, my_dropdown_get_text},
{LV_HASP_TABVIEW, ATTR_TEXT, my_tabview_set_text, my_tabview_get_text},
{LV_HASP_TEXTAREA, ATTR_TEXT, lv_textarea_set_text, lv_textarea_get_text},
{LV_HASP_TAB, ATTR_TEXT, my_tab_set_text, my_tab_get_text},

View File

@ -472,6 +472,31 @@ lv_obj_t* FindButtonLabel(lv_obj_t* btn)
return NULL;
}
// OK - lvgl does not return a const char *
static const char* my_dropdown_get_text(const lv_obj_t* dd)
{
const char* str_p = lv_dropdown_get_text((lv_obj_t*)dd);
return str_p ? str_p : "";
}
// OK - lvgl does not return a const char *
static void my_dropdown_set_text(lv_obj_t* dd, const char* text)
{
size_t len = 0;
if(text) len = strlen(text) + 1;
// release previous text
char* str_p = (char*)lv_dropdown_get_text(dd);
if(str_p) lv_mem_free(str_p);
// reserve and copy new text
str_p = (char*)lv_mem_alloc(len);
if(str_p != NULL) strncpy(str_p, text, len);
lv_dropdown_set_text((lv_obj_t*)dd, str_p); // library does not return const
lv_obj_invalidate(dd); // Needed if old ptr is equal to new ptr
}
// OK - lvgl does not return a const char *
static const char* my_label_get_text(const lv_obj_t* label)
{

View File

@ -452,7 +452,7 @@ void dispatch_topic_payload(const char* topic, const char* payload, bool update,
}
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
if(topic == strstr_P(topic, PSTR(MQTT_TOPIC_CUSTOM "/"))) { // startsWith custom
topic += 7u;
custom_topic_payload(topic, (char*)payload, source);
@ -1295,7 +1295,7 @@ void dispatch_send_sensordata(const char*, const char*, uint8_t source)
haspDevice.get_sensors(doc);
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_get_sensors(doc);
#endif

View File

@ -99,6 +99,10 @@ void delete_event_handler(lv_obj_t* obj, lv_event_t event)
my_obj_del_task(obj);
break;
case LV_HASP_DROPDOWN:
lv_mem_free(lv_dropdown_get_text(obj));
break;
default:
break;
}
@ -302,8 +306,8 @@ static void event_object_selection_changed(lv_obj_t* obj, uint8_t eventid, int16
char eventname[8];
Parser::get_event_name(eventid, eventname, sizeof(eventname));
if(const char* tag = my_obj_get_tag(obj))
snprintf_P(data, sizeof(data), PSTR("{\"event\":\"%s\",\"val\":%d,\"text\":%s,\"tag\":%s}"), eventname,
val, serialized_text, tag);
snprintf_P(data, sizeof(data), PSTR("{\"event\":\"%s\",\"val\":%d,\"text\":%s,\"tag\":%s}"), eventname, val,
serialized_text, tag);
else
snprintf_P(data, sizeof(data), PSTR("{\"event\":\"%s\",\"val\":%d,\"text\":%s}"), eventname, val,
serialized_text);

View File

@ -640,6 +640,7 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id)
case HASP_OBJ_DROPDOWN:
obj = lv_dropdown_create(parent_obj, NULL);
if(obj) {
lv_dropdown_set_text(obj, NULL); // Clear default text
lv_dropdown_set_draw_arrow(obj, true);
// lv_dropdown_set_anim_time(obj, 200);
lv_obj_set_top(obj, true);

View File

@ -32,7 +32,7 @@ void task_every_second_cb(lv_task_t* task)
telnetEverySecond();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_every_second();
#endif
// debugEverySecond();
@ -53,7 +53,7 @@ void task_every_second_cb(lv_task_t* task)
break;
case 3:
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_every_5seconds();
#endif
break;

View File

@ -70,6 +70,6 @@
#endif
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
#include "custom/my_custom.h"
#endif

242
src/lang/ru_RU.h Normal file
View File

@ -0,0 +1,242 @@
// This translation file is maintained on https://crowdin.com/project/openhasp/
// Do not edit directly!
#ifndef HASP_LANG_RU_RU_H
#define HASP_LANG_RU_RU_H
#define D_ISO_LANG_CODE "ru-RU"
#define D_USERNAME "Имя пользователя:"
#define D_PASSWORD "Пароль:"
#define D_SSID "Ssid:"
#define D_YES "Да"
#define D_NO "Нет"
#define D_ERROR_OUT_OF_MEMORY "Не хватает памяти"
#define D_ERROR_UNKNOWN "Неизвестная ошибка"
#define D_CONFIG_NOT_CHANGED "Настройки не изменены"
#define D_CONFIG_CHANGED "Настройки изменены"
#define D_CONFIG_LOADED "Настройки загружены"
#define D_FILE_LOADING "Загружается %s"
#define D_FILE_LOADED "Загружено %s"
#define D_FILE_LOAD_FAILED "Ошибка загрузки %s"
#define D_FILE_SAVING "Сохранение %s"
#define D_FILE_SAVED "Сохранено %s"
#define D_FILE_SAVE_FAILED "Ошибка сохранения %s"
#define D_FILE_NOT_FOUND "Файл не найден"
#define D_FILE_SIZE_BYTES "байт"
#define D_FILE_SIZE_KILOBYTES "KiB"
#define D_FILE_SIZE_MEGABYTES "MiB"
#define D_FILE_SIZE_GIGABYTES "GiB"
#define D_FILE_SIZE_TERABYTES "TiB"
#define D_FILE_SIZE_DIVIDER 1024 // kibi or kilo bytes
#define D_DECIMAL_POINT "." // decimal comma or point
#define D_SERVICE_STARTING "Запуск..."
#define D_SERVICE_STARTED "Запущено"
#define D_SERVICE_START_FAILED "Ошибка запуска"
#define D_SERVICE_STOPPED "Остановлено"
#define D_SERVICE_DISABLED "Отключено"
#define D_SERVICE_CONNECTED "Подключен"
#define D_SERVICE_DISCONNECTED "Отключен"
#define D_SETTING_ENABLED "Включено"
#define D_SETTING_DISABLED "Выключено"
#define D_SETTING_DEFAULT "По умолчанию"
#define D_NETWORK_IP_ADDRESS_RECEIVED "Получен IP адрес %s"
#define D_NETWORK_ONLINE "онлайн"
#define D_NETWORK_OFFLINE "оффлайн"
#define D_NETWORK_CONNECTION_FAILED "Ошибка подключения"
#define D_NETWORK_CONNECTION_UNAUTHORIZED "Ошибка авторизации"
#define D_MQTT_DEFAULT_NAME "plate_%s"
#define D_MQTT_CONNECTING "Подключение..."
#define D_MQTT_CONNECTED "Подключен к брокеру %s с clientID %s"
#define D_MQTT_NOT_CONNECTED "Не подключен ???"
#define D_MQTT_DISCONNECTING "Отключение..."
#define D_MQTT_DISCONNECTED "Отключен"
#define D_MQTT_RECONNECTING "Отключен от брокера, переподключение..."
#define D_MQTT_NOT_CONFIGURED "Брокер не настроен"
#define D_MQTT_STARTED "Запущен: %d байт"
#define D_MQTT_FAILED "Не удалось:"
#define D_MQTT_INVALID_TOPIC "Сообщение имеет недопустимую тему"
#define D_MQTT_SUBSCRIBED "Подписан на %s"
#define D_MQTT_NOT_SUBSCRIBED "Не удалось подписаться на %s"
#define D_MQTT_HA_AUTO_DISCOVERY "Зарегистрирован в HA auto-discovery"
#define D_MQTT_PAYLOAD_TOO_LONG "Пейлоад слишком длинный(%u байт)"
#define D_TELNET_CLOSING_CONNECTION "Закрытие сессии от %s"
#define D_TELNET_CLIENT_LOGIN_FROM "Клиент авторизовался от %s"
#define D_TELNET_CLIENT_CONNECT_FROM "Клиент подключился от %s"
#define D_TELNET_CLIENT_NOT_CONNECTED "Клиент НЕ подключен"
#define D_TELNET_INCORRECT_LOGIN_ATTEMPT "Неверная попытка входа в систему %s"
#define D_TELNET_STARTED "Telnet консоль запущена"
#define D_TELNET_FAILED "Ошибка запуска telnet консоли"
#define D_TELNET_CLIENT_CONNECTED "Клиент подключен"
#define D_TELNET_CLIENT_REJECTED "Клиент отклонен"
#define D_HASP_INVALID_PAGE "Неверная страница %u"
#define D_HASP_INVALID_LAYER "Невозможно очистить системный уровень"
#define D_HASP_CHANGE_PAGE "Изменение страницы на %u"
#define D_HASP_CLEAR_PAGE "Очистка страницы %u"
#define D_OBJECT_DELETED "Объект удален"
#define D_OBJECT_UNKNOWN "Неизвестный объект"
#define D_OBJECT_MISMATCH "Объекты НЕ совпадают!"
#define D_OBJECT_LOST "Потерянный объект!"
#define D_OBJECT_CREATE_FAILED "Ошибка создания объета с id %u"
#define D_OBJECT_PAGE_UNKNOWN "Страница с ID %u не определена"
#define D_OBJECT_EVENT_UNKNOWN "Неизвестное событие %d"
#define D_ATTRIBUTE_UNKNOWN "Неизвестное свойство %s"
// D_ATTRIBUTE_OBSOLETE D_ATTRIBUTE_INSTEAD can be used together or just D_ATTRIBUTE_OBSOLETE alone
#define D_ATTRIBUTE_OBSOLETE "%s это устарело"
#define D_ATTRIBUTE_INSTEAD ", используйте %s вместо него"
#define D_ATTRIBUTE_READ_ONLY "%s только для чтения"
#define D_ATTRIBUTE_PAGE_METHOD_INVALID "Невозможно вызвать %s на странице"
#define D_ATTRIBUTE_ALIGN_INVALID "Недопустимое свойство выравнивания: %s"
#define D_ATTRIBUTE_COLOR_INVALID "Недопустимое свойство цвета: %s"
#define D_ATTRIBUTE_LONG_MODE_INVALID "Недопустимый режим длины: %s"
#define D_OOBE_SSID_VALIDATED "SSID %s подтвержден"
#define D_OOBE_AUTO_CALIBRATE "Автокалибровка включена"
#define D_OOBE_CALIBRATED "Уже откалиброван"
#define D_DISPATCH_COMMAND_NOT_FOUND "Команда '%s' не найдена"
#define D_DISPATCH_INVALID_PAGE "Неверная страница %s"
#define D_DISPATCH_REBOOT "Перезагружаем устройство!"
#define D_JSON_FAILED "Парсинг JSON не удался:"
#define D_JSONL_FAILED "JSONL ошибка парсинга на строке %u"
#define D_JSONL_SUCCEEDED "Jsonl полностью прочтен"
#define D_OTA_CHECK_UPDATE "Проверяем URL с обновлением: %s"
#define D_OTA_CHECK_COMPLETE "Проверка обновлений завершена"
#define D_OTA_CHECK_FAILED "Ошибка проверки обновлений: %s"
#define D_OTA_UPDATE_FIRMWARE "OTA обновление прошивки"
#define D_OTA_UPDATE_COMPLETE "OTA обновление завершено"
#define D_OTA_UPDATE_APPLY "Установка прошивки и перезагрузка"
#define D_OTA_UPDATE_FAILED "Ошибка OTA обновления"
#define D_OTA_UPDATING_FIRMWARE "Обновление прошивка..."
#define D_OTA_UPDATING_FILESYSTEM "Обновление файловой системы..."
#define D_HTTP_HASP_DESIGN "HASP оформление"
#define D_HTTP_INFORMATION "Информация"
#define D_HTTP_HTTP_SETTINGS "Настройки HTTP"
#define D_HTTP_FTP_SETTINGS "Настройки FTP"
#define D_HTTP_WIFI_SETTINGS "Настройки Wifi"
#define D_HTTP_WIREGUARD_SETTINGS "Настройки WireGuard"
#define D_HTTP_MQTT_SETTINGS "Настройки MQTT"
#define D_HTTP_GPIO_SETTINGS "Настройки GPIO"
#define D_HTTP_MDNS_SETTINGS "Настройки mDNS"
#define D_HTTP_TELNET_SETTINGS "Настройки Telnet"
#define D_HTTP_DEBUG_SETTINGS "Настройки отладки"
#define D_HTTP_GUI_SETTINGS "Настройки дисплея"
#define D_HTTP_SAVE_SETTINGS "Сохранить настройки"
#define D_HTTP_UPLOAD_FILE "Загрузить файл"
#define D_HTTP_ERASE_DEVICE "Сброс всех настроек"
#define D_HTTP_ADD_GPIO "Добавить новый пин"
#define D_HTTP_BACK "Назад"
#define D_HTTP_REFRESH "Обновить"
#define D_HTTP_PREV_PAGE "Предыдущая страница"
#define D_HTTP_NEXT_PAGE "Следующая страница"
#define D_HTTP_CALIBRATE "Калибровка"
#define D_HTTP_ANTIBURN "Запуск Anti Burn-in"
#define D_HTTP_SCREENSHOT "Скриншот"
#define D_HTTP_FILE_BROWSER "Файловый редактор"
#define D_HTTP_FIRMWARE_UPGRADE "Обновление прошивки"
#define D_HTTP_UPDATE_FIRMWARE "Обновление прошивки"
#define D_HTTP_FACTORY_RESET "Сброс на заводские настройки"
#define D_HTTP_MAIN_MENU "Главное меню"
#define D_HTTP_REBOOT "Перезапуск"
#define D_HTTP_CONFIGURATION "Конфигурацияя"
#define D_HTTP_CONFIG_CHANGED \
"Конфигурация изменена, пожалуйста кликните на <a href='/reboot'>Перезагрузка</a> для сохранения изменений в память устройства."
#define D_HTTP_SENDING_PAGE "Отправлена %S страница на %s"
#define D_HTTP_FOOTER "by Francis Van Roie"
#define D_INFO_VERSION "Version"
#define D_INFO_BUILD_DATETIME "Build DateTime"
#define D_INFO_ENVIRONMENT "Environment"
#define D_INFO_UPTIME "Uptime"
#define D_INFO_FREE_HEAP "Free Heap"
#define D_INFO_FREE_BLOCK "Free Block"
#define D_INFO_DEVICE_MEMORY "Device Memory"
#define D_INFO_LVGL_MEMORY "LVGL Memory"
#define D_INFO_TOTAL_MEMORY "Total"
#define D_INFO_FREE_MEMORY "Free"
#define D_INFO_FRAGMENTATION "Fragmentation"
#define D_INFO_PSRAM_FREE "PSRam Free"
#define D_INFO_PSRAM_SIZE "PSRam Size"
#define D_INFO_FLASH_SIZE "Flash Size"
#define D_INFO_SKETCH_USED "Program Size Used"
#define D_INFO_SKETCH_FREE "Program Size Free"
#define D_INFO_FS_SIZE "Filesystem Size"
#define D_INFO_FS_USED "Filesystem Used"
#define D_INFO_FS_FREE "Filesystem Free"
#define D_INFO_MODULE "Module"
#define D_INFO_MODEL "Model"
#define D_INFO_FREQUENCY "Frequency"
#define D_INFO_CORE_VERSION "Core Version"
#define D_INFO_RESET_REASON "Reset Reason"
#define D_INFO_STATUS "Status"
#define D_INFO_SERVER "Server"
#define D_INFO_USERNAME "Username"
#define D_INFO_CLIENTID "Client ID"
// #define D_INFO_CONNECTED "Connected"
// #define D_INFO_DISCONNECTED "Disconnected"
#define D_INFO_RECEIVED "Received"
#define D_INFO_PUBLISHED "Published"
#define D_INFO_FAILED "Failed"
#define D_INFO_ETHERNET "Ethernet"
#define D_INFO_WIFI "Wifi"
#define D_INFO_WIREGUARD "WireGuard"
#define D_INFO_LINK_SPEED "Link Speed"
#define D_INFO_FULL_DUPLEX "Full Duplex"
#define D_INFO_BSSID "BSSID"
#define D_INFO_SSID "SSID"
#define D_INFO_RSSI "Signal Strength"
#define D_INFO_IP_ADDRESS "IP Address"
#define D_INFO_MAC_ADDRESS "MAC Address"
#define D_INFO_GATEWAY "Gateway"
#define D_INFO_DNS_SERVER "DNS Server"
#define D_INFO_ENDPOINT_IP "Endpoint IP"
#define D_INFO_ENDPOINT_PORT "Endpoint Port"
#define D_OOBE_MSG "Тапните по акрану для настройки WiFi или подключитесь к этой Точке Доступа:"
#define D_OOBE_SCAN_TO_CONNECT "Сканируте для подключения"
#define D_WIFI_CONNECTING_TO "Подключение к %s"
#define D_WIFI_CONNECTED_TO "Подключено к %s, запрашиваем IP..."
#define D_WIFI_RSSI_EXCELLENT "Отлично"
#define D_WIFI_RSSI_GOOD "Хорошо"
#define D_WIFI_RSSI_FAIR "Нормально"
#define D_WIFI_RSSI_WEAK "Слабо"
#define D_WIFI_RSSI_BAD "Очень плохо"
#define D_WG_INITIALIZED "Инициализирован"
#define D_WG_BAD_CONFIG "Отсутствует или неверная конфигурация"
#define D_GPIO_SWITCH "Switch"
#define D_GPIO_BUTTON "Push Button"
#define D_GPIO_TOUCH "Capacitive Touch"
#define D_GPIO_LED "Led"
#define D_GPIO_LED_R "Mood Red"
#define D_GPIO_LED_G "Mood Green"
#define D_GPIO_LED_B "Mood Blue"
#define D_GPIO_POWER_RELAY "Power Relay"
#define D_GPIO_LIGHT_RELAY "Light Relay"
#define D_GPIO_PWM "PWM"
#define D_GPIO_DAC "DAC"
#define D_GPIO_SERIAL_DIMMER "Serial Dimmer"
#define D_GPIO_UNKNOWN "Unknown"
#define D_GPIO_PIN "Pin"
#define D_GPIO_GROUP "Group"
#define D_GPIO_GROUP_NONE "None"
#define D_GPIO_STATE_NORMAL "Normal"
#define D_GPIO_STATE_INVERTED "Inverted"
#endif

242
src/lang/sv_SE.h Normal file
View File

@ -0,0 +1,242 @@
// This translation file is maintained on https://crowdin.com/project/openhasp/
// Do not edit directly!
#ifndef HASP_LANG_SV_SE_H
#define HASP_LANG_SV_SE_H
#define D_ISO_LANG_CODE "sv-SE"
#define D_USERNAME "Användarnamn:"
#define D_PASSWORD "Lösenord:"
#define D_SSID "Ssid:"
#define D_YES "Ja"
#define D_NO "Nej"
#define D_ERROR_OUT_OF_MEMORY "Slut minne"
#define D_ERROR_UNKNOWN "Okänt fel"
#define D_CONFIG_NOT_CHANGED "Inställningar ändrades inte"
#define D_CONFIG_CHANGED "Inställningar ändrade"
#define D_CONFIG_LOADED "Inställningarna inlästa"
#define D_FILE_LOADING "Läser %s"
#define D_FILE_LOADED "Läst %s"
#define D_FILE_LOAD_FAILED "Misslyckades att läsa %s"
#define D_FILE_SAVING "Sparar %s"
#define D_FILE_SAVED "Sparat %s"
#define D_FILE_SAVE_FAILED "Kunde inte spara %s"
#define D_FILE_NOT_FOUND "Filen hittades inte"
#define D_FILE_SIZE_BYTES "bytes"
#define D_FILE_SIZE_KILOBYTES "KiB"
#define D_FILE_SIZE_MEGABYTES "MiB"
#define D_FILE_SIZE_GIGABYTES "GiB"
#define D_FILE_SIZE_TERABYTES "TiB"
#define D_FILE_SIZE_DIVIDER 1024 // kibi eller kilo bytes
#define D_DECIMAL_POINT "." // kommatecken eller punkt
#define D_SERVICE_STARTING "Startar..."
#define D_SERVICE_STARTED "Startat"
#define D_SERVICE_START_FAILED "Misslyckades att starta"
#define D_SERVICE_STOPPED "Stoppat"
#define D_SERVICE_DISABLED "Inaktiverad"
#define D_SERVICE_CONNECTED "Ansluten"
#define D_SERVICE_DISCONNECTED "Frånkopplad"
#define D_SETTING_ENABLED "Aktiverad"
#define D_SETTING_DISABLED "Inaktiverad"
#define D_SETTING_DEFAULT "Standard"
#define D_NETWORK_IP_ADDRESS_RECEIVED "Mottagen IP-adress %s"
#define D_NETWORK_ONLINE "online"
#define D_NETWORK_OFFLINE "offline"
#define D_NETWORK_CONNECTION_FAILED "Anslutning misslyckades"
#define D_NETWORK_CONNECTION_UNAUTHORIZED "Auktorisering misslyckades"
#define D_MQTT_DEFAULT_NAME "plate_%s"
#define D_MQTT_CONNECTING "Ansluter..."
#define D_MQTT_CONNECTED "Ansluten till broker %s som clientID %s"
#define D_MQTT_NOT_CONNECTED "Inte ansluten ???"
#define D_MQTT_DISCONNECTING "Kopplar från..."
#define D_MQTT_DISCONNECTED "Frånkopplad"
#define D_MQTT_RECONNECTING "Frånkopplad från broker, återansluter..."
#define D_MQTT_NOT_CONFIGURED "Broker är inte konfigurerad"
#define D_MQTT_STARTED "Startat: %d bytes"
#define D_MQTT_FAILED "Misslyckades:"
#define D_MQTT_INVALID_TOPIC "Meddelande har ogiltigt topic"
#define D_MQTT_SUBSCRIBED "Prenumererade på %s"
#define D_MQTT_NOT_SUBSCRIBED "Misslyckades att prenumerera på %s"
#define D_MQTT_HA_AUTO_DISCOVERY "Registrera HA auto-discovery"
#define D_MQTT_PAYLOAD_TOO_LONG "Payload för lång (%u bytes)"
#define D_TELNET_CLOSING_CONNECTION "Stänger session från %s"
#define D_TELNET_CLIENT_LOGIN_FROM "Klientinloggning från %s"
#define D_TELNET_CLIENT_CONNECT_FROM "Klient ansluten från %s"
#define D_TELNET_CLIENT_NOT_CONNECTED "Klient INTE ansluten"
#define D_TELNET_INCORRECT_LOGIN_ATTEMPT "Felaktigt inloggningsförsök från %s"
#define D_TELNET_STARTED "Telnet-konsol startad"
#define D_TELNET_FAILED "Misslyckades att starta telnet-konsolen"
#define D_TELNET_CLIENT_CONNECTED "Klient ansluten"
#define D_TELNET_CLIENT_REJECTED "Klient avvisad"
#define D_HASP_INVALID_PAGE "Ogiltig sida %u"
#define D_HASP_INVALID_LAYER "Kan inte rensa systemlager"
#define D_HASP_CHANGE_PAGE "Byter sida till %u"
#define D_HASP_CLEAR_PAGE "Rensar sida %u"
#define D_OBJECT_DELETED "Objektet borttaget"
#define D_OBJECT_UNKNOWN "Okänt objekt"
#define D_OBJECT_MISMATCH "Objekt matchar INTE!"
#define D_OBJECT_LOST "Förlorat objekt!"
#define D_OBJECT_CREATE_FAILED "Misslyckades att skapa objekt-id %u"
#define D_OBJECT_PAGE_UNKNOWN "Sida ID %u inte skapad"
#define D_OBJECT_EVENT_UNKNOWN "Okänd händelse %d"
#define D_ATTRIBUTE_UNKNOWN "Okänd egenskap %s"
// D_ATTRIBUTE_OBSOLETE D_ATTRIBUTE_INSTEAD kan användas tillsammans eller bara D_ATTRIBUTE_OBSOLETE ensam
#define D_ATTRIBUTE_OBSOLETE "%s är föråldrad"
#define D_ATTRIBUTE_INSTEAD ", använd %s istället"
#define D_ATTRIBUTE_READ_ONLY "%s är skrivskyddad"
#define D_ATTRIBUTE_PAGE_METHOD_INVALID "Kan inte anropa %s på en sida"
#define D_ATTRIBUTE_ALIGN_INVALID "Ogiltig align-värde: %s"
#define D_ATTRIBUTE_COLOR_INVALID "Ogiltig färg-värde: %s"
#define D_ATTRIBUTE_LONG_MODE_INVALID "Ogiltigt long-läge: %s"
#define D_OOBE_SSID_VALIDATED "SSID %s validerat"
#define D_OOBE_AUTO_CALIBRATE "Automatisk kalibrering aktiverad"
#define D_OOBE_CALIBRATED "Redan kalibrerad"
#define D_DISPATCH_COMMAND_NOT_FOUND "Kommando '%s' hittades inte
#define D_DISPATCH_INVALID_PAGE "Ogiltig sida %s"
#define D_DISPATCH_REBOOT "Startar om MCU nu!"
#define D_JSON_FAILED "JSON parsning misslyckades:"
#define D_JSONL_FAILED "JSONL parsning misslyckades på rad %u"
#define D_JSONL_SUCCEEDED "Jsonl helt tolkad"
#define D_OTA_CHECK_UPDATE "Försöker uppdatera URL: %s"
#define D_OTA_CHECK_COMPLETE "Uppdateringskontroll slutförd"
#define D_OTA_CHECK_FAILED "Uppdateringskontroll misslyckades: %s"
#define D_OTA_UPDATE_FIRMWARE "OTA Uppdatering"
#define D_OTA_UPDATE_COMPLETE "OTA Uppdatering klar"
#define D_OTA_UPDATE_APPLY "Sparar fast programvara och startar om"
#define D_OTA_UPDATE_FAILED "OTA Uppdatering misslyckades"
#define D_OTA_UPDATING_FIRMWARE "Uppdatera den inbyggda programvaran..."
#define D_OTA_UPDATING_FILESYSTEM "Uppdaterar filsystemet..."
#define D_HTTP_HASP_DESIGN "HASP Design"
#define D_HTTP_INFORMATION "Information"
#define D_HTTP_HTTP_SETTINGS "HTTP-inställningar"
#define D_HTTP_FTP_SETTINGS "FTP-inställningar"
#define D_HTTP_WIFI_INSTÄLLNINGAR "Wifi-inställningar"
#define D_HTTP_WIREGUARD_INSTÄLLNINGAR "WireGuard inställningar"
#define D_HTTP_MQTT_INSTÄLLNINGAR "MQTT-inställningar"
#define D_HTTP_GPIO_SETTINGS "GPIO-inställningar"
#define D_HTTP_MDNS_INSTÄLLNINGAR "mDNS-inställningar"
#define D_HTTP_TELNET_INSTÄLLNINGAR "Telnet-inställningar"
#define D_HTTP_DEBUG_INSTÄLLNINGAR "Debug-inställningar"
#define D_HTTP_GUI_INSTÄLLNINGAR "Visningsinställningar"
#define D_HTTP_SAVE_SETTINGS "Spara inställningar"
#define D_HTTP_UPLOAD_FILE "Ladda upp fil"
#define D_HTTP_ERASE_DEVICE "Återställ alla inställningar"
#define D_HTTP_ADD_GPIO "Lägg till ny GPIO"
#define D_HTTP_BACK "Tillbaka"
#define D_HTTP_REFRESH "Uppdatera"
#define D_HTTP_PREV_PAGE "Föregående sida"
#define D_HTTP_NEXT_PAGE "Nästa sida"
#define D_HTTP_CALIBRATE "Kalibrera"
#define D_HTTP_ANTIBURN "Kör Anti Burn-in"
#define D_HTTP_SCREENSHOT "Skärmdump"
#define D_HTTP_FILE_BROWSER "Filredigerare"
#define D_HTTP_FIRMWARE_UPGRADE "Uppgradering av fast programvara"
#define D_HTTP_UPDATE_FIRMWARE "Uppdatera fast programvara"
#define D_HTTP_FACTORY_RESET "Fabriksåterställning"
#define D_HTTP_MAIN_MENU "Huvudmeny"
#define D_HTTP_REBOOT "Omstart"
#define D_HTTP_CONFIGURATION "Konfiguration"
#define D_HTTP_CONFIG_CHANGED \
"Konfigurationen har ändrats, klicka på <a href='/reboot'>Starta om</a> för att spara ändringar."
#define D_HTTP_SENDING_PAGE "Skickat %S sida till %s"
#define D_HTTP_FOOTER "av Francis Van Roie"
#define D_INFO_VERSION "Version"
#define D_INFO_BUILD_DATETIME "Byggd datum/tid"
#define D_INFO_ENVIRONMENT "Miljö"
#define D_INFO_UPTIME "Uptime"
#define D_INFO_FREE_HEAP "Ledig Heap"
#define D_INFO_FREE_BLOCK "Lediga Block"
#define D_INFO_DEVICE_MEMORY "Enhetsminne"
#define D_INFO_LVGL_MEMORY "LVGL-minne"
#define D_INFO_TOTAL_MEMORY "Totalt"
#define D_INFO_FREE_MEMORY "Ledigt"
#define D_INFO_FRAGMENTATION "Fragmentering"
#define D_INFO_PSRAM_FREE "Ledigt PSRam"
#define D_INFO_PSRAM_SIZE "PSRam storlek"
#define D_INFO_FLASH_SIZE "Flash storlek"
#define D_INFO_SKETCH_USED "Använd programstorlek"
#define D_INFO_SKETCH_FREE "Ledig programstorlek"
#define D_INFO_FS_SIZE "Storlek på filsystem"
#define D_INFO_FS_USED "Använt av filsystem"
#define D_INFO_FS_FREE "Filsystem ledigt"
#define D_INFO_MODULE "Modul"
#define D_INFO_MODEL "Modell"
#define D_INFO_FREQUENCY "Frekvens"
#define D_INFO_CORE_VERSION "Core version"
#define D_INFO_RESET_REASON "Omstartsorsak"
#define D_INFO_STATUS "Status"
#define D_INFO_SERVER "Server"
#define D_INFO_USERNAME "Username"
#define D_INFO_CLIENTID "Klient-ID"
// #define D_INFO_CONNECTED "Ansluten"
// #define D_INFO_DISCONNECTED "Frånkopplad"
#define D_INFO_RECEIVED "Mottaget"
#define D_INFO_PUBLISHED "Publicerat"
#define D_INFO_FAILED "Misslyckade"
#define D_INFO_ETHERNET "Ethernet"
#define D_INFO_WIFI "Wifi"
#define D_INFO_WIREGUARD "WireGuard"
#define D_INFO_LINK_SPEED "Länkhastighet"
#define D_INFO_FULL_DUPLEX "Full duplex"
#define D_INFO_BSSID "BSSID"
#define D_INFO_SSID "SSID"
#define D_INFO_RSSI "Signalstyrka"
#define D_INFO_IP_ADDRESS "IP-adress"
#define D_INFO_MAC_ADDRESS "MAC-adress"
#define D_INFO_GATEWAY "Gateway"
#define D_INFO_DNS_SERVER "DNS-server"
#define D_INFO_ENDPOINT_IP "Slutpunkt IP"
#define D_INFO_ENDPOINT_PORT "Slutpunkt port"
#define D_OOBE_MSG "Tryck på skärmen för att konfigurera WiFi eller ansluta till denna accesspunkt:"
#define D_OOBE_SCAN_TO_CONNECT "Skanna för att ansluta"
#define D_WIFI_CONNECTING_TO "Ansluter till %s"
#define D_WIFI_CONNECTED_TO "Ansluten till %s, begär IP..."
#define D_WIFI_RSSI_EXCELLENT "Utmärkt"
#define D_WIFI_RSSI_GOOD "Bra"
#define D_WIFI_RSSI_FAIR "Hygglig"
#define D_WIFI_RSSI_WEAK "Svag"
#define D_WIFI_RSSI_BAD "Mycket dålig"
#define D_WG_INITIALIZED "Initierad"
#define D_WG_BAD_CONFIG "Saknad eller felaktig konfiguration"
#define D_GPIO_SWITCH "Omkopplare"
#define D_GPIO_BUTTON "Tryckknapp"
#define D_GPIO_TOUCH "Kapacitiv beröring"
#define D_GPIO_LED "Lysdiod"
#define D_GPIO_LED_R "Stämning röd"
#define D_GPIO_LED_G "Stämning grön"
#define D_GPIO_LED_B "Stämning blå"
#define D_GPIO_POWER_RELAY "Effektrelä"
#define D_GPIO_LIGHT_RELAY "Relä"
#define D_GPIO_PWM "PWM"
#define D_GPIO_DAC "DAC"
#define D_GPIO_SERIAL_DIMMER "Seriell dimmer"
#define D_GPIO_UNKNOWN "Okänt"
#define D_GPIO_PIN "GPIO"
#define D_GPIO_GROUP "Grupp"
#define D_GPIO_GROUP_NONE "Ingen"
#define D_GPIO_STATE_NORMAL "Normal"
#define D_GPIO_STATE_INVERTED "Inverterad"
#endif

View File

@ -136,7 +136,7 @@ void setup()
slaveSetup();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_setup();
#endif
@ -195,7 +195,7 @@ IRAM_ATTR void loop()
consoleLoop();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_loop();
#endif
@ -222,7 +222,7 @@ IRAM_ATTR void loop()
telnetEverySecond();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_every_second();
#endif
// debugEverySecond();
@ -243,7 +243,7 @@ IRAM_ATTR void loop()
// gpioEvery5Seconds();
#endif
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
custom_every_5seconds();
#endif
break;

View File

@ -371,7 +371,7 @@ void onMqttConnect(esp_mqtt_client_handle_t client)
// mqttSubscribeTo(mqttGroupTopic + subtopic);
// mqttSubscribeTo(mqttNodeTopic + subtopic);
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
String subtopic = F(MQTT_TOPIC_CUSTOM "/#");
mqttSubscribeTo(mqttGroupCommandTopic + subtopic);
mqttSubscribeTo(mqttNodeCommandTopic + subtopic);

View File

@ -328,7 +328,7 @@ static void onConnect(void* context, MQTTAsync_successData* response)
topic = mqttNodeTopic + "config/#";
mqtt_subscribe(mqtt_client, topic.c_str());
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
topic = mqttGroupTopic + MQTT_TOPIC_CUSTOM "/#";
mqtt_subscribe(mqtt_client, topic.c_str());

View File

@ -269,7 +269,7 @@ static void onConnect(void* context)
topic = mqttNodeTopic + "config/#";
mqtt_subscribe(mqtt_client, topic.c_str());
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
topic = mqttGroupTopic + MQTT_TOPIC_CUSTOM "/#";
mqtt_subscribe(mqtt_client, topic.c_str());

View File

@ -311,7 +311,7 @@ void mqttStart()
snprintf_P(topic, sizeof(topic), PSTR("%s" MQTT_TOPIC_CONFIG "/#"), mqttNodeTopic);
mqttSubscribeTo(topic);
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
snprintf_P(topic, sizeof(topic), PSTR("%s" MQTT_TOPIC_CUSTOM "/#"), mqttGroupTopic);
mqttSubscribeTo(topic);
snprintf_P(topic, sizeof(topic), PSTR("%s" MQTT_TOPIC_CUSTOM "/#"), mqttNodeTopic);

View File

@ -123,7 +123,7 @@ static void gpio_event_handler(AceButton* button, uint8_t eventType, uint8_t but
bool state = false;
switch(eventType) {
case AceButton::kEventPressed:
if(gpioConfig[btnid].type != hasp_gpio_type_t::BUTTON) {
if(gpioConfig[btnid].type != hasp_gpio_type_t::BUTTON_TYPE) {
eventid = HASP_EVENT_ON;
} else {
eventid = HASP_EVENT_DOWN;
@ -146,7 +146,7 @@ static void gpio_event_handler(AceButton* button, uint8_t eventType, uint8_t but
// state = true; // do not repeat DOWN + LONG + HOLD
// break;
case AceButton::kEventReleased:
if(gpioConfig[btnid].type != hasp_gpio_type_t::BUTTON) {
if(gpioConfig[btnid].type != hasp_gpio_type_t::BUTTON_TYPE) {
eventid = HASP_EVENT_OFF;
} else {
eventid = HASP_EVENT_RELEASE;
@ -253,7 +253,7 @@ static void gpio_setup_pin(uint8_t index)
pinMode(gpio->pin, input_mode);
gpio->max = 0;
break;
case hasp_gpio_type_t::BUTTON:
case hasp_gpio_type_t::BUTTON_TYPE:
if(gpio->btn) delete gpio->btn;
gpio->btn = new AceButton(&buttonConfig, gpio->pin, default_state, index);
gpio->power = gpio->btn->isPressedRaw();
@ -776,7 +776,7 @@ bool gpioIsSystemPin(uint8_t gpio)
return true;
}
#if defined(HASP_USE_CUSTOM)
#if defined(HASP_USE_CUSTOM) && HASP_USE_CUSTOM > 0
if(custom_pin_in_use(gpio)) {
LOG_DEBUG(TAG_GPIO, F(D_BULLET D_GPIO_PIN " %d => Custom"), gpio);
return true;
@ -849,7 +849,7 @@ void gpio_discovery(JsonObject& input, JsonArray& relay, JsonArray& light, JsonA
relay.add(gpioConfig[i].pin);
break;
case BUTTON ... TOUCH:
case BUTTON_TYPE ... TOUCH:
event.add(gpioConfig[i].pin);
break;
@ -861,7 +861,7 @@ void gpio_discovery(JsonObject& input, JsonArray& relay, JsonArray& light, JsonA
dimmer.add(gpioConfig[i].pin);
break;
// case BUTTON ... TOUCH:
// case BUTTON_TYPE ... TOUCH:
case SWITCH:
strcpy_P(description, PSTR("none"));
break;
@ -955,7 +955,7 @@ void gpio_discovery(JsonObject& input, JsonArray& relay, JsonArray& light, JsonA
}
if((gpioConfig[i].type >= hasp_gpio_type_t::SWITCH && gpioConfig[i].type <= hasp_gpio_type_t::WINDOW)) {
// || (gpioConfig[i].type >= hasp_gpio_type_t::BUTTON && gpioConfig[i].type <= hasp_gpio_type_t::TOUCH)) {
// || (gpioConfig[i].type >= hasp_gpio_type_t::BUTTON_TYPE && gpioConfig[i].type <= hasp_gpio_type_t::TOUCH)) {
JsonArray arr = input[description];
if(arr.isNull()) arr = input.createNestedArray(description);
arr.add(gpioConfig[i].pin);
@ -1040,4 +1040,4 @@ bool gpioSetConfig(const JsonObject& settings)
return changed;
}
#endif // HASP_USE_CONFIG
#endif // HASP_USE_CONFIG

View File

@ -134,7 +134,7 @@ enum hasp_gpio_type_t {
TAMPER = 0xBB,
UPDATE = 0xBC,
BUTTON = 0xF0,
BUTTON_TYPE = 0xF0,
BUTTON_TOGGLE_UP = 0xF1,
BUTTON_TOGGLE_DOWN = 0xF2,
BUTTON_TOGGLE_BOTH = 0xF3,
@ -153,4 +153,4 @@ enum hasp_gpio_type_t {
} /* extern "C" */
#endif
#endif
#endif

View File

@ -264,18 +264,18 @@ static void webSendFooter()
#endif
}
static void http_send_cache_header(int size, int age = 3600)
static void http_send_cache_header(int age = 3600)
{
webServer.sendHeader("Content-Length", (String)(size));
webServer.sendHeader("Cache-Control", (String)(F("public, max-age=")) + (String)(age));
}
static int http_send_cached(int statuscode, const char* contenttype, const char* data, size_t size, int age = 3600)
{
http_send_cache_header(size, age);
http_send_cache_header(age);
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
webServer.send_P(statuscode, contenttype, data, size);
#else
webServer.sendHeader("Content-Length", (String)(size));
webServer.send(statuscode, contenttype, data);
#endif
return statuscode;
@ -1804,7 +1804,7 @@ static void webHandleGpioConfig()
switch(conf.type) {
case hasp_gpio_type_t::BUTTON:
case hasp_gpio_type_t::BUTTON_TYPE:
httpMessage += D_GPIO_BUTTON;
break;
case hasp_gpio_type_t::SWITCH:
@ -2049,7 +2049,7 @@ static void webHandleGpioInput()
httpMessage += F("</select></p>");
httpMessage += F("<p><b>Type</b> <select id='type' name='type'>");
httpMessage += getOption(hasp_gpio_type_t::BUTTON, D_GPIO_BUTTON, conf.type);
httpMessage += getOption(hasp_gpio_type_t::BUTTON_TYPE, D_GPIO_BUTTON, conf.type);
httpMessage += getOption(hasp_gpio_type_t::SWITCH, D_GPIO_SWITCH, conf.type);
httpMessage += getOption(hasp_gpio_type_t::DOOR, "door", conf.type);
httpMessage += getOption(hasp_gpio_type_t::GARAGE_DOOR, "garage_door", conf.type);

View File

@ -1311,7 +1311,7 @@ void webHandleGuiConfig(AsyncWebServerRequest* request)
httpMessage += getOption(-1, F("None"), bcklpin == -1);
#if defined(ARDUINO_ARCH_ESP32)
add_gpio_select_option(httpMessage, 5, bcklpin); // D8 on ESP32 for D1 mini 32
add_gpio_select_option(httpMessage, 12, bcklpin); // TFT_LED on the Liligo Pi
add_gpio_select_option(httpMessage, 12, bcklpin); // TFT_LED on the Lilygo Pi
add_gpio_select_option(httpMessage, 13, bcklpin); // TFT_LED on the D1 R32 + Waveshare
add_gpio_select_option(httpMessage, 15, bcklpin); // TFT_LED on the AZ Touch
add_gpio_select_option(httpMessage, 16, bcklpin); // D4 on ESP32 for D1 mini 32
@ -1479,7 +1479,7 @@ void webHandleGpioConfig(AsyncWebServerRequest* request)
switch(conf.type) {
case hasp_gpio_type_t::BUTTON:
case hasp_gpio_type_t::BUTTON_TYPE:
httpMessage += F(D_GPIO_BUTTON);
break;
case hasp_gpio_type_t::SWITCH:
@ -1757,8 +1757,8 @@ void webHandleGpioInput(AsyncWebServerRequest* request)
bool selected;
httpMessage += F("<p><b>Type</b> <select id='type' name='type'>");
selected = (conf.type == hasp_gpio_type_t::BUTTON);
httpMessage += getOption(hasp_gpio_type_t::BUTTON, F(D_GPIO_BUTTON), selected);
selected = (conf.type == hasp_gpio_type_t::BUTTON_TYPE);
httpMessage += getOption(hasp_gpio_type_t::BUTTON_TYPE, F(D_GPIO_BUTTON), selected);
selected = (conf.type == hasp_gpio_type_t::SWITCH);
httpMessage += getOption(hasp_gpio_type_t::SWITCH, F(D_GPIO_SWITCH), selected);

View File

@ -146,7 +146,7 @@ framework = arduino
;platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip
;;;platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip
;platform = espressif32@5.3.0
;platform = espressif32@5.4.0
lib_ignore =
${esp32.lib_ignore}
LittleFS_esp32 ; Not needed for Arduino v2

View File

@ -0,0 +1,64 @@
[env:esp32-2432s022c_4MB]
extends = arduino_esp32_v2, flash_4mb
board = esp32dev
upload_speed = 921600
build_flags =
${arduino_esp32_v2.build_flags}
${esp32.no_ps_ram}
;region -- TFT_eSPI build options ------------------------
-D ESP32_2432S022C=1
-D LGFX_USE_V1=1
; -D USER_SETUP_LOADED=1
-D ST7789_DRIVER=1
; -D CGRAM_OFFSET=1
; -DSUPPORT_TRANSACTIONS
-D TFT_INVERSION_OFF
-D TFT_PARALLEL_8_BIT
-D TFT_ROTATION=0 ; 0=0, 1=90, 2=180 or 3=270 degree
-D TFT_WIDTH=240
-D TFT_HEIGHT=320
-D TFT_CS=17 ; Chip select control pin=library pulls permanently low
-D TFT_DC=16 ; Data Command control pin
-D TFT_RST=-1 ; Reset pin, toggles on startup
-D TFT_WR=4 ; Write strobe control pin
-D TFT_RD=2 ; Read strobe control pin
-D TFT_D0=15
-D TFT_D1=13
-D TFT_D2=12
-D TFT_D3=14
-D TFT_D4=27
-D TFT_D5=25
-D TFT_D6=33
-D TFT_D7=32
-D TFT_BCKL=0 ; LED back-light
;CST816S driver
-D TOUCH_DRIVER=0x816
-D HASP_USE_LGFX_TOUCH=1
-D I2C_TOUCH_PORT=I2C_NUM_0
-D TOUCH_SDA=21
-D TOUCH_SCL=22
-D TOUCH_IRQ=-1
-D TOUCH_RST=-1
-D I2C_TOUCH_FREQUENCY=400000
-D I2C_TOUCH_ADDRESS=0x15
-D SD_MISO=19
-D SD_MOSI=23
-D SD_SCLK=18
-D SD_CS=5
; sound output is on IO26, through an SC8002B IC
; -- Debugging options -----------------------------
; -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
;endregion
lib_deps =
${arduino_esp32_v2.lib_deps}
${lovyangfx.lib_deps}
;${tft_espi.lib_deps}

View File

@ -26,6 +26,7 @@ build_flags =
-D SUPPORT_TRANSACTIONS
-D SPI_READ_FREQUENCY=20000000
-D TOUCH_OFFSET_ROTATION=0 ; 1=swap xy, 2=invert x, 4=inverty
-D TFT_RGB_ORDER=0 ; Colour order Red-Green-Blue
-D ESP32_2432S028R=1
;endregion
@ -128,3 +129,77 @@ lib_deps =
;${tft_espi.lib_deps}
${lovyangfx.lib_deps}
;${goodix.lib_deps}
[esp32-2432s028_v2]
extends = arduino_esp32_v2
board = esp32dev
upload_speed = 921600
build_flags =
${arduino_esp32_v2.build_flags}
${esp32.no_ps_ram}
; TFT_ROTATION values:
; 0 - 0 deg (= default when not set)
; 1 - 90 deg anti-clockwise (from 0 deg)
; 2 - 180 deg anti-clockwise
; 3 - 270 deg anti-clockwise
; 4 - mirror content, and rotate 180 deg anti-clockwise
; 5 - mirror content, and rotate 270 deg anti-clockwise
; 6 - mirror content, and rotate 0 deg anti-clockwise
; 7 - mirror content, and rotate 90 deg anti-clockwise
;region -- TFT_eSPI build options ------------------------
; -D USER_SETUP_LOADED=1
-D LGFX_USE_V1=1
-D ILI9341_DRIVER=1 ;
-D INVERT_COLORS=0
-D TFT_ROTATION=6 ; 0=0, 1=90, 2=180 or 3=270 degree, Mirrors: 6, 5, 4, 3
-D TFT_WIDTH=320
-D TFT_HEIGHT=240
-D TFT_RST=-1
-D TFT_SCLK=14
-D TFT_DC=2
-D TFT_CS=15
-D TFT_MOSI=13
-D TFT_MISO=12
-D TFT_BCKL=21
-D SUPPORT_TRANSACTIONS
-D SPI_FREQUENCY=55000000
-D SPI_READ_FREQUENCY=20000000
-D TOUCH_OFFSET_ROTATION=2 ; 1=swap xy, 2=invert x, 4=inverty
-D TFT_RGB_ORDER=1 ; Colour order Red-Green-Blue
-D ESP32_2432S028R=1
;endregion
; -- Debugging options -----------------------------
; -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
lib_deps =
${arduino_esp32_v2.lib_deps}
${lovyangfx.lib_deps}
[env:esp32-2432s028r_v2_4MB]
extends = esp32-2432s028_v2, flash_4mb
build_flags =
${esp32-2432s028_v2.build_flags}
-D TOUCH_DRIVER=0x2046 ; XPT2606 Resistive touch panel driver
-D HASP_USE_LGFX_TOUCH=1
-D TOUCH_CS=33
-D TOUCH_SCLK=25
-D TOUCH_MOSI=32
-D TOUCH_MISO=39
-D TOUCH_SDA=-1
-D TOUCH_SCL=-1
-D TOUCH_IRQ=36
-D SPI_TOUCH_FREQUENCY=2500000
; -- Debugging options -----------------------------
; -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
lib_deps =
${esp32-2432s028_v2.lib_deps}
;${tft_espi.lib_deps}
${lovyangfx.lib_deps}
;${goodix.lib_deps}

View File

@ -6,8 +6,8 @@
;***************************************************;
[env:huzzah32-v2-featherwing-35-v2]
extends = arduino_esp32_v2, flash_4mb
board = featheresp32
extends = arduino_esp32_v2, flash_8mb
board = adafruit_feather_esp32_v2
build_flags =
-D HASP_MODEL="Adafruit HUZZAH32 V2 ESP32 Featherwing 3.5 V2"
@ -16,13 +16,14 @@ build_flags =
-D LV_INDEV_DEF_READ_PERIOD=30
;region -- TFT_eSPI build options ------------------------
${lcd.featherwing-35-v2}
-D TFT_MISO=19
-D TFT_MOSI=18
-D TFT_SCLK=5
-D TFT_DC=10
-D TFT_CS=9
-D TFT_MISO=21 ; GPIO21 / MISO
-D TFT_MOSI=19 ; GPIO19 / MOSI
-D TFT_SCLK=5 ; GPIO5 / SCK
-D TFT_DC=33 ; GPIO33 / D33
-D TFT_CS=15 ; GPIO15 / D15
-D TFT_RST=-1 ; RST
-D TFT_BCKL=21 ; Solder the LITE pad to a PWM enabled pin of the ESP, like GPIO 21
-D TFT_BCKL=37 ; Solder the LITE pad to a PWM enabled pin of the ESP, like GPIO 21
;endregion
lib_deps =

View File

@ -0,0 +1,33 @@
;***************************************************;
; HUZZAH32 V2 ESP32 with Featherwing TFT 3.5" ;
; - HUZZAH32 V2 w/ 2 MB PSRAM board ;
; - HX8357D TFT Featherwing 3.5" V2 ;
; - STMPE610 touch controller ;
;***************************************************;
[env:huzzah32-v2-featherwing-35]
extends = arduino_esp32_v2, flash_8mb
board = adafruit_feather_esp32_v2
build_flags =
-D HASP_MODEL="Adafruit HUZZAH32 V2 ESP32 Featherwing 3.5"
${arduino_esp32_v2.build_flags}
${esp32.ps_ram}
-D LV_INDEV_DEF_READ_PERIOD=30
;region -- TFT_eSPI build options ------------------------
${lcd.featherwing-35}
-D TFT_MISO=21 ; GPIO21 / MISO
-D TFT_MOSI=19 ; GPIO19 / MOSI
-D TFT_SCLK=5 ; GPIO5 / SCK
-D TFT_DC=33 ; GPIO33 / D33
-D TFT_CS=15 ; GPIO15 / D15
-D TFT_RST=-1 ; RST
-D TOUCH_CS=32
-D TFT_BCKL=26 ; Solder the LITE pad to a PWM enabled pin of the ESP, like GPIO 26
;endregion
lib_deps =
${arduino_esp32_v2.lib_deps}
${tft_espi.lib_deps}
${stmpe610.lib_deps}

View File

@ -28,6 +28,7 @@ build_flags =
-D TOUCH_RST=-1
-D TOUCH_SDA=23
-D TOUCH_SCL=32
-D TWATCH=1
;endregion
lib_deps =
@ -40,7 +41,7 @@ extends = ttgo-t-watch, flash_16mb
build_flags =
${ttgo-t-watch.build_flags}
-D HASP_MODEL="TTgo T-Watch 2019"
-D HASP_MODEL="TTGo T-Watch 2019"
-D INVERT_COLORS=1
[env:ttgo-t-watch-2020]
@ -48,7 +49,7 @@ extends = ttgo-t-watch, flash_16mb
build_flags =
${ttgo-t-watch.build_flags}
-D HASP_MODEL="TTgo T-Watch 2020"
-D HASP_MODEL="TTGo T-Watch 2020"
-D TFT_ROTATION=0
;-D TFT_ROTATION=2
-D TOUCH_OFFSET_ROTATION=4 ; 1=swap xy, 2=invert x, 4=inverty

View File

@ -6,12 +6,13 @@
;***************************************************;
[env:makerfabs-tft-s2_ili9488]
extends = esp32s2-solo_16mb_v2
extends = arduino_esp32s2-solo_v2, flash_16mb
board = esp32s2
build_flags =
${env.build_flags}
${esp32s2.build_flags}
${esp32s2.no_ps_ram}
;region -- TFT_eSPI build options ------------------------
-D ILI9488_DRIVER=1

View File

@ -18,4 +18,5 @@ framework = arduino
; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.05.01/platform-espressif32.zip
; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.08.01/platform-espressif32.zip
; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip
; platform = espressif32 @6.5.0

View File

@ -74,7 +74,7 @@ build_flags =
-D TFT_DE=41
-D TFT_VSYNC=40
-D TFT_HSYNC=39
-D TFT_PCLK=0
-D TFT_PCLK=0
[env:elecrow-s3-8048c070_4MB]
extends = elecrow-esp32-s3-tft, flash_4mb

View File

@ -0,0 +1,71 @@
;***************************************************;
; Lanbon L9 with ST7789 ;
;***************************************************;
[env:lanbon_l9]
extends = arduino_esp32s3_v2, flash_16mb
board = esp32-s3-devkitc-1
board_build.arduino.memory_type = qio_opi
build_flags =
${env.build_flags}
${esp32s3.build_flags}
${esp32s3.ps_ram}
-D HASP_MODEL="Lanbon L9"
;-D ARDUINO_USB_MODE=0
;-DARDUINO_USB_CDC_ON_BOOT
;-DUSE_USB_CDC_CONSOLE
;region -- TFT_eSPI build options ------------------------
-D ST7789_DRIVER=1
-D HASP_USE_ARDUINOGFX=1
-D TFT_WIDTH=170
-D TFT_HEIGHT=320
-D TFT_ROTATION=0 ; see TFT_ROTATION values
; -D TFT_INVERSION_OFF ; for normal colors
;-D TFT_INVERSION_ON
;-D TFT_RGB_ORDER=0 ; Colour order Blue-Green-Red
;-D INVERT_COLORS=1 ; for inverted colors
-D SPI_FREQUENCY=16000000
-D TFT_RST=-1
-D TFT_CS=21
-D TFT_DC=17
-D TFT_WR=13
-D TFT_RD=18
-D TFT_D0=6
-D TFT_D1=7
-D TFT_D2=15
-D TFT_D3=16
-D TFT_D4=10
-D TFT_D5=9
-D TFT_D6=46
-D TFT_D7=3
-D TFT_BCKL=42
; Touch Setttings
-D TOUCH_WIDTH=170
-D TOUCH_HEIGHT=320
-D TOUCH_DRIVER=0x6336
-D TOUCH_SCL=0
-D TOUCH_SDA=35
-D TOUCH_IRQ=-1
-D TOUCH_RST=-1
-D I2C_TOUCH_ADDRESS=0x38
-D I2C_TOUCH_PORT=1
-D I2C_TOUCH_FREQUENCY=400000
;endregion
;region -- Library options -------------------------------
lib_deps =
${env.lib_deps}
${esp32s3.lib_deps}
${arduino_esp32s3_v2.lib_deps}
${arduinogfx.lib_deps}
${goodix.lib_deps}
${ft6336.lib_deps}
lib_ignore =
${env.lib_ignore}
${esp32s3.lib_ignore}
${arduino_esp32s3_v2.lib_ignore}
;endregion

View File

@ -0,0 +1,90 @@
;***************************************************;
; Lilygo T-Panel S3, 4-Inch Touch Screen ;
; - Custom esp32-s3 board ;
; - st7701s TFT ;
; - CST3240 touch controller (WIP) ;
; - IO Expansion: XL9535 ;
;***************************************************;
[lilygo-t-panel]
extends = arduino_esp32s3_v2
board = esp32s3_flash_16MB
; board_build.memory_type = qio_opi ;Enable internal PSRAM
board_build.memory_type = qio_qspi ;Enable external PSRAM
board_upload.flash_size = 16MB
board_build.partitions = default_16MB.csv
build_flags =
-D HASP_MODEL="Lilygo T-Panel v1.2"
${arduino_esp32s3_v2.build_flags}
${esp32s3.ps_ram}
-DLILYGO_T_PANEL
-D LILYGO_T_PANEL=1
-Wall ;all errors that everybody could agree on
-Wextra ;somebody agree on
; -Werror ;Think of "Warning" as "Error".
; -D CORE_DEBUG_LEVEL=1 ;Debug level 0-5
-D BOARD_HAS_PSRAM ;Enable external PSRAM
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=0 ;1 is to use the USB port as a serial port
-D ARDUINO_RUNNING_CORE=1 ; Arduino Runs On Core (setup, loop)
-D ARDUINO_EVENT_RUNNING_CORE=1 ; Events Run On Core
;region -- ArduinoGFX build options ------------------------
-D HASP_USE_ARDUINOGFX=1
-D HASP_LV_USE_SW_ROTATE=1
-D ST7701_DRIVER=1
-D TFT_WIDTH=480
-D TFT_HEIGHT=480
; Bus Settings
-D TFT_HSYNC=39
-D TFT_VSYNC=40
-D TFT_PCLK=41
-D TFT_B0=1
-D TFT_B1=2
-D TFT_B2=3
-D TFT_B3=4
-D TFT_B4=5
-D TFT_G0=6
-D TFT_G1=7
-D TFT_G2=8
-D TFT_G3=9
-D TFT_G4=10
-D TFT_G5=11
-D TFT_R0=12
-D TFT_R1=13
-D TFT_R2=42
-D TFT_R3=46
-D TFT_R4=45
-D TFT_BCKL=14
; Touch Settings
-D TOUCH_MODULES_CST_MUTUAL
-D TOUCH_DRIVER=0x3240
-D TOUCH_WIDTH=480
-D TOUCH_HEIGHT=480
-D TOUCH_SDA=17
-D TOUCH_SCL=18
-D TOUCH_INT=21
-D TOUCH_RST=-1
-D TOUCH_CS=-1
-D TOUCH_IRQ=TOUCH_INT
-D I2C_TOUCH_FREQUENCY=400000UL
-D I2C_TOUCH_ADDRESS=0x5A
; -D I2C_TOUCH_PORT=
-D LV_DISP_DEF_REFR_PERIOD=10
;endregion
lib_deps =
${arduino_esp32s3_v2.lib_deps}
git+https://github.com/mmMicky/TouchLib.git
moononournation/GFX Library for Arduino@1.4.0
[env:lilygo-t-panel_16MB]
extends = lilygo-t-panel, flash_16mb
; monitor_port = COM8
; upload_port = COM8

View File

@ -0,0 +1,98 @@
;***************************************************;
; Sunton ESP32-WROOM custom dev board with ;
; - ILI9341 TFT SPI 4-WIRE ;
; - XPT2046 or CST820 touch controller ;
;***************************************************;
[sunton-esp32-2432s024]
extends = arduino_esp32_v2
board = esp32dev
build_flags =
${arduino_esp32_v2.build_flags}
${esp32.no_ps_ram}
;region -- TFT_eSPI build options ------------------------
${esp32.hspi} ; Use HSPI hardware SPI bus
-D LGFX_USE_V1=1
-D HASP_USE_LGFX_TOUCH=1
-D ILI9341_DRIVER=1
-D TFT_WIDTH=320
-D TFT_HEIGHT=240
-D TFT_CS=15 ;// Chip select control pin
-D TFT_DC=2 ;// Data Command control pin
-D TFT_RST=-1 ;// Reset pin (could connect to RST pin)
-D TFT_BCKL=27 ;None, configurable via web UI (e.g. 2 for D4)
-D SUPPORT_TRANSACTIONS
-D SPI_FREQUENCY=65000000
-D SPI_READ_FREQUENCY=20000000
-D SPI_TOUCH_FREQUENCY=2500000
;endregion
; -- Debugging options -----------------------------
; -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
lib_deps =
${arduino_esp32_v2.lib_deps}
${lovyangfx.lib_deps}
[env:esp32-2432s024r_4MB]
upload_port = /dev/ttyUSB0
extends = sunton-esp32-2432s024, flash_4mb
board = esp32dev
build_flags =
${sunton-esp32-2432s024.build_flags}
${esp32.no_ps_ram}
;region -- TFT_eSPI build options ------------------------
${esp32.hspi} ; Use HSPI hardware SPI bus
;-D USER_SETUP_LOADED=1
-D TFT_RGB_ORDER=1 ; Colour order Red-Green-Blue
-D TFT_ROTATION=5 ; 0=0, 1=90, 2=180 or 3=270 degree
-D TOUCH_CS=33
-D TOUCH_SCLK=14
-D TOUCH_MOSI=13
-D TOUCH_MISO=12
-D TOUCH_DRIVER=0x2046 ; XPT2606 Resistive touch panel driver
-D TOUCH_SDA=-1
-D TOUCH_SCL=-1
-D TOUCH_IRQ=-1
-D I2C_TOUCH_PORT=0
-D I2C_TOUCH_ADDRESS=0
-D I2C_TOUCH_FREQUENCY=0
-D TOUCH_OFFSET_ROTATION=0 ;touch rotation
;endregion
; -- Debugging options -----------------------------
; -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
[env:esp32-2432s024c_4MB]
upload_port = /dev/ttyUSB0
extends = sunton-esp32-2432s024, flash_4mb
board = esp32dev
build_flags =
${sunton-esp32-2432s024.build_flags}
${esp32.no_ps_ram}
;region -- TFT_eSPI build options ------------------------
${esp32.hspi} ; Use HSPI hardware SPI bus
;-D USER_SETUP_LOADED=1
-D TFT_ROTATION=4 ; 0=0, 1=90, 2=180 or 3=270 degree
-D TOUCH_DRIVER=0x0820 ; CST820 Capacitive I2C touch panel driver
-D TOUCH_SDA=33
-D TOUCH_SCL=32
-D TOUCH_IRQ=21
;-D TOUCH_IRQ=-1
-D TOUCH_RST=25
-D I2C_TOUCH_FREQUENCY=400000
-D I2C_TOUCH_PORT=1
-D I2C_TOUCH_ADDRESS=0x15 ; or 0x14
-D TOUCH_OFFSET_ROTATION=2 ;touch rotation
;endregion
; -- Debugging options -----------------------------
; -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG

View File

@ -145,8 +145,8 @@ build_flags =
-D TFT_PREFER_SPEED=13900000 ; 1/2 of Typical DCLK Frequency
-D TFT_AUTO_FLUSH=1
; Touch Settings
-D TOUCH_WIDTH=480
-D TOUCH_HEIGHT=272
-D TOUCH_WIDTH=800
-D TOUCH_HEIGHT=480
-D TOUCH_DRIVER=0x911
-D TOUCH_SCL=20
-D TOUCH_SDA=19
@ -171,16 +171,18 @@ build_flags =
-D TFT_WIDTH=800
-D TFT_HEIGHT=480
; Panel Settings
; see see https://github.com/wegi1/ESP32-8048S050-5INCH-LCD/blob/main/4-Driver_IC_Data_Sheet/JC8048B050N_I.pdf
-D TFT_HSYNC_POLARITY=0
-D TFT_HSYNC_FRONT_PORCH=48 ; Maximum HSYNC Front Porch
-D TFT_HSYNC_FRONT_PORCH=8 ; Maximum HSYNC Front Porch
-D TFT_HSYNC_PULSE_WIDTH=4 ; Typical HSYNC Pulse Width
-D TFT_HSYNC_BACK_PORCH=8 ; Typical HSYNC Back Porch
-D TFT_VSYNC_POLARITY=0
-D TFT_VSYNC_FRONT_PORCH=12 ; Maximum VSYNC Front Porch
-D TFT_VSYNC_FRONT_PORCH=8 ; Maximum VSYNC Front Porch
-D TFT_VSYNC_PULSE_WIDTH=4 ; Typical VSYNC Pulse Width
-D TFT_VSYNC_BACK_PORCH=8 ; Typical VSYNC Back Porch
-D TFT_PCLK_ACTIVE_NEG=1
-D TFT_PREFER_SPEED=13900000 ; 1/2 of Typical DCLK Frequency
; 13900000 fails on some boards, high values cause wifi issues
-D TFT_PREFER_SPEED=14500000 ; 1/2 of Typical DCLK Frequency
-D TFT_AUTO_FLUSH=1
; Touch Settings
-D TOUCH_WIDTH=800

View File

@ -0,0 +1,77 @@
;***************************************************;
; TTGO T-Display-S3 with ST7789 ;
; - TTGO T7 S3 v1.1 Mini esp32 s3 board ;
; - ST7789 TFT ;
; - CST816S touch controller ;
;***************************************************;
[ttgo-t-display-s3_st7789]
extends = arduino_esp32s3_v2
board = lilygo-t-display-s3
board_build.arduino.memory_type = qio_opi
build_flags =
${env.build_flags}
${esp32s3.build_flags}
${esp32s3.ps_ram}
-D HASP_MODEL="TTGO T-Display S3"
;-Wno-macro-redefined
-D ARDUINO_USB_MODE=0 ; If USB MODE 1, the device will only boot when a serial port is opened.
-D ARDUINO_USB_CDC_ON_BOOT
-D USE_USB_CDC_CONSOLE
;region -- TFT_eSPI build options ------------------------
-D USER_SETUP_LOADED=1
-D ST7789_DRIVER=1
-D CGRAM_OFFSET=1 ; Library will add offsets required
; -D TFT_SDA_READ ; Read from display, it only provides an SDA pin
-D TFT_WIDTH=170
-D TFT_HEIGHT=320
; -D TFT_ROTATION=2 ; see TFT_ROTATION values
; -D TFT_INVERSION_OFF ; for normal colors
-D TFT_INVERSION_ON
-D TFT_RGB_ORDER=0 ; Colour order Blue-Green-Red
-D INVERT_COLORS=1 ; for inverted colors
-D DISABLE_ALL_LIBRARY_WARNINGS ; Disable TFTeSPI log warning
; -D INIT_SEQUENCE_3 ; Using this initialisation sequence improves the display image
-D TFT_PARALLEL_8_BIT
-D TFT_DC=7
-D TFT_RST=5
-D TFT_WR=8
-D TFT_RD=9
-D TFT_D0=39
-D TFT_D1=40
-D TFT_D2=41
-D TFT_D3=42
-D TFT_D4=45
-D TFT_D5=46
-D TFT_D6=47
-D TFT_D7=48
-D TFT_BCKL=38
; Touch Settings
-D TOUCH_DRIVER=0x816
-D TOUCH_SDA=18
-D TOUCH_SCL=17
-D TOUCH_RST=21
-D TOUCH_IRQ=16
-D I2C_TOUCH_FREQUENCY=400000
-D I2C_TOUCH_ADDRESS=0x15
; End Touch Settings
;endregion
;region -- Library options -------------------------------
lib_deps =
${env.lib_deps}
${esp32s3.lib_deps}
${arduino_esp32s3_v2.lib_deps}
${tft_espi.lib_deps}
lib_ignore =
${env.lib_ignore}
${esp32s3.lib_ignore}
${arduino_esp32s3_v2.lib_ignore}
;endregion
[env:ttgo-t-display-s3_st7789_touch_16MB]
extends = ttgo-t-display-s3_st7789, flash_16mb

View File

@ -0,0 +1,53 @@
;**********************************************************;
; Waveshare ESP32-S3 TFT 1.69inch 240x280 C-Touch ;
; - ST7789V2 TFT SPI 4-WIRE ;
; - CST816s touch controller ;
;**********************************************************;
[env:waveshare-s3-1_69-ctp]
extends = arduino_esp32s3_v2, flash_16mb
board = esp32-s3-devkitc-1
board_build.arduino.memory_type = qio_opi
build_flags =
-D HASP_MODEL="Waveshare micro TFT"
${arduino_esp32s3_v2.build_flags}
${esp32s3.ps_ram}
; -D USE_USB_CDC_CONSOLE=1
; -D ARDUINO_USB_MODE=1
; -D ARDUINO_USB_CDC_ON_BOOT=1
# --- Display settings ---
-D LGFX_USE_V1=1 ; for lovyangfx driver
-D HASP_USE_LGFX_TOUCH=1 ; for lovyangfx driver
-D ST7789_DRIVER=1
-D SPI_FREQUENCY=80000000
-D TFT_ROTATION=0 ; 0=0, 1=90, 2=180 or 3=270 degree
-D TFT_WIDTH=240
-D TFT_HEIGHT=280
-D TFT_OFFSET_Y=20
-D TFT_MOSI=7
-D TFT_SCLK=6
-D TFT_CS=5
-D TFT_DC=4
-D TFT_RST=8
-D TFT_BL=15
-D TFT_BCKL=15
; -D TFT_INVERSION_ON
; -D TFT_RGB_ORDER TFT_BGR
# --- Touch settings ---
-D TOUCH_DRIVER=0x0816
-D TOUCH_SDA=11
-D TOUCH_SCL=10
-D TOUCH_RST=13
-D TOUCH_IRQ=14
-D TOUCH_CS=-1
-D I2C_TOUCH_FREQUENCY=400000
-D I2C_TOUCH_ADDRESS=0x15
lib_deps =
${arduino_esp32s3_v2.lib_deps}
${lovyangfx.lib_deps}
upload_protocol = esp-builtin