Compare commits

..

No commits in common. "master" and "v0.5.0" have entirely different histories.

567 changed files with 190000 additions and 413875 deletions

View File

@ -1,35 +0,0 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/python:1": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"platformio.platformio-ide"
]
}
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
// Allow uploading to device
"mounts": ["type=bind,source=/dev/bus/usb,target=/dev/bus/usb"],
"runArgs": ["--privileged"]
}

10
.github/FUNDING.yml vendored
View File

@ -1,16 +1,12 @@
# These are supported funding model platforms
github: [aderusha, lovyan03, bblanchon] # Replace with up to 4 GitHub Sponsors-enabled usernames
github: aderusha # Replace with up to 4 GitHub Sponsors-enabled usernames
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: openhasp
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: [
"https://www.paypal.com/donate/?business=E76SN28JLZCXU",
"https://www.buymeacoffee.com/aktdCofU",
"https://arduinojson.org/book/",
] # Up to 4 links
custom: ['https://www.buymeacoffee.com/gW5rPpsKR','https://arduinojson.org/book/'] # Up to 4 links

View File

@ -16,7 +16,7 @@ or join the [#openHASP channel](https://discord.gg/VCWyuhF) on Discord.
-->
### Perform all steps below and tick them with [x]
- [ ] Check the related part of the [Documentation](https://www.openhasp.com/)
- [ ] Check the related part of the [Documentation](https://haswitchplate.github.io/openHASP-docs/)
- [ ] Update openHASP to the latest version
- [ ] Reproduce the issue and describe all steps

View File

@ -1,12 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot
version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly

View File

@ -1,168 +1,63 @@
name: Build branch
name: Build master branch
on:
release:
types: [published]
push:
branches:
- master
paths-ignore:
- "**.md"
- "**.yml"
- "**.yaml"
workflow_dispatch:
on: [push, workflow_dispatch]
jobs:
build_esp32:
build:
runs-on: ubuntu-latest
#runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
environment:
- out: adafruit
env: "huzzah32-featherwing-24 -e huzzah32-featherwing-35 -e huzzah32-featherwing-24-v2 -e huzzah32-featherwing-35-v2 -e huzzah32-v2-featherwing-24-v2 -e huzzah32-v2-featherwing-35-v2"
- out: az-touch
env: "az-touch-mod-esp32_ili9341_4MB -e az-touch-mod-esp32_ili9341_8MB"
- env: d1-mini-esp32_ili9341
out: d1-mini-esp32
- out: d1-r32-espduino32
env: "d1-r32-waveshare_ili9486 -e d1-r32-unoshield_ili9341_adc -e d1-r32-unoshield_ili9486_adc"
- out: dustinwatts
env: "freetouchdeck_4MB -e freetouchdeck_8MB -e esp32-touchdown"
- out: elecrow
env: "esp32-terminal-rgb_16MB -e esp32-terminal-spi_16MB -e elecrow-s3-8048c050_4MB -e elecrow-s3-8048c070_4MB"
- out: globalsecurity
env: gs-t3e_16MB
- out: guition
env: esp32-s3-4848s040_16MB -e guition-jc4827w543c_4MB
- out: lanbon
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
env: lolin-d32-pro_ili9341
- out: m5stack
env: m5stack-core2
- out: makerfabs
env: "makerfabs-tft35-cap_4MB -e makerfabs-tft35-cap_16MB -e makerfabs-s3-tft35-spi -e makerfabs-s3-tft40-rgb -e makerfabs-s3-tft43-rgb"
- out: panlee
env: "panlee-zw3d95ce01s-ar-4848_16MB -e panlee-zw3d95ce01s-ur-4848_16MB -e panlee-zw3d95ce01s-tr-4848_16MB"
- out: seeed-studios
env: "sensecap-indicator-d1_8MB"
- out: sunton
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 -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
env: yeacreate-nscreen32
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Install Setuptools
- name: Enable ESP platforms from platformio_override-template.ini
run: |
pip install --upgrade setuptools
- name: Enable ESP32 platforms from platformio_override-template.ini
run: |
sed 's/; user_setups\/esp32/user_setups\/esp32/g' platformio_override-template.ini > platformio_override.ini
- name: List all files in current folder
run: |
ls -la
- name: Cat platformio_override.ini
run: |
cat platformio_override.ini
- name: Run PlatformIO
run: pio run -e ${{ matrix.environment.env }}
- name: Upload output file
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.environment.out }}
path: build_output/firmware/*.*n
## Release only:
- name: Zip artifact for deployment
if: github.ref != 'refs/heads/master'
run: |
zip ${{ matrix.environment.out }}.zip build_output/firmware/*.bin -r
- name: On Release, upload assets to that Release
if: github.ref != 'refs/heads/master'
uses: AButler/upload-release-assets@v3.0
with:
files: ${{ matrix.environment.out }}.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
linux_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Enable Linux platform from platformio_override.ini
run: |
sed 's/; user_setups\/linux/user_setups\/linux/g' platformio_override-template.ini > platformio_override.ini
mkdir -p .pio/libdeps/linux_sdl/paho/src
- name: Install SDL2 library
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: List all files in current folder
run: |
ls -la
- name: Cat platformio_override.ini
run: |
cat platformio_override.ini
sed 's/; user_setups\/esp/user_setups\/esp/g' platformio_override-template.ini > platformio_override.ini
- name: Enable Linux platform from platformio_override.ini
run: |
sed -i 's/; user_setups\/linux/user_setups\/linux/g' platformio_override.ini
mkdir -p .pio/libdeps/linux_sdl/paho/src
mkdir -p .pio/libdeps/linux_sdl_64bits/paho/src
- name: Install SDL2 library
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: List all files in current folder
run: |
ls -la
- name: Cat platformio_override.ini
run: |
cat platformio_override.ini
- name: Run PlatformIO
run: pio run -e linux_sdl
run: pio run -e d1-mini-esp32_ili9341 -e esp32-touchdown -e freetouchdeck -e huzzah32-featherwing-24 -e huzzah32-featherwing-35 -e lanbon_l8 -e m5stack-core2 -e wt32-sc01 -e d1-mini-esp8266_ili9341 -e linux_sdl_64bits
- name: Upload output file
uses: actions/upload-artifact@v2
with:
name: openHASP firmware.zip
path: build_output/firmware/*.bin
#- name: Create release and upload firmware
# run: |
# set -x
# assets=()
# for asset in build_output/firmware/*.bin; do
# assets+=("-a" "$asset")
# done
# tag_name="${GITHUB_REF##*/}"
# hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,74 +0,0 @@
name: Build Linux (Obsolete)
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environments:
- linux_sdl
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
# - name: Enable ESP platforms from platformio_override-template.ini
# run: |
# sed 's/; user_setups\/esp/user_setups\/esp/g' platformio_override-template.ini > platformio_override.ini
- name: Enable Linux platform from platformio_override.ini
run: |
sed -i 's/; user_setups\/linux/user_setups\/linux/g' platformio_override.ini
mkdir -p .pio/libdeps/linux_sdl/paho/src
- name: Install SDL2 library
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: List all files in current folder
run: |
ls -la
- name: Cat platformio_override.ini
run: |
cat platformio_override.ini
- name: Run PlatformIO
run: pio run -e ${{ matrix.environments }}
# - name: Upload output file
# uses: actions/upload-artifact@v2
# with:
# name: ${{ matrix.environments }}
# path: build_output/firmware/*.bin
#- name: Create release and upload firmware
# run: |
# set -x
# assets=()
# for asset in build_output/firmware/*.bin; do
# assets+=("-a" "$asset")
# done
# tag_name="${GITHUB_REF##*/}"
# hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,9 +1,8 @@
on:
# release:
# types: [created]
workflow_dispatch:
release:
types: [created]
name: Create Release (Obsolete)
name: Create Release
jobs:
build:
@ -12,23 +11,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
@ -39,7 +36,7 @@ jobs:
- name: Enable Linux platform from platformio_override.ini
run: |
sed -i 's/; user_setups\/linux/user_setups\/linux/g' platformio_override.ini
mkdir -p .pio/libdeps/linux_sdl/paho/src
mkdir -p .pio/libdeps/linux_sdl_64bits/paho/src
- name: Install SDL2 library
run: |
sudo apt-get update
@ -51,27 +48,9 @@ jobs:
run: |
cat platformio_override.ini
- name: Run PlatformIO
run: pio run -e lolin-d32-pro_ili9341
- name: Run PlatformIO
run: pio run -e az-touch-mod-esp32_ili9341_4MB -e az-touch-mod-esp32_ili9341_8MB
- name: Run PlatformIO
run: pio run -e makerfabs-tft35-cap_4MB -e makerfabs-tft35-cap_16MB
- name: Run PlatformIO
run: pio run -e yeacreate-nscreen32 -e
- name: Run PlatformIO
run: pio run -e d1-mini-esp32_ili9341
- name: Run PlatformIO
run: pio run -e esp32-touchdown -e freetouchdeck_4MB -e freetouchdeck_8MB
- name: Run PlatformIO
run: pio run -e huzzah32-featherwing-24 -e huzzah32-featherwing-35 -e huzzah32-featherwing-24-v2 -e huzzah32-featherwing-35-v2 -e huzzah32-v2-featherwing-24-v2 -e huzzah32-v2-featherwing-35-v2
- name: Run PlatformIO
run: pio run -e lanbon_l8
- name: Run PlatformIO
run: pio run -e wt32-sc01_4MB -e wt32-sc01_16MB
- name: Run PlatformIO
run: pio run -e m5stack-core2
run: pio run -e d1-mini-esp32_ili9341 -e esp32-touchdown -e freetouchdeck -e huzzah32-featherwing-24 -e huzzah32-featherwing-35 -e lanbon_l8 -e m5stack-core2 -e wt32-sc01 -e d1-mini-esp8266_ili9341 -e linux_sdl_64bits
- name: Upload output file
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v2
with:
name: openHASP firmware.zip
path: build_output/firmware/*.bin

37
.gitignore vendored
View File

@ -4,52 +4,22 @@
## Project files ######
.git
.pio
bin/*
data/*
!data/edit.htm
!data/en.json
!data/main.js
!data/openhasp.ttf
!data/style.css
!data/script.js
!data/vars.css
!data/cert/
!data/cert/x509_crt_bundle.bin
!data/pages/
!data/pages/*.jsonl
!data/static/
!data/static/*.gz
data/static/edit.htm.gz
data/static/en.json.gz
data/static/main.js.gz
data/static/script.js.gz
data/static/style.css.gz
data/static/*.js
src/user_setups/active/*
include/user_config_override.h
src/user_config_override.h
user_config_override.h
platformio_override.ini
user_setups/active/*
user_setups/custom/*
build_output/*
build_output/firmware/*.bin
build_output/firmware/*.exe
lib/SimpleFTPServer/examples/*
src/custom/*
!src/custom/README.md
!src/custom/bootlogo_template.h
!src/custom/my_custom_template.h
!src/custom/my_custom_template.cpp
!src/custom/my_custom_fan_template.cpp
#npm filter
node_modules/*
package.json
package-lock.json
## Test result files
*.xml
*.bin
## Visual Studio Code specific ######
!.vscode
@ -59,6 +29,3 @@ package-lock.json
.vscode/c_cpp_properties.json
.vscode/launch.json
*.bak
test/config.yaml
tools/mklittlefs*

7
.gitmodules vendored
View File

@ -1,4 +1,3 @@
[submodule "lib/freetype"]
path = lib/freetype
url = https://github.com/fvanroie/freetype
[submodule "lib/lv_lib_qrlodepng"]
path = lib/lv_lib_qrlodepng
url = https://github.com/littlevgl/lv_lib_lodepng

5
.gitpod.Dockerfile vendored
View File

@ -1,5 +0,0 @@
FROM gitpod/workspace-full
USER gitpod
RUN pip install -U platformio

View File

@ -1,7 +0,0 @@
tasks:
- init: cp platformio_override-template.ini platformio_override.ini
- before: platformio upgrade; npm install -g lv_font_conv
- command: echo "Please open 'platformio_override.ini', uncomment the platform, override and environment you wish to build for, save and then run command 'platformio run'."
image:
file: .gitpod.Dockerfile

View File

@ -1,11 +1,8 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-vscode.cpptools",
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-vscode.cpptools",
"platformio.platformio-ide"
]
}

View File

@ -1,329 +0,0 @@
# openHASP Changelog
## v0.7.0
!!! THE PARTITION SCHEME OF THE INTERNAL FLASH HAS CHANGED, CHECK THE DOCS BEFORE UPGRADING !!!
### Commands
- Removed deprecated `dim`, `brightness` and `light` commands, use `backlight` instead
### Objects
<!-- ? Support for State and Part properties -->
- `action` and `swipe` can now be set to any command
- Set default `line_width` of new `line` objects to 1
- Add `qrcode` object (thanks @marsman7)
- Allow line and block comments in pages.jsonl
- Removed deprecated `txt` property, use `text` instead
- Removed deprecated `objid` property, use `obj` instead
- HASP theme: Toggle objects now use the secondary color when they are in the toggled state.
### Fonts
- Firmware files include the bitmapped font sizes 12, 16, 24 and 32pt
- Use embedded TrueType font for other font sizes (PSram highly recommended)
- Add glyphs from Cyrillic, Latin-2, Greek and Viernamese character sets to default fonts
- Add 12 new MDI icons
### Web UI
- Update Web UI to petite-vue app
- Redesigned the File Editor
<!-- - _Selectable dark/light theme?_ -->
### Services
- Change MQTT client from _PubSubClient_ to asynchronic Espressif _esp_mqtt_ client
- Make the MQTT topics configurable
- MQTT discovery now uses a subtopic of `hasp/discovery`. Discovery requires version 0.7.x of the Custom Component.
- Add service start/stop mqtt
- Add SimpleFTPServer to easily upload and download files to the plate *(one simultaneous connection only)*
- Add service start/stop ftp
- Add configuration for NTP servers and timezone
- Add support system scripts executed when the idle level is changed
- Add support for WireGuard (thanks @perexg)
### Devices
- Add Elecrow ESP32-Terminal 3.5" SPI and RGB
- Add GS-T3E Smart Panel
- Add Lilygo Ttgo Lily Pi ESP32
- Add Makerfabs ESP32-S3 SPI
- Add Sunton ESP32-S3 TFT 4.3", 5.0" and 7.0"
- Add Sunton ESP32-2432S028R ESP32-3248S035C ESP32-3248S035R
- Add support for Wireless-Tag WT32-SC01 Plus and WT32S3-86V
- Deprecate support for WT-86-32-3ZW1 with ESP32-S2
- Fade backlight on ESP32 devices (thanks @presslab-us)
## Bug fixes
- Fix for first touch not working properly
- Add button GPIOs to input discovery message
### Architecture
- Moved to Tasmota Arduino 2.0.11 and ESP-IDF 4.4.5 (thanks @Jason2866)
- Add Arduino-GFX display driver
- Add support for ESP32-S3 and ESP32-C3 devices
- Deprecation of support for ESP32-S2 devices due to lack of sRAM
Updated libraries to Arduino_GFX v1.4.0, ArduinoJson 6.21.5, ArduinoStreamUtils 1.8.0, AceButton 1.10.1, TFT_eSPI 2.5.43, LovyanGFX 1.1.12 and SimpleFTPServer 2.1.5
## v0.6.3
### Commands
- Additional `idle` parameters now accept `off`, `short` and `long`
- Add `sensors` command to trigger the sensors state message
- Run `L:/boot.cmd` when the plate is (re)booted if the script exists
- You can now use the `pXbY.jsonl` command to update multiple object properties at once (thanks @nagyrobi)
### Objects
- All objects have a custom `tag` property which can contain arbitrary JSON data *(or numbers or text)* (thanks @nagyrobi)
- `img.src` now accepts both `http` and `https` urls (thanks @htvekov)
- `img.src` now accepts `png` and `binary` image urls, PSram is *highly* recommended
- `img.src` now accepts 16-bit BMP files stored in flash
### Web UI
- Updated to modern responsive design *(requires JavaScript)*
- Add `/api/info/` and `/api/config/*/` endpoints
- Allow for a customizable `vars.css`, `style.css`, `script.js` and `edit.htm`
- Display a message when the configuration is changed and a reboot is needed
- Add checkbox for backlight inversion to Display settings (thanks @wolffman122)
- Add checkbox to toggle ANSI codes #261 (thanks @geiseri)
- Allow firmware upgrade/downgrade in AP mode
### GUI
- `antiburn` displays random pixels *aka.* white noise
- Hide cursor during `antiburn` and `idle` if the pointer is enabled
### MQTT
- Remember last `page` id of `jsonl` messages. Sending multiple messages now behaves like `jsonl` files (thanks @arovak)
### Fonts
- Use TrueType fonts from flash, PSram is *highly* recommended (thanks to @s-hadinger)
- Custom LVGL binary fonts can be read from flash and loaded into memory, PSram is *highly* recommended
- Font ID is replaced by `namexx` *(where `xx` is the font size)* but the previous Font IDs still work for backwards compatibility
- Added build option for Vietnamese character set (thanks @kydang789)
- ⚠️ **Breaking:** Removed defunct .zi font support!
### Bug fixes
- Fixed Lanbon L8 v1.17 PCB screen corruption #316 (thanks @DJBenson)- Fix for screenshots not showing properly in Safari on macOS/iOS (thanks @masto)
- Fix bug that would not accept `on` state for setting output GPIOs #275 (thanks @freshnas and @cerietke)
- Fix a bug in `dropdownlist` were `close` method performed `open` instead #299 (thanks @htvekov)
- Fix `src` bug in `img` objects that could corrupt images sent over http (thanks @htvekov)
- Fix screen dimensions in `statusupdate` message, taking into account current orientation #278 (thanks @kquinsland)
- Fix for HTTP password that could be overwritten by 8 asterisks when it was not changed in the web UI
- Fixed MQTT hostname limit *again*... #304 (thanks @fake-name)
- Fixed firmware upgrade from URL #300 (thank @nagyrobi)
- Fixed a bug that prevented Wifi from connecting to different BSSID #330 (thanks @Braehead)
- Syslog message format fixes and improvements #285 (thanks @geiseri)
### Custom component
- Expose `antiburn` and `page` in the CC (thanks @dgomes)
- Expose the device URL in discovery message and CC
### Architecture
- Moved to Tasmota Arduino 2.0.3 with native LittleFS library (thanks @Jason2866) and ESP-IDF 4.4.1 fixes for FragAttacks CVEs (thanks @nagyrobi)
- Add support for ESP32-S2 devices
- ⚠️ **Breaking:** Removed support for ESP8266!
Updated libraries to ArduinoJson 6.19.4, ArduinoStreamUtils 1.6.3, AceButton 1.9.2, TFT_eSPI 2.4.61, LovyanGFX 0.4.17 and Adafruit STMPE610 1.1.4
## v0.6.2
### Initial Setup
- Add Captive Portal to first time setup (thanks @AndreTeixeira1998)
- Create default `pages.jsonl`, `online.cmd` and `offline.cmd` files if they don't exist (thanks @nagyrobi)
### Objects
- Enable `click` by default on `image` object
- Add `type` to `spinner` object
- Add `zoom`, `angle`, `pivot_x`, `pivot_y` and `antialias` attributes to `image` object
- Allow url as `src` of `image` object for raw webimages and from push image service from the CC (thanks @dgomes and @nagyrobi)
- Use `L:/file.png` instead of `/littlefs/file.png` for image paths, `/littlefs/` still works for backwards compatibility
### Objects
- Add `antiburn` command to prevent static parts of the screen to create a *ghosting* effect in some LCDs or conditions
### Devices
- Add Analog touch driver for Unoshield displays (thanks @wesleygas)
- Add AZ-Touch MOD ESP32 with 2.4" or 2.8"
- Add Lilygo®Ttgo Pi ESP32 with TFT 3.5"
- Add Waveshare ESP32 One development board with Rpi MHS4001(B) or Waveshare RPi(C) LCD display
- Add D1-R32 ESP32 development board with Waveshare ILI9486 Touch Shield
### Bug fixes
- Fix bug that caused a crash when both `btnmatrix` and `msgbox` where used (thanks @AndreTeixeira1998)
- Fix L8-HD dimmer brightness initialization after a reboot (thanks @Stupco)
- Keep last dimmer value when toggling dimmer state on/off
- Fix configurable mqttPort (thanks @Qargh)
- Fix opaque background of `spinner` object in HASP theme (thanks @nagyrobi)
Updated libraries to AceButton 1.9.1 and ArduinoJson 6.18.5
## v0.6.1
### Commands
- Add `run` command to execute script files (`.cmd` or `.jsonl`)
- Add `unzip` command for __no-compression__ zip files
- Add `service` command to start/stop a service
### Wifi
- Don't reboot the plate anymore after prolonged wifi connection lost
- Run `/online.cmd` or `/offline.cmd` script when the wifi status changed
### Objects
- Add new *[line](https://www.openhasp.com/0.6.1/design/objects/#line)* object
- Add `val` to *[btnmatrix](https://www.openhasp.com/0.6.1/design/objects/#button-matrix)* when `one_select` is set
- Cache up to 20 *[images](https://www.openhasp.com/0.6.1/design/objects/#image)* in PSram when available
- Improve precision on the *[linemeter](https://www.openhasp.com/0.6.1/design/objects/#line-meter)* scales
- Fix *[dropdown](https://www.openhasp.com/0.6.1/design/objects/#dropdown-list)* redraw bug
### Devices
- Fix [L8-HD dimmer](https://www.openhasp.com/0.6.1/devices/lanbon-l8/) not responding correctly to mqtt after a reboot
- Add [M5Stack Core2](https://www.openhasp.com/0.6.1/devices/m5stack-core2/) backlight dimming
- Add [Yeacreate Nscreen32](https://www.openhasp.com/0.6.1/devices/yeacreate-nscreen32/)
- Add [Makerfabs ESP32 TFT Touch](https://www.openhasp.com/0.6.1/devices/makerfabs-tft-touch/) Capacitive
### Fonts
- [Additional characters](https://www.openhasp.com/0.6.1/design/fonts/#ascii): `²` (squared) and `³` (cubed)
- [Additional icons](https://www.openhasp.com/0.6.1/design/fonts/#built-in-icons): recycle-variant and additional weather icons
- Use latin1 as default charset on [WT32-SC01](https://www.openhasp.com/0.6.1/devices/wt32-sc01/)
- Add [Greek font](https://www.openhasp.com/0.6.1/design/fonts/#greek)
### Compiling
- Allow custom bootlogo
- Selectively start http, telnet or console at boot
- Updated AceButton to 1.9.0 and ArduinoJson to 6.18.3
## v0.6.0
### Commands:
- Obsolete `dim` and `light` commands, use `backlight` command instead
- Add `discovery` command to facilitate HA CC discovery
- Add `idle` command to retrieve idle state, replaces `wakeup` command
- Updated `moodlight` command with brightness support
- Rewrite `outputX` and add `inputX` command
### Objects:
- `lmeter` object renamed to `linemeter`
- `align` values are now `left`, `right`, `center` instead of numbers *(numbers can still be used)*
- Added `ext_click_h` and `ext_click_v` attributes to extend the clickable area
- Added `clear` method to remove only the child objects from an object
- New `tabview`, `tab`, `calendar` and `msgbox` objects
- Add `img` object with png support *(needs PSram for any sizable images)*
- Added missing properties of the `spinner` object
### Web UI:
- Updated GPIO configuration pages
- Include a File Editor on ESP32: Create, Edit, Upload, Delete and Apply pages.jsonl (Thanks Cossie)
- Cache css, favicon and edit.htm.gz in the browser
- New Information page layout, including MQTT message counters for sent, received and failed
### MCU:
- Allow longer wifi ssid and password
- Update partition boundaries to use *all* remaining space for lfs filesystem
- Speed improvement: keep LVGL functions in fast memory & reduce overhead in main loop
- Use ascii characterset for WT32-SC01 due to limited flash size
### GPIO rewrite:
- Better handling of gpios
- Support for Lanbon L8-HD dimmer (EU and AU version, thanks to @Stupco)
- Add moodlight brightness support
### Broadcast and Discovery topic (HASP_USE_BROADCAST and HASP_USE_DISCOVERY)
- Allow dynamic configuration of HA entities using the [openHASP Custom Component](https://github.com/HASwitchPlate/openHASP-custom-component/releases/) (thanks @dgomes)
- Add Manufacturer and Model to statusupdate
Updated libraries to lvgl 7.11.0, ArduinoJson 6.18.0 and TFT_eSPI 2.3.70
### Internationalization:
- Added French language
- Added Portuguese language (thanks @AndreTeixeira1998 and @dgomes)
- Added Spanish language (thanks @altersis)
## v0.5.1
- Restore broken `config/submodule` topics
- Don't show warning on `comment` attribute
- Patched a potential memory leak
- Added an automatic lv_mem_defrag to free up lvgl memory
- Allow selection of fonts via user_config_override
- Allow for longer mqtt configuration strings in user_config_override
- Allow default HASP_GPIO_TEMPLATE configuration in user_config_override
- Add `manufacturer` and `model` to statusupdate
- Fixed `enabled` attribute and added `click` attribute
## v0.5.0
Name changed to openHASP - https://www.openhasp.com/
> When using HomeAssistant also update the [openHASP Custom Component](https://github.com/HASwitchPlate/openHASP-custom-component/releases/tag/0.5.0)
- Switch built-in icons from FontAwesome to MaterialDesign icons #139
- Add built option for other character sets then latin1
- Built-in Font sizes dependent on screen size
- Add `swipe` property to switch pages
- Add `action` property for local page navigation
- Add `back`, `prev`, `next` attributes to pages #114
- JSON Serialize text in payloads containing text attributes #140
- Add az-touch-mod-esp32_ili9341 config and allow for TFT_BACKLIGHT_ON set to LOW #131
- Add [FreeTouchDeck](https://www.openhasp.com/0.5/#devices/freetouchdeck/) and [ESP32-Touchdown](https://www.openhasp.com/0.5/#devices/esp32-touchdown/) configs
- Add roller `mode` `infinite` attribute
- Add btnmatrix `toggle` and `one_check` attributes
- Rework all event handlers to reduce update events and prevent race condition #119 *(events have changed!)*
- Add ability to style the selected part of roller object
- Add `scan_method = WIFI_ALL_CHANNEL_SCAN` for ESP32, improving multi-AP connection
- Add warning `objid` property is obsolete, use `obj` instead
- Add warning `txt` property is obsolete, use `text` instead
- Add dark theme build option for web UI
- Update lvgl and tft_espi library version
- Update maximum backlight_level from 100 to 255
- Set default `HASP_LOG_LEVEL=LOG_LEVEL_TRACE`
## v0.4.0
**Note:** The partition scheme has changed and you will need to reflash the device over serial first.
*All data will be erased, so make sure to backup your pages.jsonl, config.json and fonts.*
Changes:
- Provide all-in-one binary files for ESP32 to flash a device over serial using a single .bin file
- Allow long wifi passwords (#71 thanks @nagyrobi)
- Wakeup screen on first touch (#80)
- Reduce slider events (#88)
- Update events to accommodate the [HA Custom Component](https://github.com/HASwitchPlate/openHASP-custom-component) (by @dgomes)
- Remove HA auto-discovery in favor of the HA Custom Component
- Add `clearpage all` command option
- Add local page navigation and transitions
- Add [scale properties](https://www.openhasp.com/0.5/#styling/#scale)
- Add `config/gpio` command
- Allow for timezone setting in user_config_override.h (thanks @arovak)
- Start localizations for NL, HU and RO (thanks @nagyrobi)
- New prebuild devices:
- esp32-touchdown (thanks @joelhaasnoot and @dustinwatts)
- huzzah featherwing 2.4" and 3.5" (thanks @arovak)
- m5stack-core2
- Fix zi font crash bug
- Update setting min/max attributes (#103 thanks @arovak)
- Native builds for Windows, MacOS and Linux (thanks to @thouters and @dgomes)
## v0.3.4
The webserver was not properly started at initial setup, when the device was in AP mode.
## v0.3.3
- Change `txt` to `text`. `txt` is now obsoleted.
- Initial support for moodlight e.g. Lanbon L8
## v0.3.2
- Add Lanbon L8
- Add WT32-SC01
## v0.3.1
- Fixes wifi connection issue in OOBE
- Fixes memory leak in value_str
## v0.3.0
First release of compiled .bin files

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019-2024 Francis Van Roie
Copyright (c) 2019-2021 Francis Van Roie
Copyright (c) 2018-2019 Allen Derusha allen@derusha.org
Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@ -1,12 +1,11 @@
# openHASP firmware
[![GitHub Workflow Status]( https://img.shields.io/github/actions/workflow/status/HASwitchPlate/openHASP/build.yaml?branch=master&label=build%20status&logo=github&logoColor=%23dddddd)](https://github.com/HASwitchPlate/openHASP/actions)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/HASwitchPlate/openHASP/PlatformIO%20CI?label=build%20status&logo=github&logoColor=%23dddddd)](https://github.com/HASwitchPlate/openHASP/actions)
[![GitHub release](https://img.shields.io/github/v/release/HASwitchPlate/openHASP?include_prereleases)](https://github.com/HASwitchPlate/openHASP/releases)
[![GitHub issues](https://img.shields.io/github/issues/HASwitchPlate/openHASP.svg)](http://github.com/HASwitchPlate/openHASP/issues)
[![Discord](https://img.shields.io/discord/538814618106331137?color=%237289DA&label=discord&logo=discord&logoColor=white)][3]
[![Discord](https://img.shields.io/discord/538814618106331137?color=%237289DA&label=support&logo=discord&logoColor=white)][6]
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/HASwitchPlate/openHASP/blob/master/LICENSE)
[!["PayPal"](https://img.shields.io/badge/Paypal-donate-00457C.svg?logo=paypal)](https://github.com/HASwitchPlate/openHASP#donate)
Control your home-automation devices from a customizable touchscreen UI connected via MQTT.
@ -14,28 +13,67 @@ This project is a re-implementation of the popular HASwitchPlate sketch created
The [HASPone][1] project uses a Wemos D1 mini and requires a Nextion/TJC HMI display.
This rewrite removes the Nextion/TJC hardware requirement by using the [Light and Versatile Graphics Library][2] on the MCU to drive a commodity display.
openHASP uses the ESP32 and STM32F4 to take advantage of the hardware capabilities.
openHASP also adds ESP32 and STM32F4 support to take advantage of the additional hardware capabilities.
## Demo Screens
![Screenshot](https://www.openhasp.com/0.6/assets/images/screenshots/demo_switches_covers.png) &nbsp;
![Screenshot](https://www.openhasp.com/0.6/assets/images/screenshots/demo_jaffa1.png) &nbsp;
![Screenshot](https://www.openhasp.com/0.6/assets/images/screenshots/demo_mediaplayer.png)
![Screenshot](https://raw.githubusercontent.com/HASwitchPlate/openHASP/0.0.11/docs/img/sliders.png) &nbsp;
![Screenshot](https://raw.githubusercontent.com/HASwitchPlate/openHASP/0.0.11/docs/img/buttons.png) &nbsp;
![Screenshot](https://raw.githubusercontent.com/HASwitchPlate/openHASP/0.0.11/docs/img/mediaplayer.png)
## Features
| Feature | ESP8266 | ESP32 | STM32F4
|-------------------------|---------|---------|----------
| SPI display | :white_check_mark: yes | :white_check_mark: yes | :white_check_mark: yes
| Parallel display | :x: no | :white_check_mark: yes | :white_check_mark: yes
| PWM Screen dimming | :white_check_mark: yes | :white_check_mark: yes | :white_check_mark: yes
| Maximum Page Count | 4 | 12 | 12
| Object Types / Widgets | 14 | 15 | 15
| Dynamic Objects | :white_check_mark: yes | :white_check_mark: yes | :white_check_mark: yes
| [Lvgl Theme Support][3] | basic only | all themes | tbd
| [Custom .zi V5 font][4] | :white_check_mark: yes (latin1) | :white_check_mark: yes (latin1) | no
| [FontAwesome Icons][5] | :white_check_mark: 1300+ | :white_check_mark: 1300+ | no
| PNG images | :x: no | :grey_question: tbd | :grey_question: tbd
| Network | :white_check_mark: Wifi | :white_check_mark: Wifi | :white_check_mark: Ethernet
## Cloning
Make sure to add the `--recursive` parameter when cloning the project. Otherwise git will not download the required submodules in the `/lib` subdirectory.
```bash
git clone --recursive https://github.com/HASwitchPlate/openHASP
```
If you already cloned openHASP without the submodules, you can fetch the submodules seperately using:
```bash
git submodule update --init --recursive
```
To build a defierent branch use:
```bash
git clone --recursive https://github.com/HASwitchPlate/openHASP
cd openHASP
git checkout 0.4.0
git submodule update --init --recursive
```
## Getting Started
Check out the [documentation](https://www.openhasp.com/) for how-to's, information and frequently asked questions.</br>
For support using openHASP, please join the [#openHASP channel][3] on Discord.
Check out the [documentation](https://haswitchplate.github.io/openHASP-docs/) for how-to's, information and frequently asked questions.
Support
---------------------------
For support using openHASP, please join the [#openHASP channel][6] on Discord.
## Donate
[![Paypal donation](https://img.shields.io/badge/Paypal-donate-00457C?style=for-the-badge&logo=paypal)][4]
[![Buy a coffee](https://img.shields.io/badge/Kofi-donate-FF5E5B?style=for-the-badge&logo=kofi)](https://ko-fi.com/openhasp)
[![Buy me a coffee](https://img.shields.io/badge/Buy_Me_a_Coffee-donate-FFDD00?style=for-the-badge&logo=buymeacoffee)](https://www.buymeacoffee.com/aktdCofU)
[1]: https://github.com/HASwitchPlate/HASPone
[2]: https://github.com/lvgl/lvgl
[3]: https://www.openhasp.com/discord
[4]: https://www.paypal.com/donate/?business=E76SN28JLZCXU&currency_code=EUR
[3]: https://littlevgl.com/themes
[4]: https://github.com/fvanroie/HMI-Font-Pack/releases
[5]: https://fontawesome.com/cheatsheet/
[6]: https://discord.gg/VCWyuhF

View File

@ -1,35 +0,0 @@
{
"build": {
"arduino": {
"ldscript": "esp32s2_out.ld"
},
"core": "esp32",
"extra_flags": "-DBOARD_HAS_PSRAM",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s2",
"variant": "esp32s2",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s2.cfg"
},
"frameworks": [
"espidf",
"arduino"
],
"name": "Espressif Generic ESP32-S2",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html",
"vendor": "Espressif"
}

View File

@ -1,35 +0,0 @@
{
"build": {
"arduino": {
"ldscript": "esp32s2_out.ld"
},
"core": "esp32",
"extra_flags": "-DBOARD_HAS_PSRAM -DCORE32SOLO1",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qoi",
"mcu": "esp32s2",
"variant": "esp32s2",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s2.cfg"
},
"frameworks": [
"espidf",
"arduino"
],
"name": "Espressif Generic ESP32-S2",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html",
"vendor": "Espressif"
}

View File

@ -1,43 +0,0 @@
{
"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,41 +0,0 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "opi_opi"
},
"boot": "opi",
"psram_type": "opi",
"core": "esp32",
"extra_flags": [
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"espidf",
"arduino"
],
"name": "Espressif Generic ESP32-S3 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}

View File

@ -1,41 +0,0 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "opi_qspi"
},
"boot": "opi",
"psram_type": "qspi",
"core": "esp32",
"extra_flags": [
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"espidf",
"arduino"
],
"name": "Espressif Generic ESP32-S3 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}

View File

@ -1,41 +0,0 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_opi"
},
"boot": "qio",
"psram_type": "opi",
"core": "esp32",
"extra_flags": [
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"espidf",
"arduino"
],
"name": "Espressif Generic ESP32-S3 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}

View File

@ -1,41 +0,0 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_qspi"
},
"boot": "qio",
"psram_type": "qspi",
"core": "esp32",
"extra_flags": [
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "esp32_partition_app1856k_spiffs320k.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"espidf",
"arduino"
],
"name": "Espressif Generic ESP32-S3 4M Flash, Tasmota 1856k Code/OTA, 320k FS",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/",
"vendor": "Espressif"
}

View File

@ -1,5 +0,0 @@
files:
- source: data/en.json
translation: /data/%locale_with_underscore%.%file_extension%
- source: /src/lang/en_US.h
translation: /%original_path%/%locale_with_underscore%.%file_extension%

Binary file not shown.

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "Dansk",
"home": {
"title": "Hovedmenu",
"btn": "Hovedmenu",
"nav": "Forside"
},
"save": "Gem Indstillinger",
"user": "Brugernavn",
"pass": "Adgangskode",
"hasp": {
"title": "HASP Design",
"btn": "HASP Design",
"theme": "UI Tema",
"color1": "Primær farve",
"color2": "Sekundær farve",
"pages": "Start Layout",
"font": "Standardfont",
"startpage": "Opstarts side",
"startdim": "Opstartslysstyrke"
},
"screenshot": {
"title": "Skærmbillede",
"btn": "Skærmbillede",
"nav": "Skærmbillede",
"prev": "Forrige Side",
"next": "Næste Side",
"refresh": "Opdater"
},
"info": {
"title": "Information",
"btn": "Information",
"nav": "Information"
},
"config": {
"title": "Konfiguration",
"btn": "Konfiguration",
"nav": "Indstillinger"
},
"ota": {
"title": "Firmware Opdatering",
"btn": "Firmware Opdatering",
"nav": "Firmware",
"submit": "Opdater Firmware",
"file": "Firmware Fil",
"url": "Firmware URL",
"redirect": "Følg Omdirigeringer",
"never": "Aldrig",
"strict": "Streng",
"always": "Altid"
},
"editor": {
"title": "Fil Editor",
"btn": "Fil Editor",
"nav": "Fil Editor"
},
"reset": {
"title": "Gendan fabriksindstillinger",
"btn": "Gendan fabriksindstillinger",
"warning": "Advarsel",
"message": "Denne proces vil nulstille alle indstillinger til standardværdierne. Den interne flash vil blive slettet, og enheden genstartes. Du skal muligvis oprette forbindelse til WiFi AP vist på panelet for at omkonfigurere enheden, før du får adgang til den igen.",
"fileloss": "ALLE FILER VIL TABE!"
},
"reboot": {
"title": "Genstarter...",
"btn": "Genstart",
"nav": "Genstart",
"message": "Enheden er ved at genstarte."
},
"about": {
"credits": "Baseret på det tidligere arbejde fra følgende open source-udviklere:",
"copyright": "Ophavsret ",
"rights": "Alle rettigheder forbeholdes.",
"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": "WiFi Indstillinger",
"btn": "WiFi Indstillinger",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "MQTT Indstillinger",
"btn": "MQTT Indstillinger",
"name": "Værtsnavn",
"group": "Gruppenavn",
"host": "Broker",
"port": "Port",
"node_t": "Node Emne",
"group_t": "Gruppe Emne",
"broadcast_t": "Broadcast Emne",
"hass_t": "HA LWT Emne"
},
"http": {
"title": "HTTP Indstillinger",
"btn": "HTTP Indstillinger"
},
"ftp": {
"title": "FTP Indstillinger",
"btn": "FTP Indstillinger",
"port": "FTP Port",
"pasv": "Passiv Port"
},
"gui": {
"title": "Skærm Indstillinger",
"btn": "Skærm Indstillinger",
"antiburn": "Antiforbrænding",
"calibrate": "Kalibrér"
},
"gpio": "GPIO Indstillinger",
"debug": {
"title": "Debug Indstillinger",
"btn": "Debug Indstillinger",
"baud": "Baudrate",
"tele": "Tele Periode",
"ansi": "Brug ANSI-koder",
"host": "Syslog Server",
"port": "Syslog Port",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facilitet"
},
"time": {
"title": "Tids Indstillinger",
"btn": "Tids Indstillinger",
"region": "Region",
"zone": "Tidszone",
"tz": "Tidszone",
"ntp": "NTP-servere"
},
"region": {
"etc": "Etcetera ",
"continents": "Kontinenter ",
"af": "Afrika ",
"as": "Asien ",
"au": "Australien ",
"aq": "Antarktis ",
"eu": "Europa ",
"na": "Nordamerika ",
"sa": "Sydamerika ",
"islands": "Øer ",
"at": "Atlanterhavet ",
"in": "Indiske Ocean ",
"pa": "Stillehavet "
}
}
}

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "Deutsch",
"home": {
"title": "Hauptmenü",
"btn": "Hauptmenü",
"nav": "Startseite"
},
"save": "Einstellungen speichern",
"user": "Benutzername",
"pass": "Passwort",
"hasp": {
"title": "HASP-Design",
"btn": "HASP-Design",
"theme": "UI-Thema",
"color1": "Hauptfarbe",
"color2": "Sekundärfarbe",
"pages": "Start-Layout",
"font": "Standardschrift",
"startpage": "Startseite",
"startdim": "Starthelligkeit"
},
"screenshot": {
"title": "Bildschirmaufnahme",
"btn": "Bildschirmaufnahme",
"nav": "Bildschirmaufnahme",
"prev": "Vorherige Seite",
"next": "Nächste Seite",
"refresh": "Aktualisieren"
},
"info": {
"title": "Informationen",
"btn": "Informationen",
"nav": "Informationen"
},
"config": {
"title": "Konfiguration",
"btn": "Konfiguration",
"nav": "Konfiguration"
},
"ota": {
"title": "Firmware Update",
"btn": "Firmware Update",
"nav": "Firmware",
"submit": "Firmware aktualisieren",
"file": "Firmware-Datei",
"url": "Firmware-URL",
"redirect": "Umleitungen folgen",
"never": "Niemals",
"strict": "Strikt",
"always": "Immer"
},
"editor": {
"title": "Datei Editor",
"btn": "Datei Editor",
"nav": "Datei Editor"
},
"reset": {
"title": "Werkseinsetzung",
"btn": "Werkseinstellungen zurücksetzen",
"warning": "Warnung",
"message": "Dieser Prozess setzt alle Einstellungen auf die Standardwerte zurück. Der interne Blitz wird gelöscht und das Gerät wird neu gestartet. Möglicherweise müssen Sie eine Verbindung zu dem WiFi AP auf dem Panel herstellen, um das Gerät neu zu konfigurieren, bevor Sie auf es erneut zugreifen.",
"fileloss": "ALLE DATEIEN WERDEN GELÖSCHT!"
},
"reboot": {
"title": "Neustarten...",
"btn": "Neustarten",
"nav": "Neustart",
"message": "Das Gerät wird neu gestartet."
},
"about": {
"credits": "Basierend auf der bisherigen Arbeit der folgenden Open-Source-Entwickler:",
"copyright": "Urheberrechte ",
"rights": "Alle Rechte vorbehalten.",
"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-Lizenz",
"bsd": "BSD-Lizenz",
"freebsd": "FreeBSD-Lizenz",
"apache2": "Apache2-Lizenz"
},
"wifi": {
"title": "WiFi-Einstellungen",
"btn": "WiFi-Einstellungen",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Einstellungen",
"btn": "WireGuard Einstellungen",
"vpnip": "VPN IP",
"privkey": "Privater Schlüssel",
"host": "Entfernte IP",
"port": "Entfernter Port",
"pubkey": "Öffentlicher Remote-Schlüssel"
},
"mqtt": {
"title": "MQTT-Einstellungen",
"btn": "MQTT-Einstellungen",
"name": "Hostname",
"group": "Gruppenname",
"host": "Broker",
"port": "Port",
"node_t": "Knoten-Thema",
"group_t": "Gruppen-Thema",
"broadcast_t": "Broadcast-Thema",
"hass_t": "HA LWT-Thema"
},
"http": {
"title": "HTTP-Einstellungen",
"btn": "HTTP-Einstellungen"
},
"ftp": {
"title": "FTP-Einstellungen",
"btn": "FTP-Einstellungen",
"port": "FTP-Port",
"pasv": "Passiver Port"
},
"gui": {
"title": "Bildschirmeinstellungen",
"btn": "Bildschirmeinstellungen",
"antiburn": "Anti-Burn",
"calibrate": "Kalibrieren"
},
"gpio": "GPIO-Einstellungen",
"debug": {
"title": "Debug-Einstellungen",
"btn": "Debug-Einstellungen",
"baud": "Baudrate",
"tele": "Tele-Periode",
"ansi": "ANSI-Codes verwenden",
"host": "Syslog-Server",
"port": "Syslog-Port",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Zeit Einstellungen",
"btn": "Zeit Einstellungen",
"region": "Region",
"zone": "Zeitzone",
"tz": "Zeitzone",
"ntp": "NTP-Server"
},
"region": {
"etc": "Etcetera ",
"continents": "Kontinenten ",
"af": "Afrika ",
"as": "Asien ",
"au": "Australien ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "Nordamerika ",
"sa": "Südamerika ",
"islands": "Inseln ",
"at": "Atlantischer Ozean ",
"in": "Indischer Ozean ",
"pa": "Pazifischer Ozean "
}
}
}

View File

@ -1 +0,0 @@
<!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

@ -1 +0,0 @@
{"en":{"language":"English","home":{"title":"Main Menu","btn":"Main Menu","nav":"Home"},"save":"Save Settings","user":"Username","pass":"Password","hasp":{"title":"HASP Design","btn":"HASP Design","theme":"UI Theme","color1":"Primary color","color2":"Secondary color","pages":"Start Layout","font":"Default Font","startpage":"Startup Page","startdim":"Startup Dim"},"screenshot":{"title":"Screenshot","btn":"Screenshot","nav":"Screenshot","prev":"Prev Page","next":"Next Page","refresh":"Refresh"},"info":{"title":"Information","btn":"Information","nav":"Information"},"config":{"title":"Configuration","btn":"Configuration","nav":"Settings"},"ota":{"title":"Firmware Update","btn":"Firmware Update","nav":"Firmware","submit":"Update Firmware","file":"Firmware File","url":"Firmware URL","redirect":"Follow Redirects","never":"Never","strict":"Strict","always":"Always"},"editor":{"title":"File Editor","btn":"File Editor","nav":"File Editor"},"reset":{"title":"Factory Reset","btn":"Factory Reset","warning":"Warning","message":"This process will reset all settings to the default values. The internal flash will be erased and the device is restarted. You may need to connect to the WiFi AP displayed on the panel to reconfigure the device before accessing it again.","fileloss":"ALL FILES WILL BE LOST!"},"reboot":{"title":"Rebooting...","btn":"Restart","nav":"Reboot","message":"The device is rebooting."},"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 License","bsd":"BSD License","freebsd":"FreeBSD License","apache2":"Apache2 License"},"wifi":{"title":"Wifi Settings","btn":"Wifi Settings","ssid":"SSID"},"wg":{"title":"WireGuard Settings","btn":"WireGuard Settings","vpnip":"VPN IP","privkey":"Private Key","host":"Remote IP","port":"Remote Port","pubkey":"Remote Public Key"},"mqtt":{"title":"MQTT Settings","btn":"MQTT Settings","name":"Hostname","group":"Groupname","host":"Broker","port":"Port","node_t":"Node Topic","group_t":"Group Topic","broadcast_t":"Broadcast Topic","hass_t":"HA LWT Topic"},"http":{"title":"HTTP Settings","btn":"HTTP Settings"},"ftp":{"title":"FTP Settings","btn":"FTP Settings","port":"FTP Port","pasv":"Passive Port"},"gui":{"title":"Display Settings","btn":"Display Settings","antiburn":"Antiburn","calibrate":"Calibrate"},"gpio":"GPIO Settings","debug":{"title":"Debug Settings","btn":"Debug Settings","baud":"Baudrate","tele":"Tele Period","ansi":"Use ANSI codes","host":"Syslog Server","port":"Syslog Port","ietf":"IETF (RFC 5424)","bsd":"BSD (RFC 3164)","log":"Facility"},"time":{"title":"Time Settings","btn":"Time Settings","region":"Region","zone":"Timezone","tz":"Timezone","ntp":"NTP Servers"},"region":{"etc":"Etcetera ","continents":"Continents ","af":"Africa ","as":"Asia ","au":"Australia ","aq":"Antarctica ","eu":"Europe ","na":"North America ","sa":"South America ","islands":"Islands ","at":"Atlantic Ocean ","in":"Indian Ocean ","pa":"Pacific Ocean "}}}

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "Español",
"home": {
"title": "Menu Principal",
"btn": "Menu Principal",
"nav": "Inicio"
},
"save": "Guardar Configuración",
"user": "Usuario",
"pass": "Contraseña",
"hasp": {
"title": "Diseño de HASP",
"btn": "Diseño de HASP",
"theme": "Tema de IU",
"color1": "Color Primario",
"color2": "Color Secundario",
"pages": "Diseño Inicial",
"font": "Fuente por Defecto",
"startpage": "Página de Inicio",
"startdim": "Brillo Inicial"
},
"screenshot": {
"title": "Captura de Pantalla",
"btn": "Captura de Pantalla",
"nav": "Captura de Pantalla",
"prev": "Prev Página",
"next": "Siguiente Página",
"refresh": "Actualizar"
},
"info": {
"title": "Información",
"btn": "Información",
"nav": "Información"
},
"config": {
"title": "Configuración",
"btn": "Configuración",
"nav": "Configuraciones"
},
"ota": {
"title": "Actualización de Firmware",
"btn": "Actualización de Firmware",
"nav": "Firmware",
"submit": "Actualizar Firmware",
"file": "Archivo Firmware",
"url": "URL del Firmware",
"redirect": "Sigue Redirecciones",
"never": "Nunca",
"strict": "Estricto",
"always": "Siempre"
},
"editor": {
"title": "Editor de Archivos",
"btn": "Editor de Archivos",
"nav": "Editor de Archivos"
},
"reset": {
"title": "Reconfiguración de Fábrica",
"btn": "Restaurar conf de Fábrica",
"warning": "Aviso",
"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": {
"title": "Reiniciando...",
"btn": "Reiniciar",
"nav": "Reiniciar",
"message": "El dispositivo se está reiniciando."
},
"about": {
"credits": "Basado en el trabajo anterior de los siguientes desarrolladores de código abierto:",
"copyright": "Copyright ",
"rights": "Todos los derechos reservados.",
"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": "Licencia MIT",
"bsd": "Licencia BSD",
"freebsd": "Licencia FreeBSD",
"apache2": "Licencia Apache2"
},
"wifi": {
"title": "Ajustes WiFi",
"btn": "Ajustes WiFi",
"ssid": "SSID"
},
"wg": {
"title": "Ajustes de WireGuard",
"btn": "Ajustes de WireGuard",
"vpnip": "IP VPN",
"privkey": "Clave Privada",
"host": "IP Remota",
"port": "Puerto Remoto",
"pubkey": "Clave Pública Remota"
},
"mqtt": {
"title": "Ajustes MQTT",
"btn": "Ajustes MQTT",
"name": "Nombre del Host",
"group": "Nombre del Grupo",
"host": "Broker",
"port": "Puerto",
"node_t": "Tema del Nodo",
"group_t": "Tema del Grupo",
"broadcast_t": "Tema de Broadcast",
"hass_t": "Tema HA LWT"
},
"http": {
"title": "Ajustes HTTP",
"btn": "Ajustes HTTP"
},
"ftp": {
"title": "Ajustes FTP",
"btn": "Ajustes FTP",
"port": "Puerto FTP",
"pasv": "Puerto Pasivo"
},
"gui": {
"title": "Ajustes de Pantalla",
"btn": "Ajustes de Pantalla",
"antiburn": "Anti-quemaduras",
"calibrate": "Calibrar"
},
"gpio": "Ajustes GPIO",
"debug": {
"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",
"port": "Puerto Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Ajustes de Tiempo",
"btn": "Ajustes de Tiempo",
"region": "Región",
"zone": "Zona Horaria",
"tz": "Zona Horaria",
"ntp": "Servidor NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continentes ",
"af": "Africa ",
"as": "Asia ",
"au": "Australia ",
"aq": "Antártida ",
"eu": "Europa ",
"na": "América del Norte ",
"sa": "América del Sur ",
"islands": "Islas ",
"at": "Océano Atlántico ",
"in": "Océano Índico ",
"pa": "Océano Pacífico "
}
}
}

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "Français",
"home": {
"title": "Menu Principal",
"btn": "Menu Principal",
"nav": "Page d'accueil"
},
"save": "Enregistrer les Paramètres",
"user": "Nom d'utilisateur",
"pass": "Mot de Passe",
"hasp": {
"title": "Design HASP",
"btn": "Design HASP",
"theme": "Thème UI",
"color1": "Couleur Primaire",
"color2": "Couleur Secondaire",
"pages": "Mise en page",
"font": "Police par défaut",
"startpage": "Page de départ",
"startdim": "Luminosité"
},
"screenshot": {
"title": "Capture d'écran",
"btn": "Capture d'écran",
"nav": "Capture d'écran",
"prev": "Page Précédente",
"next": "Page Suivante",
"refresh": "Actualiser"
},
"info": {
"title": "Information",
"btn": "Information",
"nav": "Information"
},
"config": {
"title": "Configuration",
"btn": "Configuration",
"nav": "Paramètres"
},
"ota": {
"title": "Mise à jour du micrologiciel",
"btn": "Mise à jour du micrologiciel",
"nav": "Micrologiciel",
"submit": "Mettre à jour le firmware",
"file": "Fichier du Firmware",
"url": "URL du Firmware",
"redirect": "Suivre les redirections",
"never": "Jamais",
"strict": "Stricte",
"always": "Toujours"
},
"editor": {
"title": "Éditeur de fichiers",
"btn": "Éditeur de fichiers",
"nav": "Éditeur de fichiers"
},
"reset": {
"title": "Paramètres d'usine",
"btn": "Retour aux paramètres d'usine",
"warning": "Attention",
"message": "Ce processus va réinitialiser tous les paramètres aux valeurs par défaut. Le flash interne sera effacé et l'appareil sera redémarré. Il se peut que vous deviez vous connecter à l'AP WiFi affiché sur le panneau pour reconfigurer l'appareil avant d'y accéder.",
"fileloss": "TOUS LES FICHIERS SERONT PERDUS !"
},
"reboot": {
"title": "Redémarrage en cours...",
"btn": "Redémarrer",
"nav": "Redémarrer",
"message": "L'appareil est en cours de redémarrage."
},
"about": {
"credits": "Basé sur le travail précédent des développeurs Open Source suivants :",
"copyright": "Droits dauteur ",
"rights": "Tous les droits sont réservés.",
"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": "Licence MIT",
"bsd": "Licence BSD",
"freebsd": "Licence FreeBSD",
"apache2": "Licence Apache2"
},
"wifi": {
"title": "Paramètres WiFi",
"btn": "Paramètres WiFi",
"ssid": "SSID"
},
"wg": {
"title": "Paramètres WireGuard",
"btn": "Paramètres WireGuard",
"vpnip": "IP du VPN",
"privkey": "Clé Privée",
"host": "Adresse IP distante",
"port": "Port Distant",
"pubkey": "Clé publique distante"
},
"mqtt": {
"title": "Paramètres MQTT",
"btn": "Paramètres MQTT",
"name": "Nom d'hôte",
"group": "Groupe",
"host": "Broker",
"port": "Port",
"node_t": "Sujet du Node",
"group_t": "Sujet de Groupe",
"broadcast_t": "Sujet Broadcast",
"hass_t": "Sujet HA LWT"
},
"http": {
"title": "Paramètres HTTP",
"btn": "Paramètres HTTP"
},
"ftp": {
"title": "Paramètres FTP",
"btn": "Paramètres FTP",
"port": "Port FTP",
"pasv": "Port Passif"
},
"gui": {
"title": "Paramètres d'affichage",
"btn": "Paramètres d'affichage",
"antiburn": "Anti-brûlure",
"calibrate": "Calibrer"
},
"gpio": "Paramètres GPIO",
"debug": {
"title": "Paramètres de Débogage",
"btn": "Paramètres de Débogage",
"baud": "Baudrate",
"tele": "Période de Tele",
"ansi": "Utiliser les codes ANSI",
"host": "Serveur Syslog",
"port": "Port Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Paramètres de l'heure",
"btn": "Paramètres de l'heure",
"region": "Région",
"zone": "Fuseau horaire",
"tz": "Fuseau horaire",
"ntp": "Serveurs NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continents ",
"af": "L'Afrique ",
"as": "L'Asie ",
"au": "L'Australie ",
"aq": "Antarctique ",
"eu": "LEurope ",
"na": "L'Amérique du Nord ",
"sa": "L'Amérique du Sud ",
"islands": "Îles ",
"at": "L'océan Atlantique ",
"in": "L'océan Indien ",
"pa": "L'océan Pacifique "
}
}
}

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "Magyar",
"home": {
"title": "Főmenü",
"btn": "Főmenü",
"nav": "Főoldal"
},
"save": "Beállítások mentése",
"user": "Felhasználónév",
"pass": "Jelszó",
"hasp": {
"title": "Képernyő dizájn",
"btn": "Képernyő dizájn",
"theme": "UI téma",
"color1": "Elsődleges szín",
"color2": "Másodlagos szín",
"pages": "Betöltendő oldalak",
"font": "Alapértelmezett font",
"startpage": "Kezdő oldal",
"startdim": "Kezdeti fényerő"
},
"screenshot": {
"title": "Képernyőkép",
"btn": "Képernyőkép",
"nav": "Képernyőkép",
"prev": "Előző oldal",
"next": "Következő oldal",
"refresh": "Frissítés"
},
"info": {
"title": "Információk",
"btn": "Információk",
"nav": "Információk"
},
"config": {
"title": "Beállítások",
"btn": "Beállítások",
"nav": "Beállítások"
},
"ota": {
"title": "Firmware frissítés",
"btn": "Firmware frissítés",
"nav": "Firmware",
"submit": "Firmware frissítése",
"file": "Firmware fájl",
"url": "Firmware URL",
"redirect": "Átirányítások",
"never": "Soha",
"strict": "Szigorú",
"always": "Mindig"
},
"editor": {
"title": "Fájlkezelő",
"btn": "Fájlkezelő",
"nav": "Fájlkezelő"
},
"reset": {
"title": "Gyári beállítások visszaállítása",
"btn": "Gyári beállítások visszaállítása",
"warning": "Képernyőkép",
"message": "Ez a folyamat az összes beállítást visszaállítja az alapértelmezett értékekre. A belső memória törlődik, majd a készülék újraindul. Előfordulhat, hogy csatlakoznia kell a panelen megjelenő WiFi hozzáférési ponthoz az eszköz újrakonfigurálásához, mielőtt ismét hozzá tudna férni.",
"fileloss": "AZ ÖSSZES FÁJL TÖRLŐDIK!"
},
"reboot": {
"title": "Újraindítás...",
"btn": "Újraindítás",
"nav": "Újraindítás",
"message": "Az eszköz újraindul."
},
"about": {
"credits": "Az alábbi nyílt forráskódú fejlesztők korábbi munkája alapján:",
"copyright": "Copyright ",
"rights": "Minden jog fenntartva.",
"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 licenc",
"bsd": "BSD licenc",
"freebsd": "FreeBSD licenc",
"apache2": "Apache2 licenc"
},
"wifi": {
"title": "WiFi beállítások",
"btn": "WiFi beállítások",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "MQTT beállítások",
"btn": "MQTT beállítások",
"name": "Név",
"group": "Csoport",
"host": "Szerver",
"port": "Port",
"node_t": "Eszköz topik",
"group_t": "Csoport topik",
"broadcast_t": "Mindenki topik",
"hass_t": "HA LWT topik"
},
"http": {
"title": "HTTP beállítások",
"btn": "HTTP beállítások"
},
"ftp": {
"title": "FTP beállítások",
"btn": "FTP beállítások",
"port": "FTP Port",
"pasv": "Passzív Port"
},
"gui": {
"title": "Képernyő beállítások",
"btn": "Képernyő beállítások",
"antiburn": "Beégésvédelem futtatása",
"calibrate": "Kalibrálás"
},
"gpio": "GPIO beállítások",
"debug": {
"title": "Hibakeresési beállítások",
"btn": "Hibakeresési beállítások",
"baud": "Baud ráta",
"tele": "Tele- periódus",
"ansi": "ANSI kódolás",
"host": "Syslog szerver",
"port": "Syslog port",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Idő beállítások",
"btn": "Idő beállítások",
"region": "Régió",
"zone": "Időzóna",
"tz": "Időzóna",
"ntp": "NTP szerverek"
},
"region": {
"etc": "Etcetera ",
"continents": "Kontinensek ",
"af": "Afrika ",
"as": "Ázsia ",
"au": "Ausztrália ",
"aq": "Antarktika ",
"eu": "Európa ",
"na": "Észak-Amerika ",
"sa": "Dél-Amerika ",
"islands": "Szigetek ",
"at": "Atlanti-óceán ",
"in": "Indiai-óceán ",
"pa": "Csendes-óceán "
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "Nederlands",
"home": {
"title": "Hoofdmenu",
"btn": "Hoofdmenu",
"nav": "Hoofdpagina"
},
"save": "Instellingen Opslaan",
"user": "Gebruikersnaam",
"pass": "Wachtwoord",
"hasp": {
"title": "HASP Design",
"btn": "HASP Design",
"theme": "UI Thema",
"color1": "Primaire Kleur",
"color2": "Secundaire Kleur",
"pages": "Start Lay-out",
"font": "Standaard Lettertype",
"startpage": "Startpagina",
"startdim": "Start Helderheid"
},
"screenshot": {
"title": "Schermafdruk",
"btn": "Schermafdruk",
"nav": "Schermafdruk",
"prev": "Vorige Pagina",
"next": "Volgende Pagina",
"refresh": "Vernieuwen"
},
"info": {
"title": "Informatie",
"btn": "Informatie",
"nav": "Informatie"
},
"config": {
"title": "Instellingen",
"btn": "Instellingen",
"nav": "Instellingen"
},
"ota": {
"title": "Firmware Bijwerken",
"btn": "Firmware Bijwerken",
"nav": "Firmware",
"submit": "Firmware Bijwerken",
"file": "Firmware Bestand",
"url": "Firmware URL",
"redirect": "Volg Redirects",
"never": "Nooit",
"strict": "Strikt",
"always": "Altijd"
},
"editor": {
"title": "Bestandseditor",
"btn": "Bestandseditor",
"nav": "Bestandseditor"
},
"reset": {
"title": "Fabrieksinstellingen",
"btn": "Fabrieksinstellingen",
"warning": "Waarschuwing",
"message": "Dit proces zal alle instellingen terugzetten naar de standaardwaarden. De interne flash zal worden gewist en het apparaat wordt opnieuw gestart. U moet mogelijk verbinding maken met het Wifi AP die wordt weergegeven op het paneel om het apparaat opnieuw te configureren voordat u weer toegang krijgt.",
"fileloss": "ALLE BESTANDEN WORDEN VERWIJDERD!"
},
"reboot": {
"title": "Herstarten...",
"btn": "Herstarten",
"nav": "Herstart",
"message": "Het apparaat wordt herstart."
},
"about": {
"credits": "Gebaseerd op het eerdere werk van de volgende Open Source ontwikkelaars:",
"copyright": "Copyright ",
"rights": "Alle rechten voorbehouden.",
"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 Licentie",
"bsd": "BSD Licentie",
"freebsd": "FreeBSD Licentie",
"apache2": "Apache2 Licentie"
},
"wifi": {
"title": "Wifi Instellingen",
"btn": "Wifi Instellingen",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Instellingen",
"btn": "WireGuard Instellingen",
"vpnip": "VPN IP",
"privkey": "Private Sleutel",
"host": "Extern IP",
"port": "Externe Poort",
"pubkey": "Externe Openbare Sleutel"
},
"mqtt": {
"title": "MQTT Instellingen",
"btn": "MQTT Instellingen",
"name": "Hostnaam",
"group": "Groepsnaam",
"host": "Broker",
"port": "Poort",
"node_t": "Node Onderwerp",
"group_t": "Groep Onderwerp",
"broadcast_t": "Broadcast Onderwerp",
"hass_t": "HA LWT Onderwerp"
},
"http": {
"title": "HTTP Instellingen",
"btn": "HTTP Instellingen"
},
"ftp": {
"title": "FTP Instellingen",
"btn": "FTP Instellingen",
"port": "FTP Poort",
"pasv": "Passieve Poort"
},
"gui": {
"title": "Scherminstellingen",
"btn": "Scherminstellingen",
"antiburn": "Inbranden Voorkomen",
"calibrate": "Kalibreer"
},
"gpio": "GPIO Instellingen",
"debug": {
"title": "Debug Instellingen",
"btn": "Debug Instellingen",
"baud": "Baudrate",
"tele": "Tele Periode",
"ansi": "Gebruik ANSI codes",
"host": "Syslog Server",
"port": "Syslog Poort",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Faciliteit"
},
"time": {
"title": "Tijdsinstellingen",
"btn": "Tijdsinstellingen",
"region": "Regio",
"zone": "Tijdzone",
"tz": "Tijdzone",
"ntp": "NTP Servers"
},
"region": {
"etc": "Etcetera ",
"continents": "Continenten ",
"af": "Afrika ",
"as": "Azië ",
"au": "Australië ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "Noord-Amerika ",
"sa": "Zuid-Amerika ",
"islands": "Eilanden ",
"at": "Atlantische Oceaan ",
"in": "Indische Oceaan ",
"pa": "Stille Oceaan "
}
}
}

Binary file not shown.

View File

@ -1,73 +0,0 @@
{"page":1,"comment":"Connected Relay Buttons"}
{"id":1,"obj":"switch","x":30,"y":40,"w":180,"h":75,"radius":40,"radius20":40,"groupid":1}
{"id":2,"obj":"switch","x":30,"y":122,"w":180,"h":75,"radius":40,"radius20":40,"groupid":2}
{"id":3,"obj":"switch","x":30,"y":205,"w":180,"h":75,"radius":40,"radius20":40,"groupid":3}
{"page":2,"comment":"WLED Control Panel"}
{"id":103,"obj":"switch","x":12,"y":29,"w":60,"h":20,"radius":15}
{"id":104,"obj":"label","x":10,"y":5,"w":180,"h":32,"text":"Night Light","text_color":"#FFFFFF"}
{"id":105,"obj":"label","x":5,"y":57,"w":180,"h":32,"text":"Brightness","text_color":"#FFFFFF"}
{"id":106,"obj":"slider","x":34,"y":82,"w":14,"h":90,"min":0,"max":255}
{"id":107,"obj":"cpicker","x":85,"y":10,"w":150,"h":150}
{"id":108,"obj":"dropdown","x":10,"y":200,"w":115,"h":30,"options":""}
{"id":110,"obj":"btn","x":10,"y":255,"w":115,"h":30}
{"id":111,"obj":"label","x":15,"y":180,"w":180,"h":32,"text":"Preset","text_color":"#FFFFFF"}
{"id":112,"obj":"label","x":15,"y":260,"w":180,"h":32,"text":"","text_color":"#FFFFFF"}
{"id":113,"obj":"label","x":160,"y":180,"w":180,"h":32,"text":"Intensity","text_color":"#FFFFFF"}
{"id":114,"obj":"label","x":160,"y":233,"w":180,"h":32,"text":"Speed","text_color":"#FFFFFF"}
{"id":115,"obj":"slider","x":145,"y":205,"w":90,"h":14,"min":0,"max":255}
{"id":116,"obj":"slider","x":145,"y":260,"w":90,"h":14,"min":0,"max":255}
{"id":117,"obj":"label","x":15,"y":233,"w":180,"h":32,"text":"Random Effect","text_color":"#FFFFFF"}
{"page":3,"comment":"Media Player"}
{"id":10,"obj":"obj","x":5,"y":35,"w":230,"h":250,"click":0,"bg_opa":0,"shadow_opa":140,"shadow_color":"black","shadow_width":20,"shadow_spread":0}
{"id":13,"obj":"label","x":0,"y":5,"w":117,"h":30,"text":"-","mode":"scroll","align":1}
{"id":12,"obj":"label","x":120,"y":5,"w":120,"h":30,"text":"-","mode":"scroll","align":1}
{"id":14,"obj":"bar","x":8,"y":278,"w":200,"h":5,"min":0,"max":100,"border_opa":0,"pad_top":0,"pad_bottom":0,"pad_left":0,"pad_right":0}
{"id":21,"obj":"obj","x":8,"y":35,"w":200,"h":200,"radius":6,"clip_corner":1,"hidden":1}
{"id":22,"obj":"img","x":0,"y":0,"w":200,"h":200,"parentid":21,"src":"","auto_size":1}
{"id":17,"obj":"btn","x":8,"y":226,"w":50,"h":50,"toggle":false,"text":"\uE4AE","text_font":32}
{"id":18,"obj":"btn","x":66,"y":226,"w":83,"h":50,"toggle":false,"text":"\uE40A","text_font":32}
{"id":19,"obj":"btn","x":157,"y":226,"w":51,"h":50,"toggle":false,"text":"\uE4AD","text_font":32}
{"id":20,"obj":"slider","x":212,"y":38,"w":20,"h":244,"min":0,"max":100,"val":85}
{"page":4,"comment":"Thermostat"}
{"id":1,"obj":"label","x":5,"y":5,"w":230,"h":25,"text":"Master Bedroom","align":"center"}
{"id":10,"obj":"obj","x":5,"y":35,"w":230,"h":250,"click":0}
{"id":20,"obj":"arc","x":5,"y":37,"w":230,"h":230,"min":170,"max":300,"val":250,"border_side":0,"type":0,"rotation":0,"start_angle":135,"end_angle":45,"adjustable":"true","line_width":21,"line_width10":21,"line_color10":"#34bdeb","bg_opa":0,"pad_top20":5,"pad_bottom20":5,"pad_left20":5,"pad_right20":5,"pad_top":5,"pad_bottom":5,"pad_left":5,"pad_right":5}
{"id":21,"obj":"gauge","x":28,"y":28,"w":175,"h":175,"parentid":20,"min":170,"max":300,"val":224,"format":1,"critical_value":301,"label_count":14,"line_count":27,"border_width":0,"pad_top":2,"pad_bottom":2,"pad_left":2,"pad_right":2,"value_str":"°C","value_ofs_y":55,"value_font":16,"bg_opa":0,"line_width10":3,"line_rounded10":1,"line_color":"#348feb","line_color60":"#348feb","scale_grad_color":"#eb4934","scale_grad_color60":"#eb4934","scale_end_color60":"#eb4934"}
{"id":22,"obj":"obj","x":85,"y":85,"w":60,"h":60,"parentid":20,"click":0,"radius":30,"border_width":2,"border_opa":200}
{"id":23,"obj":"label","x":80,"y":100,"w":70,"h":30,"parentid":20,"text":"22.4","text_font":24,"align":"center"}
{"id":24,"obj":"obj","x":145,"y":245,"w":60,"h":30,"click":0,"radius":5}
{"id":25,"obj":"label","x":145,"y":245,"w":60,"h":30,"text":"25","text_font":24,"align":"center"}
{"id":26,"obj":"label","x":90,"y":220,"w":60,"h":30,"text":"#909090 \u2022# #000000 \u2022# #909090 \u2022#","text_font":24,"align":"center","text_color":"grey","border_width":0}
{"id":30,"obj":"tabview","x":0,"y":235,"w":240,"h":80,"btn_pos":0,"bg_opa":0,"border_width":0,"radius":0}
{"id":31,"obj":"tab","parentid":30}
{"id":32,"obj":"tab","parentid":30}
{"id":33,"obj":"tab","parentid":30}
{"id":41,"obj":"switch","x":35,"y":10,"w":60,"h":30,"parentid":31,"radius":25,"radius20":25}
{"id":42,"obj":"dropdown","x":15,"y":10,"w":110,"h":30,"parentid":32,"options":"fan_modes","direction":"1","radius":5}
{"id":43,"obj":"dropdown","x":15,"y":10,"w":110,"h":30,"parentid":33,"options":"hvac_modes","direction":"1","radius":5}
{"page":5,"comment":"Backlight"}
{"id":1,"obj":"label","x":5,"y":5,"w":230,"h":25,"text":"Backlight","align":"center"}
{"id":10,"obj":"btn","x":20,"y":40,"w":90,"h":75,"text":"10%","action":{"up":"backlight {'state':'on','brightness':26}"}}
{"id":11,"obj":"btn","x":130,"y":40,"w":90,"h":75,"text":"40%","action":{"up":"backlight {'state':'on','brightness':103}"}}
{"id":12,"obj":"btn","x":20,"y":122,"w":90,"h":75,"text":"70%","action":{"up":"backlight {'state':'on','brightness':179}"}}
{"id":13,"obj":"btn","x":130,"y":122,"w":90,"h":75,"text":"100%","action":{"up":"backlight {'state':'on','brightness':255}"}}
{"id":14,"obj":"btn","x":20,"y":205,"w":200,"h":75,"text":"Off","action":{"up":"backlight {'state':'off'}"}}
{"page":6,"comment":"Moodlight"}
{"id":1,"obj":"label","x":5,"y":5,"w":230,"h":25,"text":"Moodlight","align":"center"}
{"id":10,"obj":"btn","x":20,"y":40,"w":90,"h":75,"text":"Red","action":{"up":"moodlight {'state':'on','brightness':255,'color':'red'}","hold":"moodlight {'state':'on','brightness':255,'color':'maroon'}"}}
{"id":11,"obj":"btn","x":20,"y":122,"w":90,"h":75,"text":"Green","action":{"up":"moodlight {'state':'on','brightness':255,'color':'green'}","hold":"moodlight {'state':'on','brightness':255,'color':'lime'}"}}
{"id":12,"obj":"btn","x":20,"y":205,"w":90,"h":75,"text":"Blue","action":{"up":"moodlight {'state':'on','brightness':255,'color':'blue'}","hold":"moodlight {'state':'on','brightness':255,'color':'cyan'}"}}
{"id":13,"obj":"btn","x":130,"y":40,"w":90,"h":75,"text":"Yellow","action":{"up":"moodlight {'state':'on','brightness':255,'color':'yellow'}","hold":"moodlight {'state':'on','brightness':255,'color':'orange'}"}}
{"id":14,"obj":"btn","x":130,"y":122,"w":90,"h":75,"text":"Purple","action":{"up":"moodlight {'state':'on','brightness':255,'color':'purple'}","hold":"moodlight {'state':'on','brightness':255,'color':'magenta'}"}}
{"id":15,"obj":"btn","x":130,"y":205,"w":90,"h":75,"text":"Off","action":{"up":"moodlight {'state':'off'}","hold":"moodlight {'state':'on','brightness':255,'color':'white'}"}}
{"page":0,"comment":"Page Navigation"}
{"id":1,"obj":"btn","action":"prev","x":0,"y":290,"w":79,"h":32,"bg_color":"#2C3E50","text":"\uE141","text_color":"#FFFFFF","radius":0,"border_side":0,"text_font":28}
{"id":2,"obj":"btn","action":"p1","x":80,"y":290,"w":80,"h":32,"bg_color":"#2C3E50","text":"\uE2DC","text_color":"#FFFFFF","radius":0,"border_side":0,"text_font":22}
{"id":3,"obj":"btn","action":"next","x":161,"y":290,"w":79,"h":32,"bg_color":"#2C3E50","text":"\uE142","text_color":"#FFFFFF","radius":0,"border_side":0,"text_font":28}
{"id":6,"obj":"obj","swipe":1,"x":0,"y":0,"h":30,"w":240,"opacity":0,"comment":"swipe-area-at-top"}

View File

@ -1 +0,0 @@
{"page":1,"id":10,"w":240,"obj":"label","text":"%hostname%"}

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "Portuguese-Brazil",
"home": {
"title": "Menu Principal",
"btn": "Menu Principal",
"nav": "Início"
},
"save": "Guardar Configuração",
"user": "Usuário",
"pass": "Senha",
"hasp": {
"title": "Design do HASP",
"btn": "Design do HASP",
"theme": "Tema da IU",
"color1": "Cor principal",
"color2": "Cor secundária",
"pages": "Layout inicial",
"font": "Fonte padrão",
"startpage": "Startup Page",
"startdim": "Startup Dim"
},
"screenshot": {
"title": "Screenshot",
"btn": "Screenshot",
"nav": "Screenshot",
"prev": "Página Anterior",
"next": "Página Seguinte",
"refresh": "Atualizar"
},
"info": {
"title": "Informação",
"btn": "Informação",
"nav": "Informação"
},
"config": {
"title": "Configuração",
"btn": "Configuração",
"nav": "Configuração"
},
"ota": {
"title": "Atualização do firmware",
"btn": "Atualização do firmware",
"nav": "Firmware",
"submit": "Atualizar o firmware",
"file": "Arquivo de Firmware",
"url": "URL de Firmware",
"redirect": "Seguir redirecionamentos",
"never": "Nunca",
"strict": "Estrito",
"always": "Sempre"
},
"editor": {
"title": "Editor de ficheiros",
"btn": "Editor de ficheiros",
"nav": "Editor de ficheiros"
},
"reset": {
"title": "Repor configuração de fábrica",
"btn": "Repor configuração de fábrica",
"warning": "Aviso",
"message": "Este processo irá redefinir todas as configurações para os valores padrão. O flash interno será apagado e o dispositivo será reiniciado. Talvez seja necessário conectar-se ao WiFi AP exibido no painel para reconfigurar o dispositivo antes de acessá-lo novamente.",
"fileloss": "TODOS OS ARQUIVOS SERÃO PERDIDOS!"
},
"reboot": {
"title": "Reiniciando...",
"btn": "Reiniciar",
"nav": "Reiniciar",
"message": "Este dispositivo está reiniciando."
},
"about": {
"credits": "Com base no trabalho anterior dos seguintes desenvolvedores de código aberto:",
"copyright": "Direitos autorais ",
"rights": "Todos os direitos reservados.",
"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": "Licença MIT",
"bsd": "Licença BSD",
"freebsd": "Licença FreeBSD",
"apache2": "Licença Apache2"
},
"wifi": {
"title": "Configurar Wifi",
"btn": "Configurar Wifi",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "Configurar MQTT",
"btn": "Configurar MQTT",
"name": "Nome do host",
"group": "Nome do Grupo",
"host": "Broker",
"port": "Porta",
"node_t": "Tópico do Node",
"group_t": "Tópico do Grupo",
"broadcast_t": "Tópico do Broadcast",
"hass_t": "Tópico HA LWT"
},
"http": {
"title": "Configurar HTTP",
"btn": "Configurar HTTP"
},
"ftp": {
"title": "Configurar FTP",
"btn": "Configurar FTP",
"port": "Porta FTP",
"pasv": "Porta Passiva"
},
"gui": {
"title": "Configurar Tela",
"btn": "Configurar Tela",
"antiburn": "Anti-queimadura",
"calibrate": "Calibrar"
},
"gpio": "Configurar GPIO",
"debug": {
"title": "Configurar debug",
"btn": "Configurar debug",
"baud": "Baudrate",
"tele": "Período Tele",
"ansi": "Usar códigos ANSI",
"host": "Servidor Syslog",
"port": "Porta Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Configurar hora",
"btn": "Configurar hora",
"region": "Região",
"zone": "Fuso horário",
"tz": "Fuso horário",
"ntp": "Servidores NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continentes ",
"af": "África ",
"as": "Ásia ",
"au": "Austrália ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "América do Norte ",
"sa": "América do Sul ",
"islands": "Ilhas ",
"at": "Oceano Atlântico ",
"in": "Oceano Índico ",
"pa": "Oceano Pacífico "
}
}
}

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "Português",
"home": {
"title": "Menu Principal",
"btn": "Menu Principal",
"nav": "Início"
},
"save": "Guardar Configuração",
"user": "Utilizador",
"pass": "Palavra-passe",
"hasp": {
"title": "Design do HASP",
"btn": "Design do HASP",
"theme": "Tema da IU",
"color1": "Cor Principal",
"color2": "Cor secundária",
"pages": "Layout inicial",
"font": "Fonte padrão",
"startpage": "Startup Page",
"startdim": "Startup Dim"
},
"screenshot": {
"title": "Screenshot",
"btn": "Screenshot",
"nav": "Screenshot",
"prev": "Página Anterior",
"next": "Página Seguinte",
"refresh": "Atualizar"
},
"info": {
"title": "Informação",
"btn": "Informação",
"nav": "Informação"
},
"config": {
"title": "Configuração",
"btn": "Configuração",
"nav": "Configuração"
},
"ota": {
"title": "Atualização do firmware",
"btn": "Atualização do firmware",
"nav": "Firmware",
"submit": "Atualizar o firmware",
"file": "Arquivo de Firmware",
"url": "URL do Firmware",
"redirect": "Seguir Redirecionamentos",
"never": "Nunca",
"strict": "Estrito",
"always": "Sempre"
},
"editor": {
"title": "Editor de ficheiros",
"btn": "Editor de ficheiros",
"nav": "Editor de ficheiros"
},
"reset": {
"title": "Repor configuração de fábrica",
"btn": "Repor configuração de fábrica",
"warning": "Aviso",
"message": "Este processo irá redefinir todas as configurações para os valores padrão. O flash interno será apagado e o dispositivo será reiniciado. Talvez seja necessário conectar-se ao WiFi AP exibido no painel para reconfigurar o dispositivo antes de acessá-lo novamente.",
"fileloss": "TODOS OS ARQUIVOS SERÃO PERDIDOS!"
},
"reboot": {
"title": "Reiniciando...",
"btn": "Reiniciar",
"nav": "Reiniciar",
"message": "O dispositivo está reiniciando."
},
"about": {
"credits": "Baseado no trabalho anterior dos seguintes desenvolvedores de código aberto:",
"copyright": "Copyright ",
"rights": "Todos os direitos reservados.",
"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": "Licença MIT",
"bsd": "Licença BSD",
"freebsd": "Licença FreeBSD",
"apache2": "Licença Apache2"
},
"wifi": {
"title": "Configurar Wifi",
"btn": "Configurar Wifi",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "Configurar MQTT",
"btn": "Configurar MQTT",
"name": "Nome do host",
"group": "Nome do Grupo",
"host": "Broker",
"port": "Porta",
"node_t": "Tópico do Node",
"group_t": "Tópico de Grupo",
"broadcast_t": "Tópico do Broadcast",
"hass_t": "Tópico HA LWT"
},
"http": {
"title": "Configurar HTTP",
"btn": "Configurar HTTP"
},
"ftp": {
"title": "Configurar FTP",
"btn": "Configurar FTP",
"port": "Porta de FTP",
"pasv": "Porta Passiva"
},
"gui": {
"title": "Configurar tela",
"btn": "Configurar tela",
"antiburn": "Anti-queimaduras",
"calibrate": "Calibrar"
},
"gpio": "Configurar MQTT",
"debug": {
"title": "Configurar debug",
"btn": "Configurar debug",
"baud": "Baudrate",
"tele": "Período Tele",
"ansi": "Usar códigos ANSI",
"host": "Servidor Syslog",
"port": "Porta Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "Configurar Hora",
"btn": "Configurar Hora",
"region": "Região",
"zone": "Fuso horário",
"tz": "Fuso horário",
"ntp": "Servidores NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continentes ",
"af": "África ",
"as": "Ásia ",
"au": "Austrália ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "América do Norte ",
"sa": "América do Sul ",
"islands": "Ilhas ",
"at": "Oceano Atlântico ",
"in": "Oceano Índico ",
"pa": "Oceano Pacífico "
}
}
}

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "Română",
"home": {
"title": "Meniu principal",
"btn": "Meniu principal",
"nav": "Acasă"
},
"save": "Salvarea setărilor",
"user": "Nume utilizator",
"pass": "Parola",
"hasp": {
"title": "Desenul ecranului",
"btn": "Desenul ecranului",
"theme": "Tema UI",
"color1": "Culoare primară",
"color2": "Culoare secundară",
"pages": "Layout inițial",
"font": "Font implicit",
"startpage": "Pagină inițială",
"startdim": "Luminozitatea"
},
"screenshot": {
"title": "Captură de ecran",
"btn": "Captură de ecran",
"nav": "Captură de ecran",
"prev": "Pagina anterioară",
"next": "Pagina următoare",
"refresh": "Reîmprospătare"
},
"info": {
"title": "Informații",
"btn": "Informații",
"nav": "Informații"
},
"config": {
"title": "Setări",
"btn": "Setări",
"nav": "Setări"
},
"ota": {
"title": "Actualizare Firmware",
"btn": "Actualizare Firmware",
"nav": "Firmware",
"submit": "Actualizarea firmware-ului",
"file": "Fișier firmware",
"url": "URL firmware",
"redirect": "Redirecționări",
"never": "Niciodată",
"strict": "Strict",
"always": "Mereu"
},
"editor": {
"title": "Browser de fișiere",
"btn": "Browser de fișiere",
"nav": "Browser de fișiere"
},
"reset": {
"title": "Resetare la parametri de fabrică",
"btn": "Resetare la parametri de fabrică",
"warning": "Avertizare",
"message": "Acest proces va reseta toate setările la valorile implicite. Flash intern va fi șters și dispozitivul este repornit. Este posibil să fie necesar să vă conectați la WiFi AP afișat pe panou pentru a reconfigura dispozitivul înainte de a-l accesa din nou.",
"fileloss": "TOATE FIȘIERELE VOR FI PIERDE!"
},
"reboot": {
"title": "Repornire...",
"btn": "Repornire",
"nav": "Repornire",
"message": "Dispozitivul se repornire."
},
"about": {
"credits": "Pe baza lucrărilor anterioare ale următorilor dezvoltatori open source:",
"copyright": "Drepturi de autor ",
"rights": "Toate drepturile rezervate.",
"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": "Licență MIT",
"bsd": "Licență BSD",
"freebsd": "Licență FreeBSD",
"apache2": "Licență Apache2"
},
"wifi": {
"title": "Setări WiFi",
"btn": "Setări WiFi",
"ssid": "SSID"
},
"wg": {
"title": "WireGuard Settings",
"btn": "WireGuard Settings",
"vpnip": "VPN IP",
"privkey": "Private Key",
"host": "Remote IP",
"port": "Remote Port",
"pubkey": "Remote Public Key"
},
"mqtt": {
"title": "Setări MQTT",
"btn": "Setări MQTT",
"name": "Nume gazdă",
"group": "Nume grup",
"host": "Broker",
"port": "Poartă",
"node_t": "Subiect nod",
"group_t": "Subiect Grup",
"broadcast_t": "Subiect difuzare",
"hass_t": "Subiect HA LWT"
},
"http": {
"title": "Setări HTTP",
"btn": "Setări HTTP"
},
"ftp": {
"title": "Setări FTP",
"btn": "Setări FTP",
"port": "Port FTP",
"pasv": "Port Pasiv"
},
"gui": {
"title": "Setări ecran",
"btn": "Setări ecran",
"antiburn": "Anti-arsuri",
"calibrate": "Calibrare"
},
"gpio": "Setări GPIO",
"debug": {
"title": "Setări Depanare",
"btn": "Setări Depanare",
"baud": "Baudrate",
"tele": "Perioada Tele",
"ansi": "Utilizează codurile ANSI",
"host": "Server Syslog",
"port": "Poartă Syslog",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facilitate"
},
"time": {
"title": "Setări de timp",
"btn": "Setări de timp",
"region": "Regiune",
"zone": "Fus orar",
"tz": "Fus orar",
"ntp": "Servere NTP"
},
"region": {
"etc": "Etcetera ",
"continents": "Continente ",
"af": "Africa ",
"as": "Asia ",
"au": "Australia ",
"aq": "Antarctica ",
"eu": "Europa ",
"na": "America de Nord ",
"sa": "America de Sud ",
"islands": "Insulele ",
"at": "Oceanul Atlantic ",
"in": "Oceanul Indian ",
"pa": "Oceanul Pacific "
}
}
}

View File

@ -1,162 +0,0 @@
{
"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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,607 +0,0 @@
/* Icons SVG files */
:root {
--info: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-information-outline" viewBox="0 0 24 24"><path d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z" /></svg>');
--home: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-home-outline" viewBox="0 0 24 24"><path d="M12 5.69L17 10.19V18H15V12H9V18H7V10.19L12 5.69M12 3L2 12H5V20H11V14H13V20H19V12H22" /></svg>');
--shot: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-camera-outline" viewBox="0 0 24 24"><path d="M20,4H16.83L15,2H9L7.17,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6A2,2 0 0,0 20,4M20,18H4V6H8.05L9.88,4H14.12L15.95,6H20V18M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15Z" /></svg>');
--ota: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-cpu-32-bit" viewBox="0 0 24 24"><path d="M9,3V5H7A2,2 0 0,0 5,7V9H3V11H5V13H3V15H5V17A2,2 0 0,0 7,19H9V21H11V19H13V21H15V19H17A2,2 0 0,0 19,17V15H21V13H19V11H21V9H19V7A2,2 0 0,0 17,5H15V3H13V5H11V3M7,9H10.5A1,1 0 0,1 11.5,10V14A1,1 0 0,1 10.5,15H7V13.5H10V12.75H8.5V11.25H10V10.5H7M12.5,9H16A1,1 0 0,1 17,10V11.75A1,1 0 0,1 16,12.75H14V13.5H17V15H12.5V12.25A1,1 0 0,1 13.5,11.25H15.5V10.5H12.5" /></svg>');
--browse: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-edit-outline" viewBox="0 0 24 24"><path d="M10 20H6V4H13V9H18V12.1L20 10.1V8L14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H10V20M20.2 13C20.3 13 20.5 13.1 20.6 13.2L21.9 14.5C22.1 14.7 22.1 15.1 21.9 15.3L20.9 16.3L18.8 14.2L19.8 13.2C19.9 13.1 20 13 20.2 13M20.2 16.9L14.1 23H12V20.9L18.1 14.8L20.2 16.9Z" /></svg>');
--cog: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-cog-outline" viewBox="0 0 24 24"><path d="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z" /></svg>');
--star: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -6 16 16"><line y1="-3" y2="3" stroke="red" transform="rotate(15)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(75)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(-45)"></line></svg>');
--trash: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-trash-can-outline" width="24" height="24" viewBox="0 0 24 24"><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" /></svg>');
--download: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-download" width="24" height="24" viewBox="0 0 24 24"><path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" /></svg>');
--upload: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-upload-outline" viewBox="0 0 24 24"><path d="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M12,12L16,16H13.5V19H10.5V16H8L12,12Z" /></svg>');
--flash: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-chip" viewBox="0 0 24 24"><path d="M6,4H18V5H21V7H18V9H21V11H18V13H21V15H18V17H21V19H18V20H6V19H3V17H6V15H3V13H6V11H3V9H6V7H3V5H6V4M11,15V18H12V15H11M13,15V18H14V15H13M15,15V18H16V15H15Z" /></svg>');
--file: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-outline" viewBox="0 0 24 24"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z" /></svg>');
--dir: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-outline" viewBox="0 0 24 24"><path d="M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z" /></svg>');
--diropen: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-open-outline" viewBox="0 0 24 24"><path d="M6.1,10L4,18V8H21A2,2 0 0,0 19,6H12L10,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H19C19.9,20 20.7,19.4 20.9,18.5L23.2,10H6.1M19,18H6L7.6,12H20.6L19,18Z" /></svg>');
--html: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-code-tags" viewBox="0 0 24 24"><path d="M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z" /></svg>');
--image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-image-outline" viewBox="0 0 24 24"><path d="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M17,13V19H7L12,14L14,16M10,10.5A1.5,1.5 0 0,1 8.5,12A1.5,1.5 0 0,1 7,10.5A1.5,1.5 0 0,1 8.5,9A1.5,1.5 0 0,1 10,10.5Z" /></svg>');
--zip: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-cabinet" viewBox="0 0 24 24"><path d="M14,8H10V6H14V8M20,4V20C20,21.11 19.11,22 18,22H6C4.89,22 4,21.11 4,20V4A2,2 0 0,1 6,2H18C19.11,2 20,2.9 20,4M18,13H6V20H18V13M18,4H6V11H18V4M14,15H10V17H14V15Z" /></svg>');
--cmd: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-application-outline" viewBox="0 0 24 24"><path d="M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 20H3V6H21V20Z" /></svg>');
--css: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-script-outline" viewBox="0 0 24 24"><path d="M15,20A1,1 0 0,0 16,19V4H8A1,1 0 0,0 7,5V16H5V5A3,3 0 0,1 8,2H19A3,3 0 0,1 22,5V6H20V5A1,1 0 0,0 19,4A1,1 0 0,0 18,5V9L18,19A3,3 0 0,1 15,22H5A3,3 0 0,1 2,19V18H13A2,2 0 0,0 15,20Z" /></svg>');
--ttf: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-format-text" viewBox="0 0 24 24"><path d="M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z" /></svg>');
--eye: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-eye-outline" viewBox="0 0 24 24"><path d="M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z" /></svg>');
--json: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-code-braces" viewBox="0 0 24 24"><path d="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z" /></svg>');
--audio: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-file-music-outline" viewBox="0 0 24 24"><path d="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M13,10V12H11V17A2,2 0 0,1 9,19A2,2 0 0,1 7,17A2,2 0 0,1 9,15C9.4,15 9.7,15.1 10,15.3V10H13Z" /></svg>');
}
.fn:hover {
text-decoration: underline;
}
.fi {
display: inline-block;
vertical-align: middle;
width: 1.1rem;
height: 1.25rem;
mask-size: auto;
mask-repeat: no-repeat;
mask-position: center;
-webkit-mask-size: auto;
-webkit-mask-repeat: no-repeat;
-webkit-mask-position: center;
background-color: var(--txt);
}
.fa {
display: block;
text-indent: -9999px;
width: clamp(2rem, 7.5vw, 5rem);
height: 2rem;
mask-size: auto;
mask-repeat: no-repeat;
mask-position: center;
-webkit-mask-size: auto;
-webkit-mask-repeat: no-repeat;
-webkit-mask-position: center;
background-color: var(--clr-primary-400);
transition: 0.5s;
padding: 1rem;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
.fa-browse { mask-image: var(--browse); -webkit-mask-image: var(--browse)}
.fa-cog { mask-image: var(--cog); -webkit-mask-image: var(--cog)}
.fa-download{ mask-image: var(--download); -webkit-mask-image: var(--download)}
.fa-upload { mask-image: var(--upload); -webkit-mask-image: var(--upload)}
.fa-home { mask-image: var(--home); -webkit-mask-image: var(--home)}
.fa-info { mask-image: var(--info); -webkit-mask-image: var(--info)}
.fa-ota { mask-image: var(--ota); -webkit-mask-image: var(--ota)}
.fa-shot { mask-image: var(--shot); -webkit-mask-image: var(--shot)}
.fa-star { mask-image: var(--star); -webkit-mask-image: var(--star)}
.fa-trash { mask-image: var(--trash); -webkit-mask-image: var(--trask)}
.fa-flash { mask-image: var(--flash); -webkit-mask-image: var(--flash)}
.fa-file { mask-image: var(--file); -webkit-mask-image: var(--file)}
.fa-dir { mask-image: var(--dir); -webkit-mask-image: var(--dir)}
.fa-diropen { mask-image: var(--diropen); -webkit-mask-image: var(--diropen)}
.fa-eye { mask-image: var(--eye); -webkit-mask-image: var(--eye)}
.fa-zip { mask-image: var(--zip); -webkit-mask-image: var(--zip)}
.fa-css { mask-image: var(--css); -webkit-mask-image: var(--css)}
.fa-cmd { mask-image: var(--cmd); -webkit-mask-image: var(--cmd)}
.fa-json { mask-image: var(--json); -webkit-mask-image: var(--json)}
.fa-jsonl { mask-image: var(--json); -webkit-mask-image: var(--json)}
.fa-image { mask-image: var(--image); -webkit-mask-image: var(--image)}
.fa-audio { mask-image: var(--audio); -webkit-mask-image: var(--audio)}
.fa-html { mask-image: var(--html); -webkit-mask-image: var(--html)}
.fa-ttf { mask-image: var(--ttf); -webkit-mask-image: var(--ttf)}
.nav-list {
font-size: var(--fs-nav);
padding: 0;
display: flex;
justify-content: space-evenly;
gap: clamp(1.5rem, 10vw, var(--size-500));
width: clamp(275px, 80vw, 600px);
}
.nav-list a {
position: relative;
display: flex;
justify-content: space-evenly;
align-items: center;
flex-direction: column;
text-decoration: none;
color: var(--clr-primary-400);
}
.nav-list a:hover,
.nav-list a:focus-visible {
color: var(--clr-accent-400);
}
.nav-list a .text {
position: absolute;
letter-spacing: -0.05rem;
font-size: var(--fs-500);
font-weight: var(--fw-semi-bold);
white-space: nowrap;
opacity: 0;
transition: 0.5s;
transform: translateY(0.5rem);
}
.nav-list a:hover .text,
.nav-list a:focus-visible .text {
opacity: 1;
transform: translateY(1rem);
}
.nav-list a:hover .fa,
.nav-list a:focus-visible .fa {
background-color: var(--clr-accent-400);
transform: translateY(-0.5rem);
}
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Set default margin */
* {
margin: 0px;
padding: 0px;
}
p {
margin: 1em 0px;
}
/* Main Style */
body {
font-family: 'Inter', sans-serif;
line-height: 1.5;
height: 100%;
background: var(--bg);
color: var(--txt)
}
a {
text-decoration: none;
}
a[href],
input[type='submit'],
label[for],
select,
button,
.pointer {
cursor: pointer;
}
/* Message Fields */
.error,
.info,
.success,
.validation,
.warning {
border: 1px solid;
margin: 1rem auto;
padding: 2rem 1rem 1rem 3rem;
background-repeat: no-repeat;
background-position: 10px center;
max-width: 500px
}
.info { color: #00529B; background-color: #BDE5F8 }
.success{ color: #4F8A10; background-color: #DFF2BF }
.warning{ color: #9F6000; background-color: #FEEFB3 }
.error { color: #D8000C; background-color: #FFD2D2 }
.left { float: left }
.right { float: right }
.bold { font-weight: bold }
/* Main Page */
#doc {
text-align: left;
margin: 0 auto;
/* display: inline-block;
display: table; */
color: var(--txt);
width: 80%;
min-width: 300px;
max-width: 600px;
}
#doc>a,
.dist>a,
#doc button,
#doc input[type=submit] {
/* padding: 12px; */
height: 3rem;
border: 1px solid var(--btnbrd);
border-radius: .6rem;
background-color: var(--btnbg);
color: var(--btnfg);
font-size: 1rem;
width: 100%;
margin: 12px 0;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
text-decoration: none
}
#doc>a:hover,
.dist>a:hover,
#doc button:hover,
#doc input[type=submit]:hover {
background-color: var(--btnbghi)
}
#doc input:not([type=file]) {
background-color: var(--fldbg);
color: var(--fldfg)
}
#doc input[type=checkbox],
#doc input[type=radio] {
width: 1rem;
height: 1rem;
margin: 0.25rem
}
#doc input[type=color] {
width: 30%;
padding: 5px
}
#doc input:invalid {
border: 1px solid var(--fldred)
}
#doc select {
background-color: var(--fldbg);
color: var(--fldfg)
}
.c {
text-align: center
}
#doc>a.red,
#doc button.red {
background-color: var(--btnred)
}
#doc>a.red:focus,
#doc>a.red:hover,
#doc button.red:focus,
#doc button.red:hover {
background-color: var(--btnredhi)
}
#doc td {
padding-bottom: 0;
padding-top: 0
}
#doc th {
padding-top: .5rem
}
#doc input,
#doc select,
#doc textarea {
width: 100%;
padding: 1rem;
border: 1px solid #ccc;
border-radius: .6rem;
resize: vertical
}
#doc select {
appearance: none;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
background-repeat: no-repeat;
background-position: right .8rem center;
background-size: 1rem
}
#doc label {
padding-right: 18px;
padding-left: .25rem;
display: inline-block
}
#bmp {
max-width: 100%;
height: auto;
}
.required {
background-image: var(--star);
background-position: right;
background-repeat: no-repeat;
background-size: 1.5rem 1.5rem;
}
.icon {
background-size: 1.25rem 1.25rem;
background-position: left;
background-repeat: no-repeat;
width: 1.5rem;
display: inline-block;
text-decoration: none
}
.icon:before{content: "\0000a0"}
.edit{background-image: var(--browse)}
.trash{background-image: var(--trash)}
/* Forms */
.container {
background-color: var(--grpbg);
color: var(--grpfg);
border-radius: .6rem;
padding: 10px;
margin: 20px 0
}
.dist {
display: flex;
justify-content: space-between;
width: 100%;
margin: 1rem 0
}
.dist>a {
flex-grow: 1;
margin: 0 6px
}
.dist>a:first-child {
margin-left: 0
}
.dist>a:last-child {
margin-right: 0
}
.row:after {
content: "";
display: table;
clear: both
}
.row {
/* font-size: .833rem; */
margin: 5px
}
.gap,
.row:last-of-type {
margin-bottom: 1rem
}
.col-25 {
/* float: left;
width: 25%; */
text-align: left;
}
/* .col-75 {
float: left;
width: 75%
} */
#doc label,
#doc legend {
padding: 5px 18px 5px 0;
}
#doc fieldset {
display: contents
}
[v-cloak] > * { display:none }
/* [v-cloak]::before { content: "Loading…"; margin: auto; } */
@media screen and (min-width:800px) {
.row {
display:flex;
align-items:center
}
.col-25,
.col-75
{
float: left;
width: 75%;
margin-top: 0
}
.col-25 {
width: 25%;
text-align: right
}
}
/*
@media screen and (max-width:800px) {
// #doc input[type=submit],
.col-25,
.col-75
{
width: 100%;
margin-top: 0
}
.col-25 {
text-align: left
}
#doc label {
padding: 5px 18px 5px 0
}
}
*/
/* ********** Page Footer ********** */
.foot {
background-color: transparent !important;
all: revert;
float: right;
margin: 0;
font-size: .6rem
}
a.foot:link,
a.foot:visited {
color: var(--footfg)
}
.clear {
clear: both
}
/* ********** File Editor ********** */
.container__editor {
/* display: none; */
display: flex;
/* Misc */
border: 0;
width: 100vw;
height: 100vh;
background-color: var(--bg);
}
.container__left {
/* Initially, the left takes 3/4 width */
width: 10rem;
min-width: 6rem;
max-width: 20rem;
/* Misc */
/* align-items: center; */
display: flex;
justify-content: left;
overflow-x: clip;
overflow-y: scroll;
background-color: var(--treebg);
/* Popout */
top: 0;
bottom: 0;
left: 0;
right: clamp(10rem, 15vw, 80rem);
z-index: 10;
/* position: absolute; */
/* visibility: hidden; */
}
.resizer {
background-color: #d5dbe2;
cursor: ew-resize;
height: 100%;
width: 5px;
}
.container__right {
/* Take the remaining width */
flex: 1;
flex-direction: column;
/* Misc */
align-items: center;
display: flex;
background-color: #888;
}
.toolbar {
text-align: center;
width: 100%;
padding: 0.5rem;
color: var(--btnfg);
background-color: var(--toolbg)
}
.container__bottom {
/* Take the remaining width */
flex: 1;
/* Misc */
align-items: center;
display: flex;
justify-content: center;
top: 0;
bottom: 0;
width: 100%;
/* background-color: bisque; */
}
#sizeList {
width: 4rem;
}
#ctx {
display: none;
top: 10px;
left: 50px;
position: absolute;
background: #fff;
z-index: 10;
padding: 0.75rem;
border-radius: 0.5rem;
box-shadow: 0 0.5rem 0.75rem rgba(0,0,0,0.25);
}
#ctx > ul {
padding-left: 0px;
}
#ctx > ul > li {
white-space: nowrap
}
#ctx > ul > li:hover {
background: #ccc;
}
#fontsize, #page {
width: 3rem
}
#preview {
padding: 0.3rem;
overflow: scroll;
}
#preview > img {
max-width:100%;
max-height:100%;
height: 100%;
margin: auto;
display: block
}
#download-frame,
#preview {
display:none;
}
#tree {
width: 100%;
line-height: 1.3rem;
font-size: 0.95rem;
}
.download{background-image: var(--download)}
.upload{background-image: var(--upload)}
.eye{background-image: var(--eye)}
.flash{background-image: var(--flash)}
.file{background-image: var(--file)}
.zip{background-image: var(--zip)}
.css{background-image: var(--css)}
.cmd{background-image: var(--cmd)}
.json{background-image: var(--json)}
.jsonl{background-image: var(--json)}
.image{background-image: var(--image)}
.audio{background-image: var(--audio)}
.html{background-image: var(--html)}
.dir{background-image: var(--dir)}
.diropen{background-image: var(--diropen)}
#toast {
position: fixed;
bottom: 1rem;
right: 1.5rem;
display: grid;
align-items: end;
align-content: end;
gap: 1rem;
}
.toast {
font-size: 1rem;
margin: 0;
font-weight: bold;
line-height: 1;
padding: 0.5em 1em;
background-color: lightblue;
animation: toastIt 3000ms cubic-bezier(0.785, 0.135, 0.15, 0.86) forwards;
}
@keyframes toastIt {
0%,
100% {
transform: translateY(150%);
opacity: 0;
}
10%,
90% {
transform: translateY(0);
opacity: 1;
}
}

View File

@ -1,162 +0,0 @@
{
"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

@ -1,13 +0,0 @@
:root {
--txt: #000;
--bg: #fff;
--btnfg: #fff;
--btnbg: #1fa3ec;
--btnbghi: #0083cc;
--grpbg: #f2f2f2;
--fldbg: #fff;
--fldfg: #000;
--btnred: #f00;
--btnredhi: #b00;
--btnbrd: transparent;
}

View File

@ -1,162 +0,0 @@
{
"en": {
"language": "中文(简体)",
"home": {
"title": "主菜单",
"btn": "主菜单",
"nav": "首页"
},
"save": "保存设置",
"user": "用户名",
"pass": "密码",
"hasp": {
"title": "HASP 设计",
"btn": "HASP 设计",
"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": "固件网址",
"redirect": "跟随重定向",
"never": "从不",
"strict": "严格",
"always": "总是"
},
"editor": {
"title": "文件编辑器",
"btn": "文件编辑器",
"nav": "文件编辑器"
},
"reset": {
"title": "出厂重置",
"btn": "出厂重置",
"warning": "警告",
"message": "此过程会将所有设置重置为默认值。 内部闪存将被擦除,设备将重新启动。 您可能需要连接到面板上显示的 WiFi AP 以重新配置设备,然后才能再次访问它。",
"fileloss": "所有文件都会被删除!"
},
"reboot": {
"title": "重启中...",
"btn": "重启",
"nav": "重启",
"message": "设备正在重启。"
},
"about": {
"credits": "基于以下开源开发者的先前工作:",
"copyright": "版权 ",
"rights": "版权所有。",
"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": "专用密钥",
"host": "远程IP",
"port": "删除",
"pubkey": "远程公钥"
},
"mqtt": {
"title": "MQTT 设置",
"btn": "MQTT 设置",
"name": "主机名",
"group": "组名",
"host": "MQTT 经纪人",
"port": "端口",
"node_t": "设备主题",
"group_t": "群组主题",
"broadcast_t": "广播主题",
"hass_t": "HA LWT 主题"
},
"http": {
"title": "HTTP 设置",
"btn": "HTTP 设置"
},
"ftp": {
"title": "FTP设置",
"btn": "FTP设置",
"port": "FTP 端口",
"pasv": "被动端口"
},
"gui": {
"title": "屏幕设置",
"btn": "屏幕设置",
"antiburn": "防烧",
"calibrate": "校准"
},
"gpio": "GPIO 设置",
"debug": {
"title": "调试设置",
"btn": "调试设置",
"baud": "波特率",
"tele": "远程时期",
"ansi": "使用 ANSI 代码",
"host": "Syslog 服务器",
"port": "Syslog端口",
"ietf": "IETF (RFC 5424)",
"bsd": "BSD (RFC 3164)",
"log": "Facility"
},
"time": {
"title": "时间设置",
"btn": "时间设置",
"region": "区域",
"zone": "时区",
"tz": "时区",
"ntp": "NTP 服务器"
},
"region": {
"etc": "等等 ",
"continents": "大洲数 ",
"af": "非洲 ",
"as": "亚洲 ",
"au": "澳大利亚 ",
"aq": "南极洲 ",
"eu": "欧洲 ",
"na": "北美洲 ",
"sa": "南美洲 ",
"islands": "群岛 ",
"at": "大西洋 ",
"in": "印度洋 ",
"pa": "太平洋 "
}
}
}

View File

@ -1,4 +1,3 @@
#if USE_MONITOR
#include <unistd.h>
#define SDL_MAIN_HANDLED /*To fix SDL's "undefined reference to WinMain" issue*/
#include <SDL2/SDL.h>
@ -54,4 +53,3 @@ void hal_loop(void)
// lv_task_handler();
// }
}
#endif

View File

@ -1,5 +1,5 @@
#include <Arduino.h>
#include "Arduino.h"
#include "stm32f4xx.h"
//#include "stm32f429i_discovery.h"

View File

@ -1,6 +1,3 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
/* This file is used during the build of the paho library */
#ifndef VERSIONINFO_H

View File

@ -2,31 +2,28 @@
// https://www.online-utility.org/image/convert/to/XBM
// The output must be pasted in a header file, renamed and adjusted to appear
// as a const unsigned char array in PROGMEM (FLASH program memory).
// as as a const unsigned char array in PROGMEM (FLASH program memory).
// The xbm format adds padding to pixel rows so they are a whole number of bytes
// In this example 93 pixel width means 96 bits = 12 bytes
// the 16 height then means array uses 12 x 16 = 192 bytes of FLASH
// In this example 50 pixel width means 56 bits = 7 bytes
// the 50 height then means array uses 50 x 7 = 350 bytes of FLASH
// The library ignores the padding bits when drawing the image on the display.
// The openHASP logo uses the MaterialDesign icons font, released under the OFL license
// Usage:
// - Copy this file to src/custom/bootlogo.h
// - Add #define HASP_CUSTOMIZE_BOOTLOGO to include/user_config_override.h
#ifdef ARDUINO
#include <pgmspace.h> // PROGMEM support header
#endif
#ifndef HASP_BOOTLOGO_H
#define HASP_BOOTLOGO_H
// RGB array
#define logoBgColor {0,128,128}
#define logoFgColor {255,255,255}
#ifndef PROGMEM
#define PROGMEM
#endif
// Image is stored in th array below, adjust the width and height accordingly
#define logoWidth 93
#define logoHeight 16
// Image is stored in the array below, also update the width and height accordingly
PROGMEM const unsigned char logoImage[] = {
PROGMEM const unsigned char bootscreen[] = {
0x7C, 0xF0, 0x07, 0xFF, 0x71, 0x1C, 0xC7, 0xC1, 0x07, 0xFC, 0xF1, 0x07, 0xFE, 0xF0, 0x0F, 0xFF, 0xF1, 0x1C,
0xC7, 0xE1, 0x0F, 0xFE, 0xF1, 0x0F, 0xFF, 0xF1, 0x1F, 0xFF, 0xF1, 0x1C, 0xC7, 0xF1, 0x1F, 0xFF, 0xF1, 0x1F,
0xC7, 0x71, 0x1C, 0x07, 0xF0, 0x1C, 0xC7, 0x71, 0x1C, 0x07, 0x70, 0x1C, 0xC7, 0x71, 0x1C, 0x07, 0xF0, 0x1D,
@ -39,5 +36,3 @@ PROGMEM const unsigned char logoImage[] = {
0xC7, 0x71, 0x1C, 0xFF, 0x71, 0x00, 0xFE, 0x70, 0x00, 0xFF, 0x71, 0x1E, 0xC7, 0x71, 0x1C, 0xFF, 0x71, 0x00,
0x7C, 0x70, 0x00, 0xFF, 0x71, 0x1C, 0xC7, 0x71, 0x1C, 0xFF, 0x70, 0x00,
};
#endif // HASP_BOOTLOGO_H

View File

@ -1,6 +1,3 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef WIFISPI_H
#define WIFISPI_H

View File

@ -1,183 +0,0 @@
/****************************************************************************
*
* ftstdlib.h
*
* ANSI-specific library and header configuration file (specification
* only).
*
* Copyright (C) 2002-2020 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/**************************************************************************
*
* This file is used to group all `#includes` to the ANSI~C library that
* FreeType normally requires. It also defines macros to rename the
* standard functions within the FreeType source code.
*
* Load a file which defines `FTSTDLIB_H_` before this one to override it.
*
*/
#ifndef FTSTDLIB_H_
#define FTSTDLIB_H_
#include <stddef.h>
#include "hasp_mem.h"
typedef void hasp_FILE;
extern hasp_FILE * lv_ft_fopen(const char * filename, const char * mode );
extern int lv_ft_fclose(hasp_FILE * stream);
extern size_t lv_ft_fread(void * ptr, size_t size, size_t count, hasp_FILE * stream);
extern int lv_ft_fseek(hasp_FILE * stream, long int offset, int origin );
extern int lv_ft_ftell(hasp_FILE * stream);
#define ft_ptrdiff_t ptrdiff_t
/**************************************************************************
*
* integer limits
*
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
* `int` and `long` in bytes at compile-time. So far, this works for all
* platforms the library has been tested on.
*
* Note that on the extremely rare platforms that do not provide integer
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
* `int` is 36~bits), we do not make any guarantee about the correct
* behaviour of FreeType~2 with all fonts.
*
* In these cases, `ftconfig.h` will refuse to compile anyway with a
* message like 'couldn't find 32-bit type' or something similar.
*
*/
#include <limits.h>
#define FT_CHAR_BIT CHAR_BIT
#define FT_USHORT_MAX USHRT_MAX
#define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
/**************************************************************************
*
* character and string processing
*
*/
#include <string.h>
#define ft_memchr memchr
#define ft_memcmp memcmp
#define ft_memcpy memcpy
#define ft_memmove memmove
#define ft_memset memset
#define ft_strcat strcat
#define ft_strcmp strcmp
#define ft_strcpy strcpy
#define ft_strlen strlen
#define ft_strncmp strncmp
#define ft_strncpy strncpy
#define ft_strrchr strrchr
#define ft_strstr strstr
/**************************************************************************
*
* file handling
*
*/
#include <stdio.h>
#define FT_FILE hasp_FILE
#define ft_fclose lv_ft_fclose
#define ft_fopen lv_ft_fopen
#define ft_fread lv_ft_fread
#define ft_fseek lv_ft_fseek
#define ft_ftell lv_ft_ftell
#define ft_sprintf sprintf
/**************************************************************************
*
* sorting
*
*/
#include <stdlib.h>
#define ft_qsort qsort
/**************************************************************************
*
* memory allocation
*
*/
#define ft_scalloc hasp_calloc
#define ft_sfree hasp_free
#define ft_smalloc hasp_malloc
#define ft_srealloc hasp_realloc
/**************************************************************************
*
* miscellaneous
*
*/
#define ft_strtol strtol
#define ft_getenv getenv
/**************************************************************************
*
* execution control
*
*/
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* `jmp_buf` is defined as a macro */
/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
/* The following is only used for debugging purposes, i.e., if */
/* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */
#include <stdarg.h>
#endif /* FTSTDLIB_H_ */
/* END */

View File

@ -1,13 +1,6 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_CONF_H
#define HASP_CONF_H
#if HASP_TARGET_ARDUINO
#include "Arduino.h"
#endif
#ifdef USE_CONFIG_OVERRIDE
#include "user_config_override.h"
#endif
@ -15,17 +8,6 @@
// language specific defines
#include "lang/lang.h"
// Lengths
#ifndef MAX_PASSWORD_LENGTH
#define MAX_PASSWORD_LENGTH 64
#endif
#ifndef MAX_USERNAME_LENGTH
#define MAX_USERNAME_LENGTH 32
#endif
#ifndef MAX_HOSTNAME_LENGTH
#define MAX_HOSTNAME_LENGTH 128
#endif
// TFT defines
#ifndef TFT_BACKLIGHT_ON
#define TFT_BACKLIGHT_ON HIGH
@ -37,11 +19,6 @@
#define HASP_USE_APP 1
/* Validate that build target was specified */
#if HASP_TARGET_ARDUINO + HASP_TARGET_PC != 1
#error "Build target invalid! Set *one* of: HASP_TARGET_ARDUINO, HASP_TARGET_PC"
#endif
#ifndef HASP_USE_DEBUG
#define HASP_USE_DEBUG 1
#endif
@ -52,64 +29,28 @@
#endif
#ifndef HASP_USE_WIFI
#define HASP_USE_WIFI (ARDUINO_ARCH_ESP32 > 0 || ARDUINO_ARCH_ESP8266 > 0)
#endif
#ifndef HASP_USE_CAPTIVE_PORTAL
#define HASP_USE_CAPTIVE_PORTAL (ARDUINO_ARCH_ESP32 > 0) && (HASP_USE_WIFI > 0)
#define HASP_USE_WIFI (ARDUINO_ARCH_ESP32 > 0 || ARDUINO_ARCH_ESP8266 > 0 || HASP_USE_WIFI > 0)
#endif
#define HASP_HAS_NETWORK \
(ARDUINO_ARCH_ESP32 > 0 || ARDUINO_ARCH_ESP8266 > 0 || HASP_USE_ETHERNET > 0 || HASP_USE_WIFI > 0)
#ifndef HASP_USE_ARDUINOOTA
#define HASP_USE_ARDUINOOTA 0 //(HASP_HAS_NETWORK)
#endif
#ifndef HASP_USE_HTTP_UPDATE
#define HASP_USE_HTTP_UPDATE (HASP_HAS_NETWORK) // Adds 10kB
#ifndef HASP_USE_OTA
#define HASP_USE_OTA (HASP_HAS_NETWORK)
#endif
#ifndef HASP_USE_MQTT
#define HASP_USE_MQTT (HASP_HAS_NETWORK)
#endif
#ifndef HASP_USE_MQTT_ASYNC
#define HASP_USE_MQTT_ASYNC (HASP_TARGET_PC)
#endif
#ifndef HASP_USE_WIREGUARD
#define HASP_USE_WIREGUARD 0
#endif
#ifndef HASP_USE_BROADCAST
#define HASP_USE_BROADCAST 1
#endif
#ifndef MQTT_NODENAME
#define MQTT_NODENAME "plate"
#endif
#ifndef HASP_START_CONSOLE
#define HASP_START_CONSOLE 1
#endif
#ifndef HASP_USE_HTTP
#define HASP_USE_HTTP (HASP_HAS_NETWORK)
#endif
#ifndef HASP_USE_HTTP_ASYNC
#define HASP_USE_HTTP_ASYNC 0 //(HASP_HAS_NETWORK)
#endif
#ifndef HASP_START_HTTP
#define HASP_START_HTTP 1
#endif
#ifndef HASP_START_FTP
#define HASP_START_FTP 1
#endif
#ifndef HASP_USE_MDNS
#define HASP_USE_MDNS (HASP_HAS_NETWORK)
#endif
@ -118,22 +59,10 @@
#define HASP_USE_SYSLOG (HASP_HAS_NETWORK)
#endif
#ifndef HASP_USE_FTP
#define HASP_USE_FTP 0
#endif
#ifndef HASP_USE_TELNET
#define HASP_USE_TELNET 0
#endif
#ifndef HASP_START_TELNET
#define HASP_START_TELNET 1
#endif
#ifndef HASP_USE_CONSOLE
#define HASP_USE_CONSOLE 1
#endif
/* Filesystem */
#define HASP_HAS_FILESYSTEM (ARDUINO_ARCH_ESP32 > 0 || ARDUINO_ARCH_ESP8266 > 0)
@ -169,25 +98,13 @@
#define HASP_USE_PNGDECODE 0
#endif
#ifndef HASP_USE_BMPDECODE
#define HASP_USE_BMPDECODE 0
#endif
#ifndef HASP_USE_GIFDECODE
#define HASP_USE_GIFDECODE 0
#endif
#ifndef HASP_USE_JPGDECODE
#define HASP_USE_JPGDECODE 0
#endif
#ifndef HASP_NUM_GPIO_CONFIG
#define HASP_NUM_GPIO_CONFIG 8
#endif
// #ifndef HASP_USE_CUSTOM
// #define HASP_USE_CUSTOM 0
// #endif
#ifndef HASP_NUM_INPUTS
#define HASP_NUM_INPUTS 4 // Number of ACE Buttons
#endif
// #ifndef HASP_NUM_OUTPUTS
// #define HASP_NUM_OUTPUTS 3
@ -203,53 +120,13 @@
#define HASP_OBJECT_NOTATION "p%ub%u"
#ifndef HASP_ATTRIBUTE_FAST_MEM
#define HASP_ATTRIBUTE_FAST_MEM
#endif
#ifndef IRAM_ATTR
#define IRAM_ATTR
#endif
#if !defined(FPSTR)
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper*>(pstr_pointer))
#endif
#if !defined(PGM_P)
#define PGM_P const char*
#endif
/* Workarounds for PC build */
#if HASP_TARGET_PC
#ifndef __FlashStringHelper
typedef char __FlashStringHelper;
#endif
#if defined(__cplusplus) && !defined(String)
#include <iostream>
using String = std::string;
#endif
#ifndef F
#define F(x) (x)
#endif
#ifndef PSTR
#define PSTR(x) x
#endif
#ifndef PROGMEM
#define PROGMEM
#endif
#endif
/* Includes */
#ifdef WINDOWS
#include "winsock2.h"
#include "Windows.h"
#elif defined(POSIX)
#else
#include <Arduino.h>
#include "Arduino.h"
#endif
#if HASP_USE_SPIFFS > 0
@ -272,7 +149,7 @@ using String = std::string;
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
// #include "lv_zifont.h"
#include "lv_zifont.h"
#endif
#endif
@ -289,19 +166,10 @@ static WiFiSpiClass WiFi;
#endif
#endif // HASP_USE_WIFI
#if HASP_USE_WIREGUARD > 0
#include "sys/net/hasp_wireguard.h"
#endif
#if HASP_USE_ETHERNET > 0
#if defined(ARDUINO_ARCH_ESP32)
#include "sys/net/hasp_ethernet_esp32.h"
#if HASP_USE_ETHSPI > 0
#include <ETHSPI.h>
#warning Using ESP32 Ethernet SPI W5500
#define HASP_ETHERNET ETHSPI
#include <ETH.h>
#else
#define ETH_ADDR 0
#define ETH_POWER_PIN -1
#define ETH_MDC_PIN 23
@ -309,10 +177,9 @@ static WiFiSpiClass WiFi;
#define NRST 5
#define ETH_TYPE ETH_PHY_LAN8720
#define ETH_CLKMODE ETH_CLOCK_GPIO17_OUT
#include <ETH.h>
#include "sys/net/hasp_ethernet_esp32.h"
#warning Using ESP32 Ethernet LAN8720
#define HASP_ETHERNET ETH
#endif // HASP_USE_ETHSPI
#else
#if USE_BUILTIN_ETHERNET > 0
@ -334,11 +201,10 @@ static WiFiSpiClass WiFi;
#if HASP_USE_MQTT > 0
#include "mqtt/hasp_mqtt.h"
#if HASP_TARGET_PC
#define HASP_USE_PAHO
#if defined(WINDOWS) || defined(POSIX)
#define USE_PAHO
#else
#define HASP_USE_ESP_MQTT
//#define HASP_USE_PUBSUBCLIENT
#define USE_PUBSUBCLIENT
#endif
#endif
@ -351,18 +217,6 @@ static WiFiSpiClass WiFi;
#include "sys/svc/hasp_http.h"
#endif
#if HASP_USE_HTTP_ASYNC > 0
#include "sys/svc/hasp_http.h"
#endif
#if HASP_USE_CONSOLE > 0
#include "sys/svc/hasp_console.h"
#endif
#if HASP_USE_FTP > 0
#include "sys/svc/hasp_ftp.h"
#endif
#if HASP_USE_TELNET > 0
#include "sys/svc/hasp_telnet.h"
#endif
@ -371,50 +225,67 @@ static WiFiSpiClass WiFi;
#include "sys/svc/hasp_mdns.h"
#endif
#if HASP_USE_ARDUINOOTA > 0 || HASP_USE_HTTP_UPDATE > 0
#if HASP_USE_OTA > 0
#include "sys/svc/hasp_ota.h"
#ifndef HASP_OTA_PORT
#if defined(ARDUINO_ARCH_ESP32)
#define HASP_OTA_PORT 3232
#elif defined(ARDUINO_ARCH_ESP8266)
#define HASP_OTA_PORT 8266
#endif
#endif
#endif
#if HASP_USE_TASMOTA_CLIENT > 0
#include "sys/svc/hasp_slave.h"
#endif
#ifndef FPSTR
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper*>(pstr_pointer))
#endif
#ifndef PGM_P
#define PGM_P const char*
#endif
#if defined(WINDOWS) || defined(POSIX)
#ifndef __FlashStringHelper
#define __FlashStringHelper char
#endif
#ifndef F
#define F(x) (x)
#endif
#ifndef PSTR
#define PSTR(x) x
#endif
#ifndef PROGMEM
#define PROGMEM
#endif
#endif
#if defined(WINDOWS)
#include <Windows.h>
#define delay Sleep
#endif
#if defined(POSIX)
#ifdef USE_MONITOR
#define delay SDL_Delay
#else
#define delay msleep
#endif
#endif
#if HASP_TARGET_PC
#if defined(WINDOWS) || defined(POSIX)
#include <string.h>
#include <strings.h>
#include <stdio.h>
#if USE_MONITOR
#include <SDL2/SDL.h>
#endif
#define snprintf_P snprintf
#define memcpy_P memcpy
#define strcasecmp_P strcasecmp
#define strcmp_P strcmp
#define strcpy_P strcpy
#define strstr_P strstr
#define halRestartMcu()
#if USE_MONITOR
#define millis SDL_GetTicks
#elif defined(WINDOWS)
#define millis Win32Millis
#elif defined(POSIX)
#define millis PosixMillis
#endif
#define DEC 10
#define HEX 16

View File

@ -1,33 +1,9 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_MACRO_H
#define HASP_MACRO_H
#ifdef ARDUINO
#include "ArduinoLog.h"
#endif
#ifdef USE_CONFIG_OVERRIDE
#include "user_config_override.h"
#endif
#if HASP_TARGET_PC
#define HASP_RANDOM(x) rand() % x
#elif HASP_TARGET_ARDUINO
#define HASP_RANDOM(x) random(x)
#else
#define HASP_RANDOM(x) random() % x
#endif
#if HASP_TARGET_PC
#if defined(WINDOWS) || defined(POSIX)
#define LOG_OUTPUT(x, ...) printf(__VA_ARGS__)
#else
#ifndef HASP_LOG_LEVEL
#define HASP_LOG_LEVEL LOG_LEVEL_TRACE
#endif
#define LOG_OUTPUT(...) Log.output(...)
#if HASP_LOG_LEVEL >= LOG_LEVEL_FATAL

View File

@ -1,31 +0,0 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef HASP_MEM_H
#define HASP_MEM_H
#include <stdlib.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef LODEPNG_NO_COMPILE_ALLOCATORS
void* lodepng_calloc(size_t num, size_t size);
void* lodepng_malloc(size_t size);
void* lodepng_realloc(void* ptr, size_t new_size);
void lodepng_free(void* ptr);
#endif // LODEPNG_NO_COMPILE_ALLOCATORS
bool hasp_use_psram();
void* hasp_calloc(size_t num, size_t size);
void* hasp_malloc(size_t size);
void* hasp_realloc(void* ptr, size_t new_size);
void hasp_free(void* ptr);
#ifdef __cplusplus
}
#endif
#endif // HASP_MEM_H

View File

@ -1,7 +1,3 @@
#ifdef USE_CONFIG_OVERRIDE
#include "user_config_override.h"
#endif
#include "lv_conf_v7.h"
#define LV_THEME_DEFAULT_FLAGS LV_THEME_DEFAULT_FLAG

View File

@ -59,7 +59,7 @@
/* Default display refresh period.
* Can be changed in the display driver (`lv_disp_drv_t`).*/
#define LV_DISP_DEF_REFR_PERIOD 50 /*[ms]*/
#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/
/* Dot Per Inch: used to initialize default sizes.
* E.g. a button with width = LV_DPI / 2 -> half inch wide
@ -76,32 +76,19 @@ typedef int16_t lv_coord_t;
/* LittelvGL's internal memory manager's settings.
* The graphical objects and other related data are stored here. */
//#define LV_FS_SEEK(x, y) lv_fs_seek(x, y, LV_FS_SEEK_SET)
#define LV_FS_SEEK(x, y) lv_fs_seek(x, y)
#define _lv_img_decoder_t _lv_img_decoder
#ifndef LV_MEM_CUSTOM
/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */
#define LV_MEM_CUSTOM 0
#endif
#if LV_MEM_CUSTOM == 0
/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
#ifndef LV_MEM_SIZE
#if defined(ARDUINO_ARCH_ESP8266)
# define LV_MEM_SIZE (12 * 1024U) // Minimum 12 Kb
#elif defined(ESP32S2) && defined(BOARD_HAS_PSRAM)
# define LV_MEM_SIZE (48 * 1024U) // 48Kb on ESP32-S2 with PSram
#elif defined(ESP32S2)
# define LV_MEM_SIZE (32 * 1024U) // 32Kb on ESP32-S2
#elif defined(ARDUINO_ARCH_ESP32) && defined(BOARD_HAS_PSRAM)
# define LV_MEM_SIZE (64 * 1024U) // 64Kb on ESP32 with PSram
#elif defined(ARDUINO_ARCH_ESP32)
# define LV_MEM_SIZE (48 * 1024U) // 48Kb on ESP32
# define LV_MEM_SIZE (10 * 1024U) // Minimum 10 Kb
#else
# define LV_MEM_SIZE (256 * 1024U) // native app
# define LV_MEM_SIZE (20 * 1024U) // 20Kb is much better
#endif
#endif
#endif // LV_MEM_SIZE
/* Complier prefix for a big array declaration */
# define LV_MEM_ATTR
@ -115,25 +102,11 @@ typedef int16_t lv_coord_t;
/* Automatically defrag. on free. Defrag. means joining the adjacent free cells. */
# 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 hasp_malloc /*Wrapper to malloc*/
#define LV_MEM_CUSTOM_FREE hasp_free /*Wrapper to free*/
# 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*/
#endif /*LV_MEM_CUSTOM*/
#ifndef LV_VDB_SIZE
#if defined(ARDUINO_ARCH_ESP8266)
# define LV_VDB_SIZE (8 * 1024U) // Minimum 8 Kb
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
# define LV_VDB_SIZE (16 * 1024U) // 16kB draw buffer
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
# define LV_VDB_SIZE (48 * 1024U) // 16kB draw buffer
#elif defined(ARDUINO_ARCH_ESP32)
# define LV_VDB_SIZE (32 * 1024U) // 32kB draw buffer
#else
# define LV_VDB_SIZE (128 * 1024U) // native app
#endif
#endif // LV_VDB_SIZE
/* Garbage Collector settings
* Used if lvgl is binded to higher level language and the memory is managed by that language */
#define LV_ENABLE_GC 0
@ -151,9 +124,7 @@ typedef int16_t lv_coord_t;
* Can be changed in the Input device driver (`lv_indev_drv_t`)*/
/* Input device read period in milliseconds */
#ifndef LV_INDEV_DEF_READ_PERIOD
#define LV_INDEV_DEF_READ_PERIOD 20 /*[ms]*/
#endif
#define LV_INDEV_DEF_READ_PERIOD 30
/* Drag threshold in pixels */
#define LV_INDEV_DEF_DRAG_LIMIT 10
@ -211,27 +182,21 @@ typedef void* lv_group_user_data_t;
#define LV_USE_FILESYSTEM 1
#if LV_USE_FILESYSTEM
/*Declare the type of the user data of file system drivers (can be e.g. `void *`, `int`, `struct`)*/
typedef const char* lv_fs_drv_user_data_t;
typedef void* lv_fs_drv_user_data_t;
/*File system interface*/
#ifndef LV_USE_FS_IF
#define LV_USE_FS_IF !defined(STM32)
#endif
#define LV_USE_FS_IF 0
#if LV_USE_FS_IF
# define LV_FS_IF_FATFS '\0'
#if defined(STM32F4xx) // || defined(ARDUINO_ARCH_ESP8266)
# define LV_FS_IF_PC '\0'
//# define LV_FS_IF_SPIFFS '\0' // internal esp Flash
# define LV_FS_IF_SPIFFS '\0' // internal esp Flash
#else
# define LV_FS_IF_PC 'L' // Local filesystem
# define LV_FS_IF_PC '\0'
# define LV_FS_IF_POSIX '\0'
//# define LV_FS_IF_SPIFFS '\0' // no internal esp Flash
# define LV_FS_IF_SPIFFS '\0' // no internal esp Flash
#endif
#endif /*LV_USE_FS_IF*/
#if HASP_TARGET_ARDUINO && !defined(LV_FS_PC_PATH)
#define LV_FS_PC_PATH "/littlefs"
#endif
#endif
@ -254,12 +219,7 @@ typedef const char* lv_fs_drv_user_data_t;
* With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
* However the opened images might consume additional RAM.
* LV_IMG_CACHE_DEF_SIZE must be >= 1 */
#ifndef LV_IMG_CACHE_DEF_SIZE
#define LV_IMG_CACHE_DEF_SIZE 1
#endif
#ifndef LV_IMG_CACHE_DEF_SIZE_PSRAM
#define LV_IMG_CACHE_DEF_SIZE_PSRAM 12 // special openHASP setting when PSRAM is used
#endif
/*Declare the type of the user data of image decoder (can be e.g. `void *`, `int`, `struct`)*/
typedef void* lv_img_decoder_user_data_t;
@ -271,9 +231,7 @@ typedef void* lv_img_decoder_user_data_t;
#define LV_ATTRIBUTE_TICK_INC
/* Define a custom attribute to `lv_task_handler` function */
#ifndef LV_ATTRIBUTE_TASK_HANDLER
#define LV_ATTRIBUTE_TASK_HANDLER
#endif
/* With size optimization (-Os) the compiler might not align data to
* 4 or 8 byte boundary. This alignment will be explicitly applied where needed.
@ -380,265 +338,63 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
/*==================
* FONT USAGE
*===================*/
// #if 1 || HASP_USE_FREETYPE<=0
// #if TFT_HEIGHT>=480 && TFT_WIDTH>=480
// #ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
// #define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
// #define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_64_LATIN1
// #define ROBOTOCONDENSED_REGULAR_64_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
// #endif
// #endif
// #ifndef HASP_FONT_1
// #define HASP_FONT_1 robotocondensed_regular_24_latin1 /* 5% Width */
// #endif
// #ifndef HASP_FONT_2
// #define HASP_FONT_2 robotocondensed_regular_32_latin1 /* 5% Width */
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_3
// #define HASP_FONT_3 robotocondensed_regular_48_latin1 /* 10% Width */
// #endif
// #ifndef HASP_FONT_4
// #define HASP_FONT_4 robotocondensed_regular_64_latin1 /* 10% Height */
// #endif
// #ifndef HASP_FONT_5
// #define HASP_FONT_5 robotocondensed_regular_16_latin1 /* 5% Width */
// #endif
// #endif
// #ifndef HASP_FONT_SIZE_1
// #define HASP_FONT_SIZE_1 24
// #endif
// #ifndef HASP_FONT_SIZE_2
// #define HASP_FONT_SIZE_2 32
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_SIZE_3
// #define HASP_FONT_SIZE_3 48
// #endif
// #ifndef HASP_FONT_SIZE_4
// #define HASP_FONT_SIZE_4 64
// #endif
// #ifndef HASP_FONT_SIZE_5
// #define HASP_FONT_SIZE_5 16
// #endif
// #endif
// #elif TFT_HEIGHT>=320 && TFT_WIDTH>=320
// #ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
// #define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
// #define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
// #define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
// #endif
// #endif
// #ifndef HASP_FONT_1
// #define HASP_FONT_1 robotocondensed_regular_16_latin1 /* 5% Width */
// #endif
// #ifndef HASP_FONT_2
// #define HASP_FONT_2 robotocondensed_regular_24_latin1 /* 5% Width */
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_3
// #define HASP_FONT_3 robotocondensed_regular_32_latin1 /* 10% Width */
// #endif
// #ifndef HASP_FONT_4
// #define HASP_FONT_4 robotocondensed_regular_48_latin1 /* 10% Height */
// #endif
// #ifndef HASP_FONT_5
// #define HASP_FONT_5 robotocondensed_regular_12_latin1 /* 5% Width */
// #endif
// #endif
// #ifndef HASP_FONT_SIZE_1
// #define HASP_FONT_SIZE_1 16
// #endif
// #ifndef HASP_FONT_SIZE_2
// #define HASP_FONT_SIZE_2 24
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_SIZE_3
// #define HASP_FONT_SIZE_3 32
// #endif
// #ifndef HASP_FONT_SIZE_4
// #define HASP_FONT_SIZE_4 48
// #endif
// #ifndef HASP_FONT_SIZE_5
// #define HASP_FONT_SIZE_5 12
// #endif
// #endif
// #elif TFT_HEIGHT>=272 && TFT_WIDTH>=272
// #ifndef ROBOTOCONDENSED_REGULAR_14_LATIN1
// #define ROBOTOCONDENSED_REGULAR_14_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_18_LATIN1
// #define ROBOTOCONDENSED_REGULAR_18_LATIN1 1
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef ROBOTOCONDENSED_REGULAR_28_LATIN1
// #define ROBOTOCONDENSED_REGULAR_28_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_36_LATIN1
// #define ROBOTOCONDENSED_REGULAR_36_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
// #endif
// #endif
// #ifndef HASP_FONT_1
// #define HASP_FONT_1 robotocondensed_regular_14_latin1 /* 5% Width */
// #endif
// #ifndef HASP_FONT_2
// #define HASP_FONT_2 robotocondensed_regular_18_latin1 /* 5% Width */
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_3
// #define HASP_FONT_3 robotocondensed_regular_28_latin1 /* 10% Width */
// #endif
// #ifndef HASP_FONT_4
// #define HASP_FONT_4 robotocondensed_regular_36_latin1 /* 10% Height */
// #endif
// #ifndef HASP_FONT_5
// #define HASP_FONT_5 robotocondensed_regular_48_latin1 /* 5% Width */
// #endif
// #endif
// #ifndef HASP_FONT_SIZE_1
// #define HASP_FONT_SIZE_1 14
// #endif
// #ifndef HASP_FONT_SIZE_2
// #define HASP_FONT_SIZE_2 18
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_SIZE_3
// #define HASP_FONT_SIZE_3 28
// #endif
// #ifndef HASP_FONT_SIZE_4
// #define HASP_FONT_SIZE_4 36
// #endif
// #ifndef HASP_FONT_SIZE_5
// #define HASP_FONT_SIZE_5 48
// #endif
// #endif
// #else // smaller than 272
// #ifndef HASP_FONT_1
// #define HASP_FONT_1 robotocondensed_regular_12_latin1 /* 5% Width */
// #endif
// #ifndef HASP_FONT_2
// #define HASP_FONT_2 robotocondensed_regular_16_latin1 /* 5% Width */
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_3
// #define HASP_FONT_3 robotocondensed_regular_24_latin1 /* 10% Width */
// #endif
// #ifndef HASP_FONT_4
// #define HASP_FONT_4 robotocondensed_regular_32_latin1 /* 10% Height */
// #endif
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
// #define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
// #define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
// #define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
// #endif
// #endif
// #ifndef HASP_FONT_SIZE_1
// #define HASP_FONT_SIZE_1 12
// #endif
// #ifndef HASP_FONT_SIZE_2
// #define HASP_FONT_SIZE_2 16
// #endif
// #if HASP_USE_FREETYPE<=0
// #ifndef HASP_FONT_SIZE_3
// #define HASP_FONT_SIZE_3 24
// #endif
// #ifndef HASP_FONT_SIZE_4
// #define HASP_FONT_SIZE_4 32
// #endif
// #ifndef HASP_FONT_SIZE_5
// #define HASP_FONT_SIZE_5 48
// #endif
// #endif
// #endif
// #endif
#ifndef ROBOTOCONDENSED_REGULAR_12_ALL
#define ROBOTOCONDENSED_REGULAR_12_ALL 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_16_ALL
#define ROBOTOCONDENSED_REGULAR_16_ALL 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_24_ALL
#define ROBOTOCONDENSED_REGULAR_24_ALL 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_32_ALL
#define ROBOTOCONDENSED_REGULAR_32_ALL 1
#endif
#if TFT_WIDTH>=320 || TFT_WIDTH>=480
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_12_all
#define HASP_FONT_1 robotocondensed_regular_16_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_2
#define HASP_FONT_2 robotocondensed_regular_16_all
#define HASP_FONT_2 robotocondensed_regular_24_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_3
#define HASP_FONT_3 robotocondensed_regular_24_all
#define HASP_FONT_3 robotocondensed_regular_32_latin1 /* 10% Width */
#endif
#ifndef HASP_FONT_4
#define HASP_FONT_4 robotocondensed_regular_32_all
#define HASP_FONT_4 robotocondensed_regular_48_latin1 /* 10% Height */
#endif
#ifndef HASP_FONT_SIZE_1
#define HASP_FONT_SIZE_1 12
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
#endif
#ifndef HASP_FONT_SIZE_2
#define HASP_FONT_SIZE_2 16
#ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
#define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
#endif
#ifndef HASP_FONT_SIZE_3
#define HASP_FONT_SIZE_3 24
#ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
#define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
#endif
#ifndef HASP_FONT_SIZE_4
#define HASP_FONT_SIZE_4 32
#ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
#endif
#else
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_12_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_2
#define HASP_FONT_2 robotocondensed_regular_16_latin1 /* 5% Width */
#endif
#ifndef HASP_FONT_3
#define HASP_FONT_3 robotocondensed_regular_24_latin1 /* 10% Width */
#endif
#ifndef HASP_FONT_4
#define HASP_FONT_4 robotocondensed_regular_32_latin1 /* 10% Height */
#endif
#ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
#define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
#define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
#define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
#endif
#endif
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
@ -726,51 +482,41 @@ typedef void* lv_font_user_data_t;
// #define HASP_FONT_1_base FONT_CONCAT(HASP_FONT_1_size, _)
// #define HASP_FONT_1 FONT_CONCAT(HASP_FONT_1_base, HASP_CHARACTER_SET)
// /* Concatenate the fontname macros */
// #define HASP_FONT_2_size FONT_CONCAT(HASP_FONTNAME, 16)
// #define HASP_FONT_2_base FONT_CONCAT(HASP_FONT_2_size, _)
// #define HASP_FONT_2 FONT_CONCAT(HASP_FONT_2_base, HASP_CHARACTER_SET)
// /* Concatenate the fontname macros */
// #define HASP_FONT_3_size FONT_CONCAT(HASP_FONTNAME, 22)
// #define HASP_FONT_3_base FONT_CONCAT(HASP_FONT_3_size, _)
// #define HASP_FONT_3 FONT_CONCAT(HASP_FONT_3_base, HASP_CHARACTER_SET)
// /* Concatenate the fontname macros */
// #define HASP_FONT_4_size FONT_CONCAT(HASP_FONTNAME, 28)
// #define HASP_FONT_4_base FONT_CONCAT(HASP_FONT_4_size, _)
// #define HASP_FONT_4 FONT_CONCAT(HASP_FONT_4_base, HASP_CHARACTER_SET)
/*Always set a default font from the built-in fonts*/
#if 0 && HASP_USE_FREETYPE<=0 // LV_HIGH_RESOURCE_MCU>0
#if LV_HIGH_RESOURCE_MCU>0
// #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_montserrat_16);
// #define LV_FONT_CUSTOM_12 LV_FONT_DECLARE(robotocondensed_regular_12)
// #define LV_FONT_CUSTOM_16 LV_FONT_DECLARE(robotocondensed_regular_16)
// #define LV_FONT_CUSTOM_22 LV_FONT_DECLARE(robotocondensed_regular_22)
// #define LV_FONT_CUSTOM_28 LV_FONT_DECLARE(robotocondensed_regular_28)
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(HASP_FONT_1) \
LV_FONT_DECLARE(HASP_FONT_2) \
LV_FONT_DECLARE(HASP_FONT_3) \
LV_FONT_DECLARE(HASP_FONT_4) \
LV_FONT_DECLARE(HASP_FONT_5) \
#ifndef LV_FONT_DEFAULT
#define LV_FONT_DEFAULT &HASP_FONT_2 //&lv_font_montserrat_16
#endif
#else
//#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(unscii_8_icon);
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(HASP_FONT_1) \
LV_FONT_DECLARE(HASP_FONT_2) \
LV_FONT_DECLARE(HASP_FONT_3) \
LV_FONT_DECLARE(HASP_FONT_4) \
#ifndef LV_FONT_DEFAULT
#if TFT_HEIGHT >= 480 && TFT_WIDTH >= 480
#define LV_FONT_DEFAULT &HASP_FONT_4
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_3
#elif TFT_HEIGHT >= 320 && TFT_WIDTH >= 320
#define LV_FONT_DEFAULT &HASP_FONT_3
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_2
#else // smaller than 320
#define LV_FONT_DEFAULT &HASP_FONT_2
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_1
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(unscii_8_icon);
#define LV_FONT_DEFAULT &unscii_8_icon //&lv_font_unscii_8
//#define LV_FONT_DEFAULT my_font
#endif
#endif // LV_FONT_DEFAULT
#ifndef LV_THEME_DEFAULT_FONT_SMALL
#define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT
#endif
#define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT
#define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT
#define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT
#endif // LV_HIGH_RESOURCE_MCU
/*================
* THEME USAGE
@ -783,17 +529,17 @@ typedef void* lv_font_user_data_t;
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_RED
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLUE
#define LV_THEME_DEFAULT_FLAG 0 //LV_THEME_MATERIAL_FLAG_NONE
// #if HASP_USE_FREETYPE<=0 //LV_HIGH_RESOURCE_MCU
// #define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_1 //&lv_font_montserrat_12
// #define LV_THEME_DEFAULT_FONT_NORMAL &HASP_FONT_2 //&lv_font_montserrat_16
// #define LV_THEME_DEFAULT_FONT_SUBTITLE &HASP_FONT_2 //&lv_font_montserrat_22
// #define LV_THEME_DEFAULT_FONT_TITLE &HASP_FONT_2 //&lv_font_montserrat_22 //&lv_font_montserrat_28_compressed
// #else
// #define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT // &lv_font_montserrat_12
// #define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT // &lv_font_montserrat_16
// #define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT // &lv_font_montserrat_22
// #define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT // &lv_font_montserrat_28_compressed
// #endif
#if LV_HIGH_RESOURCE_MCU
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_1 //&lv_font_montserrat_12
#define LV_THEME_DEFAULT_FONT_NORMAL &HASP_FONT_2 //&lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE &HASP_FONT_3 //&lv_font_montserrat_22
#define LV_THEME_DEFAULT_FONT_TITLE &HASP_FONT_4 //&lv_font_montserrat_22 //&lv_font_montserrat_28_compressed
#else
#define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT // &lv_font_montserrat_12
#define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT // &lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT // &lv_font_montserrat_22
#define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT // &lv_font_montserrat_28_compressed
#endif
#define LV_USE_THEME_EMPTY 0
#define LV_USE_THEME_MONO 1
@ -843,8 +589,8 @@ typedef void* lv_font_user_data_t;
#endif
/*Change the built in (v)snprintf functions*/
#define LV_SPRINTF_CUSTOM 1 // saves 1.4 KiB
#if LV_SPRINTF_CUSTOM
#define LV_SPRINTF_CUSTOM 0
#if LV_SPRINTF_CUSTOM
# define LV_SPRINTF_INCLUDE <stdio.h>
# define lv_snprintf snprintf
# define lv_vsnprintf vsnprintf
@ -858,13 +604,11 @@ typedef void* lv_font_user_data_t;
/*Declare the type of the user data of object (can be e.g. `void *`, `int`, `struct`)*/
typedef struct {
uint8_t id:8;
uint8_t objid:6;
//uint8_t transitionid:4;
//uint8_t actionid:4;
uint8_t objid:8;
uint8_t transitionid:4;
uint8_t actionid:4;
uint8_t groupid:4;
// uint8_t swipeid:4;
void* ext;
// char* action;
uint8_t swipeid:4;
} lv_obj_user_data_t;
/*1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
@ -901,7 +645,7 @@ typedef struct {
#define LV_USE_BTNMATRIX 1
/*Calendar (dependencies: -)*/
#define LV_USE_CALENDAR 0
#define LV_USE_CALENDAR 1
/*Canvas (dependencies: lv_img)*/
#define LV_USE_CANVAS 1
@ -910,7 +654,7 @@ typedef struct {
#define LV_USE_CHECKBOX 1
/*Chart (dependencies: -)*/
#define LV_USE_CHART 0
#define LV_USE_CHART 1
#if LV_USE_CHART
# define LV_CHART_AXIS_TICK_LABEL_MAX_LEN 20
#endif
@ -928,19 +672,6 @@ typedef struct {
# define LV_DROPDOWN_DEF_ANIM_TIME 200
#endif
/*Linemeter (dependencies: -*/
#define LV_USE_LINEMETER 1
#if LV_USE_LINEMETER
/* Set how precisely should the lines of the line meter be calculated.
* Higher precision means slower rendering.
* 0: normal
* 1: extra precision in the inner ring
* 2. extra precision on the outer ring too
*/
# define LV_LINEMETER_PRECISE 2
#endif
/*Gauge (dependencies:lv_bar, lv_linemeter)*/
#define LV_USE_GAUGE 1
@ -951,7 +682,7 @@ typedef struct {
#define LV_USE_IMGBTN 1
#if LV_USE_IMGBTN
/*1: The imgbtn requires left, mid and right parts and the width can be set freely*/
# define LV_IMGBTN_TILED 1
# define LV_IMGBTN_TILED 0
#endif
/*Keyboard (dependencies: lv_btnm)*/
@ -975,7 +706,6 @@ typedef struct {
/*LED (dependencies: -)*/
#define LV_USE_LED 1
#define LV_LED_BRIGHT_MIN 0
/*Line (dependencies: -*/
#define LV_USE_LINE 1
@ -991,7 +721,7 @@ typedef struct {
#define LV_USE_LMETER 1
/*Mask (dependencies: -)*/
#define LV_USE_OBJMASK 0
#define LV_USE_OBJMASK 1
/*Message box (dependencies: lv_rect, lv_btnm, lv_label)*/
#define LV_USE_MSGBOX 1
@ -1025,7 +755,7 @@ typedef struct {
#define LV_USE_SLIDER 1
/*Spinbox (dependencies: lv_ta)*/
#define LV_USE_SPINBOX 0
#define LV_USE_SPINBOX 1
/*Switch (dependencies: lv_slider)*/
#define LV_USE_SWITCH 1
@ -1038,7 +768,7 @@ typedef struct {
#endif
/*Table (dependencies: lv_label)*/
#define LV_USE_TABLE 0 //(LV_HIGH_RESOURCE_MCU)
#define LV_USE_TABLE 1 //(LV_HIGH_RESOURCE_MCU)
#if LV_USE_TABLE
# define LV_TABLE_COL_MAX 12
#endif
@ -1051,14 +781,14 @@ typedef struct {
#endif
/*Tileview (dependencies: lv_page) */
#define LV_USE_TILEVIEW 0
#define LV_USE_TILEVIEW 1
#if LV_USE_TILEVIEW
/*Time of slide animation [ms] (0: no animation)*/
# define LV_TILEVIEW_DEF_ANIM_TIME 300
#endif
/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
#define LV_USE_WIN 0
#define LV_USE_WIN 1
/*==================
* Non-user section

View File

@ -86,10 +86,8 @@ typedef int16_t lv_coord_t;
/* LittelvGL's internal memory manager's settings.
* The graphical objects and other related data are stored here. */
#ifndef LV_MEM_CUSTOM
/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc` and `lv_mem_free` */
#define LV_MEM_CUSTOM 0
#endif
#if LV_MEM_CUSTOM == 0
/* Size of the memory used by `lv_mem_alloc` in bytes (>= 2kB)*/
//# define LV_MEM_SIZE (32U * 1024U)
@ -105,8 +103,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 hasp_malloc /*Wrapper to malloc*/
# define LV_MEM_CUSTOM_FREE hasp_free /*Wrapper to free*/
# define LV_MEM_CUSTOM_ALLOC malloc /*Wrapper to malloc*/
# define LV_MEM_CUSTOM_FREE free /*Wrapper to free*/
#endif /*LV_MEM_CUSTOM*/
/* Use the standard memcpy and memset instead of LVGL's own functions.
@ -558,7 +556,7 @@ typedef void * lv_font_user_data_t;
#define LV_USE_ARABIC_PERSIAN_CHARS 0
/*Change the built in (v)snprintf functions*/
#define LV_SPRINTF_CUSTOM 1 // saves 1.4 KiB
#define LV_SPRINTF_CUSTOM 0
#if LV_SPRINTF_CUSTOM
# define LV_SPRINTF_INCLUDE <stdio.h>
# define lv_snprintf snprintf
@ -694,7 +692,7 @@ typedef struct {
* 1: extra precision in the inner ring
* 2. extra precision on the outer ring too
*/
# define LV_LINEMETER_PRECISE 2
# define LV_LINEMETER_PRECISE 1
#endif
/*Mask (dependencies: -)*/
#define LV_USE_OBJMASK 1

View File

@ -125,11 +125,7 @@
#define USE_WINDOWS 0
#endif
#ifndef USE_WIN32DRV
#define USE_WINDOWS 0
#endif
#if USE_WINDOWS || USE_WIN32DRV
#if USE_WINDOWS
#define WINDOW_HOR_RES 480
#define WINDOW_VER_RES 320
#endif

View File

@ -1,6 +1,3 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
#ifndef LV_SYMBOL_MDI_DEF_H
#define LV_SYMBOL_MDI_DEF_H
/* clang-format off */

View File

@ -1,6 +1,3 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
For full license information read the LICENSE file in the project folder */
/* Include the normal default core configuration */
#include "stm32f4xx_hal_conf_default.h"

View File

@ -1,4 +1,4 @@
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
/* MIT License - Copyright (c) 2019-2021 Francis Van Roie
For full license information read the LICENSE file in the project folder */
/***************************************************
@ -18,21 +18,15 @@
WiFi Settings
**************************************************/
#define WIFI_SSID ""
#define WIFI_PASSWORD ""
#define WIFI_PASSW ""
/***************************************************
Http Server Settings
MQTT Settings
**************************************************/
#define HTTP_USERNAME ""
#define HTTP_PASSWORD ""
/***************************************************
MQTT Client Settings
**************************************************/
#define MQTT_HOSTNAME ""
#define MQTT_HOST ""
#define MQTT_PORT 1883
#define MQTT_USERNAME ""
#define MQTT_PASSWORD ""
#define MQTT_USER ""
#define MQTT_PASSW ""
#define MQTT_PREFIX "hasp"
#define MQTT_NODENAME "plate01"
#define MQTT_GROUPNAME "plates"
@ -41,17 +35,17 @@
#define MQTT_STATEPERIOD 300000
/***************************************************
* OTA Settings
* Server Settings
**************************************************/
//#define HASP_USE_ARDUINOOTA 1 // Enable the Arduino OTA service
#define ARDUINOOTA_PORT 3232
#define ARDUINOOTA_PASSWORD ""
#define OTA_HOSTNAME ""
#define OTA_SERVER ""
#define OTA_PORT 80
#define OTA_URL ""
#define OTA_PASSWORD ""
/***************************************************
* Syslog Settings
**************************************************/
#define HASP_USE_SYSLOG 0
#define SYSLOG_SERVER ""
#define SYSLOG_PORT 514
#define APP_NAME "HASP"
@ -59,43 +53,28 @@
/***************************************************
* Timezone Settings
**************************************************/
#define NTPSERVER1 "pool.ntp.org"
#define NTPSERVER2 "time.nist.gov"
#define NTPSERVER3 "time.google.com"
#define MYTZ \
"CET-1CEST,M3.5.0,M10.5.0/3" // A full list with possible timezones can be found here
// https://gist.github.com/alwynallan/24d96091655391107939
#define MYTZ "CET-1CEST,M3.5.0,M10.5.0/3" // A full list with possible timezones can be found here https://gist.github.com/alwynallan/24d96091655391107939
/***************************************************
* Interface Language Settings
**************************************************/
#define HASP_LANGUAGE en_US // English
// #define HASP_LANGUAGE es_ES // Spanish
// #define HASP_LANGUAGE fr_FR // French
// #define HASP_LANGUAGE hu_HU // Hungarian
#define HASP_LANGUAGE en_US // English
// #define HASP_LANGUAGE nl_NL // Dutch
// #define HASP_LANGUAGE pt_BR // Brazilian Portuguese
// #define HASP_LANGUAGE pt_PT // Portuguese
// #define HASP_LANGUAGE hu_HU // Hungarian
// #define HASP_LANGUAGE ro_RO // Romanian
// #define HASP_LANGUAGE de_DE // German
/***************************************************
* Web interface coloring
**************************************************/
// Light theme (default)
#define D_HTTP_COLOR_TEXT "#000" // Global text color - Black
#define D_HTTP_COLOR_BACKGROUND "#fff" // Global background color - White
#define D_HTTP_COLOR_INPUT_TEXT "#000" // Input text color - Black
#define D_HTTP_COLOR_INPUT "#fff" // Input background color - White
#define D_HTTP_COLOR_INPUT_WARNING "#f00" // Input warning border color - Red
#define D_HTTP_COLOR_BUTTON_TEXT "#fff" // Button text color - White
#define D_HTTP_COLOR_BUTTON "#1fa3ec" // Button color - Vivid blue
#define D_HTTP_COLOR_BUTTON_HOVER "#0083cc" // Button color - Olympic blue
#define D_HTTP_COLOR_BUTTON_RESET "#f00" // Restart/Reset button color - red
#define D_HTTP_COLOR_BUTTON_RESET_HOVER "#b00" // Restart/Reset button color - Dark red
#define D_HTTP_COLOR_GROUP "#f3f3f3" // Group container background color
#define D_HTTP_COLOR_GROUP_TEXT "#000" // Group container text color - black
#define D_HTTP_COLOR_FOOTER_TEXT "#0083cc" // Footer text color - Olympic blue
#define D_HTTP_COLOR_TEXT "#000" // Global text color - Black
#define D_HTTP_COLOR_BACKGROUND "#fff" // Global background color - White
#define D_HTTP_COLOR_INPUT_TEXT "#000" // Input text color - Black
#define D_HTTP_COLOR_INPUT "#fff" // Input background color - White
#define D_HTTP_COLOR_INPUT_WARNING "#f00" // Input warning border color - Red
#define D_HTTP_COLOR_BUTTON_TEXT "#fff" // Button text color - White
#define D_HTTP_COLOR_BUTTON "#1fa3ec" // Button color - Vivid blue
#define D_HTTP_COLOR_BUTTON_RESET "#f00" // Restart/Reset button color - red
/*
// Dark theme
@ -106,56 +85,12 @@
#define D_HTTP_COLOR_INPUT_WARNING "#ff5661" // Warning text color - Brick Red
#define D_HTTP_COLOR_BUTTON_TEXT "#faffff" // Button text color - Very pale (mostly white) cyan
#define D_HTTP_COLOR_BUTTON "#1fa3ec" // Button color - Vivid blue
#define D_HTTP_COLOR_BUTTON_HOVER "#0083cc" // Button color - Olympic Blue
#define D_HTTP_COLOR_BUTTON_RESET "#d43535" // Restart/Reset/Delete button color - Strong red
#define D_HTTP_COLOR_BUTTON_RESET_HOVER "#b00" // Restart/Reset button color - Dark red
#define D_HTTP_COLOR_GROUP "#444" // Group container background color - Dark gray
#define D_HTTP_COLOR_GROUP_TEXT "#fff" // Group container text color - white
#define D_HTTP_COLOR_FOOTER_TEXT "#1fa3ec" // Footer text color - Vivid blue
*/
/***************************************************
* Font Settings
**************************************************/
// #define HASP_FONT_1 robotocondensed_regular_16_latin1 // Use available fonts from src/fonts directory
// #define HASP_FONT_2 robotocondensed_regular_22_latin1
// #define HASP_FONT_3 robotocondensed_regular_40_latin1
// #define HASP_FONT_4 robotocondensed_regular_48_latin1
// #define HASP_FONT_5 robotocondensed_regular_12_latin1
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1 // Enable the selected fonts
// #define ROBOTOCONDENSED_REGULAR_22_LATIN1 1
// #define ROBOTOCONDENSED_REGULAR_40_LATIN1 1
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
// #define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
// #define HASP_FONT_SIZE_1 16 // Define used font sizes
// #define HASP_FONT_SIZE_2 22
// #define HASP_FONT_SIZE_3 40
// #define HASP_FONT_SIZE_4 48
// #define HASP_FONT_SIZE_5 12
// #define LV_FONT_DEFAULT &HASP_FONT_1
/***************************************************
* GPIO Settings
**************************************************/
//#define HASP_GPIO_TEMPLATE "[197658,263456,329249,655628,655886,656155,0,0]" // Lanbon L8 3-gang GPIO config
//#define HASP_GPIO_TEMPLATE "[3214348,197658,263456,329249,94699520,0,0,0]" // Lanbon L8 Dimmer GPIO config
/***************************************************
* Other Settings
**************************************************/
//#define HASP_USE_MDNS 0 // Disable MDNS
//#define HASP_USE_CUSTOM 1 // Enable compilation of custom code from /src/custom
//#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
//#define HASP_START_FTP 0 // Disable starting of ftp server at boot
//#define LV_MEM_SIZE (64 * 1024U) // 64KiB of lvgl memory (default 48)
//#define LV_VDB_SIZE (32 * 1024U) // 32KiB of lvgl draw buffer (default 32)
//#define HASP_DEBUG_OBJ_TREE // Output all objects to the log on page changes
//#define HASP_LOG_LEVEL LOG_LEVEL_VERBOSE // LOG_LEVEL_* can be DEBUG, VERBOSE, TRACE, INFO, WARNING, ERROR, CRITICAL, ALERT, FATAL, SILENT
//#define HASP_LOG_TASKS // Also log the Taskname and watermark of ESP32 tasks
//#define HASP_USE_HA // Enable Home Assistant auto-discovery
#endif // HASP_USER_CONFIG_OVERRIDE_H
#endif

View File

@ -17,7 +17,7 @@ Licensed under the MIT License <http://opensource.org/licenses/MIT>.
#include <inttypes.h>
#include <stdarg.h>
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
@ -343,7 +343,7 @@ class Logging {
#ifndef DISABLE_LOGGING
int _level[3];
bool _showLevel[3];
Print* _logOutput[3] = {NULL,NULL,NULL};
Print* _logOutput[3];
printfunction _prefix = NULL;
printfunction _suffix = NULL;

View File

@ -1,125 +0,0 @@
#include "Arduino_RGBPanel_mod.h"
#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
Arduino_RGBPanel_Mod::Arduino_RGBPanel_Mod(
int8_t de, int8_t vsync, int8_t hsync, int8_t pclk,
int8_t r0, int8_t r1, int8_t r2, int8_t r3, int8_t r4,
int8_t g0, int8_t g1, int8_t g2, int8_t g3, int8_t g4, int8_t g5,
int8_t b0, int8_t b1, int8_t b2, int8_t b3, int8_t b4,
uint16_t hsync_polarity, uint16_t hsync_front_porch, uint16_t hsync_pulse_width, uint16_t hsync_back_porch,
uint16_t vsync_polarity, uint16_t vsync_front_porch, uint16_t vsync_pulse_width, uint16_t vsync_back_porch,
uint16_t pclk_active_neg, int32_t prefer_speed, bool useBigEndian)
: _de(de), _vsync(vsync), _hsync(hsync), _pclk(pclk),
_r0(r0), _r1(r1), _r2(r2), _r3(r3), _r4(r4),
_g0(g0), _g1(g1), _g2(g2), _g3(g3), _g4(g4), _g5(g5),
_b0(b0), _b1(b1), _b2(b2), _b3(b3), _b4(b4),
_hsync_polarity(hsync_polarity), _hsync_front_porch(hsync_front_porch), _hsync_pulse_width(hsync_pulse_width), _hsync_back_porch(hsync_back_porch),
_vsync_polarity(vsync_polarity), _vsync_front_porch(vsync_front_porch), _vsync_pulse_width(vsync_pulse_width), _vsync_back_porch(vsync_back_porch),
_pclk_active_neg(pclk_active_neg), _prefer_speed(prefer_speed), _useBigEndian(useBigEndian)
{
}
void Arduino_RGBPanel_Mod::begin(int32_t speed)
{
if (speed == GFX_NOT_DEFINED)
{
#ifdef CONFIG_SPIRAM_MODE_QUAD
_speed = 6000000L;
#else
_speed = 12000000L;
#endif
}
else
{
_speed = speed;
}
}
uint16_t *Arduino_RGBPanel_Mod::getFrameBuffer(int16_t w, int16_t h)
{
esp_lcd_rgb_panel_config_t *_panel_config = (esp_lcd_rgb_panel_config_t *)heap_caps_calloc(1, sizeof(esp_lcd_rgb_panel_config_t), MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
_panel_config->clk_src = LCD_CLK_SRC_PLL160M;
_panel_config->timings.pclk_hz = (_prefer_speed == GFX_NOT_DEFINED) ? _speed : _prefer_speed;
_panel_config->timings.h_res = w;
_panel_config->timings.v_res = h;
// The following parameters should refer to LCD spec
_panel_config->timings.hsync_pulse_width = _hsync_pulse_width;
_panel_config->timings.hsync_back_porch = _hsync_back_porch;
_panel_config->timings.hsync_front_porch = _hsync_front_porch;
_panel_config->timings.vsync_pulse_width = _vsync_pulse_width;
_panel_config->timings.vsync_back_porch = _vsync_back_porch;
_panel_config->timings.vsync_front_porch = _vsync_front_porch;
_panel_config->timings.flags.hsync_idle_low = (_hsync_polarity == 0) ? 1 : 0;
_panel_config->timings.flags.vsync_idle_low = (_vsync_polarity == 0) ? 1 : 0;
_panel_config->timings.flags.de_idle_high = 0;
_panel_config->timings.flags.pclk_active_neg = _pclk_active_neg;
_panel_config->timings.flags.pclk_idle_high = 0;
_panel_config->data_width = 16; // RGB565 in parallel mode, thus 16bit in width
_panel_config->sram_trans_align = 8;
_panel_config->psram_trans_align = 64;
_panel_config->hsync_gpio_num = _hsync;
_panel_config->vsync_gpio_num = _vsync;
_panel_config->de_gpio_num = _de;
_panel_config->pclk_gpio_num = _pclk;
if (_useBigEndian)
{
_panel_config->data_gpio_nums[0] = _g3;
_panel_config->data_gpio_nums[1] = _g4;
_panel_config->data_gpio_nums[2] = _g5;
_panel_config->data_gpio_nums[3] = _r0;
_panel_config->data_gpio_nums[4] = _r1;
_panel_config->data_gpio_nums[5] = _r2;
_panel_config->data_gpio_nums[6] = _r3;
_panel_config->data_gpio_nums[7] = _r4;
_panel_config->data_gpio_nums[8] = _b0;
_panel_config->data_gpio_nums[9] = _b1;
_panel_config->data_gpio_nums[10] = _b2;
_panel_config->data_gpio_nums[11] = _b3;
_panel_config->data_gpio_nums[12] = _b4;
_panel_config->data_gpio_nums[13] = _g0;
_panel_config->data_gpio_nums[14] = _g1;
_panel_config->data_gpio_nums[15] = _g2;
}
else
{
_panel_config->data_gpio_nums[0] = _b0;
_panel_config->data_gpio_nums[1] = _b1;
_panel_config->data_gpio_nums[2] = _b2;
_panel_config->data_gpio_nums[3] = _b3;
_panel_config->data_gpio_nums[4] = _b4;
_panel_config->data_gpio_nums[5] = _g0;
_panel_config->data_gpio_nums[6] = _g1;
_panel_config->data_gpio_nums[7] = _g2;
_panel_config->data_gpio_nums[8] = _g3;
_panel_config->data_gpio_nums[9] = _g4;
_panel_config->data_gpio_nums[10] = _g5;
_panel_config->data_gpio_nums[11] = _r0;
_panel_config->data_gpio_nums[12] = _r1;
_panel_config->data_gpio_nums[13] = _r2;
_panel_config->data_gpio_nums[14] = _r3;
_panel_config->data_gpio_nums[15] = _r4;
}
_panel_config->disp_gpio_num = GPIO_NUM_NC;
_panel_config->flags.disp_active_low = 0;
_panel_config->flags.relax_on_idle = 0;
_panel_config->flags.fb_in_psram = 1; // allocate frame buffer in PSRAM
ESP_ERROR_CHECK(esp_lcd_new_rgb_panel(_panel_config, &_panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_reset(_panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_init(_panel_handle));
uint16_t color = random(0xffff);
ESP_ERROR_CHECK(_panel_handle->draw_bitmap(_panel_handle, 0, 0, 1, 1, &color));
_rgb_panel = __containerof(_panel_handle, esp_rgb_panel_t, base);
return (uint16_t *)_rgb_panel->fb;
}
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

View File

@ -1,102 +0,0 @@
#ifdef HASP_USE_ARDUINOGFX
#include "Arduino.h"
#include "Arduino_DataBus.h"
#endif
#if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)
#include "databus/Arduino_ESP32RGBPanel.h" // struct esp_rgb_panel_t
#ifndef _ARDUINO_RGBPANEL_MOD_H_
#define _ARDUINO_RGBPANEL_MOD_H_
#include "esp_lcd_panel_io.h"
#include "esp_lcd_panel_rgb.h"
#include "esp_lcd_panel_vendor.h"
#include "esp_lcd_panel_ops.h"
#include "esp_lcd_panel_interface.h"
#include "esp_private/gdma.h"
#include "esp_pm.h"
#include "hal/dma_types.h"
#include "hal/lcd_hal.h"
#include "hal/lcd_ll.h"
#include "esp32s3/rom/cache.h"
// This function is located in ROM (also see esp_rom/${target}/ld/${target}.rom.ld)
extern int Cache_WriteBack_Addr(uint32_t addr, uint32_t size);
// extract from esp-idf esp_lcd_rgb_panel.c
/*struct esp_rgb_panel_t
{
esp_lcd_panel_t base; // Base class of generic lcd panel
int panel_id; // LCD panel ID
lcd_hal_context_t hal; // Hal layer object
size_t data_width; // Number of data lines (e.g. for RGB565, the data width is 16)
size_t sram_trans_align; // Alignment for framebuffer that allocated in SRAM
size_t psram_trans_align; // Alignment for framebuffer that allocated in PSRAM
int disp_gpio_num; // Display control GPIO, which is used to perform action like "disp_off"
intr_handle_t intr; // LCD peripheral interrupt handle
esp_pm_lock_handle_t pm_lock; // Power management lock
size_t num_dma_nodes; // Number of DMA descriptors that used to carry the frame buffer
uint8_t *fb; // Frame buffer
size_t fb_size; // Size of frame buffer
int data_gpio_nums[SOC_LCD_RGB_DATA_WIDTH]; // GPIOs used for data lines, we keep these GPIOs for action like "invert_color"
size_t resolution_hz; // Peripheral clock resolution
esp_lcd_rgb_timing_t timings; // RGB timing parameters (e.g. pclk, sync pulse, porch width)
gdma_channel_handle_t dma_chan; // DMA channel handle
esp_lcd_rgb_panel_frame_trans_done_cb_t on_frame_trans_done; // Callback, invoked after frame trans done
void *user_ctx; // Reserved user's data of callback functions
int x_gap; // Extra gap in x coordinate, it's used when calculate the flush window
int y_gap; // Extra gap in y coordinate, it's used when calculate the flush window
struct
{
unsigned int disp_en_level : 1; // The level which can turn on the screen by `disp_gpio_num`
unsigned int stream_mode : 1; // If set, the LCD transfers data continuously, otherwise, it stops refreshing the LCD when transaction done
unsigned int fb_in_psram : 1; // Whether the frame buffer is in PSRAM
} flags;
dma_descriptor_t dma_nodes[]; // DMA descriptor pool of size `num_dma_nodes`
};*/
class Arduino_RGBPanel_Mod
{
public:
Arduino_RGBPanel_Mod(
int8_t de, int8_t vsync, int8_t hsync, int8_t pclk,
int8_t r0, int8_t r1, int8_t r2, int8_t r3, int8_t r4,
int8_t g0, int8_t g1, int8_t g2, int8_t g3, int8_t g4, int8_t g5,
int8_t b0, int8_t b1, int8_t b2, int8_t b3, int8_t b4,
uint16_t hsync_polarity, uint16_t hsync_front_porch, uint16_t hsync_pulse_width, uint16_t hsync_back_porch,
uint16_t vsync_polarity, uint16_t vsync_front_porch, uint16_t vsync_pulse_width, uint16_t vsync_back_porch,
uint16_t pclk_active_neg = 0, int32_t prefer_speed = GFX_NOT_DEFINED, bool useBigEndian = false);
void begin(int32_t speed = GFX_NOT_DEFINED);
uint16_t *getFrameBuffer(int16_t w, int16_t h);
esp_lcd_panel_handle_t _panel_handle = NULL;
protected:
private:
int32_t _speed;
int8_t _de, _vsync, _hsync, _pclk;
int8_t _r0, _r1, _r2, _r3, _r4;
int8_t _g0, _g1, _g2, _g3, _g4, _g5;
int8_t _b0, _b1, _b2, _b3, _b4;
uint16_t _hsync_polarity;
uint16_t _hsync_front_porch;
uint16_t _hsync_pulse_width;
uint16_t _hsync_back_porch;
uint16_t _vsync_polarity;
uint16_t _vsync_front_porch;
uint16_t _vsync_pulse_width;
uint16_t _vsync_back_porch;
uint16_t _pclk_active_neg;
int32_t _prefer_speed;
bool _useBigEndian;
esp_rgb_panel_t *_rgb_panel;
};
#endif // _ARDUINO_ESP32RGBPANEL_H_
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

View File

@ -1,290 +0,0 @@
#include "Arduino_RGB_Display_mod.h"
#if defined(ESP32) && defined(CONFIG_IDF_TARGET_ESP32S3) && defined(HASP_USE_ARDUINOGFX)
#include "Arduino_GFX.h"
#include "Arduino_DataBus.h"
#include "Arduino_RGB_Display_mod.h"
Arduino_RGB_Display_Mod::Arduino_RGB_Display_Mod(int16_t w, int16_t h, Arduino_RGBPanel_Mod* rgbpanel, uint8_t r,
bool auto_flush, Arduino_DataBus* bus, int8_t rst,
const uint8_t* init_operations, size_t init_operations_len)
: Arduino_GFX(w, h), _rgbpanel(rgbpanel), _auto_flush(auto_flush), _bus(bus), _rst(rst),
_init_operations(init_operations), _init_operations_len(init_operations_len)
{
_framebuffer_size = w * h * 2;
_rotation = r;
}
bool Arduino_RGB_Display_Mod::begin(int32_t speed)
{
_rgbpanel->begin(speed);
if(_bus) {
_bus->begin();
}
if(_rst != GFX_NOT_DEFINED) {
pinMode(_rst, OUTPUT);
digitalWrite(_rst, HIGH);
delay(100);
digitalWrite(_rst, LOW);
delay(120);
digitalWrite(_rst, HIGH);
delay(120);
} else {
if(_bus) {
// Software Rest
_bus->sendCommand(0x01);
delay(120);
}
}
if(_bus) {
if(_init_operations_len > 0) {
_bus->batchOperation((uint8_t*)_init_operations, _init_operations_len);
}
}
_framebuffer = _rgbpanel->getFrameBuffer(WIDTH, HEIGHT);
if(!_framebuffer) {
return false;
}
return true;
}
void Arduino_RGB_Display_Mod::writePixelPreclipped(int16_t x, int16_t y, uint16_t color)
{
uint16_t* fb = _framebuffer;
fb += (int32_t)y * _width;
fb += x;
*fb = color;
if(_auto_flush) {
Cache_WriteBack_Addr((uint32_t)fb, 2);
}
}
void Arduino_RGB_Display_Mod::writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
{
if(_ordered_in_range(x, 0, _max_x) && h) { // X on screen, nonzero height
if(h < 0) { // If negative height...
y += h + 1; // Move Y to top edge
h = -h; // Use positive height
}
if(y <= _max_y) { // Not off bottom
int16_t y2 = y + h - 1;
if(y2 >= 0) { // Not off top
// Line partly or fully overlaps screen
if(y < 0) {
y = 0;
h = y2 + 1;
} // Clip top
if(y2 > _max_y) {
h = _max_y - y + 1;
} // Clip bottom
uint16_t* fb = _framebuffer + ((int32_t)y * _width) + x;
if(_auto_flush) {
while(h--) {
*fb = color;
Cache_WriteBack_Addr((uint32_t)fb, 2);
fb += _width;
}
} else {
while(h--) {
*fb = color;
fb += _width;
}
}
}
}
}
}
void Arduino_RGB_Display_Mod::writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
{
if(_ordered_in_range(y, 0, _max_y) && w) { // Y on screen, nonzero width
if(w < 0) { // If negative width...
x += w + 1; // Move X to left edge
w = -w; // Use positive width
}
if(x <= _max_x) { // Not off right
int16_t x2 = x + w - 1;
if(x2 >= 0) { // Not off left
// Line partly or fully overlaps screen
if(x < 0) {
x = 0;
w = x2 + 1;
} // Clip left
if(x2 > _max_x) {
w = _max_x - x + 1;
} // Clip right
uint16_t* fb = _framebuffer + ((int32_t)y * _width) + x;
uint32_t cachePos = (uint32_t)fb;
int16_t writeSize = w * 2;
while(w--) {
*(fb++) = color;
}
if(_auto_flush) {
Cache_WriteBack_Addr(cachePos, writeSize);
}
}
}
}
}
void Arduino_RGB_Display_Mod::writeFillRectPreclipped(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
{
uint16_t* row = _framebuffer;
row += y * _width;
uint32_t cachePos = (uint32_t)row;
row += x;
for(int j = 0; j < h; j++) {
for(int i = 0; i < w; i++) {
row[i] = color;
}
row += _width;
}
if(_auto_flush) {
Cache_WriteBack_Addr(cachePos, _width * h * 2);
}
}
void Arduino_RGB_Display_Mod::setRotation(uint8_t r)
{
esp_err_t err = esp_lcd_panel_swap_xy(_rgbpanel->_panel_handle, r & 1);
err = esp_lcd_panel_mirror(_rgbpanel->_panel_handle, r & 4, r & 2);
}
void Arduino_RGB_Display_Mod::invertDisplay(bool i)
{
esp_err_t err = esp_lcd_panel_invert_color(_rgbpanel->_panel_handle, i);
}
void Arduino_RGB_Display_Mod::draw16bitRGBBitmap(int16_t x, int16_t y, uint16_t* bitmap, int16_t w, int16_t h)
{
esp_err_t err = esp_lcd_panel_draw_bitmap(_rgbpanel->_panel_handle, x, y, x + w, y + h, bitmap);
return;
if(((x + w - 1) < 0) || // Outside left
((y + h - 1) < 0) || // Outside top
(x > _max_x) || // Outside right
(y > _max_y) // Outside bottom
) {
return;
} else {
int16_t xskip = 0;
if((y + h - 1) > _max_y) {
h -= (y + h - 1) - _max_y;
}
if(y < 0) {
bitmap -= y * w;
h += y;
y = 0;
}
if((x + w - 1) > _max_x) {
xskip = (x + w - 1) - _max_x;
w -= xskip;
}
if(x < 0) {
bitmap -= x;
xskip -= x;
w += x;
x = 0;
}
uint16_t* row = _framebuffer;
row += y * _width;
uint32_t cachePos = (uint32_t)row;
row += x;
if(((_width & 1) == 0) && ((xskip & 1) == 0) && ((w & 1) == 0)) {
uint32_t* row2 = (uint32_t*)row;
uint32_t* bitmap2 = (uint32_t*)bitmap;
int16_t _width2 = _width >> 1;
int16_t xskip2 = xskip >> 1;
int16_t w2 = w >> 1;
for(int16_t j = 0; j < h; j++) {
for(int16_t i = 0; i < w2; i++) {
row2[i] = *bitmap2++;
}
bitmap2 += xskip2;
row2 += _width2;
}
} else {
for(int j = 0; j < h; j++) {
for(int i = 0; i < w; i++) {
row[i] = *bitmap++;
}
bitmap += xskip;
row += _width;
}
}
if(_auto_flush) {
Cache_WriteBack_Addr(cachePos, _width * h * 2);
}
}
}
void Arduino_RGB_Display_Mod::draw16bitBeRGBBitmap(int16_t x, int16_t y, uint16_t* bitmap, int16_t w, int16_t h)
{
if(((x + w - 1) < 0) || // Outside left
((y + h - 1) < 0) || // Outside top
(x > _max_x) || // Outside right
(y > _max_y) // Outside bottom
) {
return;
} else {
int16_t xskip = 0;
if((y + h - 1) > _max_y) {
h -= (y + h - 1) - _max_y;
}
if(y < 0) {
bitmap -= y * w;
h += y;
y = 0;
}
if((x + w - 1) > _max_x) {
xskip = (x + w - 1) - _max_x;
w -= xskip;
}
if(x < 0) {
bitmap -= x;
xskip -= x;
w += x;
x = 0;
}
uint16_t* row = _framebuffer;
row += y * _width;
uint32_t cachePos = (uint32_t)row;
row += x;
uint16_t color;
for(int j = 0; j < h; j++) {
for(int i = 0; i < w; i++) {
color = *bitmap++;
MSB_16_SET(row[i], color);
}
bitmap += xskip;
row += _width;
}
if(_auto_flush) {
Cache_WriteBack_Addr(cachePos, _width * h * 2);
}
}
}
void Arduino_RGB_Display_Mod::flush(void)
{
if(!_auto_flush) {
Cache_WriteBack_Addr((uint32_t)_framebuffer, _framebuffer_size);
}
}
uint16_t* Arduino_RGB_Display_Mod::getFramebuffer()
{
return _framebuffer;
}
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

View File

@ -1,434 +0,0 @@
#ifdef HASP_USE_ARDUINOGFX
#include "Arduino.h"
#include "Arduino_DataBus.h"
#endif
#if defined(ESP32) && defined(CONFIG_IDF_TARGET_ESP32S3) && defined(HASP_USE_ARDUINOGFX)
#ifndef _ARDUINO_RGB_DISPLAY_MOD_H_
#define _ARDUINO_RGB_DISPLAY_MOD_H_
#include "Arduino_GFX.h"
#include "Arduino_RGBPanel_mod.h"
static const uint8_t st7701_4848S040_init_operations[] = {
BEGIN_WRITE,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x10,
WRITE_C8_D16, 0xC0, 0x3B, 0x00,
WRITE_C8_D16, 0xC1, 0x0D, 0x02,
WRITE_C8_D16, 0xC2, 0x31, 0x05,
WRITE_C8_D8, 0xCD, 0x00,//0x08
WRITE_COMMAND_8, 0xB0, // Positive Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x11, 0x18, 0x0E,
0x11, 0x06, 0x07, 0x08,
0x07, 0x22, 0x04, 0x12,
0x0F, 0xAA, 0x31, 0x18,
WRITE_COMMAND_8, 0xB1, // Negative Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x11, 0x19, 0x0E,
0x12, 0x07, 0x08, 0x08,
0x08, 0x22, 0x04, 0x11,
0x11, 0xA9, 0x32, 0x18,
// PAGE1
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x11,
WRITE_C8_D8, 0xB0, 0x60, // Vop=4.7375v
WRITE_C8_D8, 0xB1, 0x32, // VCOM=32
WRITE_C8_D8, 0xB2, 0x07, // VGH=15v
WRITE_C8_D8, 0xB3, 0x80,
WRITE_C8_D8, 0xB5, 0x49, // VGL=-10.17v
WRITE_C8_D8, 0xB7, 0x85,
WRITE_C8_D8, 0xB8, 0x21, // AVDD=6.6 & AVCL=-4.6
WRITE_C8_D8, 0xC1, 0x78,
WRITE_C8_D8, 0xC2, 0x78,
WRITE_COMMAND_8, 0xE0,
WRITE_BYTES, 3, 0x00, 0x1B, 0x02,
WRITE_COMMAND_8, 0xE1,
WRITE_BYTES, 11,
0x08, 0xA0, 0x00, 0x00,
0x07, 0xA0, 0x00, 0x00,
0x00, 0x44, 0x44,
WRITE_COMMAND_8, 0xE2,
WRITE_BYTES, 12,
0x11, 0x11, 0x44, 0x44,
0xED, 0xA0, 0x00, 0x00,
0xEC, 0xA0, 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,
0x0A, 0xE9, 0xD8, 0xA0,
0x0C, 0xEB, 0xD8, 0xA0,
0x0E, 0xED, 0xD8, 0xA0,
0x10, 0xEF, 0xD8, 0xA0,
WRITE_COMMAND_8, 0xE6,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE7, 0x44, 0x44,
WRITE_COMMAND_8, 0xE8,
WRITE_BYTES, 16,
0x09, 0xE8, 0xD8, 0xA0,
0x0B, 0xEA, 0xD8, 0xA0,
0x0D, 0xEC, 0xD8, 0xA0,
0x0F, 0xEE, 0xD8, 0xA0,
WRITE_COMMAND_8, 0xEB,
WRITE_BYTES, 7,
0x02, 0x00, 0xE4, 0xE4,
0x88, 0x00, 0x40,
WRITE_C8_D16, 0xEC, 0x3C, 0x00,
WRITE_COMMAND_8, 0xED,
WRITE_BYTES, 16,
0xAB, 0x89, 0x76, 0x54,
0x02, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x20,
0x45, 0x67, 0x98, 0xBA,
//-----------VAP & VAN---------------
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x13,
WRITE_C8_D8, 0xE5, 0xE4,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x00,
WRITE_COMMAND_8, 0x21, // 0x20 normal, 0x21 IPS
WRITE_C8_D8, 0x3A, 0x60, // 0x70 RGB888, 0x60 RGB666, 0x50 RGB565
//WRITE_COMMAND_8, 0x21,0X00,
//END_WRITE,
WRITE_COMMAND_8, 0x11, // Sleep Out
END_WRITE,
DELAY, 120,
BEGIN_WRITE,
WRITE_COMMAND_8, 0x29, // Display On
END_WRITE,
BEGIN_WRITE,
WRITE_COMMAND_8, 0x20, // Invert display
END_WRITE
};
static const uint8_t st7701_sensecap_indicator_init_operations[] = {
BEGIN_WRITE,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x10,
WRITE_C8_D16, 0xC0, 0x3B, 0x00,
WRITE_C8_D16, 0xC1, 0x0D, 0x02,
WRITE_C8_D16, 0xC2, 0x31, 0x05,
WRITE_C8_D8, 0xC7, 0x04,
WRITE_C8_D8, 0xCD, 0x08,
WRITE_COMMAND_8, 0xB0, // Positive Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x11, 0x18, 0x0E,
0x11, 0x06, 0x07, 0x08,
0x07, 0x22, 0x04, 0x12,
0x0F, 0xAA, 0x31, 0x18,
END_WRITE,
BEGIN_WRITE,
WRITE_COMMAND_8, 0xB1, // Negative Voltage Gamma Control
WRITE_BYTES, 16,
0x00, 0x11, 0x19, 0x0E,
0x12, 0x07, 0x08, 0x08,
0x08, 0x22, 0x04, 0x11,
0x11, 0xA9, 0x32, 0x18,
// PAGE1
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x11,
WRITE_C8_D8, 0xB0, 0x60, // Vop=4.7375v
WRITE_C8_D8, 0xB1, 0x32, // VCOM=32
WRITE_C8_D8, 0xB2, 0x07, // VGH=15v
WRITE_C8_D8, 0xB3, 0x80,
WRITE_C8_D8, 0xB5, 0x49, // VGL=-10.17v
WRITE_C8_D8, 0xB7, 0x85,
WRITE_C8_D8, 0xB8, 0x21, // AVDD=6.6 & AVCL=-4.6
WRITE_C8_D8, 0xC1, 0x78,
WRITE_C8_D8, 0xC2, 0x78,
END_WRITE,
DELAY, 20,
BEGIN_WRITE,
WRITE_COMMAND_8, 0xE0,
WRITE_BYTES, 3, 0x00, 0x1B, 0x02,
WRITE_COMMAND_8, 0xE1,
WRITE_BYTES, 11,
0x08, 0xA0, 0x00, 0x00,
0x07, 0xA0, 0x00, 0x00,
0x00, 0x44, 0x44,
WRITE_COMMAND_8, 0xE2,
WRITE_BYTES, 12,
0x11, 0x11, 0x44, 0x44,
0xED, 0xA0, 0x00, 0x00,
0xEC, 0xA0, 0x00, 0x00,
END_WRITE,
BEGIN_WRITE,
WRITE_COMMAND_8, 0xE3,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE4, 0x44, 0x44,
WRITE_COMMAND_8, 0xE5,
WRITE_BYTES, 16,
0x0A, 0xE9, 0xD8, 0xA0,
0x0C, 0xEB, 0xD8, 0xA0,
0x0E, 0xED, 0xD8, 0xA0,
0x10, 0xEF, 0xD8, 0xA0,
WRITE_COMMAND_8, 0xE6,
WRITE_BYTES, 4, 0x00, 0x00, 0x11, 0x11,
WRITE_C8_D16, 0xE7, 0x44, 0x44,
END_WRITE,
BEGIN_WRITE,
WRITE_COMMAND_8, 0xE8,
WRITE_BYTES, 16,
0x09, 0xE8, 0xD8, 0xA0,
0x0B, 0xEA, 0xD8, 0xA0,
0x0D, 0xEC, 0xD8, 0xA0,
0x0F, 0xEE, 0xD8, 0xA0,
WRITE_COMMAND_8, 0xEB,
WRITE_BYTES, 7,
0x02, 0x00, 0xE4, 0xE4,
0x88, 0x00, 0x40,
WRITE_C8_D16, 0xEC, 0x3C, 0x00,
WRITE_COMMAND_8, 0xED,
WRITE_BYTES, 16,
0xAB, 0x89, 0x76, 0x54,
0x02, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x20,
0x45, 0x67, 0x98, 0xBA,
WRITE_C8_D8, 0x36, 0x10,
END_WRITE,
BEGIN_WRITE,
//-----------VAP & VAN---------------
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x13,
WRITE_C8_D8, 0xE5, 0xE4,
WRITE_COMMAND_8, 0xFF,
WRITE_BYTES, 5, 0x77, 0x01, 0x00, 0x00, 0x00,
WRITE_COMMAND_8, 0x21, // 0x20 normal, 0x21 IPS
WRITE_C8_D8, 0x3A, 0x60, // 0x70 RGB888, 0x60 RGB666, 0x50 RGB565
WRITE_COMMAND_8, 0x11, // Sleep Out
END_WRITE,
DELAY, 120,
BEGIN_WRITE,
WRITE_COMMAND_8, 0x29, // Display On
END_WRITE,
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:
Arduino_RGB_Display_Mod(
int16_t w, int16_t h, Arduino_RGBPanel_Mod *rgbpanel, uint8_t r = 0, bool auto_flush = true,
Arduino_DataBus *bus = NULL, int8_t rst = GFX_NOT_DEFINED, const uint8_t *init_operations = NULL, size_t init_operations_len = GFX_NOT_DEFINED);
bool begin(int32_t speed = GFX_NOT_DEFINED) override;
void writePixelPreclipped(int16_t x, int16_t y, uint16_t color) override;
void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) override;
void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) override;
void writeFillRectPreclipped(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) override;
void draw16bitRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h) override;
void draw16bitBeRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h) override;
void flush(void) override;
void setRotation(uint8_t r);
void invertDisplay(bool i);
uint16_t *getFramebuffer();
Arduino_DataBus *_bus;
Arduino_RGBPanel_Mod *_rgbpanel;
protected:
uint16_t *_framebuffer;
size_t _framebuffer_size;
bool _auto_flush;
int8_t _rst;
const uint8_t *_init_operations;
size_t _init_operations_len;
private:
};
#endif // _ARDUINO_RGB_DISPLAY_H_
#endif // #if defined(ESP32) && (CONFIG_IDF_TARGET_ESP32S3)

View File

@ -1,343 +0,0 @@
/* MIT License - Copyright (c) 2022 Ben Suffolk, ben@vanilla.net
For full license information read the LICENSE file in the project folder */
#if defined(HASP_USE_ETHSPI)
#include "ETHSPI.h"
#include "esp_netif.h"
#include "esp_eth.h"
#include "esp_eth_mac.h"
#include "esp_event.h"
#include "esp_log.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#include "lwip/err.h"
#include "lwip/dns.h"
extern void tcpipInit();
ETHSPIClass::ETHSPIClass()
:initialized(false)
,staticIP(false)
,eth_handle(NULL)
,eth_netif_spi(NULL)
{
}
ETHSPIClass::~ETHSPIClass()
{}
bool ETHSPIClass::begin(int mosi_io, int miso_io, int sclk_io, int cs_io, int int_io, spi_host_device_t spi_host)
{
if(initialized) {
return true;
}
tcpipInit();
// Create instance(s) of esp-netif for SPI Ethernet(s)
esp_netif_inherent_config_t esp_netif_config = ESP_NETIF_INHERENT_DEFAULT_ETH();
esp_netif_config.if_desc = "eth0";
esp_netif_config.route_prio = 30;
esp_netif_config_t cfg_spi = {
.base = &esp_netif_config,
.stack = ESP_NETIF_NETSTACK_DEFAULT_ETH
};
eth_netif_spi = esp_netif_new(&cfg_spi);
// Init MAC and PHY configs to default
eth_mac_config_t mac_config_spi = ETH_MAC_DEFAULT_CONFIG();
eth_phy_config_t phy_config_spi = ETH_PHY_DEFAULT_CONFIG();
// Install GPIO ISR handler to be able to service SPI Eth modlues interrupts
gpio_install_isr_service(0);
// Init SPI bus
spi_device_handle_t spi_handle = NULL;
spi_bus_config_t buscfg = {
.mosi_io_num = mosi_io,
.miso_io_num = miso_io,
.sclk_io_num = sclk_io,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
};
if(spi_bus_initialize(ETHSPI_HOST, &buscfg, SPI_DMA_CH_AUTO) != ESP_OK) {
return false;
}
// Configure SPI interface and Ethernet driver for specific SPI module
esp_eth_mac_t *mac_spi;
esp_eth_phy_t *phy_spi;
spi_device_interface_config_t devcfg = {
.command_bits = 16, // Actually it's the address phase in W5500 SPI frame
.address_bits = 8, // Actually it's the control phase in W5500 SPI frame
.mode = 0,
.clock_speed_hz = ETHSPI_CLOCK_MHZ * 1000 * 1000,
.queue_size = 20
};
// Set SPI module Chip Select GPIO
devcfg.spics_io_num = cs_io;
if(spi_bus_add_device(spi_host, &devcfg, &spi_handle) != ESP_OK) {
return false;
}
// w5500 ethernet driver is based on spi driver
eth_w5500_config_t w5500_config = ETH_W5500_DEFAULT_CONFIG(spi_handle);
// Set remaining GPIO numbers and configuration used by the SPI module
w5500_config.int_gpio_num = int_io;
phy_config_spi.phy_addr = 1;
phy_config_spi.reset_gpio_num = -1;
mac_spi = esp_eth_mac_new_w5500(&w5500_config, &mac_config_spi);
phy_spi = esp_eth_phy_new_w5500(&phy_config_spi);
esp_eth_config_t eth_config_spi = ETH_DEFAULT_CONFIG(mac_spi, phy_spi);
if(esp_eth_driver_install(&eth_config_spi, &eth_handle) != ESP_OK) {
return false;
}
// W5500 Does not have a mac address on the module. So get the enternet mac address from ESP fuse
uint8_t mac[6];
esp_read_mac(mac, ESP_MAC_ETH);
if(esp_eth_ioctl(eth_handle, ETH_CMD_S_MAC_ADDR, mac) != ESP_OK) {
return false;
}
// attach Ethernet driver to TCP/IP stack
if(esp_netif_attach(eth_netif_spi, esp_eth_new_netif_glue(eth_handle)) != ESP_OK) {
return false;
}
if(esp_eth_start(eth_handle) != ESP_OK) {
return false;
}
initialized = true;
return initialized;
}
bool ETHSPIClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2)
{
esp_netif_ip_info_t ip_info;
if(local_ip != (uint32_t)0x00000000 && local_ip != INADDR_NONE) {
ip_info.ip.addr = static_cast<uint32_t>(local_ip);
ip_info.gw.addr = static_cast<uint32_t>(gateway);
ip_info.netmask.addr = static_cast<uint32_t>(subnet);
} else {
ip_info.ip.addr = 0;
ip_info.gw.addr = 0;
ip_info.netmask.addr = 0;
}
// Stop DHCP client
esp_netif_dhcp_status_t status;
if(esp_netif_dhcpc_get_status(eth_netif_spi, &status) != ESP_OK) {
log_e("could not get DHCP status");
return false;
}
if(status == ESP_NETIF_DHCP_STARTED && esp_netif_dhcpc_stop(eth_netif_spi) != ESP_OK) {
log_e("DHCP could not be stopped");
return false;
}
// Set IP Details
if(esp_netif_set_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
log_e("Unable to set IP address");
return false;
}
// Start DHCP client is required
if(ip_info.ip.addr){
staticIP = true;
} else {
if(esp_netif_dhcpc_start(eth_netif_spi) != ESP_OK) {
log_e("DHCP could not be started");
return false;
}
staticIP = false;
}
// Set primary DNS
if(dns1 != (uint32_t)0x00000000 && dns1 != INADDR_NONE) {
esp_netif_dns_info_t dns_info;
dns_info.ip.u_addr.ip4.addr = static_cast<uint32_t>(dns1);
if(esp_netif_set_dns_info(eth_netif_spi, ESP_NETIF_DNS_MAIN, &dns_info) != ESP_OK) {
log_e("Unable to set DNS");
return false;
}
}
// Set secondary DNS
if(dns2 != (uint32_t)0x00000000 && dns2 != INADDR_NONE) {
esp_netif_dns_info_t dns_info;
dns_info.ip.u_addr.ip4.addr = static_cast<uint32_t>(dns2);
if(esp_netif_set_dns_info(eth_netif_spi, ESP_NETIF_DNS_FALLBACK, &dns_info) != ESP_OK) {
log_e("Unable to set DNS");
return false;
}
}
return true;
}
IPAddress ETHSPIClass::localIP()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return IPAddress(ip_info.ip.addr);
}
IPAddress ETHSPIClass::subnetMask()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return IPAddress(ip_info.netmask.addr);
}
IPAddress ETHSPIClass::gatewayIP()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return IPAddress(ip_info.gw.addr);
}
IPAddress ETHSPIClass::dnsIP(esp_netif_dns_type_t dns_type)
{
esp_netif_dns_info_t dns_info;
if(esp_netif_get_dns_info(eth_netif_spi, dns_type, &dns_info) != ESP_OK) {
return IPAddress();
}
return IPAddress(dns_info.ip.u_addr.ip4.addr);
}
IPAddress ETHSPIClass::broadcastIP()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return WiFiGenericClass::calculateBroadcast(IPAddress(ip_info.gw.addr), IPAddress(ip_info.netmask.addr));
}
IPAddress ETHSPIClass::networkID()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return WiFiGenericClass::calculateNetworkID(IPAddress(ip_info.gw.addr), IPAddress(ip_info.netmask.addr));
}
uint8_t ETHSPIClass::subnetCIDR()
{
esp_netif_ip_info_t ip_info;
if(esp_netif_get_ip_info(eth_netif_spi, &ip_info) != ESP_OK) {
return IPAddress();
}
return WiFiGenericClass::calculateSubnetCIDR(IPAddress(ip_info.netmask.addr));
}
const char * ETHSPIClass::getHostname()
{
const char *hostname;
if(esp_netif_get_hostname(eth_netif_spi, &hostname) != ESP_OK) {
return NULL;
}
return hostname;
}
bool ETHSPIClass::setHostname(const char *hostname)
{
return(esp_netif_set_hostname(eth_netif_spi, hostname) == ESP_OK);
}
bool ETHSPIClass::fullDuplex()
{
eth_duplex_t duplex;
esp_eth_ioctl(eth_handle, ETH_CMD_G_DUPLEX_MODE, &duplex);
return (duplex == ETH_DUPLEX_FULL);
}
bool ETHSPIClass::linkUp()
{
return esp_netif_is_netif_up(eth_netif_spi);
}
uint8_t ETHSPIClass::linkSpeed()
{
eth_speed_t link_speed;
esp_eth_ioctl(eth_handle, ETH_CMD_G_SPEED, &link_speed);
return (link_speed == ETH_SPEED_10M)?10:100;
}
uint8_t * ETHSPIClass::macAddress(uint8_t* mac)
{
if(!mac) {
return NULL;
}
esp_eth_ioctl(eth_handle, ETH_CMD_G_MAC_ADDR, mac);
return mac;
}
String ETHSPIClass::macAddress(void)
{
uint8_t mac[6];
char macStr[18];
macAddress(mac);
sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
return String(macStr);
}
ETHSPIClass ETHSPI;
#endif

View File

@ -1,80 +0,0 @@
/* MIT License - Copyright (c) 2022 Ben Suffolk, ben@vanilla.net
For full license information read the LICENSE file in the project folder */
#ifndef _ETHSPI_H_
#define _ETHSPI_H_
#include "WiFi.h"
#include "esp_system.h"
#include "esp_eth.h"
#include "driver/spi_master.h"
#ifndef ETHSPI_HOST
#define ETHSPI_HOST SPI2_HOST
#endif
#ifndef ETHSPI_CLOCK_MHZ
#define ETHSPI_CLOCK_MHZ 12
#endif
#ifndef ETHSPI_INT_GPIO
#define ETHSPI_INT_GPIO 4
#endif
#ifndef ETHSPI_MOSI_GPIO
#define ETHSPI_MOSI_GPIO 13
#endif
#ifndef ETHSPI_MISO_GPIO
#define ETHSPI_MISO_GPIO 12
#endif
#ifndef ETHSPI_SCLK_GPIO
#define ETHSPI_SCLK_GPIO 14
#endif
#ifndef ETHSPI_CS_GPIO
#define ETHSPI_CS_GPIO 15
#endif
class ETHSPIClass {
private:
bool initialized;
bool staticIP;
esp_eth_handle_t eth_handle;
esp_netif_t *eth_netif_spi;
public:
ETHSPIClass();
~ETHSPIClass();
bool begin(int mosi_io = ETHSPI_MOSI_GPIO, int miso_io = ETHSPI_MISO_GPIO, int sclk_io = ETHSPI_SCLK_GPIO, int cs_io = ETHSPI_CS_GPIO, int int_io = ETHSPI_INT_GPIO, spi_host_device_t spi_host = ETHSPI_HOST);
bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = (uint32_t)0x00000000, IPAddress dns2 = (uint32_t)0x00000000);
const char * getHostname();
bool setHostname(const char * hostname);
bool fullDuplex();
bool linkUp();
uint8_t linkSpeed();
IPAddress localIP();
IPAddress subnetMask();
IPAddress gatewayIP();
IPAddress dnsIP(esp_netif_dns_type_t dns_type = ESP_NETIF_DNS_MAIN);
IPAddress broadcastIP();
IPAddress networkID();
uint8_t subnetCIDR();
uint8_t * macAddress(uint8_t* mac);
String macAddress();
friend class WiFiClient;
friend class WiFiServer;
};
extern ETHSPIClass ETHSPI;
#endif /* _ETH_H_ */

View File

@ -1,695 +0,0 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#if defined(HASP_USE_ETHSPI)
#include <string.h>
#include <stdlib.h>
#include <sys/cdefs.h>
#include "driver/gpio.h"
#include "driver/spi_master.h"
#include "esp_attr.h"
#include "esp_log.h"
#include "esp_check.h"
#include "esp_eth.h"
#include "esp_system.h"
#include "esp_intr_alloc.h"
#include "esp_heap_caps.h"
#include "esp_rom_gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "hal/cpu_hal.h"
#include "w5500.h"
#include "sdkconfig.h"
static const char *TAG = "w5500.mac";
#define W5500_SPI_LOCK_TIMEOUT_MS (50)
#define W5500_TX_MEM_SIZE (0x4000)
#define W5500_RX_MEM_SIZE (0x4000)
typedef struct {
esp_eth_mac_t parent;
esp_eth_mediator_t *eth;
spi_device_handle_t spi_hdl;
SemaphoreHandle_t spi_lock;
TaskHandle_t rx_task_hdl;
uint32_t sw_reset_timeout_ms;
int int_gpio_num;
uint8_t addr[6];
bool packets_remain;
} emac_w5500_t;
static inline bool w5500_lock(emac_w5500_t *emac)
{
return xSemaphoreTake(emac->spi_lock, pdMS_TO_TICKS(W5500_SPI_LOCK_TIMEOUT_MS)) == pdTRUE;
}
static inline bool w5500_unlock(emac_w5500_t *emac)
{
return xSemaphoreGive(emac->spi_lock) == pdTRUE;
}
static esp_err_t w5500_write(emac_w5500_t *emac, uint32_t address, const void *value, uint32_t len)
{
esp_err_t ret = ESP_OK;
spi_transaction_t trans = {
.cmd = (address >> W5500_ADDR_OFFSET),
.addr = ((address & 0xFFFF) | (W5500_ACCESS_MODE_WRITE << W5500_RWB_OFFSET) | W5500_SPI_OP_MODE_VDM),
.length = 8 * len,
.tx_buffer = value
};
if (w5500_lock(emac)) {
if (spi_device_polling_transmit(emac->spi_hdl, &trans) != ESP_OK) {
ESP_LOGE(TAG, "%s(%d): spi transmit failed", __FUNCTION__, __LINE__);
ret = ESP_FAIL;
}
w5500_unlock(emac);
} else {
ret = ESP_ERR_TIMEOUT;
}
return ret;
}
static esp_err_t w5500_read(emac_w5500_t *emac, uint32_t address, void *value, uint32_t len)
{
esp_err_t ret = ESP_OK;
spi_transaction_t trans = {
.flags = len <= 4 ? SPI_TRANS_USE_RXDATA : 0, // use direct reads for registers to prevent overwrites by 4-byte boundary writes
.cmd = (address >> W5500_ADDR_OFFSET),
.addr = ((address & 0xFFFF) | (W5500_ACCESS_MODE_READ << W5500_RWB_OFFSET) | W5500_SPI_OP_MODE_VDM),
.length = 8 * len,
.rx_buffer = value
};
if (w5500_lock(emac)) {
if (spi_device_polling_transmit(emac->spi_hdl, &trans) != ESP_OK) {
ESP_LOGE(TAG, "%s(%d): spi transmit failed", __FUNCTION__, __LINE__);
ret = ESP_FAIL;
}
w5500_unlock(emac);
} else {
ret = ESP_ERR_TIMEOUT;
}
if ((trans.flags&SPI_TRANS_USE_RXDATA) && len <= 4) {
memcpy(value, trans.rx_data, len); // copy register values to output
}
return ret;
}
static esp_err_t w5500_send_command(emac_w5500_t *emac, uint8_t command, uint32_t timeout_ms)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_CR(0), &command, sizeof(command)), err, TAG, "write SCR failed");
// after W5500 accepts the command, the command register will be cleared automatically
uint32_t to = 0;
for (to = 0; to < timeout_ms / 10; to++) {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_CR(0), &command, sizeof(command)), err, TAG, "read SCR failed");
if (!command) {
break;
}
vTaskDelay(pdMS_TO_TICKS(10));
}
ESP_GOTO_ON_FALSE(to < timeout_ms / 10, ESP_ERR_TIMEOUT, err, TAG, "send command timeout");
err:
return ret;
}
static esp_err_t w5500_get_tx_free_size(emac_w5500_t *emac, uint16_t *size)
{
esp_err_t ret = ESP_OK;
uint16_t free0, free1 = 0;
// read TX_FSR register more than once, until we get the same value
// this is a trick because we might be interrupted between reading the high/low part of the TX_FSR register (16 bits in length)
do {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_TX_FSR(0), &free0, sizeof(free0)), err, TAG, "read TX FSR failed");
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_TX_FSR(0), &free1, sizeof(free1)), err, TAG, "read TX FSR failed");
} while (free0 != free1);
*size = __builtin_bswap16(free0);
err:
return ret;
}
static esp_err_t w5500_get_rx_received_size(emac_w5500_t *emac, uint16_t *size)
{
esp_err_t ret = ESP_OK;
uint16_t received0, received1 = 0;
do {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_RX_RSR(0), &received0, sizeof(received0)), err, TAG, "read RX RSR failed");
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_RX_RSR(0), &received1, sizeof(received1)), err, TAG, "read RX RSR failed");
} while (received0 != received1);
*size = __builtin_bswap16(received0);
err:
return ret;
}
static esp_err_t w5500_write_buffer(emac_w5500_t *emac, const void *buffer, uint32_t len, uint16_t offset)
{
esp_err_t ret = ESP_OK;
uint32_t remain = len;
const uint8_t *buf = buffer;
offset %= W5500_TX_MEM_SIZE;
if (offset + len > W5500_TX_MEM_SIZE) {
remain = (offset + len) % W5500_TX_MEM_SIZE;
len = W5500_TX_MEM_SIZE - offset;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_MEM_SOCK_TX(0, offset), buf, len), err, TAG, "write TX buffer failed");
offset += len;
buf += len;
}
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_MEM_SOCK_TX(0, offset), buf, remain), err, TAG, "write TX buffer failed");
err:
return ret;
}
static esp_err_t w5500_read_buffer(emac_w5500_t *emac, void *buffer, uint32_t len, uint16_t offset)
{
esp_err_t ret = ESP_OK;
uint32_t remain = len;
uint8_t *buf = buffer;
offset %= W5500_RX_MEM_SIZE;
if (offset + len > W5500_RX_MEM_SIZE) {
remain = (offset + len) % W5500_RX_MEM_SIZE;
len = W5500_RX_MEM_SIZE - offset;
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_MEM_SOCK_RX(0, offset), buf, len), err, TAG, "read RX buffer failed");
offset += len;
buf += len;
}
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_MEM_SOCK_RX(0, offset), buf, remain), err, TAG, "read RX buffer failed");
err:
return ret;
}
static esp_err_t w5500_set_mac_addr(emac_w5500_t *emac)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_MAC, emac->addr, 6), err, TAG, "write MAC address register failed");
err:
return ret;
}
static esp_err_t w5500_reset(emac_w5500_t *emac)
{
esp_err_t ret = ESP_OK;
/* software reset */
uint8_t mr = W5500_MR_RST; // Set RST bit (auto clear)
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_MR, &mr, sizeof(mr)), err, TAG, "write MR failed");
uint32_t to = 0;
for (to = 0; to < emac->sw_reset_timeout_ms / 10; to++) {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_MR, &mr, sizeof(mr)), err, TAG, "read MR failed");
if (!(mr & W5500_MR_RST)) {
break;
}
vTaskDelay(pdMS_TO_TICKS(10));
}
ESP_GOTO_ON_FALSE(to < emac->sw_reset_timeout_ms / 10, ESP_ERR_TIMEOUT, err, TAG, "reset timeout");
err:
return ret;
}
static esp_err_t w5500_verify_id(emac_w5500_t *emac)
{
esp_err_t ret = ESP_OK;
uint8_t version = 0;
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_VERSIONR, &version, sizeof(version)), err, TAG, "read VERSIONR failed");
// W5500 doesn't have chip ID, we just print the version number instead
ESP_LOGI(TAG, "version=%x", version);
err:
return ret;
}
static esp_err_t w5500_setup_default(emac_w5500_t *emac)
{
esp_err_t ret = ESP_OK;
uint8_t reg_value = 16;
// Only SOCK0 can be used as MAC RAW mode, so we give the whole buffer (16KB TX and 16KB RX) to SOCK0
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_RXBUF_SIZE(0), &reg_value, sizeof(reg_value)), err, TAG, "set rx buffer size failed");
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_TXBUF_SIZE(0), &reg_value, sizeof(reg_value)), err, TAG, "set tx buffer size failed");
reg_value = 0;
for (int i = 1; i < 8; i++) {
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_RXBUF_SIZE(i), &reg_value, sizeof(reg_value)), err, TAG, "set rx buffer size failed");
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_TXBUF_SIZE(i), &reg_value, sizeof(reg_value)), err, TAG, "set tx buffer size failed");
}
/* Enable ping block, disable PPPoE, WOL */
reg_value = W5500_MR_PB;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_MR, &reg_value, sizeof(reg_value)), err, TAG, "write MR failed");
/* Disable interrupt for all sockets by default */
reg_value = 0;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SIMR, &reg_value, sizeof(reg_value)), err, TAG, "write SIMR failed");
/* Enable MAC RAW mode for SOCK0, enable MAC filter, no blocking broadcast and multicast */
reg_value = W5500_SMR_MAC_RAW | W5500_SMR_MAC_FILTER;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_MR(0), &reg_value, sizeof(reg_value)), err, TAG, "write SMR failed");
/* Enable receive event for SOCK0 */
reg_value = W5500_SIR_RECV;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_IMR(0), &reg_value, sizeof(reg_value)), err, TAG, "write SOCK0 IMR failed");
/* Set the interrupt re-assert level to maximum (~1.5ms) to lower the chances of missing it */
uint16_t int_level = __builtin_bswap16(0xFFFF);
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_INTLEVEL, &int_level, sizeof(int_level)), err, TAG, "write INTLEVEL failed");
err:
return ret;
}
static esp_err_t emac_w5500_start(esp_eth_mac_t *mac)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint8_t reg_value = 0;
/* open SOCK0 */
ESP_GOTO_ON_ERROR(w5500_send_command(emac, W5500_SCR_OPEN, 100), err, TAG, "issue OPEN command failed");
/* enable interrupt for SOCK0 */
reg_value = W5500_SIMR_SOCK0;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SIMR, &reg_value, sizeof(reg_value)), err, TAG, "write SIMR failed");
err:
return ret;
}
static esp_err_t emac_w5500_stop(esp_eth_mac_t *mac)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint8_t reg_value = 0;
/* disable interrupt */
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SIMR, &reg_value, sizeof(reg_value)), err, TAG, "write SIMR failed");
/* close SOCK0 */
ESP_GOTO_ON_ERROR(w5500_send_command(emac, W5500_SCR_CLOSE, 100), err, TAG, "issue CLOSE command failed");
err:
return ret;
}
IRAM_ATTR static void w5500_isr_handler(void *arg)
{
emac_w5500_t *emac = (emac_w5500_t *)arg;
BaseType_t high_task_wakeup = pdFALSE;
/* notify w5500 task */
vTaskNotifyGiveFromISR(emac->rx_task_hdl, &high_task_wakeup);
if (high_task_wakeup != pdFALSE) {
portYIELD_FROM_ISR();
}
}
static void emac_w5500_task(void *arg)
{
emac_w5500_t *emac = (emac_w5500_t *)arg;
uint8_t status = 0;
uint8_t *buffer = NULL;
uint32_t length = 0;
while (1) {
// check if the task receives any notification
if (ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(1000)) == 0 && // if no notification ...
gpio_get_level(emac->int_gpio_num) != 0) { // ...and no interrupt asserted
continue; // -> just continue to check again
}
/* read interrupt status */
w5500_read(emac, W5500_REG_SOCK_IR(0), &status, sizeof(status));
/* packet received */
if (status & W5500_SIR_RECV) {
status = W5500_SIR_RECV;
// clear interrupt status
w5500_write(emac, W5500_REG_SOCK_IR(0), &status, sizeof(status));
do {
length = ETH_MAX_PACKET_SIZE;
buffer = heap_caps_malloc(length, MALLOC_CAP_DMA);
if (!buffer) {
ESP_LOGE(TAG, "no mem for receive buffer");
break;
} else if (emac->parent.receive(&emac->parent, buffer, &length) == ESP_OK) {
/* pass the buffer to stack (e.g. TCP/IP layer) */
if (length) {
emac->eth->stack_input(emac->eth, buffer, length);
} else {
free(buffer);
}
} else {
free(buffer);
}
} while (emac->packets_remain);
}
}
vTaskDelete(NULL);
}
static esp_err_t emac_w5500_set_mediator(esp_eth_mac_t *mac, esp_eth_mediator_t *eth)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(eth, ESP_ERR_INVALID_ARG, err, TAG, "can't set mac's mediator to null");
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
emac->eth = eth;
return ESP_OK;
err:
return ret;
}
static esp_err_t emac_w5500_write_phy_reg(esp_eth_mac_t *mac, uint32_t phy_addr, uint32_t phy_reg, uint32_t reg_value)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
// PHY register and MAC registers are mixed together in W5500
// The only PHY register is PHYCFGR
ESP_GOTO_ON_FALSE(phy_reg == W5500_REG_PHYCFGR, ESP_FAIL, err, TAG, "wrong PHY register");
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_PHYCFGR, &reg_value, sizeof(uint8_t)), err, TAG, "write PHY register failed");
err:
return ret;
}
static esp_err_t emac_w5500_read_phy_reg(esp_eth_mac_t *mac, uint32_t phy_addr, uint32_t phy_reg, uint32_t *reg_value)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(reg_value, ESP_ERR_INVALID_ARG, err, TAG, "can't set reg_value to null");
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
// PHY register and MAC registers are mixed together in W5500
// The only PHY register is PHYCFGR
ESP_GOTO_ON_FALSE(phy_reg == W5500_REG_PHYCFGR, ESP_FAIL, err, TAG, "wrong PHY register");
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_PHYCFGR, reg_value, sizeof(uint8_t)), err, TAG, "read PHY register failed");
err:
return ret;
}
static esp_err_t emac_w5500_set_addr(esp_eth_mac_t *mac, uint8_t *addr)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(addr, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
memcpy(emac->addr, addr, 6);
ESP_GOTO_ON_ERROR(w5500_set_mac_addr(emac), err, TAG, "set mac address failed");
err:
return ret;
}
static esp_err_t emac_w5500_get_addr(esp_eth_mac_t *mac, uint8_t *addr)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(addr, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
memcpy(addr, emac->addr, 6);
err:
return ret;
}
static esp_err_t emac_w5500_set_link(esp_eth_mac_t *mac, eth_link_t link)
{
esp_err_t ret = ESP_OK;
switch (link) {
case ETH_LINK_UP:
ESP_LOGD(TAG, "link is up");
ESP_GOTO_ON_ERROR(mac->start(mac), err, TAG, "w5500 start failed");
break;
case ETH_LINK_DOWN:
ESP_LOGD(TAG, "link is down");
ESP_GOTO_ON_ERROR(mac->stop(mac), err, TAG, "w5500 stop failed");
break;
default:
ESP_GOTO_ON_FALSE(false, ESP_ERR_INVALID_ARG, err, TAG, "unknown link status");
break;
}
err:
return ret;
}
static esp_err_t emac_w5500_set_speed(esp_eth_mac_t *mac, eth_speed_t speed)
{
esp_err_t ret = ESP_OK;
switch (speed) {
case ETH_SPEED_10M:
ESP_LOGD(TAG, "working in 10Mbps");
break;
case ETH_SPEED_100M:
ESP_LOGD(TAG, "working in 100Mbps");
break;
default:
ESP_GOTO_ON_FALSE(false, ESP_ERR_INVALID_ARG, err, TAG, "unknown speed");
break;
}
err:
return ret;
}
static esp_err_t emac_w5500_set_duplex(esp_eth_mac_t *mac, eth_duplex_t duplex)
{
esp_err_t ret = ESP_OK;
switch (duplex) {
case ETH_DUPLEX_HALF:
ESP_LOGD(TAG, "working in half duplex");
break;
case ETH_DUPLEX_FULL:
ESP_LOGD(TAG, "working in full duplex");
break;
default:
ESP_GOTO_ON_FALSE(false, ESP_ERR_INVALID_ARG, err, TAG, "unknown duplex");
break;
}
err:
return ret;
}
static esp_err_t emac_w5500_set_promiscuous(esp_eth_mac_t *mac, bool enable)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint8_t smr = 0;
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_MR(0), &smr, sizeof(smr)), err, TAG, "read SMR failed");
if (enable) {
smr &= ~W5500_SMR_MAC_FILTER;
} else {
smr |= W5500_SMR_MAC_FILTER;
}
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_MR(0), &smr, sizeof(smr)), err, TAG, "write SMR failed");
err:
return ret;
}
static esp_err_t emac_w5500_enable_flow_ctrl(esp_eth_mac_t *mac, bool enable)
{
/* w5500 doesn't support flow control function, so accept any value */
return ESP_ERR_NOT_SUPPORTED;
}
static esp_err_t emac_w5500_set_peer_pause_ability(esp_eth_mac_t *mac, uint32_t ability)
{
/* w5500 doesn't suppport PAUSE function, so accept any value */
return ESP_ERR_NOT_SUPPORTED;
}
static inline bool is_w5500_sane_for_rxtx(emac_w5500_t *emac)
{
uint8_t phycfg;
/* phy is ok for rx and tx operations if bits RST and LNK are set (no link down, no reset) */
if (w5500_read(emac, W5500_REG_PHYCFGR, &phycfg, 1) == ESP_OK && (phycfg & 0x8001)) {
return true;
}
return false;
}
static esp_err_t emac_w5500_transmit(esp_eth_mac_t *mac, uint8_t *buf, uint32_t length)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint16_t offset = 0;
// check if there're free memory to store this packet
uint16_t free_size = 0;
ESP_GOTO_ON_ERROR(w5500_get_tx_free_size(emac, &free_size), err, TAG, "get free size failed");
ESP_GOTO_ON_FALSE(length <= free_size, ESP_ERR_NO_MEM, err, TAG, "free size (%d) < send length (%d)", length, free_size);
// get current write pointer
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_TX_WR(0), &offset, sizeof(offset)), err, TAG, "read TX WR failed");
offset = __builtin_bswap16(offset);
// copy data to tx memory
ESP_GOTO_ON_ERROR(w5500_write_buffer(emac, buf, length, offset), err, TAG, "write frame failed");
// update write pointer
offset += length;
offset = __builtin_bswap16(offset);
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_TX_WR(0), &offset, sizeof(offset)), err, TAG, "write TX WR failed");
// issue SEND command
ESP_GOTO_ON_ERROR(w5500_send_command(emac, W5500_SCR_SEND, 100), err, TAG, "issue SEND command failed");
// pooling the TX done event
int retry = 0;
uint8_t status = 0;
while (!(status & W5500_SIR_SEND)) {
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_IR(0), &status, sizeof(status)), err, TAG, "read SOCK0 IR failed");
if ((retry++ > 3 && !is_w5500_sane_for_rxtx(emac)) || retry > 10) {
return ESP_FAIL;
}
}
// clear the event bit
status = W5500_SIR_SEND;
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_IR(0), &status, sizeof(status)), err, TAG, "write SOCK0 IR failed");
err:
return ret;
}
static esp_err_t emac_w5500_receive(esp_eth_mac_t *mac, uint8_t *buf, uint32_t *length)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
uint16_t offset = 0;
uint16_t rx_len = 0;
uint16_t remain_bytes = 0;
emac->packets_remain = false;
w5500_get_rx_received_size(emac, &remain_bytes);
if (remain_bytes) {
// get current read pointer
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_SOCK_RX_RD(0), &offset, sizeof(offset)), err, TAG, "read RX RD failed");
offset = __builtin_bswap16(offset);
// read head first
ESP_GOTO_ON_ERROR(w5500_read_buffer(emac, &rx_len, sizeof(rx_len), offset), err, TAG, "read frame header failed");
rx_len = __builtin_bswap16(rx_len) - 2; // data size includes 2 bytes of header
offset += 2;
// read the payload
ESP_GOTO_ON_ERROR(w5500_read_buffer(emac, buf, rx_len, offset), err, TAG, "read payload failed, len=%d, offset=%d", rx_len, offset);
offset += rx_len;
// update read pointer
offset = __builtin_bswap16(offset);
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_RX_RD(0), &offset, sizeof(offset)), err, TAG, "write RX RD failed");
/* issue RECV command */
ESP_GOTO_ON_ERROR(w5500_send_command(emac, W5500_SCR_RECV, 100), err, TAG, "issue RECV command failed");
// check if there're more data need to process
remain_bytes -= rx_len + 2;
emac->packets_remain = remain_bytes > 0;
}
*length = rx_len;
err:
return ret;
}
static esp_err_t emac_w5500_init(esp_eth_mac_t *mac)
{
esp_err_t ret = ESP_OK;
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
esp_eth_mediator_t *eth = emac->eth;
esp_rom_gpio_pad_select_gpio(emac->int_gpio_num);
gpio_set_direction(emac->int_gpio_num, GPIO_MODE_INPUT);
gpio_set_pull_mode(emac->int_gpio_num, GPIO_PULLUP_ONLY);
gpio_set_intr_type(emac->int_gpio_num, GPIO_INTR_NEGEDGE); // active low
gpio_intr_enable(emac->int_gpio_num);
gpio_isr_handler_add(emac->int_gpio_num, w5500_isr_handler, emac);
ESP_GOTO_ON_ERROR(eth->on_state_changed(eth, ETH_STATE_LLINIT, NULL), err, TAG, "lowlevel init failed");
/* reset w5500 */
ESP_GOTO_ON_ERROR(w5500_reset(emac), err, TAG, "reset w5500 failed");
/* verify chip id */
ESP_GOTO_ON_ERROR(w5500_verify_id(emac), err, TAG, "vefiry chip ID failed");
/* default setup of internal registers */
ESP_GOTO_ON_ERROR(w5500_setup_default(emac), err, TAG, "w5500 default setup failed");
return ESP_OK;
err:
gpio_isr_handler_remove(emac->int_gpio_num);
gpio_reset_pin(emac->int_gpio_num);
eth->on_state_changed(eth, ETH_STATE_DEINIT, NULL);
return ret;
}
static esp_err_t emac_w5500_deinit(esp_eth_mac_t *mac)
{
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
esp_eth_mediator_t *eth = emac->eth;
mac->stop(mac);
gpio_isr_handler_remove(emac->int_gpio_num);
gpio_reset_pin(emac->int_gpio_num);
eth->on_state_changed(eth, ETH_STATE_DEINIT, NULL);
return ESP_OK;
}
static esp_err_t emac_w5500_del(esp_eth_mac_t *mac)
{
emac_w5500_t *emac = __containerof(mac, emac_w5500_t, parent);
vTaskDelete(emac->rx_task_hdl);
vSemaphoreDelete(emac->spi_lock);
free(emac);
return ESP_OK;
}
esp_eth_mac_t *esp_eth_mac_new_w5500(const eth_w5500_config_t *w5500_config, const eth_mac_config_t *mac_config)
{
esp_eth_mac_t *ret = NULL;
emac_w5500_t *emac = NULL;
ESP_GOTO_ON_FALSE(w5500_config && mac_config, NULL, err, TAG, "invalid argument");
emac = calloc(1, sizeof(emac_w5500_t));
ESP_GOTO_ON_FALSE(emac, NULL, err, TAG, "no mem for MAC instance");
/* w5500 driver is interrupt driven */
ESP_GOTO_ON_FALSE(w5500_config->int_gpio_num >= 0, NULL, err, TAG, "invalid interrupt gpio number");
/* bind methods and attributes */
emac->sw_reset_timeout_ms = mac_config->sw_reset_timeout_ms;
emac->int_gpio_num = w5500_config->int_gpio_num;
emac->spi_hdl = w5500_config->spi_hdl;
emac->parent.set_mediator = emac_w5500_set_mediator;
emac->parent.init = emac_w5500_init;
emac->parent.deinit = emac_w5500_deinit;
emac->parent.start = emac_w5500_start;
emac->parent.stop = emac_w5500_stop;
emac->parent.del = emac_w5500_del;
emac->parent.write_phy_reg = emac_w5500_write_phy_reg;
emac->parent.read_phy_reg = emac_w5500_read_phy_reg;
emac->parent.set_addr = emac_w5500_set_addr;
emac->parent.get_addr = emac_w5500_get_addr;
emac->parent.set_speed = emac_w5500_set_speed;
emac->parent.set_duplex = emac_w5500_set_duplex;
emac->parent.set_link = emac_w5500_set_link;
emac->parent.set_promiscuous = emac_w5500_set_promiscuous;
emac->parent.set_peer_pause_ability = emac_w5500_set_peer_pause_ability;
emac->parent.enable_flow_ctrl = emac_w5500_enable_flow_ctrl;
emac->parent.transmit = emac_w5500_transmit;
emac->parent.receive = emac_w5500_receive;
/* create mutex */
emac->spi_lock = xSemaphoreCreateMutex();
ESP_GOTO_ON_FALSE(emac->spi_lock, NULL, err, TAG, "create lock failed");
/* create w5500 task */
BaseType_t core_num = tskNO_AFFINITY;
if (mac_config->flags & ETH_MAC_FLAG_PIN_TO_CORE) {
core_num = cpu_hal_get_core_id();
}
BaseType_t xReturned = xTaskCreatePinnedToCore(emac_w5500_task, "w5500_tsk", mac_config->rx_task_stack_size, emac,
mac_config->rx_task_prio, &emac->rx_task_hdl, core_num);
ESP_GOTO_ON_FALSE(xReturned == pdPASS, NULL, err, TAG, "create w5500 task failed");
return &(emac->parent);
err:
if (emac) {
if (emac->rx_task_hdl) {
vTaskDelete(emac->rx_task_hdl);
}
if (emac->spi_lock) {
vSemaphoreDelete(emac->spi_lock);
}
free(emac);
}
return ret;
}
#endif

View File

@ -1,255 +0,0 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <string.h>
#include <stdlib.h>
#include <sys/cdefs.h>
#include "esp_log.h"
#include "esp_check.h"
#include "esp_eth.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_rom_gpio.h"
#include "esp_rom_sys.h"
#include "w5500.h"
static const char *TAG = "w5500.phy";
/***************Vendor Specific Register***************/
/**
* @brief PHYCFGR(PHY Configuration Register)
*
*/
typedef union {
struct {
uint8_t link: 1; /*!< Link status */
uint8_t speed: 1; /*!< Speed status */
uint8_t duplex: 1; /*!< Duplex status */
uint8_t opmode: 3; /*!< Operation mode */
uint8_t opsel: 1; /*!< Operation select */
uint8_t reset: 1; /*!< Reset, when this bit is '0', PHY will get reset */
};
uint8_t val;
} phycfg_reg_t;
typedef struct {
esp_eth_phy_t parent;
esp_eth_mediator_t *eth;
int addr;
uint32_t reset_timeout_ms;
uint32_t autonego_timeout_ms;
eth_link_t link_status;
int reset_gpio_num;
} phy_w5500_t;
static esp_err_t w5500_update_link_duplex_speed(phy_w5500_t *w5500)
{
esp_err_t ret = ESP_OK;
esp_eth_mediator_t *eth = w5500->eth;
eth_speed_t speed = ETH_SPEED_10M;
eth_duplex_t duplex = ETH_DUPLEX_HALF;
phycfg_reg_t phycfg;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, w5500->addr, W5500_REG_PHYCFGR, (uint32_t *) & (phycfg.val)), err, TAG, "read PHYCFG failed");
eth_link_t link = phycfg.link ? ETH_LINK_UP : ETH_LINK_DOWN;
/* check if link status changed */
if (w5500->link_status != link) {
/* when link up, read negotiation result */
if (link == ETH_LINK_UP) {
if (phycfg.speed) {
speed = ETH_SPEED_100M;
} else {
speed = ETH_SPEED_10M;
}
if (phycfg.duplex) {
duplex = ETH_DUPLEX_FULL;
} else {
duplex = ETH_DUPLEX_HALF;
}
ESP_GOTO_ON_ERROR(eth->on_state_changed(eth, ETH_STATE_SPEED, (void *)speed), err, TAG, "change speed failed");
ESP_GOTO_ON_ERROR(eth->on_state_changed(eth, ETH_STATE_DUPLEX, (void *)duplex), err, TAG, "change duplex failed");
}
ESP_GOTO_ON_ERROR(eth->on_state_changed(eth, ETH_STATE_LINK, (void *)link), err, TAG, "change link failed");
w5500->link_status = link;
}
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_set_mediator(esp_eth_phy_t *phy, esp_eth_mediator_t *eth)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(eth, ESP_ERR_INVALID_ARG, err, TAG, "can't set mediator to null");
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
w5500->eth = eth;
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_get_link(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
/* Updata information about link, speed, duplex */
ESP_GOTO_ON_ERROR(w5500_update_link_duplex_speed(w5500), err, TAG, "update link duplex speed failed");
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_reset(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
w5500->link_status = ETH_LINK_DOWN;
esp_eth_mediator_t *eth = w5500->eth;
phycfg_reg_t phycfg;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, w5500->addr, W5500_REG_PHYCFGR, (uint32_t *) & (phycfg.val)), err, TAG, "read PHYCFG failed");
phycfg.reset = 0; // set to '0' will reset internal PHY
ESP_GOTO_ON_ERROR(eth->phy_reg_write(eth, w5500->addr, W5500_REG_PHYCFGR, phycfg.val), err, TAG, "write PHYCFG failed");
vTaskDelay(pdMS_TO_TICKS(10));
phycfg.reset = 1; // set to '1' after reset
ESP_GOTO_ON_ERROR(eth->phy_reg_write(eth, w5500->addr, W5500_REG_PHYCFGR, phycfg.val), err, TAG, "write PHYCFG failed");
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_reset_hw(esp_eth_phy_t *phy)
{
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
// set reset_gpio_num to a negative value can skip hardware reset phy chip
if (w5500->reset_gpio_num >= 0) {
esp_rom_gpio_pad_select_gpio(w5500->reset_gpio_num);
gpio_set_direction(w5500->reset_gpio_num, GPIO_MODE_OUTPUT);
gpio_set_level(w5500->reset_gpio_num, 0);
esp_rom_delay_us(100); // insert min input assert time
gpio_set_level(w5500->reset_gpio_num, 1);
}
return ESP_OK;
}
static esp_err_t w5500_negotiate(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
esp_eth_mediator_t *eth = w5500->eth;
/* in case any link status has changed, let's assume we're in link down status */
w5500->link_status = ETH_LINK_DOWN;
phycfg_reg_t phycfg;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, w5500->addr, W5500_REG_PHYCFGR, (uint32_t *) & (phycfg.val)), err, TAG, "read PHYCFG failed");
phycfg.opsel = 1; // PHY working mode configured by register
phycfg.opmode = 7; // all capable, auto-negotiation enabled
ESP_GOTO_ON_ERROR(eth->phy_reg_write(eth, w5500->addr, W5500_REG_PHYCFGR, phycfg.val), err, TAG, "write PHYCFG failed");
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_pwrctl(esp_eth_phy_t *phy, bool enable)
{
// power control is not supported for W5500 internal PHY
return ESP_OK;
}
static esp_err_t w5500_set_addr(esp_eth_phy_t *phy, uint32_t addr)
{
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
w5500->addr = addr;
return ESP_OK;
}
static esp_err_t w5500_get_addr(esp_eth_phy_t *phy, uint32_t *addr)
{
esp_err_t ret = ESP_OK;
ESP_GOTO_ON_FALSE(addr, ESP_ERR_INVALID_ARG, err, TAG, "addr can't be null");
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
*addr = w5500->addr;
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_del(esp_eth_phy_t *phy)
{
phy_w5500_t *w5500 = __containerof(phy, phy_w5500_t, parent);
free(w5500);
return ESP_OK;
}
static esp_err_t w5500_advertise_pause_ability(esp_eth_phy_t *phy, uint32_t ability)
{
// pause ability advertisement is not supported for W5500 internal PHY
return ESP_OK;
}
static esp_err_t w5500_loopback(esp_eth_phy_t *phy, bool enable)
{
// Loopback is not supported for W5500 internal PHY
return ESP_ERR_NOT_SUPPORTED;
}
static esp_err_t w5500_init(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
/* Power on Ethernet PHY */
ESP_GOTO_ON_ERROR(w5500_pwrctl(phy, true), err, TAG, "power control failed");
/* Reset Ethernet PHY */
ESP_GOTO_ON_ERROR(w5500_reset(phy), err, TAG, "reset failed");
return ESP_OK;
err:
return ret;
}
static esp_err_t w5500_deinit(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
/* Power off Ethernet PHY */
ESP_GOTO_ON_ERROR(w5500_pwrctl(phy, false), err, TAG, "power control failed");
return ESP_OK;
err:
return ret;
}
esp_eth_phy_t *esp_eth_phy_new_w5500(const eth_phy_config_t *config)
{
esp_eth_phy_t *ret = NULL;
ESP_GOTO_ON_FALSE(config, NULL, err, TAG, "invalid arguments");
phy_w5500_t *w5500 = calloc(1, sizeof(phy_w5500_t));
ESP_GOTO_ON_FALSE(w5500, NULL, err, TAG, "no mem for PHY instance");
w5500->addr = config->phy_addr;
w5500->reset_timeout_ms = config->reset_timeout_ms;
w5500->reset_gpio_num = config->reset_gpio_num;
w5500->link_status = ETH_LINK_DOWN;
w5500->autonego_timeout_ms = config->autonego_timeout_ms;
w5500->parent.reset = w5500_reset;
w5500->parent.reset_hw = w5500_reset_hw;
w5500->parent.init = w5500_init;
w5500->parent.deinit = w5500_deinit;
w5500->parent.set_mediator = w5500_set_mediator;
w5500->parent.negotiate = w5500_negotiate;
w5500->parent.get_link = w5500_get_link;
w5500->parent.pwrctl = w5500_pwrctl;
w5500->parent.get_addr = w5500_get_addr;
w5500->parent.set_addr = w5500_set_addr;
w5500->parent.advertise_pause_ability = w5500_advertise_pause_ability;
w5500->parent.loopback = w5500_loopback;
w5500->parent.del = w5500_del;
return &(w5500->parent);
err:
return ret;
}

View File

@ -1,77 +0,0 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#define W5500_ADDR_OFFSET (16) // Address length
#define W5500_BSB_OFFSET (3) // Block Select Bits offset
#define W5500_RWB_OFFSET (2) // Read Write Bits offset
#define W5500_BSB_COM_REG (0x00) // Common Register
#define W5500_BSB_SOCK_REG(s) ((s)*4+1) // Socket Register
#define W5500_BSB_SOCK_TX_BUF(s) ((s)*4+2) // Socket TX Buffer
#define W5500_BSB_SOCK_RX_BUF(s) ((s)*4+3) // Socket RX Buffer
#define W5500_ACCESS_MODE_READ (0) // Read Mode
#define W5500_ACCESS_MODE_WRITE (1) // Write Mode
#define W5500_SPI_OP_MODE_VDM (0x00) // Variable Data Length Mode (SPI frame is controlled by CS line)
#define W5500_SPI_OP_MODE_FDM_1 (0x01) // Fixed Data Length Mode, 1 Byte Length
#define W5500_SPI_OP_MODE_FDM_2 (0x02) // Fixed Data Length Mode, 2 Bytes Length
#define W5500_SPI_OP_MODE_FDM_4 (0x03) // Fixed Data Length Mode, 4 Bytes Length
#define W5500_MAKE_MAP(offset, bsb) ((offset) << W5500_ADDR_OFFSET | (bsb) << W5500_BSB_OFFSET)
#define W5500_REG_MR W5500_MAKE_MAP(0x0000, W5500_BSB_COM_REG) // Mode
#define W5500_REG_MAC W5500_MAKE_MAP(0x0009, W5500_BSB_COM_REG) // MAC Address
#define W5500_REG_INTLEVEL W5500_MAKE_MAP(0x0013, W5500_BSB_COM_REG) // Interrupt Level Timeout
#define W5500_REG_IR W5500_MAKE_MAP(0x0015, W5500_BSB_COM_REG) // Interrupt
#define W5500_REG_IMR W5500_MAKE_MAP(0x0016, W5500_BSB_COM_REG) // Interrupt Mask
#define W5500_REG_SIR W5500_MAKE_MAP(0x0017, W5500_BSB_COM_REG) // Socket Interrupt
#define W5500_REG_SIMR W5500_MAKE_MAP(0x0018, W5500_BSB_COM_REG) // Socket Interrupt Mask
#define W5500_REG_RTR W5500_MAKE_MAP(0x0019, W5500_BSB_COM_REG) // Retry Time
#define W5500_REG_RCR W5500_MAKE_MAP(0x001B, W5500_BSB_COM_REG) // Retry Count
#define W5500_REG_PHYCFGR W5500_MAKE_MAP(0x002E, W5500_BSB_COM_REG) // PHY Configuration
#define W5500_REG_VERSIONR W5500_MAKE_MAP(0x0039, W5500_BSB_COM_REG) // Chip version
#define W5500_REG_SOCK_MR(s) W5500_MAKE_MAP(0x0000, W5500_BSB_SOCK_REG(s)) // Socket Mode
#define W5500_REG_SOCK_CR(s) W5500_MAKE_MAP(0x0001, W5500_BSB_SOCK_REG(s)) // Socket Command
#define W5500_REG_SOCK_IR(s) W5500_MAKE_MAP(0x0002, W5500_BSB_SOCK_REG(s)) // Socket Interrupt
#define W5500_REG_SOCK_SR(s) W5500_MAKE_MAP(0x0004, W5500_BSB_SOCK_REG(s)) // Socket Status
#define W5500_REG_SOCK_RXBUF_SIZE(s) W5500_MAKE_MAP(0x001E, W5500_BSB_SOCK_REG(s)) // Socket Receive Buffer Size
#define W5500_REG_SOCK_TXBUF_SIZE(s) W5500_MAKE_MAP(0x001F, W5500_BSB_SOCK_REG(s)) // Socket Transmit Buffer Size
#define W5500_REG_SOCK_TX_FSR(s) W5500_MAKE_MAP(0x0020, W5500_BSB_SOCK_REG(s)) // Socket TX Free Size
#define W5500_REG_SOCK_TX_RD(s) W5500_MAKE_MAP(0x0022, W5500_BSB_SOCK_REG(s)) // Socket TX Read Pointer
#define W5500_REG_SOCK_TX_WR(s) W5500_MAKE_MAP(0x0024, W5500_BSB_SOCK_REG(s)) // Socket TX Write Pointer
#define W5500_REG_SOCK_RX_RSR(s) W5500_MAKE_MAP(0x0026, W5500_BSB_SOCK_REG(s)) // Socket RX Received Size
#define W5500_REG_SOCK_RX_RD(s) W5500_MAKE_MAP(0x0028, W5500_BSB_SOCK_REG(s)) // Socket RX Read Pointer
#define W5500_REG_SOCK_RX_WR(s) W5500_MAKE_MAP(0x002A, W5500_BSB_SOCK_REG(s)) // Socket RX Write Pointer
#define W5500_REG_SOCK_IMR(s) W5500_MAKE_MAP(0x002C, W5500_BSB_SOCK_REG(s)) // Socket Interrupt Mask
#define W5500_MEM_SOCK_TX(s,addr) W5500_MAKE_MAP(addr, W5500_BSB_SOCK_TX_BUF(s)) // Socket TX buffer address
#define W5500_MEM_SOCK_RX(s,addr) W5500_MAKE_MAP(addr, W5500_BSB_SOCK_RX_BUF(s)) // Socket RX buffer address
#define W5500_MR_RST (1<<7) // Software reset
#define W5500_MR_PB (1<<4) // Ping block (block the response to a ping request)
#define W5500_SIMR_SOCK0 (1<<0) // Socket 0 interrupt
#define W5500_SMR_MAC_RAW (1<<2) // MAC RAW mode
#define W5500_SMR_MAC_FILTER (1<<7) // MAC filter
#define W5500_SCR_OPEN (0x01) // Open command
#define W5500_SCR_CLOSE (0x10) // Close command
#define W5500_SCR_SEND (0x20) // Send command
#define W5500_SCR_RECV (0x40) // Recv command
#define W5500_SIR_RECV (1<<2) // Receive done
#define W5500_SIR_SEND (1<<4) // Send done

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 LittlevGL
Copyright (c) 2019 lewis he
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -0,0 +1,2 @@
FT5206 Library
=====================================

View File

@ -0,0 +1,29 @@
#######################################
# Syntax Coloring Map For FT5206 Library By lewis He
# github:https://github.com/lewisxhe
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
TP_Point KEYWORD1
FT5206_Class KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
begin KEYWORD2
adjustTheshold KEYWORD2
getPoint KEYWORD2
enterSleepMode KEYWORD2
enterMonitorMode KEYWORD2
#######################################
# Instances (KEYWORD2)
#######################################
#######################################
# Constants (LITERAL1)
#######################################

View File

@ -0,0 +1,10 @@
name=FT5206_Library
version=1.0.0
author=Lewis He
maintainer=Lewis He <lewishe@outlook.com>
sentence=Arduino library for FT5206 chip.
paragraph=Arduino library for FT5206 chip. Tested with ESP32
category=Communication
url=https://github.com/lewisxhe/FT5206_Library
architectures=*
architectures=esp32

View File

@ -0,0 +1,108 @@
/////////////////////////////////////////////////////////////////
/*
MIT License
Copyright (c) 2019 lewis he
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
FT5206.cpp - Arduino library for FT5206 chip.
Created by Lewis on April 17, 2019.
github:https://github.com/lewisxhe/FT5206_Library
*/
/////////////////////////////////////////////////////////////////
#include "FT5206.h"
int FT5206_Class::begin(TwoWire &port, uint8_t addr)
{
_i2cPort = &port;
_address = addr;
uint8_t val;
_readByte(FT5206_VENDID_REG, 1, &val);
//Serial.printf("vend id %d\n",val );
if (val != FT5206_VENDID) {
// return false;
}
_readByte(FT5206_CHIPID_REG, 1, &val);
//Serial.printf("chip id %d\n",val );
if ((val != FT6206_CHIPID) && (val != FT6236_CHIPID) && (val != FT6236U_CHIPID) && (val != FT5206U_CHIPID) && (val != FT5316_CHIPID) ) {
return false;
}
_init = true;
return true;
}
// valid touching detect threshold.
void FT5206_Class::adjustTheshold(uint8_t thresh)
{
if (!_init)return;
_writeByte(FT5206_THRESHHOLD_REG, 1, &thresh);
}
TP_Point FT5206_Class::getPoint(uint8_t num)
{
if (!_init) return TP_Point(0, 0);
_readRegister();
if ((_touches == 0) || (num > 1)) {
return TP_Point(0, 0);
} else {
return TP_Point(_x[num], _y[num]);
}
}
uint8_t FT5206_Class::touched()
{
if (!_init)return 0;
uint8_t val = 0;
_readByte(FT5206_TOUCHES_REG,1,&val);
return val > 2 ? 0: val;
}
void FT5206_Class::enterSleepMode()
{
if (!_init)return;
uint8_t val = FT5206_SLEEP_IN;
_writeByte(FT5206_POWER_REG, 1, &val);
}
void FT5206_Class::enterMonitorMode()
{
if (!_init)return;
uint8_t val = FT5206_MONITOR;
_writeByte(FT5206_POWER_REG, 1, &val);
}
void FT5206_Class::_readRegister()
{
_readByte(DEVIDE_MODE, 16, _data);
_touches = _data[TD_STATUS];
if ((_touches > 2) || (_touches == 0)) {
_touches = 0;
return;
}
for (uint8_t i = 0; i < 2; i++) {
_x[i] = _data[TOUCH1_XH + i * 6] & 0x0F;
_x[i] <<= 8;
_x[i] |= _data[TOUCH1_XL + i * 6];
_y[i] = _data[TOUCH1_YH + i * 6] & 0x0F;
_y[i] <<= 8;
_y[i] |= _data[TOUCH1_YL + i * 6];
_id[i] = _data[TOUCH1_YH + i * 6] >> 4;
}
}

View File

@ -0,0 +1,123 @@
/////////////////////////////////////////////////////////////////
/*
MIT License
Copyright (c) 2019 lewis he
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
FT5206.h - Arduino library for FT5206 chip.
Created by Lewis on April 17, 2019.
github:https://github.com/lewisxhe/FT5206_Library
*/
/////////////////////////////////////////////////////////////////
#pragma once
#include <Arduino.h>
#include <Wire.h>
#define FT5206_SLAVE_ADDRESS (0x38)
#define FT5206_MODE_REG (0x00)
#define FT5206_TOUCHES_REG (0x02)
#define FT5206_VENDID_REG (0xA8)
#define FT5206_CHIPID_REG (0xA3)
#define FT5206_THRESHHOLD_REG (0x80)
#define FT5206_POWER_REG (0x87)
#define FT5206_MONITOR (0x01)
#define FT5206_SLEEP_IN (0x03)
#define FT5206_VENDID 0x11
#define FT6206_CHIPID 0x06
#define FT6236_CHIPID 0x36
#define FT6236U_CHIPID 0x64
#define FT5206U_CHIPID 0x64
#define FT5316_CHIPID 0x0a
#define DEVIDE_MODE 0x00
#define TD_STATUS 0x02
#define TOUCH1_XH 0x03
#define TOUCH1_XL 0x04
#define TOUCH1_YH 0x05
#define TOUCH1_YL 0x06
class TP_Point
{
public:
TP_Point(void)
{
x = 0;
y = 0;
}
TP_Point(int16_t _x, int16_t _y)
{
x = _x;
y = _y;
}
int16_t x;
int16_t y;
};
class FT5206_Class
{
public:
FT5206_Class() {};
int begin(TwoWire &port = Wire, uint8_t addr = FT5206_SLAVE_ADDRESS);
// valid touching detect threshold.
void adjustTheshold(uint8_t thresh);
TP_Point getPoint(uint8_t num = 0);
uint8_t touched();
void enterSleepMode();
void enterMonitorMode();
private:
void _readRegister();
int _readByte(uint8_t reg, uint8_t nbytes, uint8_t *data)
{
_i2cPort->beginTransmission(_address);
_i2cPort->write(reg);
_i2cPort->endTransmission();
_i2cPort->requestFrom(_address, nbytes);
uint8_t index = 0;
while (_i2cPort->available())
data[index++] = _i2cPort->read();
return 0;
}
int _writeByte(uint8_t reg, uint8_t nbytes, uint8_t *data)
{
_i2cPort->beginTransmission(_address);
_i2cPort->write(reg);
for (uint8_t i = 0; i < nbytes; i++) {
_i2cPort->write(data[i]);
}
_i2cPort->endTransmission();
return 0;
}
uint8_t _address;
uint8_t _data[16];
uint16_t _x[2];
uint16_t _y[2];
uint16_t _id[2];
uint8_t _touches = 0;
bool _init = false;
TwoWire *_i2cPort;
};

View File

@ -1,38 +0,0 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# VS Code Setting
.vscode/
# Build Folder
build/

View File

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

View File

@ -1,5 +0,0 @@
# FT6336U Library
FocalTech FT6336U (Self-Capacitive Touch Panel Controller) library for Arduino.
## License
This code is released under the MIT License. Please see [LICENSE](https://github.com/aselectroworks/Arduino-FT6336U/blob/master/LICENSE) for the full text.

View File

@ -1,40 +0,0 @@
#include "FT6336U.h"
#define I2C_SDA 22
#define I2C_SCL 23
#define RST_N_PIN 21
#define INT_N_PIN 34
FT6336U ft6336u(I2C_SDA, I2C_SCL, RST_N_PIN, INT_N_PIN);
void setup() {
Serial.begin(115200);
ft6336u.begin();
Serial.print("FT6336U Firmware Version: ");
Serial.println(ft6336u.read_firmware_id());
Serial.print("FT6336U Device Mode: ");
Serial.println(ft6336u.read_device_mode());
}
void loop() {
if(digitalRead(INT_N_PIN) != -1) {
Serial.print("FT6336U TD Status: ");
Serial.println(ft6336u.read_td_status());
Serial.print("FT6336U Touch Event/ID 1: (");
Serial.print(ft6336u.read_touch1_event()); Serial.print(" / "); Serial.print(ft6336u.read_touch1_id()); Serial.println(")");
Serial.print("FT6336U Touch Position 1: (");
Serial.print(ft6336u.read_touch1_x()); Serial.print(" , "); Serial.print(ft6336u.read_touch1_y()); Serial.println(")");
Serial.print("FT6336U Touch Weight/MISC 1: (");
Serial.print(ft6336u.read_touch1_weight()); Serial.print(" / "); Serial.print(ft6336u.read_touch1_misc()); Serial.println(")");
Serial.print("FT6336U Touch Event/ID 2: (");
Serial.print(ft6336u.read_touch2_event()); Serial.print(" / "); Serial.print(ft6336u.read_touch2_id()); Serial.println(")");
Serial.print("FT6336U Touch Position 2: (");
Serial.print(ft6336u.read_touch2_x()); Serial.print(" , "); Serial.print(ft6336u.read_touch2_y()); Serial.println(")");
Serial.print("FT6336U Touch Weight/MISC 2: (");
Serial.print(ft6336u.read_touch2_weight()); Serial.print(" / "); Serial.print(ft6336u.read_touch2_misc()); Serial.println(")");
}
}

View File

@ -1,57 +0,0 @@
#include "FT6336U.h"
#include <stdio.h>
#define I2C_SDA 22
#define I2C_SCL 23
#define RST_N_PIN 21
#define INT_N_PIN 34
FT6336U ft6336u(I2C_SDA, I2C_SCL, RST_N_PIN, INT_N_PIN);
void setup() {
Serial.begin(115200);
ft6336u.begin();
// ft6336u.write_device_mode(factory_mode);
Serial.print("FT6336U Device Mode: ");
Serial.println(ft6336u.read_device_mode());
Serial.print("FT6336U Threshold: 0x");
Serial.println(ft6336u.read_touch_threshold(), HEX);
Serial.print("FT6336U Filter Coefficient: 0x");
Serial.println(ft6336u.read_filter_coefficient(), HEX);
Serial.print("FT6336U Control Mode: 0x");
Serial.println(ft6336u.read_ctrl_mode(), HEX);
Serial.print("FT6336U Time Period for enter to Monitor Mode: 0x");
Serial.println(ft6336u.read_time_period_enter_monitor(), HEX);
Serial.print("FT6336U Active Rate: 0x");
Serial.println(ft6336u.read_active_rate(), HEX);
Serial.print("FT6336U Monitor Rate: 0x");
Serial.println(ft6336u.read_monitor_rate(), HEX);
Serial.print("FT6336U LIB Ver: 0x");
Serial.println(ft6336u.read_library_version(), HEX);
Serial.print("FT6336U Chip ID: 0x");
Serial.println(ft6336u.read_chip_id(), HEX);
Serial.print("FT6336U G Mode: 0x");
Serial.println(ft6336u.read_g_mode(), HEX);
Serial.print("FT6336U POWER Mode: 0x");
Serial.println(ft6336u.read_pwrmode(), HEX);
Serial.print("FT6336U Firm ID: 0x");
Serial.println(ft6336u.read_firmware_id(), HEX);
Serial.print("FT6336U Focal Tehc ID: 0x");
Serial.println(ft6336u.read_focaltech_id(), HEX);
Serial.print("FT6336U Release Code ID: 0x");
Serial.println(ft6336u.read_release_code_id(), HEX);
Serial.print("FT6336U State: 0x");
Serial.println(ft6336u.read_state(), HEX);
}
FT6336U_TouchPointType tp;
void loop() {
tp = ft6336u.scan();
char tempString[128];
sprintf(tempString, "FT6336U TD Count %d / TD1 (%d, %4d, %4d) / TD2 (%d, %4d, %4d)\r", tp.touch_count, tp.tp[0].status, tp.tp[0].x, tp.tp[0].y, tp.tp[1].status, tp.tp[1].x, tp.tp[1].y);
Serial.print(tempString);
}

View File

@ -1,10 +0,0 @@
name=FT6336U CTP Controller
version=1.0.2
author=Atsushi Sasaki
maintainer=Atsushi Sasaki
sentence=Arduino FT6336U CTP Controller library
paragraph=Arduino FT6336U CTP Controller library
category=Sensors
url=
architectures=*
includes=FT6336U.h

View File

@ -1,271 +0,0 @@
/**************************************************************************/
/*!
@file FT6336U.cpp
Author: Atsushi Sasaki (https://github.com/aselectroworks)
License: MIT (see LICENSE)
*/
/**************************************************************************/
#include "FT6336U.h"
#include <Wire.h>
FT6336U::FT6336U(uint8_t rst_n, uint8_t int_n)
: rst_n(rst_n), int_n(int_n) {
}
#if defined(ESP32) || defined(ESP8266)
FT6336U::FT6336U(int8_t sda, int8_t scl, uint8_t rst_n, uint8_t int_n)
: sda(sda), scl(scl), rst_n(rst_n), int_n(int_n) {
}
#endif
FT6336U::~FT6336U() {
}
void FT6336U::begin(void) {
// Initialize I2C
#if defined(ESP32) || defined(ESP8266)
if(sda != -1 && scl != -1) {
Wire.begin(sda, scl);
}
else {
Wire.begin();
}
#else
Wire.begin();
#endif
// Int Pin Configuration
pinMode(int_n, INPUT);
// Reset Pin Configuration
pinMode(rst_n, OUTPUT);
digitalWrite(rst_n, LOW);
delay(10);
digitalWrite(rst_n, HIGH);
delay(500);
}
uint8_t FT6336U::read_device_mode(void) {
return (readByte(FT6336U_ADDR_DEVICE_MODE) & 0x70) >> 4;
}
void FT6336U::write_device_mode(DEVICE_MODE_Enum mode) {
writeByte(FT6336U_ADDR_DEVICE_MODE, (mode & 0x07) << 4);
}
uint8_t FT6336U::read_gesture_id(void) {
return readByte(FT6336U_ADDR_GESTURE_ID);
}
uint8_t FT6336U::read_td_status(void) {
return readByte(FT6336U_ADDR_TD_STATUS);
}
uint8_t FT6336U::read_touch_number(void) {
return readByte(FT6336U_ADDR_TD_STATUS) & 0x0F;
}
// Touch 1 functions
uint16_t FT6336U::read_touch1_x(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_TOUCH1_X);
read_buf[1] = readByte(FT6336U_ADDR_TOUCH1_X + 1);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint16_t FT6336U::read_touch1_y(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_TOUCH1_Y);
read_buf[1] = readByte(FT6336U_ADDR_TOUCH1_Y + 1);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint8_t FT6336U::read_touch1_event(void) {
return readByte(FT6336U_ADDR_TOUCH1_EVENT) >> 6;
}
uint8_t FT6336U::read_touch1_id(void) {
return readByte(FT6336U_ADDR_TOUCH1_ID) >> 4;
}
uint8_t FT6336U::read_touch1_weight(void) {
return readByte(FT6336U_ADDR_TOUCH1_WEIGHT);
}
uint8_t FT6336U::read_touch1_misc(void) {
return readByte(FT6336U_ADDR_TOUCH1_MISC) >> 4;
}
// Touch 2 functions
uint16_t FT6336U::read_touch2_x(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_TOUCH2_X);
read_buf[1] = readByte(FT6336U_ADDR_TOUCH2_X + 1);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint16_t FT6336U::read_touch2_y(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_TOUCH2_Y);
read_buf[1] = readByte(FT6336U_ADDR_TOUCH2_Y + 1);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint8_t FT6336U::read_touch2_event(void) {
return readByte(FT6336U_ADDR_TOUCH2_EVENT) >> 6;
}
uint8_t FT6336U::read_touch2_id(void) {
return readByte(FT6336U_ADDR_TOUCH2_ID) >> 4;
}
uint8_t FT6336U::read_touch2_weight(void) {
return readByte(FT6336U_ADDR_TOUCH2_WEIGHT);
}
uint8_t FT6336U::read_touch2_misc(void) {
return readByte(FT6336U_ADDR_TOUCH2_MISC) >> 4;
}
// Mode Parameter Register
uint8_t FT6336U::read_touch_threshold(void) {
return readByte(FT6336U_ADDR_THRESHOLD);
}
uint8_t FT6336U::read_filter_coefficient(void) {
return readByte(FT6336U_ADDR_FILTER_COE);
}
uint8_t FT6336U::read_ctrl_mode(void) {
return readByte(FT6336U_ADDR_CTRL);
}
void FT6336U::write_ctrl_mode(CTRL_MODE_Enum mode) {
writeByte(FT6336U_ADDR_CTRL, mode);
}
uint8_t FT6336U::read_time_period_enter_monitor(void) {
return readByte(FT6336U_ADDR_TIME_ENTER_MONITOR);
}
uint8_t FT6336U::read_active_rate(void) {
return readByte(FT6336U_ADDR_ACTIVE_MODE_RATE);
}
uint8_t FT6336U::read_monitor_rate(void) {
return readByte(FT6336U_ADDR_MONITOR_MODE_RATE);
}
// Gesture Parameters
uint8_t FT6336U::read_radian_value(void) {
return readByte(FT6336U_ADDR_RADIAN_VALUE);
}
void FT6336U::write_radian_value(uint8_t val) {
writeByte(FT6336U_ADDR_RADIAN_VALUE, val);
}
uint8_t FT6336U::read_offset_left_right(void) {
return readByte(FT6336U_ADDR_OFFSET_LEFT_RIGHT);
}
void FT6336U::write_offset_left_right(uint8_t val) {
writeByte(FT6336U_ADDR_OFFSET_LEFT_RIGHT, val);
}
uint8_t FT6336U::read_offset_up_down(void) {
return readByte(FT6336U_ADDR_OFFSET_UP_DOWN);
}
void FT6336U::write_offset_up_down(uint8_t val) {
writeByte(FT6336U_ADDR_OFFSET_UP_DOWN, val);
}
uint8_t FT6336U::read_distance_left_right(void) {
return readByte(FT6336U_ADDR_DISTANCE_LEFT_RIGHT);
}
void FT6336U::write_distance_left_right(uint8_t val) {
writeByte(FT6336U_ADDR_DISTANCE_LEFT_RIGHT, val);
}
uint8_t FT6336U::read_distance_up_down(void) {
return readByte(FT6336U_ADDR_DISTANCE_UP_DOWN);
}
void FT6336U::write_distance_up_down(uint8_t val) {
writeByte(FT6336U_ADDR_DISTANCE_UP_DOWN, val);
}
uint8_t FT6336U::read_distance_zoom(void) {
return readByte(FT6336U_ADDR_DISTANCE_ZOOM);
}
void FT6336U::write_distance_zoom(uint8_t val) {
writeByte(FT6336U_ADDR_DISTANCE_ZOOM, val);
}
// System Information
uint16_t FT6336U::read_library_version(void) {
uint8_t read_buf[2];
read_buf[0] = readByte(FT6336U_ADDR_LIBRARY_VERSION_H);
read_buf[1] = readByte(FT6336U_ADDR_LIBRARY_VERSION_L);
return ((read_buf[0] & 0x0f) << 8) | read_buf[1];
}
uint8_t FT6336U::read_chip_id(void) {
return readByte(FT6336U_ADDR_CHIP_ID);
}
uint8_t FT6336U::read_g_mode(void) {
return readByte(FT6336U_ADDR_G_MODE);
}
void FT6336U::write_g_mode(G_MODE_Enum mode){
writeByte(FT6336U_ADDR_G_MODE, mode);
}
uint8_t FT6336U::read_pwrmode(void) {
return readByte(FT6336U_ADDR_POWER_MODE);
}
uint8_t FT6336U::read_firmware_id(void) {
return readByte(FT6336U_ADDR_FIRMARE_ID);
}
uint8_t FT6336U::read_focaltech_id(void) {
return readByte(FT6336U_ADDR_FOCALTECH_ID);
}
uint8_t FT6336U::read_release_code_id(void) {
return readByte(FT6336U_ADDR_RELEASE_CODE_ID);
}
uint8_t FT6336U::read_state(void) {
return readByte(FT6336U_ADDR_STATE);
}
//coordinate diagramFPC downwards
////y ////////////////////264x176
//
//
//x
//
//
FT6336U_TouchPointType FT6336U::scan(void){
touchPoint.touch_count = read_td_status();
if(touchPoint.touch_count == 0) {
touchPoint.tp[0].status = release;
touchPoint.tp[1].status = release;
}
else if(touchPoint.touch_count == 1) {
uint8_t id1 = read_touch1_id(); // id1 = 0 or 1
touchPoint.tp[id1].status = (touchPoint.tp[id1].status == release) ? touch : stream;
touchPoint.tp[id1].x = read_touch1_x();
touchPoint.tp[id1].y = read_touch1_y();
touchPoint.tp[~id1 & 0x01].status = release;
}
else {
uint8_t id1 = read_touch1_id(); // id1 = 0 or 1
touchPoint.tp[id1].status = (touchPoint.tp[id1].status == release) ? touch : stream;
touchPoint.tp[id1].x = read_touch1_x();
touchPoint.tp[id1].y = read_touch1_y();
uint8_t id2 = read_touch2_id(); // id2 = 0 or 1(~id1 & 0x01)
touchPoint.tp[id2].status = (touchPoint.tp[id2].status == release) ? touch : stream;
touchPoint.tp[id2].x = read_touch2_x();
touchPoint.tp[id2].y = read_touch2_y();
}
return touchPoint;
}
// Private Function
uint8_t FT6336U::readByte(uint8_t addr) {
uint8_t rdData = 0;
uint8_t rdDataCount;
do {
Wire.beginTransmission(I2C_ADDR_FT6336U);
Wire.write(addr);
Wire.endTransmission(false); // Restart
delay(10);
rdDataCount = Wire.requestFrom(I2C_ADDR_FT6336U, 1);
} while(rdDataCount == 0);
while(Wire.available()) {
rdData = Wire.read();
}
return rdData;
}
void FT6336U::writeByte(uint8_t addr, uint8_t data) {
DEBUG_PRINTLN("")
DEBUG_PRINT("writeI2C reg 0x")
DEBUG_PRINT(addr, HEX)
DEBUG_PRINT(" -> 0x") DEBUG_PRINTLN(data, HEX)
Wire.beginTransmission(I2C_ADDR_FT6336U);
Wire.write(addr);
Wire.write(data);
Wire.endTransmission();
}

View File

@ -1,201 +0,0 @@
/**************************************************************************/
/*!
@file FT6336U.h
Author: Atsushi Sasaki(https://github.com/aselectroworks)
License: MIT (see LICENSE)
*/
/**************************************************************************/
#ifndef _FT6336U_H
#define _FT6336U_H
#include <stdint.h>
#include <stdbool.h>
#include <Arduino.h>
#define I2C_ADDR_FT6336U 0x48
// Touch Parameter
#define FT6336U_PRES_DOWN 0x2
#define FT6336U_COORD_UD 0x1
// Registers
#define FT6336U_ADDR_DEVICE_MODE 0x00
typedef enum {
working_mode = 0b000,
factory_mode = 0b100,
} DEVICE_MODE_Enum;
#define FT6336U_ADDR_GESTURE_ID 0x01
#define FT6336U_ADDR_TD_STATUS 0x02
#define FT6336U_ADDR_TOUCH1_EVENT 0x03
#define FT6336U_ADDR_TOUCH1_ID 0x05
#define FT6336U_ADDR_TOUCH1_X 0x03
#define FT6336U_ADDR_TOUCH1_Y 0x05
#define FT6336U_ADDR_TOUCH1_WEIGHT 0x07
#define FT6336U_ADDR_TOUCH1_MISC 0x08
#define FT6336U_ADDR_TOUCH2_EVENT 0x09
#define FT6336U_ADDR_TOUCH2_ID 0x0B
#define FT6336U_ADDR_TOUCH2_X 0x09
#define FT6336U_ADDR_TOUCH2_Y 0x0B
#define FT6336U_ADDR_TOUCH2_WEIGHT 0x0D
#define FT6336U_ADDR_TOUCH2_MISC 0x0E
#define FT6336U_ADDR_THRESHOLD 0x80
#define FT6336U_ADDR_FILTER_COE 0x85
#define FT6336U_ADDR_CTRL 0x86
typedef enum {
keep_active_mode = 0,
switch_to_monitor_mode = 1,
} CTRL_MODE_Enum;
#define FT6336U_ADDR_TIME_ENTER_MONITOR 0x87
#define FT6336U_ADDR_ACTIVE_MODE_RATE 0x88
#define FT6336U_ADDR_MONITOR_MODE_RATE 0x89
#define FT6336U_ADDR_RADIAN_VALUE 0x91
#define FT6336U_ADDR_OFFSET_LEFT_RIGHT 0x92
#define FT6336U_ADDR_OFFSET_UP_DOWN 0x93
#define FT6336U_ADDR_DISTANCE_LEFT_RIGHT 0x94
#define FT6336U_ADDR_DISTANCE_UP_DOWN 0x95
#define FT6336U_ADDR_DISTANCE_ZOOM 0x96
#define FT6336U_ADDR_LIBRARY_VERSION_H 0xA1
#define FT6336U_ADDR_LIBRARY_VERSION_L 0xA2
#define FT6336U_ADDR_CHIP_ID 0xA3
#define FT6336U_ADDR_G_MODE 0xA4
typedef enum {
pollingMode = 0,
triggerMode = 1,
} G_MODE_Enum;
#define FT6336U_ADDR_POWER_MODE 0xA5
#define FT6336U_ADDR_FIRMARE_ID 0xA6
#define FT6336U_ADDR_FOCALTECH_ID 0xA8
#define FT6336U_ADDR_RELEASE_CODE_ID 0xAF
#define FT6336U_ADDR_STATE 0xBC
// Function Specific Type
typedef enum {
touch = 0,
stream,
release,
} TouchStatusEnum;
typedef struct {
TouchStatusEnum status;
uint16_t x;
uint16_t y;
} TouchPointType;
typedef struct {
uint8_t touch_count;
TouchPointType tp[2];
} FT6336U_TouchPointType;
// Uncomment to enable debug messages
//#define FT6336U_DEBUG
// Define where debug output will be printed
#define DEBUG_PRINTER Serial
// Setup debug printing macros
#ifdef FT6336U_DEBUG
#define DEBUG_PRINT(...) \
{ \
DEBUG_PRINTER.print(__VA_ARGS__); \
}
#define DEBUG_PRINTLN(...) \
{ \
DEBUG_PRINTER.println(__VA_ARGS__); \
}
#else
#define DEBUG_PRINT(...) \
{ \
}
#define DEBUG_PRINTLN(...) \
{ \
}
#endif
/**************************************************************************/
/*!
@brief FT6336U I2C CTP controller driver
*/
/**************************************************************************/
class FT6336U
{
public:
FT6336U(uint8_t rst_n, uint8_t int_n);
#if defined(ESP32) || defined(ESP8266)
FT6336U(int8_t sda, int8_t scl, uint8_t rst_n, uint8_t int_n);
#endif
virtual ~FT6336U();
void begin(void);
uint8_t read_device_mode(void);
void write_device_mode(DEVICE_MODE_Enum);
uint8_t read_gesture_id(void);
uint8_t read_td_status(void);
uint8_t read_touch_number(void);
uint16_t read_touch1_x(void);
uint16_t read_touch1_y(void);
uint8_t read_touch1_event(void);
uint8_t read_touch1_id(void);
uint8_t read_touch1_weight(void);
uint8_t read_touch1_misc(void);
uint16_t read_touch2_x(void);
uint16_t read_touch2_y(void);
uint8_t read_touch2_event(void);
uint8_t read_touch2_id(void);
uint8_t read_touch2_weight(void);
uint8_t read_touch2_misc(void);
// Mode Parameter Register
uint8_t read_touch_threshold(void);
uint8_t read_filter_coefficient(void);
uint8_t read_ctrl_mode(void);
void write_ctrl_mode(CTRL_MODE_Enum mode);
uint8_t read_time_period_enter_monitor(void);
uint8_t read_active_rate(void);
uint8_t read_monitor_rate(void);
// Gestrue Parameter Register
uint8_t read_radian_value(void);
void write_radian_value(uint8_t val);
uint8_t read_offset_left_right(void);
void write_offset_left_right(uint8_t val);
uint8_t read_offset_up_down(void);
void write_offset_up_down(uint8_t val);
uint8_t read_distance_left_right(void);
void write_distance_left_right(uint8_t val);
uint8_t read_distance_up_down(void);
void write_distance_up_down(uint8_t val);
uint8_t read_distance_zoom(void);
void write_distance_zoom(uint8_t val);
// System Information
uint16_t read_library_version(void);
uint8_t read_chip_id(void);
uint8_t read_g_mode(void);
void write_g_mode(G_MODE_Enum mode);
uint8_t read_pwrmode(void);
uint8_t read_firmware_id(void);
uint8_t read_focaltech_id(void);
uint8_t read_release_code_id(void);
uint8_t read_state(void);
// Scan Function
FT6336U_TouchPointType scan(void);
private:
int8_t sda = -1;
int8_t scl = -1;
uint8_t rst_n = -1;
uint8_t int_n = -1;
uint8_t readByte(uint8_t addr);
void writeByte(uint8_t addr, uint8_t data);
FT6336U_TouchPointType touchPoint;
};
#endif

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SimpleFTPServer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

File diff suppressed because it is too large Load Diff

View File

@ -1,747 +0,0 @@
/*
* FtpServer Arduino, esp8266 and esp32 library for Ftp Server
* Derived form Jean-Michel Gallego version
*
* AUTHOR: Renzo Mischianti
*
* https://www.mischianti.org/2020/02/08/ftp-server-on-esp8266-and-esp32
*
*/
/*******************************************************************************
** **
** DEFINITIONS FOR FTP SERVER **
** **
*******************************************************************************/
#include <FtpServerKey.h>
#ifndef FTP_SERVER_H
#define FTP_SERVER_H
#define FTP_SERVER_VERSION "2.1.5 (2023-01-13)"
#include "ArduinoLog.h"
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
//
//#if(NETWORK_ESP8266_SD == DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP8266)
// #define ESP8266_GT_2_4_2_SD_STORAGE_SELECTED
// #define DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP8266 NETWORK_ESP8266
//#endif
#if !defined(FTP_SERVER_NETWORK_TYPE)
// select Network type based
#if defined(ESP8266) || defined(ESP31B)
#if(NETWORK_ESP8266_242 == DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP8266)
#define ARDUINO_ESP8266_RELEASE_2_4_2
#define FTP_SERVER_NETWORK_TYPE_SELECTED NETWORK_ESP8266_242
#define FTP_SERVER_NETWORK_TYPE NETWORK_ESP8266
#else
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP8266
#endif
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_ESP8266
#elif defined(ESP32)
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP32
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_ESP32
#elif defined(ARDUINO_ARCH_STM32)
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_STM32
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_STM32
#elif defined(ARDUINO_ARCH_RP2040)
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_RP2040
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_RP2040
#elif defined(ARDUINO_ARCH_SAMD)
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_SAMD
#else
#define FTP_SERVER_NETWORK_TYPE DEFAULT_FTP_SERVER_NETWORK_TYPE_ARDUINO
#define STORAGE_TYPE DEFAULT_STORAGE_TYPE_ARDUINO
// #define STORAGE_SD_ENABLED
#endif
#endif
#ifndef FTP_SERVER_NETWORK_TYPE_SELECTED
#define FTP_SERVER_NETWORK_TYPE_SELECTED FTP_SERVER_NETWORK_TYPE
#endif
#if defined(ESP8266) || defined(ESP31B)
#ifndef STORAGE_SD_FORCE_DISABLE
#define STORAGE_SD_ENABLED
#endif
#ifndef STORAGE_SPIFFS_FORCE_DISABLE
#define STORAGE_SPIFFS_ENABLED
#endif
#elif defined(ESP32)
#ifndef STORAGE_SD_FORCE_DISABLE
#define STORAGE_SD_ENABLED
#endif
#ifndef STORAGE_SPIFFS_FORCE_DISABLE
#define STORAGE_SPIFFS_ENABLED
#endif
#else
#ifndef STORAGE_SD_FORCE_DISABLE
#define STORAGE_SD_ENABLED
#endif
#endif
// Includes and defined based on Network Type
#if(FTP_SERVER_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
// Note:
// No SSL/WSS support for client in Async mode
// TLS lib need a sync interface!
#if defined(ESP8266)
#include <ESP8266WiFi.h>
//#include <WiFiClientSecure.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#elif defined(ESP32)
#include <WiFi.h>
//#include <WiFiClientSecure.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#elif defined(ESP31B)
#include <ESP31BWiFi.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#else
#error "network type ESP8266 ASYNC only possible on the ESP mcu!"
#endif
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_ESP8266 || FTP_SERVER_NETWORK_TYPE == NETWORK_ESP8266_242)
#if !defined(ESP8266) && !defined(ESP31B)
#error "network type ESP8266 only possible on the ESP mcu!"
#endif
#ifdef ESP8266
#include <ESP8266WiFi.h>
#else
#include <ESP31BWiFi.h>
#endif
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS WiFi
// #define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
// #define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_W5100 || FTP_SERVER_NETWORK_TYPE == NETWORK_ETHERNET_ENC)
#include <Ethernet.h>
#include <SPI.h>
#define FTP_CLIENT_NETWORK_CLASS EthernetClient
#define FTP_SERVER_NETWORK_SERVER_CLASS EthernetServer
#define NET_CLASS Ethernet
// #if defined(ESP8266) || defined(ESP32)
// #define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
// #define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
// #else
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
// #endif
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_ENC28J60 || FTP_SERVER_NETWORK_TYPE == NETWORK_UIPETHERNET)
#include <UIPEthernet.h>
#define FTP_CLIENT_NETWORK_CLASS UIPClient
#define FTP_SERVER_NETWORK_SERVER_CLASS UIPServer
#define NET_CLASS Ethernet
// #if define(ESP8266) || define(ESP32)
// #define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
// #define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
// #else
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
// #endif
#elif(EMAIL_NETWORK_TYPE == NETWORK_ETHERNET_LARGE)
#include <EthernetLarge.h>
#include <SPI.h>
#define FTP_CLIENT_NETWORK_CLASS EthernetClient
#define FTP_SERVER_NETWORK_SERVER_CLASS EthernetServer
#define NET_CLASS Ethernet
#elif(EMAIL_NETWORK_TYPE == NETWORK_ETHERNET_STM)
#include <Ethernet_STM.h>
#include <SPI.h>
#define FTP_CLIENT_NETWORK_CLASS EthernetClient
#define FTP_SERVER_NETWORK_SERVER_CLASS EthernetServer
#define NET_CLASS Ethernet
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_ESP32)
#include <WiFi.h>
//#include <WiFiClientSecure.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiClientSecure
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS WiFi
// #define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
// #define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_ESP32_ETH)
#include <ETH.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS Ethernet
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_WiFiNINA)
#include <WiFiNINA.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiSSLClient
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS WiFi
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#elif(FTP_SERVER_NETWORK_TYPE == NETWORK_SEEED_RTL8720DN)
#include <rpcWiFi.h>
#define FTP_CLIENT_NETWORK_CLASS WiFiClient
//#define FTP_CLIENT_NETWORK_SSL_CLASS WiFiSSLClient
#define FTP_SERVER_NETWORK_SERVER_CLASS WiFiServer
#define NET_CLASS WiFi
// #define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
// #define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#else
#error "no network type selected!"
#endif
#if defined(ESP8266) || defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
#define CommandIs( a ) (command != NULL && ! strcmp_P( command, PSTR( a )))
#define ParameterIs( a ) ( parameter != NULL && ! strcmp_P( parameter, PSTR( a )))
#else
#define CommandIs( a ) ( ! strcmp_PF( command, PSTR( a )))
#define ParameterIs( a ) ( ! strcmp_PF( parameter, PSTR( a )))
#endif
#if(STORAGE_TYPE == STORAGE_SPIFFS)
#if defined(ESP32)
// #define FS_NO_GLOBALS
#include <SPIFFS.h>
#define FTP_FILE File
#define FTP_DIR File
#else
#ifdef ARDUINO_ESP8266_RELEASE_2_4_2
#define FS_NO_GLOBALS
#include "FS.h"
#define FTP_FILE fs::File
#define FTP_DIR fs::Dir
#else
#include "FS.h"
#define FTP_FILE File
#define FTP_DIR Dir
#endif
#endif
#if ESP8266
#define FTP_FILE_READ "r"
#define FTP_FILE_READ_ONLY "r"
#define FTP_FILE_READ_WRITE "w+"
#define FTP_FILE_WRITE_APPEND "a+"
#define FTP_FILE_WRITE_CREATE "w+"
#else
#define FTP_FILE_READ "r"
#define FTP_FILE_READ_ONLY "r"
#define FTP_FILE_READ_WRITE "w"
#define FTP_FILE_WRITE_APPEND "a"
#define FTP_FILE_WRITE_CREATE "w"
#endif
#define STORAGE_MANAGER SPIFFS
#define FILENAME_LENGTH 32
#elif(STORAGE_TYPE == STORAGE_FFAT)
#include "FS.h"
#include "FFat.h"
#define STORAGE_MANAGER FFat
#define FTP_FILE File
#define FTP_DIR File
#define FTP_FILE_READ "r"
#define FTP_FILE_READ_ONLY "r"
#define FTP_FILE_READ_WRITE "w"
#define FTP_FILE_WRITE_APPEND "a"
#define FTP_FILE_WRITE_CREATE "w"
#define FILENAME_LENGTH 255
#elif(STORAGE_TYPE == STORAGE_LITTLEFS)
#if ESP8266 || ARDUINO_ARCH_RP2040
#include "LittleFS.h"
#define STORAGE_MANAGER LittleFS
#define FTP_FILE File
#define FTP_DIR Dir
#define FTP_FILE_READ "r"
#define FTP_FILE_READ_ONLY "r"
#define FTP_FILE_READ_WRITE "w+"
#define FTP_FILE_WRITE_APPEND "a+"
#define FTP_FILE_WRITE_CREATE "w+"
#else
#ifdef ESP32
#if ESP_ARDUINO_VERSION_MAJOR >= 2
#include "FS.h"
#include "LittleFS.h"
#define STORAGE_MANAGER LittleFS
#else
#include "LITTLEFS.h"
#define STORAGE_MANAGER LITTLEFS
#endif
#else
#include "LittleFS.h"
#define STORAGE_MANAGER LittleFS
#endif
#define FTP_FILE File
#define FTP_DIR File
#define FTP_FILE_READ "r"
#define FTP_FILE_READ_ONLY "r"
#define FTP_FILE_READ_WRITE "w"
#define FTP_FILE_WRITE_APPEND "a"
#define FTP_FILE_WRITE_CREATE "w"
#endif
#define FILENAME_LENGTH 128
#elif(STORAGE_TYPE == STORAGE_SD)
#include <SPI.h>
#include <SD.h>
#define STORAGE_MANAGER SD
#define FTP_FILE File
#define FTP_DIR File
#define FTP_FILE_READ FILE_READ
#define FTP_FILE_READ_ONLY FILE_READ
#ifdef ESP32
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_APPEND
#else
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_WRITE
#endif
#define FTP_FILE_WRITE_CREATE FILE_WRITE
#define FILENAME_LENGTH 255
#elif(STORAGE_TYPE == STORAGE_SD_MMC)
#include <SPI.h>
#include <SD_MMC.h>
#define STORAGE_MANAGER SD_MMC
#define FTP_FILE File
#define FTP_DIR File
#define FTP_FILE_READ FILE_READ
#define FTP_FILE_READ_ONLY FILE_READ
#define FTP_FILE_READ_WRITE FILE_WRITE
#ifdef ESP32
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_APPEND
#else
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_WRITE
#endif
#define FTP_FILE_WRITE_CREATE FILE_WRITE
#define FILENAME_LENGTH 255
#elif(STORAGE_TYPE == STORAGE_SEEED_SD)
#include <Seeed_FS.h>
#define STORAGE_MANAGER SD
#include "SD/Seeed_SD.h"
// #define STORAGE_MANAGER SPIFLASH
// #include "SFUD/Seeed_SFUD.h"
#define FTP_FILE File
#define FTP_DIR File
#define FTP_FILE_READ FILE_READ
#define FTP_FILE_READ_ONLY FILE_READ
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_APPEND
#define FTP_FILE_WRITE_CREATE FILE_WRITE
#define FILENAME_LENGTH 255
#elif (STORAGE_TYPE == STORAGE_SDFAT1)
#include <SdFat.h>
#include <sdios.h>
#define STORAGE_MANAGER sd
#define FTP_FILE SdFile
#define FTP_DIR SdFile
extern SdFat STORAGE_MANAGER;
#define FTP_FILE_READ O_READ
#define FTP_FILE_READ_ONLY O_RDONLY
#define FTP_FILE_READ_WRITE O_RDWR
#define FTP_FILE_WRITE_APPEND O_WRITE | O_APPEND
#define FTP_FILE_WRITE_CREATE O_WRITE | O_CREAT
#define FILENAME_LENGTH 255
#elif (STORAGE_TYPE == STORAGE_SDFAT2)
#include <SdFat.h>
#include <sdios.h>
#define STORAGE_MANAGER sd
#define FTP_FILE FsFile
#define FTP_DIR FsFile
extern SdFat STORAGE_MANAGER;
#define FTP_FILE_READ O_READ
#define FTP_FILE_READ_ONLY O_RDONLY
#define FTP_FILE_READ_WRITE O_RDWR
#define FTP_FILE_WRITE_APPEND O_WRITE | O_APPEND
#define FTP_FILE_WRITE_CREATE O_WRITE | O_CREAT
#define FILENAME_LENGTH 255
#elif (STORAGE_TYPE == STORAGE_SPIFM)
#include <SdFat.h>
#include <Adafruit_SPIFlash.h>
#include <sdios.h>
#define STORAGE_MANAGER fatfs
#define FTP_FILE File
#define FTP_DIR File
extern FatFileSystem STORAGE_MANAGER;
extern Adafruit_SPIFlash flash;
#define FTP_FILE_READ FILE_READ
#define FTP_FILE_READ_ONLY FILE_READ
#define FTP_FILE_READ_WRITE FILE_WRITE
#define FTP_FILE_WRITE_APPEND FILE_WRITE
#define FTP_FILE_WRITE_CREATE FILE_WRITE
#define FILENAME_LENGTH 255
#elif (STORAGE_TYPE == STORAGE_FATFS)
#include <FatFs.h>
#include <sdios.h>
#define STORAGE_MANAGER sdff
#define FTP_FILE FileFs
#define FTP_DIR DirFs
extern FatFsClass STORAGE_MANAGER;
#define O_READ FA_READ
#define O_WRITE FA_WRITE
#define O_RDWR FA_READ | FA_WRITE
#define O_CREAT FA_CREATE_ALWAYS
#define O_APPEND FA_OPEN_APPEND
#define FTP_FILE_READ O_READ
#define FTP_FILE_READ_ONLY O_RDONLY
#define FTP_FILE_READ_WRITE O_RDWR
#define FTP_FILE_WRITE_APPEND O_WRITE | O_APPEND
#define FTP_FILE_WRITE_CREATE O_WRITE | O_CREAT
#define FILENAME_LENGTH 255
#endif
//#ifdef FTP_CLIENT_NETWORK_SSL_CLASS
//#define FTP_CLIENT_NETWORK_CLASS FTP_CLIENT_NETWORK_SSL_CLASS
//#endif
#define OPEN_CLOSE_SPIFFS
#define OPEN_CLOSE_SD
// Setup debug printing macros.
#ifdef FTP_SERVER_DEBUG
// #define DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); }
// #define DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); }
#define DEBUG_PRINT(...) { Log.verbose(68 /* FTP_TAG */, __VA_ARGS__); }
#define DEBUG_PRINTLN(...) { Log.verbose(68 /* FTP_TAG */, __VA_ARGS__); }
#else
#define DEBUG_PRINT(...) {}
#define DEBUG_PRINTLN(...) {}
#endif
#define FTP_CMD_PORT 21 // Command port on wich server is listening
#define FTP_DATA_PORT_DFLT 20 // Default data port in active mode
#define FTP_DATA_PORT_PASV 50009 // Data port in passive mode
#define FF_MAX_LFN 255 // max size of a long file name
#define FTP_CMD_SIZE FF_MAX_LFN+8 // max size of a command
#define FTP_CWD_SIZE FF_MAX_LFN+8 // max size of a directory name
#define FTP_FIL_SIZE FF_MAX_LFN // max size of a file name
#define FTP_CRED_SIZE 255 // max size of username and password
#define FTP_NULLIP() IPAddress(0,0,0,0)
enum ftpCmd { FTP_Stop = 0, // In this stage, stop any connection
FTP_Init, // initialize some variables
FTP_Client, // wait for client connection
FTP_User, // wait for user name
FTP_Pass, // wait for user password
FTP_Cmd }; // answers to commands
enum ftpTransfer { FTP_Close = 0, // In this stage, close data channel
FTP_Retrieve, // retrieve file
FTP_Store, // store file
FTP_List, // list of files
FTP_Nlst, // list of name of files
FTP_Mlsd }; // listing for machine processing
enum ftpDataConn { FTP_NoConn = 0,// No data connexion
FTP_Pasive, // Pasive type
FTP_Active }; // Active type
enum FtpOperation {
FTP_CONNECT,
FTP_DISCONNECT,
FTP_FREE_SPACE_CHANGE
};
enum FtpTransferOperation {
FTP_UPLOAD_START = 0,
FTP_UPLOAD = 1,
FTP_DOWNLOAD_START = 2,
FTP_DOWNLOAD = 3,
FTP_TRANSFER_STOP = 4,
FTP_DOWNLOAD_STOP = 4,
FTP_UPLOAD_STOP = 4,
FTP_TRANSFER_ERROR = 5,
FTP_DOWNLOAD_ERROR = 5,
FTP_UPLOAD_ERROR = 5
};
class FtpServer
{
public:
FtpServer( uint16_t _cmdPort = FTP_CMD_PORT, uint16_t _pasvPort = FTP_DATA_PORT_PASV );
void begin( const char * _user, const char * _pass, const char * welcomeMessage = "Welcome to Simply FTP server" );
void begin( const char * welcomeMessage = "Welcome to Simply FTP server" );
void end();
void setLocalIp(IPAddress localIp);
void credentials( const char * _user, const char * _pass );
uint8_t handleFTP();
void setCallback(void (*_callbackParam)(FtpOperation ftpOperation, unsigned int freeSpace, unsigned int totalSpace) )
{
_callback = _callbackParam;
}
void setTransferCallback(void (*_transferCallbackParam)(FtpTransferOperation ftpOperation, const char* name, unsigned int transferredSize) )
{
_transferCallback = _transferCallbackParam;
}
private:
void (*_callback)(FtpOperation ftpOperation, unsigned int freeSpace, unsigned int totalSpace){};
void (*_transferCallback)(FtpTransferOperation ftpOperation, const char* name, unsigned int transferredSize){};
void iniVariables();
void clientConnected();
void disconnectClient();
bool processCommand();
bool haveParameter();
int dataConnect( bool out150 = true );
bool dataConnected();
bool doRetrieve();
bool doStore();
bool doList();
bool doMlsd();
void closeTransfer();
void abortTransfer();
bool makePath( char * fullName, char * param = NULL );
bool makeExistsPath( char * path, char * param = NULL );
bool openDir( FTP_DIR * pdir );
bool isDir( char * path );
uint8_t getDateTime( char * dt, uint16_t * pyear, uint8_t * pmonth, uint8_t * pday,
uint8_t * phour, uint8_t * pminute, uint8_t * second );
char * makeDateTimeStr( char * tstr, uint16_t date, uint16_t time );
bool timeStamp( char * path, uint16_t year, uint8_t month, uint8_t day,
uint8_t hour, uint8_t minute, uint8_t second );
bool getFileModTime( char * path, uint16_t * pdate, uint16_t * ptime );
#if STORAGE_TYPE != STORAGE_FATFS
bool getFileModTime( uint16_t * pdate, uint16_t * ptime );
#endif
int8_t readChar();
const char* getFileName(FTP_FILE *file){
#if STORAGE_TYPE <= STORAGE_SDFAT2
int max_characters = 100;
char f_name[max_characters];
file->getName(f_name, max_characters);
String filename = String(f_name);
return filename.c_str();
#elif STORAGE_TYPE == STORAGE_FATFS
return file->fileName();
#else
return file->name();
#endif
}
bool exists( const char * path ) {
#if STORAGE_TYPE == STORAGE_SPIFFS || (STORAGE_TYPE == STORAGE_SD && FTP_SERVER_NETWORK_TYPE == NETWORK_ESP8266_242)
if (strcmp(path, "/") == 0) return true;
#endif
#if STORAGE_TYPE == STORAGE_FFAT || (STORAGE_TYPE == STORAGE_LITTLEFS && defined(ESP32))
FTP_DIR f = STORAGE_MANAGER.open(path, "r");
return (f == true);
#else
return STORAGE_MANAGER.exists( path );
#endif
};
bool remove( const char * path ) { return STORAGE_MANAGER.remove( path ); };
#if STORAGE_TYPE == STORAGE_SPIFFS
bool makeDir( const char * path ) { return false; };
bool removeDir( const char * path ) { return false; };
#else
bool makeDir( const char * path ) { return STORAGE_MANAGER.mkdir( path ); };
bool removeDir( const char * path ) { return STORAGE_MANAGER.rmdir( path ); };
#endif
#if STORAGE_TYPE == STORAGE_SD || STORAGE_TYPE == STORAGE_SD_MMC
bool rename( const char * path, const char * newpath );
#else
bool rename( const char * path, const char * newpath ) { return STORAGE_MANAGER.rename( path, newpath ); };
#endif
#if (STORAGE_TYPE == STORAGE_SEEED_SD)
bool openFile( char path[ FTP_CWD_SIZE ], int readTypeInt );
#elif (STORAGE_TYPE == STORAGE_SD && defined(ESP8266))// FTP_SERVER_NETWORK_TYPE_SELECTED == NETWORK_ESP8266_242)
bool openFile( char path[ FTP_CWD_SIZE ], int readTypeInt );
#elif (STORAGE_TYPE == STORAGE_SPIFFS || STORAGE_TYPE == STORAGE_LITTLEFS || STORAGE_TYPE == STORAGE_FFAT )
bool openFile( const char * path, const char * readType );
// bool openFile( char path[ FTP_CWD_SIZE ], int readTypeInt );
#elif STORAGE_TYPE <= STORAGE_SDFAT2 || STORAGE_TYPE == STORAGE_SPIFM || (STORAGE_TYPE == STORAGE_SD && ARDUINO_ARCH_SAMD)
bool openFile( char path[ FTP_CWD_SIZE ], int readTypeInt );
#else
bool openFile( char path[ FTP_CWD_SIZE ], const char * readType );
bool openFile( const char * path, const char * readType );
// bool openFile( char path[ FTP_CWD_SIZE ], int readTypeInt );
#endif
// bool openFile( char path[ FTP_CWD_SIZE ], const char * readType );
// bool openFile( const char * path, const char * readType );
uint32_t fileSize( FTP_FILE file );
#if STORAGE_TYPE == STORAGE_SPIFFS || STORAGE_TYPE == STORAGE_LITTLEFS
#if ESP8266 || ARDUINO_ARCH_RP2040
uint32_t capacity() {
FSInfo fi;
STORAGE_MANAGER.info(fi);
return fi.totalBytes >> 1;
};
uint32_t free() {
FSInfo fi;
STORAGE_MANAGER.info(fi);
return (fi.totalBytes - fi.usedBytes) >> 1;
};
#else
uint32_t capacity() {
return STORAGE_MANAGER.totalBytes() >> 1;
};
uint32_t free() {
return (STORAGE_MANAGER.totalBytes() -
STORAGE_MANAGER.usedBytes()) >> 1;
};
#endif
#elif STORAGE_TYPE == STORAGE_SD || STORAGE_TYPE == STORAGE_SD_MMC
uint32_t capacity() { return true; };
uint32_t free() { return true; };
#elif STORAGE_TYPE == STORAGE_SEEED_SD
uint32_t capacity() {
return STORAGE_MANAGER.totalBytes() >> 1;
};
uint32_t free() {
return (STORAGE_MANAGER.totalBytes() -
STORAGE_MANAGER.usedBytes()) >> 1;
};
#elif STORAGE_TYPE == STORAGE_SDFAT1
uint32_t capacity() { return STORAGE_MANAGER.card()->cardSize() >> 1; };
uint32_t free() { return STORAGE_MANAGER.vol()->freeClusterCount() *
STORAGE_MANAGER.vol()->sectorsPerCluster() >> 1; };
#elif STORAGE_TYPE == STORAGE_SDFAT2
uint32_t capacity() { return STORAGE_MANAGER.card()->sectorCount() >> 1; };
uint32_t free() { return STORAGE_MANAGER.vol()->freeClusterCount() *
STORAGE_MANAGER.vol()->sectorsPerCluster() >> 1; };
#elif STORAGE_TYPE == STORAGE_SPIFM
uint32_t capacity() { return flash.size() >> 10; };
uint32_t free() { return 0; }; // TODO //
#elif STORAGE_TYPE == STORAGE_FATFS
uint32_t capacity() { return STORAGE_MANAGER.capacity(); };
uint32_t free() { return STORAGE_MANAGER.free(); };
#elif STORAGE_TYPE == STORAGE_FFAT
uint32_t capacity() { return STORAGE_MANAGER.totalBytes(); };
uint32_t free() { return STORAGE_MANAGER.freeBytes(); };
#endif
bool legalChar( char c ) // Return true if char c is allowed in a long file name
{
if( c == '"' || c == '*' || c == '?' || c == ':' ||
c == '<' || c == '>' || c == '|' )
return false;
#if STORAGE_TYPE == STORAGE_FATFS
return 0x1f < c && c < 0xff;
#else
return 0x1f < c && c < 0x7f;
#endif
}
IPAddress localIp; // IP address of server as seen by clients
IPAddress dataIp; // IP address of client for data
FTP_SERVER_NETWORK_SERVER_CLASS ftpServer;
FTP_SERVER_NETWORK_SERVER_CLASS dataServer;
FTP_CLIENT_NETWORK_CLASS client;
FTP_CLIENT_NETWORK_CLASS data;
FTP_FILE file;
FTP_DIR dir;
ftpCmd cmdStage; // stage of ftp command connexion
ftpTransfer transferStage; // stage of data connexion
ftpDataConn dataConn; // type of data connexion
bool anonymousConnection = false;
uint8_t __attribute__((aligned(4))) // need to be aligned to 32bit for Esp8266 SPIClass::transferBytes()
buf[ FTP_BUF_SIZE ]; // data buffer for transfers
char cmdLine[ FTP_CMD_SIZE ]; // where to store incoming char from client
char cwdName[ FTP_CWD_SIZE ]; // name of current directory
char rnfrName[ FTP_CWD_SIZE ]; // name of file for RNFR command
const char * user; // user name
const char * pass; // password
char command[ 5 ]; // command sent by client
bool rnfrCmd; // previous command was RNFR
char * parameter; // point to begin of parameters sent by client
const char * welcomeMessage;
uint16_t cmdPort,
pasvPort,
dataPort;
uint16_t iCL; // pointer to cmdLine next incoming char
uint16_t nbMatch;
uint32_t millisDelay, //
millisEndConnection, //
millisBeginTrans, // store time of beginning of a transaction
bytesTransfered; //
};
#endif // FTP_SERVER_H

View File

@ -1,106 +0,0 @@
/*
* FtpServer Arduino, esp8266 and esp32 library for Ftp Server
* Derived form Jean-Michel Gallego version
*
* AUTHOR: Renzo Mischianti
*
* https://www.mischianti.org/2020/02/08/ftp-server-on-esp8266-and-esp32
*
*/
/*******************************************************************************
** **
** SETTINGS FOR FTP SERVER **
** **
*******************************************************************************/
#ifndef FTP_SERVER_CONFIG_H
#define FTP_SERVER_CONFIG_H
// Uncomment to enable printing out nice debug messages.
// #define FTP_SERVER_DEBUG
// Define where debug output will be printed.
#define DEBUG_PRINTER Serial
#define STORAGE_SDFAT1 1 // Library SdFat version 1.4.x
#define STORAGE_SDFAT2 2 // Library SdFat version >= 2.0.2
#define STORAGE_SPIFM 3 // Libraries Adafruit_SPIFlash and SdFat-Adafruit-Fork
#define STORAGE_FATFS 4 // Library FatFs
#define STORAGE_SD 5 // Standard SD library (suitable for Arduino esp8266 and esp32
#define STORAGE_SPIFFS 6 // SPIFFS
#define STORAGE_LITTLEFS 7 // LITTLEFS
#define STORAGE_SEEED_SD 8 // Seeed_SD library
#define STORAGE_FFAT 9 // ESP32 FFAT
#define STORAGE_SD_MMC 10 // SD_MMC library
#define NETWORK_ESP8266_ASYNC (1)
#define NETWORK_ESP8266 (2) // Standard ESP8266WiFi
#define NETWORK_ESP8266_242 (3) // ESP8266WiFi before 2.4.2 core
#define NETWORK_W5100 (4) // Standard Arduino Ethernet library
#define NETWORK_ENC28J60 (5) // UIPEthernet library
#define NETWORK_ESP32 (6) // Standard WiFi library
#define NETWORK_RP2040_WIFI (6) // Raspberry Pi Pico W standard WiFi library
#define NETWORK_ESP32_ETH (7) // Standard ETH library
#define NETWORK_WiFiNINA (8) // Standard WiFiNINA library
#define NETWORK_SEEED_RTL8720DN (9) // Standard SEED WiFi library
#define NETWORK_ETHERNET_LARGE (10)
#define NETWORK_ETHERNET_ENC (11) // EthernetENC library (evolution of UIPEthernet
#define NETWORK_ETHERNET_STM (12)
#define NETWORK_UIPETHERNET (13) // UIPEthernet library same of NETWORK_ENC28J60
// esp8266 configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP8266
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP8266 NETWORK_ESP8266
#define DEFAULT_STORAGE_TYPE_ESP8266 STORAGE_LITTLEFS
#endif
// esp32 configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP32
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_ESP32 NETWORK_ESP32
#define DEFAULT_STORAGE_TYPE_ESP32 STORAGE_FFAT
#endif
// Standard AVR Arduino configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_ARDUINO
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_ARDUINO NETWORK_W5100
#define DEFAULT_STORAGE_TYPE_ARDUINO STORAGE_SD
#endif
// STM32 configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_STM32
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_STM32 NETWORK_W5100
#define DEFAULT_STORAGE_TYPE_STM32 STORAGE_SDFAT2
#endif
// Raspberry Pi Pico (rp2040) configuration
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_RP2040
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_RP2040 NETWORK_RP2040_WIFI
#define DEFAULT_STORAGE_TYPE_RP2040 STORAGE_LITTLEFS
#endif
// Arduino SAMD21 like Arduino MKR Nano 33 IoT or Wio Terminal
#ifndef DEFAULT_FTP_SERVER_NETWORK_TYPE_ARDUINO_SAMD
// Wio Terminal
// #define DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD NETWORK_SEEED_RTL8720DN
// #define DEFAULT_STORAGE_TYPE_SAMD STORAGE_SEEED_SD
// Arduino SAMD
#define DEFAULT_FTP_SERVER_NETWORK_TYPE_SAMD NETWORK_WiFiNINA
#define DEFAULT_STORAGE_TYPE_SAMD STORAGE_SD
#endif
#define UTF8_SUPPORT
//#define SD_CS_PIN 4
// Disconnect client after 5 minutes of inactivity (expressed in seconds)
#define FTP_TIME_OUT 5 * 60
// Wait for authentication for 10 seconds (expressed in seconds)
#define FTP_AUTH_TIME_OUT 10
// Size of file buffer for read/write
// Transfer speed depends of this value
// Best value depends on many factors: SD card, client side OS, ...
// But it can be reduced to 512 if memory usage is critical.
#define FTP_BUF_SIZE 1024 //2048 //1024 // 512
#endif // FTP_SERVER_CONFIG_H

View File

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

View File

@ -1,107 +0,0 @@
# SimpleFTPServer
[Instruction on FTP server on esp8266 and esp32](https://www.mischianti.org/2020/02/08/ftp-server-on-esp8266-and-esp32)
[Simple FTP Server library now with support for Wio Terminal and SD](https://www.mischianti.org/2021/07/01/simple-ftp-server-library-now-with-support-for-wio-terminal-and-sd/)
#### Simple FTP Server for
- Raspberry Pi Pico W (Flash: LittleFS) (To test SD and SdFat)
- esp8266 (Flash: SPIFFs, LittleFS. SD: SD, SdFat 2)
- esp32 (SPIFFS, LITTLEFS, FFAT, SD: SD, SdFat)
- stm32 (SdFat, SPI flash)
- Arduino (SD with 8.3 file format, SD: SD, SdFat 2)
- Wio Terminal (SdFat 2, Seed SD, and native FAT)
#### Changelog
- 2022-01-13 2.1.5 Fix SPIFM external SPI Flash date management (add SPIFM esp32 example)
- 2022-09-21 2.1.4 Add support for Raspberry Pi Pico W and rp2040 boards, Fix SD card config
- 2022-09-20 2.1.3 Soft AP IP management, more disconnect event and SD_MCC
- 2022-05-21 2.1.2 Fix SD path (#19)
- 2022-05-21 2.1.1 Minor fix
- 2022-03-30 2.1.0 Add UTF8 support and enabled It by default (Thanks to @plaber)
- 2022-03-30 2.0.0 Complete support for STM32 with SD and SPI Flash minor bux fix and HELP command support
- 2022-03-17 1.3.0 Fix enc28j60 and w5500 support and restructuring for local settings
- 2022-02-25 1.2.1 Fix anonymous user begin and fix SPIFFS wrong display
- 2022-02-22 1.2.0 Add anonymous user and implement correct RFC (#9 now work correctly with File Explorer)
- 2022-02-01 1.1.1 Add workaround to start FTP server before connection, add end and setLocalIP method.
<!-- wp:paragraph -->
<p>When I develop a new solution I'd like to divide the application in layer, and so I'd like focus my attention in only one aspect at time. </p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p> In detail I separate the REST layer (written inside the microcontroller) and the Front-End (written in Angular, React/Redux or vanilla JS), so I'd like to upload new web interface directly to the microcontroller via FTP. </p>
<!-- /wp:paragraph -->
<!-- wp:image {"align":"center","id":2155} -->
<div class="wp-block-image"><figure class="aligncenter"><img width="450px" src="https://www.mischianti.org/wp-content/uploads/2019/06/FTPTransferEsp8266-1024x662.jpg" alt="" class="wp-image-2155"/><figcaption></figcaption></figure></div>
<!-- /wp:image -->
<!-- wp:paragraph -->
<p>For static information (Web pages for examples), that not change frequently, esp8266 or esp32 have internal SPIFFS (SPI Flash File System) and you can upload data via Arduino IDE as explained in the article "<a href="https://www.mischianti.org/2019/08/30/wemos-d1-mini-esp8266-integrated-spiffs-filesistem-part-2/">WeMos D1 mini (esp8266), integrated SPIFFS Filesystem</a>" for esp8266 or "<a rel="noreferrer noopener" href="https://www.mischianti.org/2020/06/04/esp32-integrated-spiffs-filesystem-part-2/" target="_blank">ESP32: integrated SPIFFS FileSystem</a>" for esp32 or with LittleFS "<a href="https://www.mischianti.org/2020/06/22/wemos-d1-mini-esp8266-integrated-littlefs-filesystem-part-5/">WeMos D1 mini (esp8266), integrated LittleFS Filesystem</a>" but for fast operation and future support It's usefully use FTP.</p>
<!-- /wp:paragraph -->
```cpp
/*
* FtpServer esp8266 and esp32 with SPIFFS
*
* AUTHOR: Renzo Mischianti
*
* https://www.mischianti.org/2020/02/08/ftp-server-on-esp8266-and-esp32
*
*/
#ifdef ESP8266
#include <ESP8266WiFi.h>
#elif defined ESP32
#include <WiFi.h>
#include "SPIFFS.h"
#endif
#include <SimpleFTPServer.h>
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASS";
FtpServer ftpSrv; //set #define FTP_DEBUG in ESP8266FtpServer.h to see ftp verbose on serial
void setup(void){
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.println("");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
/////FTP Setup, ensure SPIFFS is started before ftp; /////////
/////FTP Setup, ensure SPIFFS is started before ftp; /////////
#ifdef ESP32 //esp32 we send true to format spiffs if cannot mount
if (SPIFFS.begin(true)) {
#elif defined ESP8266
if (SPIFFS.begin()) {
#endif
Serial.println("SPIFFS opened!");
ftpSrv.begin("esp8266","esp8266"); //username, password for ftp. set ports in ESP8266FtpServer.h (default 21, 50009 for PASV)
}
}
void loop(void){
ftpSrv.handleFTP(); //make sure in loop you call handleFTP()!!
// server.handleClient(); //example if running a webserver you still need to call .handleClient();
}
```
https://downloads.arduino.cc/libraries/logs/github.com/xreef/SimpleFTPServer/

View File

@ -1,18 +0,0 @@
/*
* FtpServer Arduino, esp8266 and esp32 library for Ftp Server
* Derived form https://github.com/nailbuster/esp8266FTPServer
*
* AUTHOR: Renzo Mischianti
*
* https://www.mischianti.org/2020/02/08/ftp-server-on-esp8266-and-esp32
*
*/
#ifndef SIMPLE_FTP_SERVER_H
#define SIMPLE_FTP_SERVER_H
#include <FtpServer.h>
#endif
#pragma once

View File

@ -1,17 +0,0 @@
#######################################
# Datatypes (KEYWORD1)
#######################################
SimpleFtpServer KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
begin KEYWORD2
end KEYWORD2
setLocalIp KEYWORD2
credentials KEYWORD2
setCallback KEYWORD2
setTransferCallback KEYWORD2
handleFTP KEYWORD2

View File

@ -1,21 +0,0 @@
{
"name": "SimpleFTPServer",
"description": "Simple FTP Server for using esp8266, esp32, STM32, Arduino",
"keywords": "arduino, esp8266, esp32, stm32, rp2040, Raspberry Pi, ftp, FtpServer, spiffs, Fat, LittleFS, Ethernet, WiFi, WiFiNINA",
"homepage": "https://www.mischianti.org/category/my-libraries/simple-ftp-server/",
"authors":
{
"name": "Renzo Mischianti",
"email": "renzo.mischianti@gmail.com",
"url": "https://www.mischianti.org"
},
"repository":
{
"type": "git",
"url": "https://github.com/xreef/SimpleFTPServer"
},
"url": "https://www.mischianti.org",
"frameworks": "Arduino",
"version": "2.1.5",
"platforms": "*"
}

Some files were not shown because too many files have changed in this diff Show More