mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-04-20 21:37:19 +00:00
Compare commits
No commits in common. "master" and "v0.3.4" have entirely different histories.
@ -1,12 +1,12 @@
|
||||
---
|
||||
Language: Cpp
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignOperands: true
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
@ -21,51 +21,51 @@ AlwaysBreakTemplateDeclarations: false
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterClass: false
|
||||
BraceWrapping:
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 120
|
||||
CommentPragmas: "^ IWYU pragma:"
|
||||
ColumnLimit: 120
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
ForEachMacros: [foreach, Q_FOREACH, BOOST_FOREACH]
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: ".*"
|
||||
Priority: 1
|
||||
IncludeIsMainRegex: "$"
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IncludeIsMainRegex: '$'
|
||||
IndentCaseLabels: true
|
||||
IndentWidth: 4
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
# IndentPPDirectives: BeforeHash
|
||||
IndentPPDirectives: BeforeHash
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MacroBlockBegin: ""
|
||||
MacroBlockEnd: ""
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCBlockIndentWidth: 2
|
||||
@ -77,20 +77,21 @@ PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: false
|
||||
PointerAlignment: Middle
|
||||
ReflowComments: true
|
||||
SortIncludes: false
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: Never
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
...
|
||||
|
@ -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"]
|
||||
}
|
12
.github/FUNDING.yml
vendored
12
.github/FUNDING.yml
vendored
@ -1,16 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [aderusha, lovyan03, bblanchon] # Replace with up to 4 GitHub Sponsors-enabled usernames
|
||||
github: [bblanchon] # 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
|
||||
open_collective: lvgl # Replace with a single Open Collective username
|
||||
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
|
||||
|
11
.github/ISSUE_TEMPLATE/bug_report.md
vendored
11
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -2,22 +2,21 @@
|
||||
name: Bug report
|
||||
about: Create a bug report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
labels: 'bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
IMPORTANT
|
||||
Issues that don't use this template will be ignored and closed.
|
||||
|
||||
If you are not sure if your issue is a bug, please open a [github discussion](https://github.com/HASwitchPlate/openHASP/discussions) first
|
||||
or join the [#openHASP channel](https://discord.gg/VCWyuhF) on Discord.
|
||||
If you are not sure if your issue is a bug, please open a [github discussion](https://github.com/fvanroie/hasp-lvgl/discussions) first
|
||||
or join the [#hasp-lvgl 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/)
|
||||
- [ ] Update openHASP to the latest version
|
||||
- [ ] Check the related part of the [Documentation](https://fvanroie.github.io/hasp-docs/)
|
||||
- [ ] Update hasp-lvgl to the latest version
|
||||
- [ ] Reproduce the issue and describe all steps
|
||||
|
||||
### Describe the bug
|
||||
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,20 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
16
.github/ISSUE_TEMPLATE/other-question.md
vendored
16
.github/ISSUE_TEMPLATE/other-question.md
vendored
@ -1,16 +0,0 @@
|
||||
---
|
||||
name: Other Question
|
||||
about: Please use the forum or discord for general questions
|
||||
title: ''
|
||||
labels: question
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Questions
|
||||
|
||||
We only keep bug reports and active requests being worked on in the issues tracker.
|
||||
|
||||
For general questions we have opened the [discussion forum](https://github.com/HASwitchPlate/openHASP/discussions) on github and [#openHASP channel](https://discord.gg/VCWyuhF) on Discord.
|
||||
|
||||
If you are not sure if your question is related to the code development, feel free to ask!
|
12
.github/dependabot.yml
vendored
12
.github/dependabot.yml
vendored
@ -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
|
168
.github/workflows/build.yaml
vendored
168
.github/workflows/build.yaml
vendored
@ -1,168 +0,0 @@
|
||||
name: Build branch
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "**.yml"
|
||||
- "**.yaml"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build_esp32:
|
||||
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"
|
||||
- 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: Install Setuptools
|
||||
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
|
||||
- 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: Run PlatformIO
|
||||
run: pio run -e linux_sdl
|
74
.github/workflows/build_linux.yaml
vendored
74
.github/workflows/build_linux.yaml
vendored
@ -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 }}
|
49
.github/workflows/release.yml
vendored
49
.github/workflows/release.yml
vendored
@ -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
|
||||
@ -36,14 +33,6 @@ jobs:
|
||||
- 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
|
||||
@ -51,29 +40,11 @@ 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 lanbon_l8 -e wt32-sc01 -e d1-mini-esp8266_ili9341
|
||||
- name: Upload output file
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: openHASP firmware.zip
|
||||
name: hasp-lvgl firmware.zip
|
||||
path: build_output/firmware/*.bin
|
||||
- name: Create release and upload firmware
|
||||
run: |
|
||||
|
56
.github/workflows/test.yaml
vendored
Normal file
56
.github/workflows/test.yaml
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
name: PlatformIO CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache pip
|
||||
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@v2
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
- 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: 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 d1-mini-esp32_ili9341 -e lanbon_l8 -e wt32-sc01 -e d1-mini-esp8266_ili9341
|
||||
- name: Upload output file
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: hasp-lvgl 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 }}
|
46
.gitignore
vendored
46
.gitignore
vendored
@ -4,61 +4,21 @@
|
||||
## 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
|
||||
|
||||
include/user_config_override.h
|
||||
src/user_setups/active/*
|
||||
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
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.vscode
|
||||
.vscode/.browse.c_cpp.db*
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
*.bak
|
||||
|
||||
test/config.yaml
|
||||
tools/mklittlefs*
|
7
.gitmodules
vendored
7
.gitmodules
vendored
@ -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
5
.gitpod.Dockerfile
vendored
@ -1,5 +0,0 @@
|
||||
FROM gitpod/workspace-full
|
||||
|
||||
USER gitpod
|
||||
|
||||
RUN pip install -U platformio
|
@ -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
|
11
.vscode/extensions.json
vendored
11
.vscode/extensions.json
vendored
@ -1,11 +0,0 @@
|
||||
{
|
||||
// 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"
|
||||
]
|
||||
}
|
329
CHANGELOG.md
329
CHANGELOG.md
@ -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
|
2
LICENSE
2
LICENSE
@ -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
|
||||
|
84
README.md
84
README.md
@ -1,41 +1,79 @@
|
||||
# openHASP firmware
|
||||
# HASP - Open Hardware edition
|
||||
|
||||
[](https://github.com/HASwitchPlate/openHASP/actions)
|
||||
[](https://github.com/HASwitchPlate/openHASP/releases)
|
||||
[](http://github.com/HASwitchPlate/openHASP/issues)
|
||||
[][3]
|
||||
[](https://github.com/fvanroie/hasp-lvgl/actions?query=workflow%3A%22PlatformIO+CI%22)
|
||||
[](https://github.com/fvanroie/hasp-lvgl/releases)
|
||||
[](http://github.com/fvanroie/hasp-lvgl/issues)
|
||||
[][6]
|
||||
[](#Contributing)
|
||||
[](https://github.com/HASwitchPlate/openHASP/blob/master/LICENSE)
|
||||
[](https://github.com/HASwitchPlate/openHASP#donate)
|
||||
[](https://github.com/fvanroie/hasp-lvgl/blob/master/LICENSE)
|
||||
|
||||
Control your home-automation devices from a customizable touchscreen UI connected via MQTT.
|
||||
|
||||
This project is a re-implementation of the popular HASwitchPlate sketch created by aderusha.
|
||||
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.
|
||||
The [original HASwitchPlate][1] project uses a Wemos D1 mini and requires a Nextion/TJC HMI display.
|
||||
This rewrite removes the Nextion/TJC requirement by using the [Littlev Graphics Library][2] on the MCU to drive a cheap commodity display.
|
||||
|
||||
openHASP uses the ESP32 and STM32F4 to take advantage of the hardware capabilities.
|
||||
This version also adds ESP32 and STM32F4 support to take advantage of the additional hardware capabilities.
|
||||
|
||||
|
||||
## Demo Screens
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## 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/fvanroie/hasp-lvgl
|
||||
```
|
||||
|
||||
If you already cloned hasp-lvgl 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/fvanroie/hasp-lvgl
|
||||
cd hasp-lvgl
|
||||
git checkout 0.1.0-dev
|
||||
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://fvanroie.github.io/hasp-docs/) for how-to's, information and frequently asked questions.
|
||||
|
||||
## Donate
|
||||
Support
|
||||
---------------------------
|
||||
For support using hasp-lvgl, please join the [#hasp-lvgl channel][6] on Discord.
|
||||
|
||||
[][4]
|
||||
[](https://ko-fi.com/openhasp)
|
||||
[](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¤cy_code=EUR
|
||||
|
||||
[1]: https://github.com/aderusha/HASwitchPlate
|
||||
[2]: https://github.com/littlevgl/lvgl
|
||||
[3]: https://littlevgl.com/themes
|
||||
[4]: https://github.com/fvanroie/HMI-Font-Pack/releases
|
||||
[5]: https://fontawesome.com/cheatsheet/
|
||||
[6]: https://discord.gg/VCWyuhF
|
||||
|
@ -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"
|
||||
}
|
@ -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"
|
||||
}
|
@ -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"
|
||||
}
|
@ -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"
|
||||
}
|
@ -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"
|
||||
}
|
@ -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"
|
||||
}
|
@ -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"
|
||||
}
|
@ -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.
162
data/da_DK.json
162
data/da_DK.json
@ -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 "
|
||||
}
|
||||
}
|
||||
}
|
162
data/de_DE.json
162
data/de_DE.json
@ -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 "
|
||||
}
|
||||
}
|
||||
}
|
@ -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>
|
@ -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 "}}}
|
162
data/es_ES.json
162
data/es_ES.json
@ -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 "
|
||||
}
|
||||
}
|
||||
}
|
162
data/fr_FR.json
162
data/fr_FR.json
@ -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 d’auteur ",
|
||||
"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": "L’Europe ",
|
||||
"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 "
|
||||
}
|
||||
}
|
||||
}
|
162
data/hu_HU.json
162
data/hu_HU.json
@ -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
162
data/nl_NL.json
162
data/nl_NL.json
@ -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.
@ -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"}
|
@ -1 +0,0 @@
|
||||
{"page":1,"id":10,"w":240,"obj":"label","text":"%hostname%"}
|
162
data/pt_BR.json
162
data/pt_BR.json
@ -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 "
|
||||
}
|
||||
}
|
||||
}
|
162
data/pt_PT.json
162
data/pt_PT.json
@ -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 "
|
||||
}
|
||||
}
|
||||
}
|
162
data/ro_RO.json
162
data/ro_RO.json
@ -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 "
|
||||
}
|
||||
}
|
||||
}
|
162
data/ru_RU.json
162
data/ru_RU.json
@ -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.
Binary file not shown.
Binary file not shown.
607
data/style.css
607
data/style.css
@ -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;
|
||||
}
|
||||
}
|
162
data/sv_SE.json
162
data/sv_SE.json
@ -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 "
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
162
data/zh_CN.json
162
data/zh_CN.json
@ -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": "太平洋 "
|
||||
}
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
#if USE_MONITOR
|
||||
#include <unistd.h>
|
||||
#define SDL_MAIN_HANDLED /*To fix SDL's "undefined reference to WinMain" issue*/
|
||||
#include <SDL2/SDL.h>
|
||||
#include "display/monitor.h"
|
||||
#include "indev/mouse.h"
|
||||
#include "indev/mousewheel.h"
|
||||
#include "indev/keyboard.h"
|
||||
|
||||
/**
|
||||
* A task to measure the elapsed time for LittlevGL
|
||||
* @param data unused
|
||||
* @return never return
|
||||
*/
|
||||
static int tick_thread(void* data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
while(1) {
|
||||
SDL_Delay(5); /*Sleep for 5 millisecond*/
|
||||
lv_tick_inc(5); /*Tell LittelvGL that 5 milliseconds were elapsed*/
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void hal_setup(void)
|
||||
{
|
||||
// Workaround for sdl2 `-m32` crash
|
||||
// https://bugs.launchpad.net/ubuntu/+source/libsdl2/+bug/1775067/comments/7
|
||||
#ifndef WIN32
|
||||
setenv("DBUS_FATAL_WARNINGS", "0", 1);
|
||||
#endif
|
||||
|
||||
/* Add a display
|
||||
* Use the 'monitor' driver which creates window on PC's monitor to simulate a display*/
|
||||
monitor_init(MONITOR_HOR_RES, MONITOR_VER_RES);
|
||||
|
||||
/* Add the mouse as input device
|
||||
* Use the 'mouse' driver which reads the PC's mouse*/
|
||||
mouse_init();
|
||||
|
||||
/* Tick init.
|
||||
* You have to call 'lv_tick_inc()' in periodically to inform LittelvGL about how much time were elapsed
|
||||
* Create an SDL thread to do this*/
|
||||
SDL_CreateThread(tick_thread, "tick", NULL);
|
||||
}
|
||||
|
||||
void hal_loop(void)
|
||||
{
|
||||
// we don't use thise !!
|
||||
// while(1) {
|
||||
// SDL_Delay(5);
|
||||
// lv_task_handler();
|
||||
// }
|
||||
}
|
||||
#endif
|
@ -1,17 +0,0 @@
|
||||
#ifndef DRIVER_H
|
||||
#define DRIVER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
void hal_setup(void);
|
||||
void hal_loop(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*DRIVER_H*/
|
@ -1,50 +0,0 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "stm32f4xx.h"
|
||||
//#include "stm32f429i_discovery.h"
|
||||
#include "tft.h"
|
||||
//#include "touchpad.h"
|
||||
|
||||
#ifdef USE_RTOS_SYSTICK
|
||||
#include <cmsis_os.h>
|
||||
#endif
|
||||
|
||||
void hal_setup(void)
|
||||
{
|
||||
pinMode(PD12, OUTPUT);
|
||||
digitalWrite(PD12, HIGH);
|
||||
|
||||
// HAL_Init();
|
||||
|
||||
// /* Configure the system clock to 180 MHz */
|
||||
// SystemClock_Config();
|
||||
|
||||
// /* Start up indication */
|
||||
// BSP_LED_Init(LED3);
|
||||
// for (uint8_t i = 0; i < 8; i++) { BSP_LED_Toggle(LED3); delay(50); }
|
||||
|
||||
tft_init();
|
||||
//touchpad_init();
|
||||
}
|
||||
|
||||
// void SysTick_Handler(void)
|
||||
// {
|
||||
// HAL_IncTick();
|
||||
// HAL_SYSTICK_IRQHandler();
|
||||
|
||||
// lv_tick_inc(1);
|
||||
|
||||
// #ifdef USE_RTOS_SYSTICK
|
||||
// osSystickHandler();
|
||||
// #endif
|
||||
// }
|
||||
|
||||
void hal_loop(void)
|
||||
{
|
||||
//while (1)
|
||||
{
|
||||
delay(5);
|
||||
lv_task_handler();
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#ifndef DRIVER_H
|
||||
#define DRIVER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
void hal_setup(void);
|
||||
void hal_loop(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*DRIVER_H*/
|
@ -1,65 +0,0 @@
|
||||
/**
|
||||
* @file disp.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <string.h>
|
||||
|
||||
#include "tft.h"
|
||||
#include "stm32f4xx.h"
|
||||
#include "fsmc_ssd1963.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_disp_drv_t disp_drv;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
/**
|
||||
* Initialize your display here
|
||||
*/
|
||||
void tft_init(void)
|
||||
{
|
||||
static lv_color_t disp_buf1[TFT_HOR_RES * 40];
|
||||
static lv_disp_buf_t buf;
|
||||
lv_disp_buf_init(&buf, disp_buf1, NULL, TFT_HOR_RES * 40);
|
||||
|
||||
lv_disp_drv_init(&disp_drv);
|
||||
fsmc_ssd1963_init(0, false);
|
||||
|
||||
disp_drv.buffer = &buf;
|
||||
disp_drv.flush_cb = fsmc_ssd1963_flush;
|
||||
disp_drv.hor_res = TFT_HOR_RES;
|
||||
disp_drv.ver_res = TFT_VER_RES;
|
||||
#if TFT_USE_GPU != 0
|
||||
DMA2D_Config();
|
||||
disp_drv.gpu_blend_cb = gpu_mem_blend;
|
||||
disp_drv.gpu_fill_cb = gpu_mem_fill;
|
||||
#endif
|
||||
lv_disp_drv_register(&disp_drv);
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
@ -1,37 +0,0 @@
|
||||
/**
|
||||
* @file disp.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DISP_H
|
||||
#define DISP_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdint.h>
|
||||
#include "lvgl.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define TFT_HOR_RES TFT_WIDTH
|
||||
#define TFT_VER_RES TFT_HEIGHT
|
||||
|
||||
#define TFT_EXT_FB 1 /*Frame buffer is located into an external SDRAM*/
|
||||
#define TFT_USE_GPU 0 /*Enable hardware accelerator*/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void tft_init(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif
|
@ -1,123 +0,0 @@
|
||||
|
||||
#include "stm32f4xx.h"
|
||||
#include "stm32f429i_discovery.h"
|
||||
#include "tft.h"
|
||||
#include "touchpad.h"
|
||||
|
||||
#ifdef USE_RTOS_SYSTICK
|
||||
#include <cmsis_os.h>
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* The system Clock is configured as follow :
|
||||
* System Clock source = PLL (HSE)
|
||||
* SYSCLK(Hz) = 180000000
|
||||
* HCLK(Hz) = 180000000
|
||||
* AHB Prescaler = 1
|
||||
* APB1 Prescaler = 4
|
||||
* APB2 Prescaler = 2
|
||||
* HSE Frequency(Hz) = 8000000
|
||||
* PLL_M = 8
|
||||
* PLL_N = 360
|
||||
* PLL_P = 2
|
||||
* PLL_Q = 7
|
||||
* VDD(V) = 3.3
|
||||
* Main regulator output voltage = Scale1 mode
|
||||
* Flash Latency(WS) = 5
|
||||
* The LTDC Clock is configured as follow :
|
||||
* PLLSAIN = 192
|
||||
* PLLSAIR = 4
|
||||
* PLLSAIDivR = 8
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void SystemClock_Config(void)
|
||||
{
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
|
||||
|
||||
/* Enable Power Control clock */
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
|
||||
/* The voltage scaling allows optimizing the power consumption when the device is
|
||||
clocked below the maximum system frequency, to update the voltage scaling value
|
||||
regarding system frequency refer to product datasheet. */
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
|
||||
/*##-1- System Clock Configuration #########################################*/
|
||||
/* Enable HSE Oscillator and activate PLL with HSE as source */
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLN = 360;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 7;
|
||||
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
||||
|
||||
/* Activate the Over-Drive mode */
|
||||
HAL_PWREx_EnableOverDrive();
|
||||
|
||||
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
|
||||
clocks dividers */
|
||||
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
|
||||
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
|
||||
|
||||
/*##-2- LTDC Clock Configuration ###########################################*/
|
||||
/* LCD clock configuration */
|
||||
/* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 MHz */
|
||||
/* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 192 MHz */
|
||||
/* PLLLCDCLK = PLLSAI_VCO Output/PLLSAIR = 192/4 = 48 MHz */
|
||||
/* LTDC clock frequency = PLLLCDCLK / RCC_PLLSAIDIVR_8 = 48/8 = 6 MHz */
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIN = 192;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIR = 4;
|
||||
PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_8;
|
||||
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
|
||||
}
|
||||
|
||||
|
||||
void hal_setup(void)
|
||||
{
|
||||
HAL_Init();
|
||||
|
||||
/* Configure the system clock to 180 MHz */
|
||||
SystemClock_Config();
|
||||
|
||||
/* Start up indication */
|
||||
BSP_LED_Init(LED3);
|
||||
for (uint8_t i = 0; i < 8; i++) { BSP_LED_Toggle(LED3); HAL_Delay(50); }
|
||||
|
||||
tft_init();
|
||||
touchpad_init();
|
||||
}
|
||||
|
||||
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
HAL_IncTick();
|
||||
HAL_SYSTICK_IRQHandler();
|
||||
|
||||
lv_tick_inc(1);
|
||||
|
||||
#ifdef USE_RTOS_SYSTICK
|
||||
osSystickHandler();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void hal_loop(void)
|
||||
{
|
||||
while(1) {
|
||||
HAL_Delay(5);
|
||||
lv_task_handler();
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#ifndef DRIVER_H
|
||||
#define DRIVER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
void hal_setup(void);
|
||||
void hal_loop(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*DRIVER_H*/
|
@ -1,236 +0,0 @@
|
||||
/**
|
||||
* @file disp.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <string.h>
|
||||
|
||||
#include "tft.h"
|
||||
#include "stm32f4xx.h"
|
||||
#include "stm32f429i_discovery_lcd.h"
|
||||
#include "ili9341.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
#define SDRAM_BANK_ADDR ((uint32_t)0xD0000000)
|
||||
|
||||
#define DMA_STREAM DMA2_Stream0
|
||||
#define DMA_CHANNEL DMA_CHANNEL_0
|
||||
#define DMA_STREAM_IRQ DMA2_Stream0_IRQn
|
||||
#define DMA_STREAM_IRQHANDLER DMA2_Stream0_IRQHandler
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
static void tft_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_p);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
extern LTDC_HandleTypeDef LtdcHandler;
|
||||
|
||||
#if TFT_USE_GPU != 0
|
||||
static DMA2D_HandleTypeDef Dma2dHandle;
|
||||
#endif
|
||||
|
||||
#if TFT_EXT_FB != 0
|
||||
static __IO uint16_t *my_fb = (__IO uint16_t *)(SDRAM_BANK_ADDR);
|
||||
#else
|
||||
static uint16_t my_fb[TFT_HOR_RES * TFT_VER_RES];
|
||||
#endif
|
||||
|
||||
/*DMA to flush to frame buffer*/
|
||||
static void DMA_Config(void);
|
||||
static void DMA_TransferComplete(DMA_HandleTypeDef *han);
|
||||
static void DMA_TransferError(DMA_HandleTypeDef *han);
|
||||
|
||||
DMA_HandleTypeDef DmaHandle;
|
||||
static lv_disp_drv_t disp_drv;
|
||||
static int32_t x1_flush;
|
||||
static int32_t y1_flush;
|
||||
static int32_t x2_flush;
|
||||
static int32_t y2_fill;
|
||||
static int32_t y_fill_act;
|
||||
static const lv_color_t *buf_to_flush;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
/**
|
||||
* Initialize your display here
|
||||
*/
|
||||
void tft_init(void)
|
||||
{
|
||||
static lv_color_t disp_buf1[TFT_HOR_RES * 40];
|
||||
static lv_disp_buf_t buf;
|
||||
lv_disp_buf_init(&buf, disp_buf1, NULL, TFT_HOR_RES * 40);
|
||||
|
||||
lv_disp_drv_init(&disp_drv);
|
||||
|
||||
BSP_LCD_Init();
|
||||
BSP_LCD_LayerDefaultInit(0, (uint32_t)my_fb);
|
||||
HAL_LTDC_SetPixelFormat(&LtdcHandler, LTDC_PIXEL_FORMAT_RGB565, 0);
|
||||
DMA_Config();
|
||||
disp_drv.buffer = &buf;
|
||||
disp_drv.flush_cb = tft_flush;
|
||||
disp_drv.hor_res = TFT_HOR_RES;
|
||||
disp_drv.ver_res = TFT_VER_RES;
|
||||
#if TFT_USE_GPU != 0
|
||||
DMA2D_Config();
|
||||
disp_drv.gpu_blend_cb = gpu_mem_blend;
|
||||
disp_drv.gpu_fill_cb = gpu_mem_fill;
|
||||
#endif
|
||||
lv_disp_drv_register(&disp_drv);
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Flush a color buffer
|
||||
* @param x1 left coordinate of the rectangle
|
||||
* @param x2 right coordinate of the rectangle
|
||||
* @param y1 top coordinate of the rectangle
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color_p pointer to an array of colors
|
||||
*/
|
||||
static void tft_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_p)
|
||||
{
|
||||
/*Return if the area is out the screen*/
|
||||
if (area->x2 < 0)
|
||||
return;
|
||||
if (area->y2 < 0)
|
||||
return;
|
||||
if (area->x1 > TFT_HOR_RES - 1)
|
||||
return;
|
||||
if (area->y1 > TFT_VER_RES - 1)
|
||||
return;
|
||||
|
||||
/*Truncate the area to the screen*/
|
||||
int32_t act_x1 = area->x1 < 0 ? 0 : area->x1;
|
||||
int32_t act_y1 = area->y1 < 0 ? 0 : area->y1;
|
||||
int32_t act_x2 = area->x2 > TFT_HOR_RES - 1 ? TFT_HOR_RES - 1 : area->x2;
|
||||
int32_t act_y2 = area->y2 > TFT_VER_RES - 1 ? TFT_VER_RES - 1 : area->y2;
|
||||
|
||||
x1_flush = act_x1;
|
||||
y1_flush = act_y1;
|
||||
x2_flush = act_x2;
|
||||
y2_fill = act_y2;
|
||||
y_fill_act = act_y1;
|
||||
buf_to_flush = color_p;
|
||||
|
||||
/*##-7- Start the DMA transfer using the interrupt mode #*/
|
||||
/* Configure the source, destination and buffer size DMA fields and Start DMA Stream transfer */
|
||||
/* Enable All the DMA interrupts */
|
||||
HAL_StatusTypeDef err;
|
||||
err = HAL_DMA_Start_IT(&DmaHandle, (uint32_t)buf_to_flush, (uint32_t)&my_fb[y_fill_act * TFT_HOR_RES + x1_flush],
|
||||
(x2_flush - x1_flush + 1));
|
||||
if (err != HAL_OK)
|
||||
{
|
||||
while (1)
|
||||
; /*Halt on error*/
|
||||
}
|
||||
}
|
||||
|
||||
static void DMA_Config(void)
|
||||
{
|
||||
/*## -1- Enable DMA2 clock #################################################*/
|
||||
__HAL_RCC_DMA2_CLK_ENABLE();
|
||||
|
||||
/*##-2- Select the DMA functional Parameters ###############################*/
|
||||
DmaHandle.Init.Channel = DMA_CHANNEL; /* DMA_CHANNEL_0 */
|
||||
DmaHandle.Init.Direction = DMA_MEMORY_TO_MEMORY; /* M2M transfer mode */
|
||||
DmaHandle.Init.PeriphInc = DMA_PINC_ENABLE; /* Peripheral increment mode Enable */
|
||||
DmaHandle.Init.MemInc = DMA_MINC_ENABLE; /* Memory increment mode Enable */
|
||||
DmaHandle.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; /* Peripheral data alignment : 16bit */
|
||||
DmaHandle.Init.MemDataAlignment = DMA_PDATAALIGN_HALFWORD; /* memory data alignment : 16bit */
|
||||
DmaHandle.Init.Mode = DMA_NORMAL; /* Normal DMA mode */
|
||||
DmaHandle.Init.Priority = DMA_PRIORITY_HIGH; /* priority level : high */
|
||||
DmaHandle.Init.FIFOMode = DMA_FIFOMODE_ENABLE; /* FIFO mode enabled */
|
||||
DmaHandle.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_1QUARTERFULL; /* FIFO threshold: 1/4 full */
|
||||
DmaHandle.Init.MemBurst = DMA_MBURST_SINGLE; /* Memory burst */
|
||||
DmaHandle.Init.PeriphBurst = DMA_PBURST_SINGLE; /* Peripheral burst */
|
||||
|
||||
/*##-3- Select the DMA instance to be used for the transfer : DMA2_Stream0 #*/
|
||||
DmaHandle.Instance = DMA_STREAM;
|
||||
|
||||
/*##-4- Initialize the DMA stream ##########################################*/
|
||||
if (HAL_DMA_Init(&DmaHandle) != HAL_OK)
|
||||
{
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
||||
/*##-5- Select Callbacks functions called after Transfer complete and Transfer error */
|
||||
HAL_DMA_RegisterCallback(&DmaHandle, HAL_DMA_XFER_CPLT_CB_ID, DMA_TransferComplete);
|
||||
HAL_DMA_RegisterCallback(&DmaHandle, HAL_DMA_XFER_ERROR_CB_ID, DMA_TransferError);
|
||||
|
||||
/*##-6- Configure NVIC for DMA transfer complete/error interrupts ##########*/
|
||||
HAL_NVIC_SetPriority(DMA_STREAM_IRQ, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA_STREAM_IRQ);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DMA conversion complete callback
|
||||
* @note This function is executed when the transfer complete interrupt
|
||||
* is generated
|
||||
* @retval None
|
||||
*/
|
||||
static void DMA_TransferComplete(DMA_HandleTypeDef *han)
|
||||
{
|
||||
y_fill_act++;
|
||||
|
||||
if (y_fill_act > y2_fill)
|
||||
{
|
||||
lv_disp_flush_ready(&disp_drv);
|
||||
}
|
||||
else
|
||||
{
|
||||
buf_to_flush += x2_flush - x1_flush + 1;
|
||||
/*##-7- Start the DMA transfer using the interrupt mode ####################*/
|
||||
/* Configure the source, destination and buffer size DMA fields and Start DMA Stream transfer */
|
||||
/* Enable All the DMA interrupts */
|
||||
if (HAL_DMA_Start_IT(han, (uint32_t)buf_to_flush, (uint32_t)&my_fb[y_fill_act * TFT_HOR_RES + x1_flush],
|
||||
(x2_flush - x1_flush + 1)) != HAL_OK)
|
||||
{
|
||||
while (1)
|
||||
; /*Halt on error*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DMA conversion error callback
|
||||
* @note This function is executed when the transfer error interrupt
|
||||
* is generated during DMA transfer
|
||||
* @retval None
|
||||
*/
|
||||
static void DMA_TransferError(DMA_HandleTypeDef *han)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles DMA Stream interrupt request.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void DMA_STREAM_IRQHANDLER(void)
|
||||
{
|
||||
/* Check the interrupt and clear flag */
|
||||
HAL_DMA_IRQHandler(&DmaHandle);
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/**
|
||||
* @file disp.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DISP_H
|
||||
#define DISP_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdint.h>
|
||||
#include "lvgl.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define TFT_HOR_RES 240
|
||||
#define TFT_VER_RES 320
|
||||
|
||||
#define TFT_EXT_FB 1 /*Frame buffer is located into an external SDRAM*/
|
||||
#define TFT_USE_GPU 0 /*Enable hardware accelerator*/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void tft_init(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif
|
@ -1,144 +0,0 @@
|
||||
/**
|
||||
* @file indev.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "tft.h"
|
||||
#include "lvgl.h"
|
||||
|
||||
#include "stm32f4xx.h"
|
||||
#include "stm32f429i_discovery.h"
|
||||
#include "stmpe811.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static bool touchpad_read(lv_indev_drv_t * drv, lv_indev_data_t *data);
|
||||
static bool touchpad_get_xy(int16_t *x, int16_t *y);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Initialize your input devices here
|
||||
*/
|
||||
void touchpad_init(void)
|
||||
{
|
||||
stmpe811_Init(TS_I2C_ADDRESS);
|
||||
stmpe811_TS_Start(TS_I2C_ADDRESS);
|
||||
|
||||
lv_indev_drv_t indev_drv;
|
||||
lv_indev_drv_init(&indev_drv);
|
||||
indev_drv.read_cb = touchpad_read;
|
||||
indev_drv.type = LV_INDEV_TYPE_POINTER;
|
||||
lv_indev_drv_register(&indev_drv);
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Read an input device
|
||||
* @param indev_id id of the input device to read
|
||||
* @param x put the x coordinate here
|
||||
* @param y put the y coordinate here
|
||||
* @return true: the device is pressed, false: released
|
||||
*/
|
||||
static bool touchpad_read(lv_indev_drv_t * drv, lv_indev_data_t *data)
|
||||
{
|
||||
static int16_t last_x = 0;
|
||||
static int16_t last_y = 0;
|
||||
|
||||
bool detected;
|
||||
int16_t x;
|
||||
int16_t y;
|
||||
detected = touchpad_get_xy(&x, &y);
|
||||
if(detected) {
|
||||
data->point.x = x;
|
||||
data->point.y = y;
|
||||
last_x = data->point.x;
|
||||
last_y = data->point.y;
|
||||
|
||||
data->state = LV_INDEV_STATE_PR;
|
||||
} else {
|
||||
data->point.x = last_x;
|
||||
data->point.y = last_y;
|
||||
data->state = LV_INDEV_STATE_REL;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static bool touchpad_get_xy(int16_t *x, int16_t *y)
|
||||
{
|
||||
static int32_t _x = 0, _y = 0;
|
||||
int16_t xDiff, yDiff, xr, yr, x_raw, y_raw;;
|
||||
|
||||
bool detected;
|
||||
detected = stmpe811_TS_DetectTouch(TS_I2C_ADDRESS);
|
||||
|
||||
if(!detected) return false;
|
||||
|
||||
|
||||
stmpe811_TS_GetXY(TS_I2C_ADDRESS, &x_raw, &y_raw);
|
||||
|
||||
/* Y value first correction */
|
||||
y_raw -= 360;
|
||||
|
||||
/* Y value second correction */
|
||||
yr = y_raw / 11;
|
||||
|
||||
/* Return y_raw position value */
|
||||
if(yr <= 0) yr = 0;
|
||||
else if (yr > TFT_VER_RES) yr = TFT_VER_RES - 1;
|
||||
|
||||
y_raw = yr;
|
||||
|
||||
/* X value first correction */
|
||||
if(x_raw <= 3000) x_raw = 3870 - x_raw;
|
||||
else x_raw = 3800 - x_raw;
|
||||
|
||||
/* X value second correction */
|
||||
xr = x_raw / 15;
|
||||
|
||||
/* Return X position value */
|
||||
if(xr <= 0) xr = 0;
|
||||
else if (xr > TFT_HOR_RES) xr = TFT_HOR_RES - 1;
|
||||
|
||||
x_raw = xr;
|
||||
xDiff = x_raw > _x? (x_raw - _x): (_x - x_raw);
|
||||
yDiff = y_raw > _y? (y_raw - _y): (_y - y_raw);
|
||||
|
||||
if (xDiff + yDiff > 5) {
|
||||
_x = x_raw;
|
||||
_y = y_raw;
|
||||
}
|
||||
|
||||
/* Update the X and Y position */
|
||||
*x = _x;
|
||||
*y = _y;
|
||||
|
||||
return true;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
/**
|
||||
* @file indev.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INDEV_H
|
||||
#define INDEV_H
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void touchpad_init(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#endif
|
@ -1,4 +1,39 @@
|
||||
|
||||
This directory is intended for project header files.
|
||||
|
||||
The header files in this folder configure the different components of HASP, LVGL and paho.
|
||||
A header file is a file containing C declarations and macro definitions
|
||||
to be shared between several project source files. You request the use of a
|
||||
header file in your project source file (C, C++, etc) located in `src` folder
|
||||
by including it, with the C preprocessing directive `#include'.
|
||||
|
||||
```src/main.c
|
||||
|
||||
#include "header.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Including a header file produces the same results as copying the header file
|
||||
into each source file that needs it. Such copying would be time-consuming
|
||||
and error-prone. With a header file, the related declarations appear
|
||||
in only one place. If they need to be changed, they can be changed in one
|
||||
place, and programs that include the header file will automatically use the
|
||||
new version when next recompiled. The header file eliminates the labor of
|
||||
finding and changing all the copies as well as the risk that a failure to
|
||||
find one copy will result in inconsistencies within a program.
|
||||
|
||||
In C, the usual convention is to give header files names that end with `.h'.
|
||||
It is most portable to use only letters, digits, dashes, and underscores in
|
||||
header file names, and at most one dot.
|
||||
|
||||
Read more about using header files in official GCC documentation:
|
||||
|
||||
* Include Syntax
|
||||
* Include Operation
|
||||
* Once-Only Headers
|
||||
* Computed Includes
|
||||
|
||||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
|
||||
|
@ -1,12 +0,0 @@
|
||||
/* 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
|
||||
#define VERSIONINFO_H
|
||||
|
||||
#define BUILD_TIMESTAMP "@BUILD_TIMESTAMP@"
|
||||
#define CLIENT_VERSION "@CLIENT_VERSION@"
|
||||
|
||||
#endif /* VERSIONINFO_H */
|
41
include/bootscreen.h
Normal file
41
include/bootscreen.h
Normal file
@ -0,0 +1,41 @@
|
||||
// Images can be converted to XBM format by using the online converter here:
|
||||
// https://www.online-utility.org/image/convert/to/XBM
|
||||
|
||||
// The output must be pasted in a header file, renamed and adjusted to appear
|
||||
// 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 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 NetWize logo uses the MaterialDesign icons font, released under the OFL license
|
||||
|
||||
#include <pgmspace.h> // PROGMEM support header
|
||||
|
||||
#define logoWidth 148
|
||||
#define logoHeight 20
|
||||
|
||||
// Image is stored in this array
|
||||
PROGMEM const unsigned char bootscreen[] = {
|
||||
0x0F, 0x0F, 0xC0, 0xFF, 0x03, 0xF8, 0x7F, 0x00, 0x0F, 0x00, 0x0F, 0x80, 0x7F, 0x00, 0xFE, 0x1F, 0x00, 0xFF, 0x0F,
|
||||
0x1F, 0x0F, 0xC0, 0xFF, 0x03, 0xF8, 0x7F, 0x00, 0x0F, 0x00, 0x0F, 0x80, 0x7F, 0x00, 0xFE, 0x1F, 0x00, 0xFF, 0x0F,
|
||||
0x1F, 0x0F, 0xC0, 0xFF, 0x03, 0xF8, 0x7F, 0x00, 0x0F, 0x0F, 0x0F, 0x80, 0x7F, 0x00, 0xFE, 0x1F, 0x00, 0xFF, 0x0F,
|
||||
0x1F, 0x0F, 0xC0, 0xFF, 0x03, 0xF8, 0x7F, 0x00, 0x0F, 0x0F, 0x0F, 0x80, 0x7F, 0x00, 0xFE, 0x1F, 0x00, 0xFF, 0x0F,
|
||||
0x3F, 0x0F, 0xC0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0x00, 0x1E, 0x00, 0x0F, 0x00,
|
||||
0x3F, 0x0F, 0xC0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x00,
|
||||
0x7F, 0x0F, 0xC0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x00,
|
||||
0x7F, 0x0F, 0xC0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x00,
|
||||
0xFF, 0x0F, 0xC0, 0xFF, 0x03, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0xC0, 0x03, 0x00, 0xFF, 0x0F,
|
||||
0xFF, 0x0F, 0xC0, 0xFF, 0x03, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0xE0, 0x01, 0x00, 0xFF, 0x0F,
|
||||
0xFF, 0x0F, 0xC0, 0xFF, 0x03, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0xE0, 0x01, 0x00, 0xFF, 0x0F,
|
||||
0xFF, 0x0F, 0xC0, 0xFF, 0x03, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0xF0, 0x00, 0x00, 0xFF, 0x0F,
|
||||
0xEF, 0x0F, 0xC0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0x78, 0x00, 0x00, 0x0F, 0x00,
|
||||
0xEF, 0x0F, 0xC0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0x78, 0x00, 0x00, 0x0F, 0x00,
|
||||
0xCF, 0x0F, 0xC0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0x3C, 0x00, 0x00, 0x0F, 0x00,
|
||||
0xCF, 0x0F, 0xC0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x1E, 0x00, 0x1E, 0x00, 0x00, 0x0F, 0x00,
|
||||
0x8F, 0x0F, 0xC0, 0xFF, 0x03, 0x80, 0x07, 0x00, 0xFF, 0xFF, 0x0F, 0x80, 0x7F, 0x00, 0xFE, 0x1F, 0x00, 0xFF, 0x0F,
|
||||
0x8F, 0x0F, 0xC0, 0xFF, 0x03, 0x80, 0x07, 0x00, 0xFF, 0xFF, 0x0F, 0x80, 0x7F, 0x00, 0xFE, 0x1F, 0x00, 0xFF, 0x0F,
|
||||
0x8F, 0x0F, 0xC0, 0xFF, 0x03, 0x80, 0x07, 0x00, 0xFE, 0xFF, 0x07, 0x80, 0x7F, 0x00, 0xFE, 0x1F, 0x00, 0xFF, 0x0F,
|
||||
0x0F, 0x0F, 0xC0, 0xFF, 0x03, 0x80, 0x07, 0x00, 0xFC, 0xFF, 0x03, 0x80, 0x7F, 0x00, 0xFE, 0x1F, 0x00, 0xFF, 0x0F,
|
||||
};
|
@ -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
|
||||
|
||||
|
@ -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 */
|
@ -1,430 +1,218 @@
|
||||
/* 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
|
||||
|
||||
// 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
|
||||
#endif
|
||||
|
||||
#ifndef TFT_BCKL
|
||||
#define TFT_BCKL -1
|
||||
#endif
|
||||
|
||||
#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
|
||||
#define HASP_USE_DEBUG 1
|
||||
#endif
|
||||
|
||||
/* Network Services */
|
||||
#ifndef HASP_USE_ETHERNET
|
||||
#define HASP_USE_ETHERNET 0
|
||||
#define HASP_USE_ETHERNET 0
|
||||
#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
|
||||
#define HASP_USE_MQTT (HASP_HAS_NETWORK)
|
||||
#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
|
||||
#define HASP_USE_HTTP (HASP_HAS_NETWORK)
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_MDNS
|
||||
#define HASP_USE_MDNS (HASP_HAS_NETWORK)
|
||||
#define HASP_USE_MDNS (HASP_HAS_NETWORK)
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_SYSLOG
|
||||
#define HASP_USE_SYSLOG (HASP_HAS_NETWORK)
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_FTP
|
||||
#define HASP_USE_FTP 0
|
||||
#define HASP_USE_SYSLOG (HASP_HAS_NETWORK)
|
||||
#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
|
||||
#define HASP_USE_TELNET 0
|
||||
#endif
|
||||
|
||||
/* Filesystem */
|
||||
#define HASP_HAS_FILESYSTEM (ARDUINO_ARCH_ESP32 > 0 || ARDUINO_ARCH_ESP8266 > 0)
|
||||
|
||||
#ifndef HASP_USE_SPIFFS
|
||||
#ifndef HASP_USE_LITTLEFS
|
||||
#define HASP_USE_SPIFFS (HASP_HAS_FILESYSTEM)
|
||||
#else
|
||||
#define HASP_USE_SPIFFS (HASP_USE_LITTLEFS <= 0)
|
||||
#endif
|
||||
#ifndef HASP_USE_LITTLEFS
|
||||
#define HASP_USE_SPIFFS (HASP_HAS_FILESYSTEM)
|
||||
#else
|
||||
#define HASP_USE_SPIFFS (HASP_USE_LITTLEFS <= 0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_LITTLEFS
|
||||
#define HASP_USE_LITTLEFS (HASP_USE_SPIFFS <= 0)
|
||||
#define HASP_USE_LITTLEFS (HASP_USE_SPIFFS <= 0)
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_EEPROM
|
||||
#define HASP_USE_EEPROM 1
|
||||
#define HASP_USE_EEPROM 1
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_SDCARD
|
||||
#define HASP_USE_SDCARD 0
|
||||
#define HASP_USE_SDCARD 0
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_GPIO
|
||||
#define HASP_USE_GPIO 1
|
||||
#define HASP_USE_GPIO 1
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_QRCODE
|
||||
#define HASP_USE_QRCODE 1
|
||||
#define HASP_USE_QRCODE 1
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_PNGDECODE
|
||||
#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
|
||||
#define HASP_USE_PNGDECODE 0
|
||||
#endif
|
||||
|
||||
#ifndef HASP_NUM_GPIO_CONFIG
|
||||
#define HASP_NUM_GPIO_CONFIG 8
|
||||
#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
|
||||
// #endif
|
||||
|
||||
#ifndef HASP_NUM_PAGES
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
#define HASP_NUM_PAGES 4
|
||||
#else
|
||||
#define HASP_NUM_PAGES 12
|
||||
#endif
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
#define HASP_NUM_PAGES 4
|
||||
#else
|
||||
#define HASP_NUM_PAGES 12
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#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>
|
||||
#endif
|
||||
|
||||
#if HASP_USE_SPIFFS > 0
|
||||
// #if defined(ARDUINO_ARCH_ESP32)
|
||||
// #include "SPIFFS.h"
|
||||
// #endif
|
||||
// #include <FS.h> // Include the SPIFFS library
|
||||
#include "hasp_filesystem.h"
|
||||
// #if defined(ARDUINO_ARCH_ESP32)
|
||||
// #include "SPIFFS.h"
|
||||
// #endif
|
||||
// #include <FS.h> // Include the SPIFFS library
|
||||
#include "hasp_filesystem.h"
|
||||
#endif
|
||||
|
||||
#if HASP_USE_LITTLEFS > 0
|
||||
// #if defined(ARDUINO_ARCH_ESP32)
|
||||
// #include "LITTLEFS.h"
|
||||
// #elif defined(ARDUINO_ARCH_ESP8266)
|
||||
// #include <FS.h> // Include the FS library
|
||||
// #include <LittleFS.h>
|
||||
// #endif
|
||||
#include "hasp_filesystem.h"
|
||||
// #if defined(ARDUINO_ARCH_ESP32)
|
||||
// #include "LITTLEFS.h"
|
||||
// #elif defined(ARDUINO_ARCH_ESP8266)
|
||||
// #include <FS.h> // Include the FS library
|
||||
// #include <LittleFS.h>
|
||||
// #endif
|
||||
#include "hasp_filesystem.h"
|
||||
#endif
|
||||
|
||||
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
|
||||
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
|
||||
// #include "lv_zifont.h"
|
||||
#endif
|
||||
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
|
||||
#include "lv_zifont.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HASP_USE_EEPROM > 0
|
||||
#include "hasp_eeprom.h"
|
||||
#include "hasp_eeprom.h"
|
||||
#endif
|
||||
|
||||
#if HASP_USE_WIFI > 0
|
||||
#include "sys/net/hasp_wifi.h"
|
||||
#include "net/hasp_wifi.h"
|
||||
|
||||
#if defined(STM32F4xx)
|
||||
#include "WiFiSpi.h"
|
||||
#if defined(STM32F4xx)
|
||||
#include "WiFiSpi.h"
|
||||
static WiFiSpiClass WiFi;
|
||||
#endif
|
||||
#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
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#include <ETH.h>
|
||||
|
||||
#else
|
||||
#define ETH_ADDR 0
|
||||
#define ETH_POWER_PIN -1
|
||||
#define ETH_MDC_PIN 23
|
||||
#define ETH_MDIO_PIN 18
|
||||
#define NRST 5
|
||||
#define ETH_TYPE ETH_PHY_LAN8720
|
||||
#define ETH_CLKMODE ETH_CLOCK_GPIO17_OUT
|
||||
#include <ETH.h>
|
||||
#warning Using ESP32 Ethernet LAN8720
|
||||
#define HASP_ETHERNET ETH
|
||||
#endif // HASP_USE_ETHSPI
|
||||
#define ETH_ADDR 0
|
||||
#define ETH_POWER_PIN -1
|
||||
#define ETH_MDC_PIN 23
|
||||
#define ETH_MDIO_PIN 18
|
||||
#define NRST 5
|
||||
#define ETH_TYPE ETH_PHY_LAN8720
|
||||
#define ETH_CLKMODE ETH_CLOCK_GPIO17_OUT
|
||||
|
||||
#else
|
||||
#if USE_BUILTIN_ETHERNET > 0
|
||||
#include <LwIP.h>
|
||||
#include <STM32Ethernet.h>
|
||||
#warning Use built-in STM32 Ethernet
|
||||
#elif USE_UIP_ETHERNET
|
||||
#include <UIPEthernet.h>
|
||||
#include <utility/logging.h>
|
||||
#warning Use ENC28J60 Ethernet shield
|
||||
#else
|
||||
#include "Ethernet.h"
|
||||
#warning Use W5x00 Ethernet shield
|
||||
#endif
|
||||
#include "sys/net/hasp_ethernet_stm32.h"
|
||||
#endif
|
||||
#include "net/hasp_ethernet_esp32.h"
|
||||
#warning Using ESP32 Ethernet LAN8720
|
||||
|
||||
#else
|
||||
#if USE_BUILTIN_ETHERNET > 0
|
||||
#include <LwIP.h>
|
||||
#include <STM32Ethernet.h>
|
||||
#warning Use built-in STM32 Ethernet
|
||||
#elif USE_UIP_ETHERNET
|
||||
#include <UIPEthernet.h>
|
||||
#include <utility/logging.h>
|
||||
#warning Use ENC28J60 Ethernet shield
|
||||
#else
|
||||
#include "Ethernet.h"
|
||||
#warning Use W5x00 Ethernet shield
|
||||
#endif
|
||||
#include "net/hasp_ethernet_stm32.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HASP_USE_MQTT > 0
|
||||
#include "mqtt/hasp_mqtt.h"
|
||||
|
||||
#if HASP_TARGET_PC
|
||||
#define HASP_USE_PAHO
|
||||
#else
|
||||
#define HASP_USE_ESP_MQTT
|
||||
//#define HASP_USE_PUBSUBCLIENT
|
||||
#endif
|
||||
|
||||
#include "svc/hasp_mqtt.h"
|
||||
#endif
|
||||
|
||||
#if HASP_USE_GPIO > 0
|
||||
#include "sys/gpio/hasp_gpio.h"
|
||||
#include "hasp_gpio.h"
|
||||
#endif
|
||||
|
||||
#if HASP_USE_HTTP > 0
|
||||
#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"
|
||||
#include "svc/hasp_http.h"
|
||||
#endif
|
||||
|
||||
#if HASP_USE_TELNET > 0
|
||||
#include "sys/svc/hasp_telnet.h"
|
||||
#include "svc/hasp_telnet.h"
|
||||
#endif
|
||||
|
||||
#if HASP_USE_MDNS > 0
|
||||
#include "sys/svc/hasp_mdns.h"
|
||||
#include "svc/hasp_mdns.h"
|
||||
#endif
|
||||
|
||||
#if HASP_USE_ARDUINOOTA > 0 || HASP_USE_HTTP_UPDATE > 0
|
||||
#include "sys/svc/hasp_ota.h"
|
||||
#if HASP_USE_OTA > 0
|
||||
#include "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"
|
||||
#if HASP_USE_TASMOTA_SLAVE > 0
|
||||
#include "svc/hasp_slave.h"
|
||||
#endif
|
||||
|
||||
#if defined(WINDOWS)
|
||||
#include <Windows.h>
|
||||
#define delay Sleep
|
||||
#ifndef FPSTR
|
||||
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
|
||||
#endif
|
||||
|
||||
#if defined(POSIX)
|
||||
#ifdef USE_MONITOR
|
||||
#define delay SDL_Delay
|
||||
#else
|
||||
#define delay msleep
|
||||
#endif
|
||||
#ifndef PGM_P
|
||||
#define PGM_P const char *
|
||||
#endif
|
||||
|
||||
#if HASP_TARGET_PC
|
||||
#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
|
||||
#define BIN 2
|
||||
|
||||
#define guiGetDim() 255
|
||||
#define guiSetDim(x)
|
||||
#define guiGetBacklight() 1
|
||||
#define guiSetBacklight(x)
|
||||
//#define guiCalibrate()
|
||||
#endif
|
||||
|
||||
#endif // HASP_CONF_H
|
||||
#endif // HASP_CONF_H
|
@ -1,94 +1,65 @@
|
||||
/* 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)
|
||||
#if HASP_LOG_LEVEL > LOG_LEVEL_FATAL
|
||||
#define LOG_FATAL(...) \
|
||||
Log.fatal(__VA_ARGS__); \
|
||||
while(true) { \
|
||||
}
|
||||
#else
|
||||
#define HASP_RANDOM(x) random() % x
|
||||
#define LOG_FATAL(...) \
|
||||
do { \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
#if HASP_TARGET_PC
|
||||
#define LOG_OUTPUT(x, ...) printf(__VA_ARGS__)
|
||||
#if HASP_LOG_LEVEL > LOG_LEVEL_ALERT
|
||||
#define LOG_ALERT(...) Log.alert(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_ALERT(...)
|
||||
#endif
|
||||
|
||||
#ifndef HASP_LOG_LEVEL
|
||||
#define HASP_LOG_LEVEL LOG_LEVEL_TRACE
|
||||
#if HASP_LOG_LEVEL > LOG_LEVEL_CRITICAL
|
||||
#define LOG_CRITICAL(...) Log.critical(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_CRITICAL(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL > LOG_LEVEL_ERROR
|
||||
#define LOG_ERROR(...) Log.error(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_ERROR(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL > LOG_LEVEL_WARNING
|
||||
#define LOG_WARNING(...) Log.warning(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_WARNING(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL > LOG_LEVEL_INFO
|
||||
#define LOG_INFO(...) Log.notice(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_INFO(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL > LOG_LEVEL_TRACE
|
||||
#define LOG_TRACE(...) Log.trace(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_TRACE(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL > LOG_LEVEL_VERBOSE
|
||||
#define LOG_VERBOSE(...) Log.verbose(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_VERBOSE(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL > LOG_LEVEL_DEBUG
|
||||
#define LOG_DEBUG(...) Log.debug(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_DEBUG(...)
|
||||
#endif
|
||||
|
||||
#define LOG_OUTPUT(...) Log.output(...)
|
||||
|
||||
#if HASP_LOG_LEVEL >= LOG_LEVEL_FATAL
|
||||
#define LOG_FATAL(...) \
|
||||
Log.fatal(__VA_ARGS__); \
|
||||
while(true) { \
|
||||
}
|
||||
#else
|
||||
#define LOG_FATAL(...) \
|
||||
do { \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL >= LOG_LEVEL_ALERT
|
||||
#define LOG_ALERT(...) Log.alert(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_ALERT(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL >= LOG_LEVEL_CRITICAL
|
||||
#define LOG_CRITICAL(...) Log.critical(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_CRITICAL(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL >= LOG_LEVEL_ERROR
|
||||
#define LOG_ERROR(...) Log.error(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_ERROR(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL >= LOG_LEVEL_WARNING
|
||||
#define LOG_WARNING(...) Log.warning(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_WARNING(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL >= LOG_LEVEL_INFO
|
||||
#define LOG_INFO(...) Log.notice(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_INFO(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL >= LOG_LEVEL_TRACE
|
||||
#define LOG_TRACE(...) Log.trace(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_TRACE(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL >= LOG_LEVEL_VERBOSE
|
||||
#define LOG_VERBOSE(...) Log.verbose(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_VERBOSE(...)
|
||||
#endif
|
||||
|
||||
#if HASP_LOG_LEVEL >= LOG_LEVEL_DEBUG
|
||||
#define LOG_DEBUG(...) Log.debug(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_DEBUG(...)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif // HASP_MACRO_H
|
||||
#endif
|
@ -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
|
42
include/lv_comp_conf.h
Normal file
42
include/lv_comp_conf.h
Normal file
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @file lv_comp_conf.h
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPY THIS FILE AS `lv_comp_conf.h` NEXT TO the `lvgl` FOLDER
|
||||
*/
|
||||
|
||||
#if 1 /*Set it to "1" to enable content*/
|
||||
|
||||
#ifndef LV_COMP_CONF_H
|
||||
#define LV_COMP_CONF_H
|
||||
|
||||
#define LV_USE_CALENDAR 1
|
||||
#define LV_USE_CALENDAR_HEADER_ARROW 1
|
||||
|
||||
#define LV_USE_COLORWHEEL 1
|
||||
|
||||
#define LV_USE_KEYBOARD 1
|
||||
|
||||
#define LV_USE_LED 1
|
||||
#define LV_LED_BRIGHT_MIN 0
|
||||
#define LV_LED_BRIGHT_MAX 255
|
||||
|
||||
#define LV_USE_LIST 1
|
||||
|
||||
#define LV_USE_MSGBOX 1
|
||||
|
||||
#define LV_USE_SPINBOX 1
|
||||
|
||||
#define LV_USE_SPINNER 1
|
||||
|
||||
#define LV_USE_TABVIEW 1
|
||||
|
||||
#define LV_USE_TILEVIEW 1
|
||||
|
||||
#define LV_USE_WIN 1
|
||||
|
||||
#endif /*LV_COMP_CONF_H*/
|
||||
|
||||
#endif /*End of "Content enable"*/
|
@ -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
|
||||
|
||||
|
@ -5,14 +5,12 @@
|
||||
|
||||
#if 1 /*Set it to "1" to enable content*/
|
||||
|
||||
#ifndef LV_CONF_H
|
||||
#define LV_CONF_H
|
||||
/* clang-format off */
|
||||
#ifndef LV_CONF_H
|
||||
#define LV_CONF_H
|
||||
/* clang-format off */
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "lv_symbol_mdi_def.h"
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
#define LV_HIGH_RESOURCE_MCU 0
|
||||
#endif
|
||||
@ -28,8 +26,6 @@
|
||||
/* Maximal horizontal and vertical resolution to support by the library.*/
|
||||
#define LV_HOR_RES_MAX (TFT_WIDTH)
|
||||
#define LV_VER_RES_MAX (TFT_HEIGHT)
|
||||
#define LV_HOR_RES (TFT_WIDTH)
|
||||
#define LV_VER_RES (TFT_HEIGHT)
|
||||
|
||||
/* Color depth:
|
||||
* - 1: 1 byte per pixel
|
||||
@ -59,7 +55,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 +72,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 +98,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 +120,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
|
||||
@ -167,7 +134,7 @@ typedef int16_t lv_coord_t;
|
||||
|
||||
/* Repeated trigger period in long press [ms]
|
||||
* Time between `LV_EVENT_LONG_PRESSED_REPEAT */
|
||||
#define LV_INDEV_DEF_LONG_PRESS_REP_TIME 200
|
||||
#define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100
|
||||
|
||||
|
||||
/* Gesture threshold in pixels */
|
||||
@ -211,27 +178,20 @@ 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 1
|
||||
#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
|
||||
#if defined(ARDUINO_ARCH_ESP32) // || defined(ARDUINO_ARCH_ESP8266)
|
||||
# define LV_FS_IF_PC 'S'
|
||||
# define LV_FS_IF_SPIFFS '\0' // internal esp Flash
|
||||
#else
|
||||
# define LV_FS_IF_PC 'L' // Local filesystem
|
||||
# define LV_FS_IF_POSIX '\0'
|
||||
//# define LV_FS_IF_SPIFFS '\0' // no internal esp Flash
|
||||
# define LV_FS_IF_PC '\0'
|
||||
# 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 +214,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 +226,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.
|
||||
@ -298,18 +251,12 @@ typedef void* lv_img_decoder_user_data_t;
|
||||
|
||||
/* 1: use a custom tick source.
|
||||
* It removes the need to manually update the tick with `lv_tick_inc`) */
|
||||
#ifdef ARDUINO
|
||||
|
||||
#define LV_TICK_CUSTOM 1
|
||||
#if LV_TICK_CUSTOM == 1
|
||||
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the sys time function*/
|
||||
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current systime in ms*/
|
||||
#endif /*LV_TICK_CUSTOM*/
|
||||
|
||||
#else
|
||||
#define LV_TICK_CUSTOM 0
|
||||
#endif
|
||||
|
||||
typedef void* lv_disp_drv_user_data_t; /*Type of user data in the display driver*/
|
||||
typedef void* lv_indev_drv_user_data_t; /*Type of user data in the input device driver*/
|
||||
|
||||
@ -380,266 +327,6 @@ 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
|
||||
|
||||
#ifndef HASP_FONT_1
|
||||
#define HASP_FONT_1 robotocondensed_regular_12_all
|
||||
#endif
|
||||
#ifndef HASP_FONT_2
|
||||
#define HASP_FONT_2 robotocondensed_regular_16_all
|
||||
#endif
|
||||
#ifndef HASP_FONT_3
|
||||
#define HASP_FONT_3 robotocondensed_regular_24_all
|
||||
#endif
|
||||
#ifndef HASP_FONT_4
|
||||
#define HASP_FONT_4 robotocondensed_regular_32_all
|
||||
#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
|
||||
#ifndef HASP_FONT_SIZE_3
|
||||
#define HASP_FONT_SIZE_3 24
|
||||
#endif
|
||||
#ifndef HASP_FONT_SIZE_4
|
||||
#define HASP_FONT_SIZE_4 32
|
||||
#endif
|
||||
|
||||
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
|
||||
* The symbols are available via `LV_SYMBOL_...` defines
|
||||
@ -715,62 +402,27 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
|
||||
/*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
|
||||
typedef void* lv_font_user_data_t;
|
||||
|
||||
// #define FONT_CONCAT2(a, b) a ## b
|
||||
// #define FONT_CONCAT(a, b) FONT_CONCAT2(a, b)
|
||||
// #define HASP_FONTNAME robotocondensed_regular_
|
||||
// #define HASP_FONTNAME_BASE FONT_CONCAT(HASP_FONTNAME, _)
|
||||
// #define HASP_CHARACTER_SET latin1
|
||||
|
||||
// /* Concatenate the fontname macros */
|
||||
// #define HASP_FONT_1_size FONT_CONCAT(HASP_FONTNAME, 12)
|
||||
// #define HASP_FONT_1_base FONT_CONCAT(HASP_FONT_1_size, _)
|
||||
// #define HASP_FONT_1 FONT_CONCAT(HASP_FONT_1_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_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) \
|
||||
#define LV_FONT_CUSTOM_12 LV_FONT_DECLARE(robotocondensed_regular_12_nokern)
|
||||
#define LV_FONT_CUSTOM_16 LV_FONT_DECLARE(robotocondensed_regular_16_nokern)
|
||||
#define LV_FONT_CUSTOM_22 LV_FONT_DECLARE(robotocondensed_regular_22_nokern)
|
||||
#define LV_FONT_CUSTOM_28 LV_FONT_DECLARE(robotocondensed_regular_28_nokern)
|
||||
|
||||
#ifndef LV_FONT_DEFAULT
|
||||
#define LV_FONT_DEFAULT &HASP_FONT_2 //&lv_font_montserrat_16
|
||||
#endif
|
||||
#define LV_FONT_CUSTOM_DECLARE LV_FONT_CUSTOM_12 \
|
||||
LV_FONT_CUSTOM_16 \
|
||||
LV_FONT_CUSTOM_22 \
|
||||
LV_FONT_CUSTOM_28 \
|
||||
|
||||
#define LV_FONT_DEFAULT &robotocondensed_regular_16_nokern //&lv_font_montserrat_16
|
||||
#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
|
||||
@ -779,21 +431,21 @@ typedef void* lv_font_user_data_t;
|
||||
/*Always enable at least on theme*/
|
||||
#define LV_USE_THEME_MATERIAL 1 /*A fast and impressive theme*/
|
||||
|
||||
#define LV_THEME_DEFAULT_INIT lv_theme_material_init // lv_theme_hasp_init // We init the theme ourselves
|
||||
#define LV_THEME_DEFAULT_INIT lv_theme_hasp_init // We init the theme ourselves
|
||||
#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
|
||||
#define LV_THEME_DEFAULT_FLAG 0 //LV_THEME_MATERIAL_FLAG_NONE
|
||||
#if LV_HIGH_RESOURCE_MCU
|
||||
#define LV_THEME_DEFAULT_FONT_SMALL &robotocondensed_regular_12_nokern //&lv_font_montserrat_12
|
||||
#define LV_THEME_DEFAULT_FONT_NORMAL &robotocondensed_regular_16_nokern //&lv_font_montserrat_16
|
||||
#define LV_THEME_DEFAULT_FONT_SUBTITLE &robotocondensed_regular_22_nokern //&lv_font_montserrat_22
|
||||
#define LV_THEME_DEFAULT_FONT_TITLE &robotocondensed_regular_28_nokern //&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 +495,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
|
||||
@ -857,14 +509,9 @@ 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 groupid:4;
|
||||
// uint8_t swipeid:4;
|
||||
void* ext;
|
||||
// char* action;
|
||||
uint8_t objid:8;
|
||||
uint8_t groupid:8;
|
||||
uint8_t id;
|
||||
} lv_obj_user_data_t;
|
||||
|
||||
/*1: enable `lv_obj_realaign()` based on `lv_obj_align()` parameters*/
|
||||
@ -901,7 +548,7 @@ typedef struct {
|
||||
#define LV_USE_BTNMATRIX 1
|
||||
|
||||
/*Calendar (dependencies: -)*/
|
||||
#define LV_USE_CALENDAR 0
|
||||
#define LV_USE_CALENDAR (LV_HIGH_RESOURCE_MCU)
|
||||
|
||||
/*Canvas (dependencies: lv_img)*/
|
||||
#define LV_USE_CANVAS 1
|
||||
@ -910,7 +557,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 +575,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 +585,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 +609,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 +624,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
|
||||
@ -1004,7 +637,7 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
/*Preload (dependencies: lv_arc, lv_anim)*/
|
||||
#define LV_USE_SPINNER 1
|
||||
#define LV_USE_SPINNER 0
|
||||
#if LV_USE_SPINNER != 0
|
||||
# define LV_SPINNER_DEF_ARC_LENGTH 60 /*[deg]*/
|
||||
# define LV_SPINNER_DEF_SPIN_TIME 1000 /*[ms]*/
|
||||
@ -1025,7 +658,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 +671,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 +684,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
|
||||
|
@ -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
|
||||
@ -584,12 +582,9 @@ typedef void * lv_font_user_data_t;
|
||||
*==================*/
|
||||
|
||||
typedef struct {
|
||||
uint8_t id:8;
|
||||
uint8_t objid:8;
|
||||
uint8_t transitionid:4;
|
||||
uint8_t actionid:4;
|
||||
uint8_t groupid:4;
|
||||
uint8_t swipeid:4;
|
||||
uint8_t groupid:8;
|
||||
uint8_t id;
|
||||
} lv_obj_user_data_t;
|
||||
|
||||
#if LV_USE_USER_DATA
|
||||
@ -694,7 +689,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
|
||||
|
@ -1,10 +1,6 @@
|
||||
/**
|
||||
* @file lv_drv_conf.h
|
||||
* Configuration file for v7.9.1
|
||||
*/
|
||||
|
||||
/*
|
||||
* COPY THIS FILE AS lv_drv_conf.h
|
||||
*
|
||||
*/
|
||||
|
||||
#if 1 /*Set it to "1" to enable the content*/
|
||||
@ -17,15 +13,9 @@
|
||||
/*********************
|
||||
* DELAY INTERFACE
|
||||
*********************/
|
||||
#ifdef ARDUINO
|
||||
#define LV_DRV_DELAY_INCLUDE <Arduino.h> /*Dummy include by default*/
|
||||
#define LV_DRV_DELAY_US(us) delayMicroseconds(ud) /*Delay the given number of microseconds*/
|
||||
#define LV_DRV_DELAY_MS(ms) delay(ms) /*Delay the given number of milliseconds*/
|
||||
#else
|
||||
#define LV_DRV_DELAY_INCLUDE <stdint.h> /*Dummy include by default*/
|
||||
#define LV_DRV_DELAY_US(us) /*delay_us(us)*/ /*Delay the given number of microseconds*/
|
||||
#define LV_DRV_DELAY_MS(ms) /*delay_ms(ms)*/ /*Delay the given number of milliseconds*/
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* DISPLAY INTERFACE
|
||||
@ -103,9 +93,7 @@
|
||||
#define MONITOR_VER_RES LV_VER_RES
|
||||
|
||||
/* Scale window by this factor (useful when simulating small screens) */
|
||||
#ifndef MONITOR_ZOOM
|
||||
#define MONITOR_ZOOM 1
|
||||
#endif
|
||||
|
||||
/* Used to test true double buffering with only address changing.
|
||||
* Set LV_VDB_SIZE = (LV_HOR_RES * LV_VER_RES) and LV_VDB_DOUBLE = 1 and LV_COLOR_DEPTH = 32" */
|
||||
@ -114,6 +102,9 @@
|
||||
/*Eclipse: <SDL2/SDL.h> Visual Studio: <SDL.h>*/
|
||||
#define MONITOR_SDL_INCLUDE_PATH <SDL2/SDL.h>
|
||||
|
||||
/*Different rendering might be used if running in a Virtual machine*/
|
||||
#define MONITOR_VIRTUAL_MACHINE 0
|
||||
|
||||
/*Open two windows to test multi display support*/
|
||||
#define MONITOR_DUAL 0
|
||||
#endif
|
||||
@ -125,22 +116,12 @@
|
||||
#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
|
||||
|
||||
/*----------------------------------------
|
||||
* GTK drivers (monitor, mouse, keyboard
|
||||
*---------------------------------------*/
|
||||
#ifndef USE_GTK
|
||||
#define USE_GTK 0
|
||||
#endif
|
||||
|
||||
/*----------------
|
||||
* SSD1963
|
||||
*--------------*/
|
||||
@ -200,17 +181,6 @@
|
||||
/*No settings*/
|
||||
#endif /*USE_ST7565*/
|
||||
|
||||
/*------------------------------
|
||||
* GC9A01 (color, low res.)
|
||||
*-----------------------------*/
|
||||
#ifndef USE_GC9A01
|
||||
#define USE_GC9A01 0
|
||||
#endif
|
||||
|
||||
#if USE_GC9A01
|
||||
/*No settings*/
|
||||
#endif /*USE_GC9A01*/
|
||||
|
||||
/*------------------------------------------
|
||||
* UC1610 (4 gray 160*[104|128])
|
||||
* (EA DOGXL160 160x104 tested)
|
||||
@ -248,20 +218,6 @@
|
||||
b) /*((uint8_t) __REV(__RBIT(b)))*/ /*Architecture / compiler dependent byte bits order reverse*/
|
||||
#endif /*USE_SHARP_MIP*/
|
||||
|
||||
/*-------------------------------------------------
|
||||
* ILI9341 240X320 TFT LCD
|
||||
*------------------------------------------------*/
|
||||
#ifndef USE_ILI9341
|
||||
#define USE_ILI9341 0
|
||||
#endif
|
||||
|
||||
#if USE_ILI9341
|
||||
#define ILI9341_HOR_RES LV_HOR_RES
|
||||
#define ILI9341_VER_RES LV_VER_RES
|
||||
#define ILI9341_GAMMA 1
|
||||
#define ILI9341_TEARING 0
|
||||
#endif /*USE_ILI9341*/
|
||||
|
||||
/*-----------------------------------------
|
||||
* Linux frame buffer device (/dev/fbx)
|
||||
*-----------------------------------------*/
|
||||
@ -284,18 +240,6 @@
|
||||
#define FBDEV_PATH "/dev/fb0"
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------
|
||||
* DRM/KMS device (/dev/dri/cardX)
|
||||
*-----------------------------------------*/
|
||||
#ifndef USE_DRM
|
||||
#define USE_DRM 0
|
||||
#endif
|
||||
|
||||
#if USE_DRM
|
||||
#define DRM_CARD "/dev/dri/card0"
|
||||
#define DRM_CONNECTOR_ID -1 /* -1 for the first connected one */
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INPUT DEVICES
|
||||
*********************/
|
||||
@ -386,25 +330,25 @@
|
||||
#define USE_EVDEV 0
|
||||
#endif
|
||||
|
||||
#ifndef USE_BSD_EVDEV
|
||||
#define USE_BSD_EVDEV 0
|
||||
#endif
|
||||
#if USE_EVDEV
|
||||
#define EVDEV_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test \
|
||||
them*/
|
||||
#define EVDEV_SWAP_AXES 0 /*Swap the x and y axes of the touchscreen*/
|
||||
|
||||
#if USE_EVDEV || USE_BSD_EVDEV
|
||||
#define EVDEV_NAME \
|
||||
"/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test \
|
||||
them*/
|
||||
#define EVDEV_SWAP_AXES 0 /*Swap the x and y axes of the touchscreen*/
|
||||
#define EVDEV_SCALE 0 /* Scale input, e.g. if touchscreen resolution does not match display resolution */
|
||||
#if EVDEV_SCALE
|
||||
#define EVDEV_SCALE_HOR_RES (4096) /* Horizontal resolution of touchscreen */
|
||||
#define EVDEV_SCALE_VER_RES (4096) /* Vertical resolution of touchscreen */
|
||||
#endif /*EVDEV_SCALE*/
|
||||
|
||||
#define EVDEV_CALIBRATE \
|
||||
0 /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/
|
||||
|
||||
#if EVDEV_CALIBRATE
|
||||
#define EVDEV_HOR_MIN 0 /*to invert axis swap EVDEV_XXX_MIN by EVDEV_XXX_MAX*/
|
||||
#define EVDEV_HOR_MAX 4096 /*"evtest" Linux tool can help to get the correct calibraion values>*/
|
||||
#define EVDEV_VER_MIN 0
|
||||
#define EVDEV_VER_MAX 4096
|
||||
#endif /*EVDEV_CALIBRATE*/
|
||||
#define EVDEV_HOR_MIN 3800 /*If EVDEV_XXX_MIN > EVDEV_XXX_MAX the XXX axis is automatically inverted*/
|
||||
#define EVDEV_HOR_MAX 200
|
||||
#define EVDEV_VER_MIN 200
|
||||
#define EVDEV_VER_MAX 3800
|
||||
#endif /*EVDEV_SCALE*/
|
||||
#endif /*USE_EVDEV*/
|
||||
|
||||
/*-------------------------------
|
||||
|
@ -1,43 +0,0 @@
|
||||
/* 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 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------
|
||||
* Symbols from Material Design Icons font
|
||||
*--------------------------------------*/
|
||||
|
||||
#define LV_SYMBOL_DOWN "\xEE\x85\x80" /* 0xE140, chevron-down */
|
||||
#define LV_SYMBOL_LEFT "\xEE\x85\x81" /* 0xE141, chevron-left */
|
||||
#define LV_SYMBOL_RIGHT "\xEE\x85\x82" /* 0xE142, chevron-right */
|
||||
#define LV_SYMBOL_OK "\xEE\x84\xAC" /* 0xE12C, check */
|
||||
#define LV_SYMBOL_EYE_OPEN "\xEE\xBF\x86" /* 0xEFC6, lock-open-variant */
|
||||
#define LV_SYMBOL_EYE_CLOSE "\xEE\x8C\xBE" /* 0xE33E, lock*/
|
||||
#define LV_SYMBOL_WIFI "\xEE\x96\xA9" /* 0xE5A9, wifi */
|
||||
#define LV_SYMBOL_KEY "\xEE\x8C\x8B" /* 0xE30B, key-variant */
|
||||
#define LV_SYMBOL_CLOSE "\xEE\x85\x96" /* 0xE156, close */
|
||||
#define LV_SYMBOL_NEW_LINE "\xEE\x98\x8C" /* 0xE60C, subdirectory-arrow-left */
|
||||
#define LV_SYMBOL_BACKSPACE "\xEE\x81\x8D" /* 0xE04D, arrow-left */
|
||||
|
||||
/** Invalid symbol at (U+F8FF). If written before a string then `lv_img` will show it as a label*/
|
||||
#define LV_SYMBOL_DUMMY "\xEF\xA3\xBF"
|
||||
|
||||
/*-------------------------------
|
||||
* Symbols from "normal" font
|
||||
*-----------------------------*/
|
||||
#define LV_SYMBOL_BULLET "\xE2\x80\xA2" /* 20042, 0x2022 */
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /*LV_SYMBOL_MDI_DEF_H*/
|
@ -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"
|
||||
|
||||
|
@ -1,161 +0,0 @@
|
||||
/* MIT License - Copyright (c) 2019-2024 Francis Van Roie
|
||||
For full license information read the LICENSE file in the project folder */
|
||||
|
||||
/***************************************************
|
||||
// This file contains the default settings that are
|
||||
// burned into the compiled firmware.
|
||||
//
|
||||
// These default settings can be changed at runtime
|
||||
//
|
||||
// To use: Save a copy as user_config_override.h
|
||||
***************************************************/
|
||||
#ifndef HASP_USER_CONFIG_OVERRIDE_H
|
||||
#define HASP_USER_CONFIG_OVERRIDE_H
|
||||
|
||||
#define SERIAL_SPEED 115200
|
||||
|
||||
/***************************************************
|
||||
WiFi Settings
|
||||
**************************************************/
|
||||
#define WIFI_SSID ""
|
||||
#define WIFI_PASSWORD ""
|
||||
|
||||
/***************************************************
|
||||
Http Server Settings
|
||||
**************************************************/
|
||||
#define HTTP_USERNAME ""
|
||||
#define HTTP_PASSWORD ""
|
||||
|
||||
/***************************************************
|
||||
MQTT Client Settings
|
||||
**************************************************/
|
||||
#define MQTT_HOSTNAME ""
|
||||
#define MQTT_PORT 1883
|
||||
#define MQTT_USERNAME ""
|
||||
#define MQTT_PASSWORD ""
|
||||
#define MQTT_PREFIX "hasp"
|
||||
#define MQTT_NODENAME "plate01"
|
||||
#define MQTT_GROUPNAME "plates"
|
||||
|
||||
#define MQTT_TELEPERIOD 60000
|
||||
#define MQTT_STATEPERIOD 300000
|
||||
|
||||
/***************************************************
|
||||
* OTA Settings
|
||||
**************************************************/
|
||||
//#define HASP_USE_ARDUINOOTA 1 // Enable the Arduino OTA service
|
||||
#define ARDUINOOTA_PORT 3232
|
||||
#define ARDUINOOTA_PASSWORD ""
|
||||
#define OTA_URL ""
|
||||
|
||||
/***************************************************
|
||||
* Syslog Settings
|
||||
**************************************************/
|
||||
#define HASP_USE_SYSLOG 0
|
||||
#define SYSLOG_SERVER ""
|
||||
#define SYSLOG_PORT 514
|
||||
#define APP_NAME "HASP"
|
||||
|
||||
/***************************************************
|
||||
* 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
|
||||
|
||||
/***************************************************
|
||||
* 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 nl_NL // Dutch
|
||||
// #define HASP_LANGUAGE pt_BR // Brazilian Portuguese
|
||||
// #define HASP_LANGUAGE pt_PT // Portuguese
|
||||
// #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
|
||||
|
||||
/*
|
||||
// Dark theme
|
||||
#define D_HTTP_COLOR_TEXT "#eaeaea" // Global text color - Very light gray
|
||||
#define D_HTTP_COLOR_BACKGROUND "#252525" // Global background color - Very dark gray (mostly black)
|
||||
#define D_HTTP_COLOR_INPUT_TEXT "#000" // Input text color - Black
|
||||
#define D_HTTP_COLOR_INPUT "#ddd" // Input background color - Very light gray
|
||||
#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
|
||||
|
||||
#endif // HASP_USER_CONFIG_OVERRIDE_H
|
602
lib/AXP192/AXP192.cpp
Normal file
602
lib/AXP192/AXP192.cpp
Normal file
@ -0,0 +1,602 @@
|
||||
#include "AXP192.h"
|
||||
|
||||
AXP192::AXP192()
|
||||
{
|
||||
}
|
||||
|
||||
void AXP192::begin(void)
|
||||
{
|
||||
|
||||
Wire1.begin(21, 22);
|
||||
Wire1.setClock(400000);
|
||||
|
||||
//AXP192 30H
|
||||
Write1Byte(0x30, (Read8bit(0x30) & 0x04) | 0X02);
|
||||
Serial.printf("axp: vbus limit off\n");
|
||||
|
||||
//AXP192 GPIO1:OD OUTPUT
|
||||
Write1Byte(0x92, Read8bit(0x92) & 0xf8);
|
||||
Serial.printf("axp: gpio1 init\n");
|
||||
|
||||
//AXP192 GPIO2:OD OUTPUT
|
||||
Write1Byte(0x93, Read8bit(0x93) & 0xf8);
|
||||
Serial.printf("axp: gpio2 init\n");
|
||||
|
||||
//AXP192 RTC CHG
|
||||
Write1Byte(0x35, (Read8bit(0x35) & 0x1c) | 0xa2);
|
||||
Serial.printf("axp: rtc battery charging enabled\n");
|
||||
|
||||
SetESPVoltage(3350);
|
||||
Serial.printf("axp: esp32 power voltage was set to 3.35v\n");
|
||||
|
||||
SetLcdVoltage(2800);
|
||||
Serial.printf("axp: lcd backlight voltage was set to 2.80v\n");
|
||||
|
||||
SetLDOVoltage(2, 3300); //Periph power voltage preset (LCD_logic, SD card)
|
||||
Serial.printf("axp: lcd logic and sdcard voltage preset to 3.3v\n");
|
||||
|
||||
SetLDOVoltage(3, 2000); //Vibrator power voltage preset
|
||||
Serial.printf("axp: vibrator voltage preset to 2v\n");
|
||||
|
||||
SetLDOEnable(2, true);
|
||||
SetDCDC3(true); // LCD backlight
|
||||
SetLed(true);
|
||||
|
||||
SetCHGCurrent(kCHG_100mA);
|
||||
//SetAxpPriphPower(1);
|
||||
//Serial.printf("axp: lcd_logic and sdcard power enabled\n\n");
|
||||
|
||||
//pinMode(39, INPUT_PULLUP);
|
||||
|
||||
//AXP192 GPIO4
|
||||
Write1Byte(0X95, (Read8bit(0x95) & 0x72) | 0X84);
|
||||
|
||||
Write1Byte(0X36, 0X4C);
|
||||
|
||||
Write1Byte(0x82,0xff);
|
||||
|
||||
SetLCDRSet(0);
|
||||
delay(100);
|
||||
SetLCDRSet(1);
|
||||
delay(100);
|
||||
// I2C_WriteByteDataAt(0X15,0XFE,0XFF);
|
||||
|
||||
// bus power mode_output
|
||||
SetBusPowerMode(0);
|
||||
}
|
||||
|
||||
void AXP192::Write1Byte(uint8_t Addr, uint8_t Data)
|
||||
{
|
||||
Wire1.beginTransmission(0x34);
|
||||
Wire1.write(Addr);
|
||||
Wire1.write(Data);
|
||||
Wire1.endTransmission();
|
||||
}
|
||||
|
||||
uint8_t AXP192::Read8bit(uint8_t Addr)
|
||||
{
|
||||
Wire1.beginTransmission(0x34);
|
||||
Wire1.write(Addr);
|
||||
Wire1.endTransmission();
|
||||
Wire1.requestFrom(0x34, 1);
|
||||
return Wire1.read();
|
||||
}
|
||||
|
||||
uint16_t AXP192::Read12Bit(uint8_t Addr)
|
||||
{
|
||||
uint16_t Data = 0;
|
||||
uint8_t buf[2];
|
||||
ReadBuff(Addr, 2, buf);
|
||||
Data = ((buf[0] << 4) + buf[1]); //
|
||||
return Data;
|
||||
}
|
||||
|
||||
uint16_t AXP192::Read13Bit(uint8_t Addr)
|
||||
{
|
||||
uint16_t Data = 0;
|
||||
uint8_t buf[2];
|
||||
ReadBuff(Addr, 2, buf);
|
||||
Data = ((buf[0] << 5) + buf[1]); //
|
||||
return Data;
|
||||
}
|
||||
|
||||
uint16_t AXP192::Read16bit(uint8_t Addr)
|
||||
{
|
||||
uint16_t ReData = 0;
|
||||
Wire1.beginTransmission(0x34);
|
||||
Wire1.write(Addr);
|
||||
Wire1.endTransmission();
|
||||
Wire1.requestFrom(0x34, 2);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
ReData <<= 8;
|
||||
ReData |= Wire1.read();
|
||||
}
|
||||
return ReData;
|
||||
}
|
||||
|
||||
uint32_t AXP192::Read24bit(uint8_t Addr)
|
||||
{
|
||||
uint32_t ReData = 0;
|
||||
Wire1.beginTransmission(0x34);
|
||||
Wire1.write(Addr);
|
||||
Wire1.endTransmission();
|
||||
Wire1.requestFrom(0x34, 3);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
ReData <<= 8;
|
||||
ReData |= Wire1.read();
|
||||
}
|
||||
return ReData;
|
||||
}
|
||||
|
||||
uint32_t AXP192::Read32bit(uint8_t Addr)
|
||||
{
|
||||
uint32_t ReData = 0;
|
||||
Wire1.beginTransmission(0x34);
|
||||
Wire1.write(Addr);
|
||||
Wire1.endTransmission();
|
||||
Wire1.requestFrom(0x34, 2);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
ReData <<= 8;
|
||||
ReData |= Wire1.read();
|
||||
}
|
||||
return ReData;
|
||||
}
|
||||
|
||||
void AXP192::ReadBuff(uint8_t Addr, uint8_t Size, uint8_t *Buff)
|
||||
{
|
||||
Wire1.beginTransmission(0x34);
|
||||
Wire1.write(Addr);
|
||||
Wire1.endTransmission();
|
||||
Wire1.requestFrom(0x34, (int)Size);
|
||||
for (int i = 0; i < Size; i++)
|
||||
{
|
||||
*(Buff + i) = Wire1.read();
|
||||
}
|
||||
}
|
||||
|
||||
void AXP192::ScreenBreath(uint8_t brightness)
|
||||
{
|
||||
if (brightness > 12)
|
||||
{
|
||||
brightness = 12;
|
||||
}
|
||||
uint8_t buf = Read8bit(0x28);
|
||||
Write1Byte(0x28, ((buf & 0x0f) | (brightness << 4)));
|
||||
}
|
||||
|
||||
bool AXP192::GetBatState()
|
||||
{
|
||||
if (Read8bit(0x01) | 0x20)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
//---------coulombcounter_from_here---------
|
||||
//enable: void EnableCoulombcounter(void);
|
||||
//disable: void DisableCOulombcounter(void);
|
||||
//stop: void StopCoulombcounter(void);
|
||||
//clear: void ClearCoulombcounter(void);
|
||||
//get charge data: uint32_t GetCoulombchargeData(void);
|
||||
//get discharge data: uint32_t GetCoulombdischargeData(void);
|
||||
//get coulomb val affter calculation: float GetCoulombData(void);
|
||||
//------------------------------------------
|
||||
void AXP192::EnableCoulombcounter(void)
|
||||
{
|
||||
Write1Byte(0xB8, 0x80);
|
||||
}
|
||||
|
||||
void AXP192::DisableCoulombcounter(void)
|
||||
{
|
||||
Write1Byte(0xB8, 0x00);
|
||||
}
|
||||
|
||||
void AXP192::StopCoulombcounter(void)
|
||||
{
|
||||
Write1Byte(0xB8, 0xC0);
|
||||
}
|
||||
|
||||
void AXP192::ClearCoulombcounter(void)
|
||||
{
|
||||
Write1Byte(0xB8, 0xA0);
|
||||
}
|
||||
|
||||
uint32_t AXP192::GetCoulombchargeData(void)
|
||||
{
|
||||
return Read32bit(0xB0);
|
||||
}
|
||||
|
||||
uint32_t AXP192::GetCoulombdischargeData(void)
|
||||
{
|
||||
return Read32bit(0xB4);
|
||||
}
|
||||
|
||||
float AXP192::GetCoulombData(void)
|
||||
{
|
||||
|
||||
uint32_t coin = 0;
|
||||
uint32_t coout = 0;
|
||||
|
||||
coin = GetCoulombchargeData();
|
||||
coout = GetCoulombdischargeData();
|
||||
|
||||
//c = 65536 * current_LSB * (coin - coout) / 3600 / ADC rate
|
||||
//Adc rate can be read from 84H ,change this variable if you change the ADC reate
|
||||
float ccc = 65536 * 0.5 * (coin - coout) / 3600.0 / 25.0;
|
||||
return ccc;
|
||||
}
|
||||
|
||||
// Cut all power, except for LDO1 (RTC)
|
||||
void AXP192::PowerOff(void)
|
||||
{
|
||||
Write1Byte(0x32, Read8bit(0x32) | 0b10000000);
|
||||
}
|
||||
|
||||
void AXP192::SetAdcState(bool state)
|
||||
{
|
||||
// Enable / Disable all ADCs
|
||||
Write1Byte(0x82, state ? 0xff : 0x00);
|
||||
}
|
||||
|
||||
void AXP192::PrepareToSleep(void)
|
||||
{
|
||||
// Disable ADCs
|
||||
SetAdcState(false);
|
||||
|
||||
// Turn LED off
|
||||
SetLed(false);
|
||||
|
||||
// Turn LCD backlight off
|
||||
SetDCDC3(false);
|
||||
}
|
||||
|
||||
void AXP192::RestoreFromLightSleep(void)
|
||||
{
|
||||
// Turn LCD backlight on
|
||||
SetDCDC3(true);
|
||||
|
||||
// Turn LED on
|
||||
SetLed(true);
|
||||
|
||||
// Enable ADCs
|
||||
SetAdcState(true);
|
||||
}
|
||||
|
||||
uint8_t AXP192::GetWarningLeve(void)
|
||||
{
|
||||
Wire1.beginTransmission(0x34);
|
||||
Wire1.write(0x47);
|
||||
Wire1.endTransmission();
|
||||
Wire1.requestFrom(0x34, 1);
|
||||
uint8_t buf = Wire1.read();
|
||||
return (buf & 0x01);
|
||||
}
|
||||
|
||||
// -- sleep
|
||||
void AXP192::DeepSleep(uint64_t time_in_us)
|
||||
{
|
||||
PrepareToSleep();
|
||||
|
||||
if (time_in_us > 0)
|
||||
{
|
||||
esp_sleep_enable_timer_wakeup(time_in_us);
|
||||
}
|
||||
else
|
||||
{
|
||||
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER);
|
||||
}
|
||||
(time_in_us == 0) ? esp_deep_sleep_start() : esp_deep_sleep(time_in_us);
|
||||
|
||||
// Never reached - after deep sleep ESP32 restarts
|
||||
}
|
||||
|
||||
void AXP192::LightSleep(uint64_t time_in_us)
|
||||
{
|
||||
PrepareToSleep();
|
||||
|
||||
if (time_in_us > 0)
|
||||
{
|
||||
esp_sleep_enable_timer_wakeup(time_in_us);
|
||||
}
|
||||
else
|
||||
{
|
||||
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER);
|
||||
}
|
||||
esp_light_sleep_start();
|
||||
|
||||
RestoreFromLightSleep();
|
||||
}
|
||||
|
||||
uint8_t AXP192::GetWarningLevel(void)
|
||||
{
|
||||
return Read8bit(0x47) & 0x01;
|
||||
}
|
||||
|
||||
float AXP192::GetBatVoltage()
|
||||
{
|
||||
float ADCLSB = 1.1 / 1000.0;
|
||||
uint16_t ReData = Read12Bit(0x78);
|
||||
return ReData * ADCLSB;
|
||||
}
|
||||
|
||||
float AXP192::GetBatCurrent()
|
||||
{
|
||||
float ADCLSB = 0.5;
|
||||
uint16_t CurrentIn = Read13Bit(0x7A);
|
||||
uint16_t CurrentOut = Read13Bit(0x7C);
|
||||
return (CurrentIn - CurrentOut) * ADCLSB;
|
||||
}
|
||||
|
||||
float AXP192::GetVinVoltage()
|
||||
{
|
||||
float ADCLSB = 1.7 / 1000.0;
|
||||
uint16_t ReData = Read12Bit(0x56);
|
||||
return ReData * ADCLSB;
|
||||
}
|
||||
|
||||
float AXP192::GetVinCurrent()
|
||||
{
|
||||
float ADCLSB = 0.625;
|
||||
uint16_t ReData = Read12Bit(0x58);
|
||||
return ReData * ADCLSB;
|
||||
}
|
||||
|
||||
float AXP192::GetVBusVoltage()
|
||||
{
|
||||
float ADCLSB = 1.7 / 1000.0;
|
||||
uint16_t ReData = Read12Bit(0x5A);
|
||||
return ReData * ADCLSB;
|
||||
}
|
||||
|
||||
float AXP192::GetVBusCurrent()
|
||||
{
|
||||
float ADCLSB = 0.375;
|
||||
uint16_t ReData = Read12Bit(0x5C);
|
||||
return ReData * ADCLSB;
|
||||
}
|
||||
|
||||
float AXP192::GetTempInAXP192()
|
||||
{
|
||||
float ADCLSB = 0.1;
|
||||
const float OFFSET_DEG_C = -144.7;
|
||||
uint16_t ReData = Read12Bit(0x5E);
|
||||
return OFFSET_DEG_C + ReData * ADCLSB;
|
||||
}
|
||||
|
||||
float AXP192::GetBatPower()
|
||||
{
|
||||
float VoltageLSB = 1.1;
|
||||
float CurrentLCS = 0.5;
|
||||
uint32_t ReData = Read24bit(0x70);
|
||||
return VoltageLSB * CurrentLCS * ReData / 1000.0;
|
||||
}
|
||||
|
||||
float AXP192::GetBatChargeCurrent()
|
||||
{
|
||||
float ADCLSB = 0.5;
|
||||
uint16_t ReData = Read12Bit(0x7A);
|
||||
return ReData * ADCLSB;
|
||||
}
|
||||
float AXP192::GetAPSVoltage()
|
||||
{
|
||||
float ADCLSB = 1.4 / 1000.0;
|
||||
uint16_t ReData = Read12Bit(0x7E);
|
||||
return ReData * ADCLSB;
|
||||
}
|
||||
|
||||
float AXP192::GetBatCoulombInput()
|
||||
{
|
||||
uint32_t ReData = Read32bit(0xB0);
|
||||
return ReData * 65536 * 0.5 / 3600 / 25.0;
|
||||
}
|
||||
|
||||
float AXP192::GetBatCoulombOut()
|
||||
{
|
||||
uint32_t ReData = Read32bit(0xB4);
|
||||
return ReData * 65536 * 0.5 / 3600 / 25.0;
|
||||
}
|
||||
|
||||
void AXP192::SetCoulombClear()
|
||||
{
|
||||
Write1Byte(0xB8, 0x20);
|
||||
}
|
||||
|
||||
void AXP192::SetLDO2(bool State)
|
||||
{
|
||||
uint8_t buf = Read8bit(0x12);
|
||||
if (State == true)
|
||||
buf = (1 << 2) | buf;
|
||||
else
|
||||
buf = ~(1 << 2) & buf;
|
||||
Write1Byte(0x12, buf);
|
||||
}
|
||||
|
||||
void AXP192::SetDCDC3(bool State)
|
||||
{
|
||||
uint8_t buf = Read8bit(0x12);
|
||||
if (State == true)
|
||||
buf = (1 << 1) | buf;
|
||||
else
|
||||
buf = ~(1 << 1) & buf;
|
||||
Write1Byte(0x12, buf);
|
||||
}
|
||||
|
||||
uint8_t AXP192::AXPInState()
|
||||
{
|
||||
return Read8bit(0x00);
|
||||
}
|
||||
bool AXP192::isACIN()
|
||||
{
|
||||
return ( Read8bit(0x00) & 0x80 ) ? true : false;
|
||||
}
|
||||
bool AXP192::isCharging()
|
||||
{
|
||||
return ( Read8bit(0x00) & 0x04 ) ? true : false;
|
||||
}
|
||||
bool AXP192::isVBUS()
|
||||
{
|
||||
return ( Read8bit(0x00) & 0x20 ) ? true : false;
|
||||
}
|
||||
|
||||
void AXP192::SetLDOVoltage(uint8_t number, uint16_t voltage)
|
||||
{
|
||||
voltage = (voltage > 3300) ? 15 : (voltage / 100) - 18;
|
||||
switch (number)
|
||||
{
|
||||
//uint8_t reg, data;
|
||||
case 2:
|
||||
Write1Byte(0x28, (Read8bit(0x28) & 0X0F) | (voltage << 4));
|
||||
break;
|
||||
case 3:
|
||||
Write1Byte(0x28, (Read8bit(0x28) & 0XF0) | voltage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AXP192::SetDCVoltage(uint8_t number, uint16_t voltage)
|
||||
{
|
||||
uint8_t addr;
|
||||
if (number > 2)
|
||||
return;
|
||||
voltage = (voltage < 700) ? 0 : (voltage - 700) / 25;
|
||||
switch (number)
|
||||
{
|
||||
case 0:
|
||||
addr = 0x26;
|
||||
break;
|
||||
case 1:
|
||||
addr = 0x25;
|
||||
break;
|
||||
case 2:
|
||||
addr = 0x27;
|
||||
break;
|
||||
}
|
||||
Write1Byte(addr, (Read8bit(addr) & 0X80) | (voltage & 0X7F));
|
||||
}
|
||||
|
||||
void AXP192::SetESPVoltage(uint16_t voltage)
|
||||
{
|
||||
if (voltage >= 3000 && voltage <= 3400)
|
||||
{
|
||||
SetDCVoltage(0, voltage);
|
||||
}
|
||||
}
|
||||
void AXP192::SetLcdVoltage(uint16_t voltage)
|
||||
{
|
||||
if (voltage >= 2500 && voltage <= 3300)
|
||||
{
|
||||
SetDCVoltage(2, voltage);
|
||||
}
|
||||
}
|
||||
|
||||
void AXP192::SetLDOEnable(uint8_t number, bool state)
|
||||
{
|
||||
uint8_t mark = 0x01;
|
||||
if ((number < 2) || (number > 3))
|
||||
return;
|
||||
|
||||
mark <<= number;
|
||||
if (state)
|
||||
{
|
||||
Write1Byte(0x12, (Read8bit(0x12) | mark));
|
||||
}
|
||||
else
|
||||
{
|
||||
Write1Byte(0x12, (Read8bit(0x12) & (~mark)));
|
||||
}
|
||||
}
|
||||
|
||||
void AXP192::SetLCDRSet(bool state)
|
||||
{
|
||||
uint8_t reg_addr = 0x96;
|
||||
uint8_t gpio_bit = 0x02;
|
||||
uint8_t data;
|
||||
data = Read8bit(reg_addr);
|
||||
|
||||
if (state)
|
||||
{
|
||||
data |= gpio_bit;
|
||||
}
|
||||
else
|
||||
{
|
||||
data &= ~gpio_bit;
|
||||
}
|
||||
|
||||
Write1Byte(reg_addr, data);
|
||||
}
|
||||
|
||||
void AXP192::SetBusPowerMode(uint8_t state)
|
||||
{
|
||||
uint8_t data;
|
||||
if (state == 0)
|
||||
{
|
||||
data = Read8bit(0x91);
|
||||
Write1Byte(0x91, (data & 0X0F) | 0XF0);
|
||||
|
||||
data = Read8bit(0x90);
|
||||
Write1Byte(0x90, (data & 0XF8) | 0X02); //set GPIO0 to LDO OUTPUT , pullup N_VBUSEN to disable supply from BUS_5V
|
||||
|
||||
data = Read8bit(0x91);
|
||||
|
||||
data = Read8bit(0x12); //read reg 0x12
|
||||
Write1Byte(0x12, data | 0x40); //set EXTEN to enable 5v boost
|
||||
}
|
||||
else
|
||||
{
|
||||
data = Read8bit(0x12); //read reg 0x10
|
||||
Write1Byte(0x12, data & 0XBF); //set EXTEN to disable 5v boost
|
||||
|
||||
//delay(2000);
|
||||
|
||||
data = Read8bit(0x90);
|
||||
Write1Byte(0x90, (data & 0xF8) | 0X01); //set GPIO0 to float , using enternal pulldown resistor to enable supply from BUS_5VS
|
||||
}
|
||||
}
|
||||
|
||||
void AXP192::SetLed(uint8_t state)
|
||||
{
|
||||
uint8_t reg_addr=0x94;
|
||||
uint8_t data;
|
||||
data=Read8bit(reg_addr);
|
||||
|
||||
if(state)
|
||||
{
|
||||
data=data&0XFD;
|
||||
}
|
||||
else
|
||||
{
|
||||
data|=0X02;
|
||||
}
|
||||
|
||||
Write1Byte(reg_addr,data);
|
||||
}
|
||||
|
||||
//set led state(GPIO high active,set 1 to enable amplifier)
|
||||
void AXP192::SetSpkEnable(uint8_t state)
|
||||
{
|
||||
uint8_t reg_addr=0x94;
|
||||
uint8_t gpio_bit=0x04;
|
||||
uint8_t data;
|
||||
data=Read8bit(reg_addr);
|
||||
|
||||
if(state)
|
||||
{
|
||||
data|=gpio_bit;
|
||||
}
|
||||
else
|
||||
{
|
||||
data&=~gpio_bit;
|
||||
}
|
||||
|
||||
Write1Byte(reg_addr,data);
|
||||
}
|
||||
|
||||
void AXP192::SetCHGCurrent(uint8_t state)
|
||||
{
|
||||
uint8_t data = Read8bit(0x33);
|
||||
data &= 0xf0;
|
||||
data = data | ( state & 0x0f );
|
||||
Write1Byte(0x33,data);
|
||||
}
|
106
lib/AXP192/AXP192.h
Normal file
106
lib/AXP192/AXP192.h
Normal file
@ -0,0 +1,106 @@
|
||||
#ifndef __AXP192_H__
|
||||
#define __AXP192_H__
|
||||
|
||||
#include <Wire.h>
|
||||
#include <Arduino.h>
|
||||
|
||||
#define SLEEP_MSEC(us) (((uint64_t)us) * 1000L)
|
||||
#define SLEEP_SEC(us) (((uint64_t)us) * 1000000L)
|
||||
#define SLEEP_MIN(us) (((uint64_t)us) * 60L * 1000000L)
|
||||
#define SLEEP_HR(us) (((uint64_t)us) * 60L * 60L * 1000000L)
|
||||
|
||||
#define AXP_ADDR 0X34
|
||||
|
||||
#define PowerOff(x) SetSleep(x)
|
||||
|
||||
class AXP192 {
|
||||
public:
|
||||
|
||||
enum CHGCurrent{
|
||||
kCHG_100mA = 0,
|
||||
kCHG_190mA,
|
||||
kCHG_280mA,
|
||||
kCHG_360mA,
|
||||
kCHG_450mA,
|
||||
kCHG_550mA,
|
||||
kCHG_630mA,
|
||||
kCHG_700mA,
|
||||
kCHG_780mA,
|
||||
kCHG_880mA,
|
||||
kCHG_960mA,
|
||||
kCHG_1000mA,
|
||||
kCHG_1080mA,
|
||||
kCHG_1160mA,
|
||||
kCHG_1240mA,
|
||||
kCHG_1320mA,
|
||||
};
|
||||
|
||||
AXP192();
|
||||
void begin(void);
|
||||
void ScreenBreath(uint8_t brightness);
|
||||
bool GetBatState();
|
||||
|
||||
void EnableCoulombcounter(void);
|
||||
void DisableCoulombcounter(void);
|
||||
void StopCoulombcounter(void);
|
||||
void ClearCoulombcounter(void);
|
||||
uint32_t GetCoulombchargeData(void);
|
||||
uint32_t GetCoulombdischargeData(void);
|
||||
float GetCoulombData(void);
|
||||
void PowerOff(void);
|
||||
void SetAdcState(bool state);
|
||||
// -- sleep
|
||||
void PrepareToSleep(void);
|
||||
void RestoreFromLightSleep(void);
|
||||
void DeepSleep(uint64_t time_in_us = 0);
|
||||
void LightSleep(uint64_t time_in_us = 0);
|
||||
uint8_t GetWarningLeve(void);
|
||||
|
||||
public:
|
||||
// void SetChargeVoltage( uint8_t );
|
||||
// void SetChargeCurrent( uint8_t );
|
||||
float GetBatVoltage();
|
||||
float GetBatCurrent();
|
||||
float GetVinVoltage();
|
||||
float GetVinCurrent();
|
||||
float GetVBusVoltage();
|
||||
float GetVBusCurrent();
|
||||
float GetTempInAXP192();
|
||||
float GetBatPower();
|
||||
float GetBatChargeCurrent();
|
||||
float GetAPSVoltage();
|
||||
float GetBatCoulombInput();
|
||||
float GetBatCoulombOut();
|
||||
uint8_t GetWarningLevel(void);
|
||||
void SetCoulombClear();
|
||||
void SetLDO2( bool State );
|
||||
void SetDCDC3( bool State );
|
||||
|
||||
uint8_t AXPInState();
|
||||
bool isACIN();
|
||||
bool isCharging();
|
||||
bool isVBUS();
|
||||
|
||||
void SetLDOVoltage(uint8_t number , uint16_t voltage);
|
||||
void SetDCVoltage(uint8_t number , uint16_t voltage);
|
||||
void SetESPVoltage(uint16_t voltage);
|
||||
void SetLcdVoltage(uint16_t voltage);
|
||||
void SetLDOEnable( uint8_t number ,bool state );
|
||||
void SetLCDRSet( bool state );
|
||||
void SetBusPowerMode( uint8_t state );
|
||||
void SetLed(uint8_t state);
|
||||
void SetSpkEnable(uint8_t state);
|
||||
void SetCHGCurrent(uint8_t state);
|
||||
|
||||
private:
|
||||
void Write1Byte( uint8_t Addr , uint8_t Data );
|
||||
uint8_t Read8bit( uint8_t Addr );
|
||||
uint16_t Read12Bit( uint8_t Addr);
|
||||
uint16_t Read13Bit( uint8_t Addr);
|
||||
uint16_t Read16bit( uint8_t Addr );
|
||||
uint32_t Read24bit( uint8_t Addr );
|
||||
uint32_t Read32bit( uint8_t Addr );
|
||||
void ReadBuff( uint8_t Addr , uint8_t Size , uint8_t *Buff );
|
||||
};
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2015-2016 Cryptography Research, Inc.
|
||||
Copyright (c) 2020 M5Stack
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -9,13 +9,13 @@ 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 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.
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -29,87 +29,85 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef ARDUINO
|
||||
|
||||
#include "ArduinoLog.h"
|
||||
#include "ArduinoLog.h"
|
||||
|
||||
void Logging::begin(int level, bool showLevel)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
setLevel(0, level);
|
||||
setLevel(1, level);
|
||||
setLevel(2, level);
|
||||
setShowLevel(0, showLevel);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Logging::registerOutput(uint8_t slot, Print * logOutput, int level, bool showLevel)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
if(slot >= 3) return;
|
||||
setLevel(slot, level);
|
||||
setShowLevel(slot, showLevel);
|
||||
_logOutput[slot] = logOutput;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Logging::unregisterOutput(uint8_t slot)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
if(slot >= 3) return;
|
||||
_logOutput[slot] = NULL;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Logging::setLevel(uint8_t slot, int level)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
_level[slot] = constrain(level, LOG_LEVEL_SILENT, LOG_LEVEL_OUTPUT);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
int Logging::getLevel(uint8_t slot) const
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
return _level[slot];
|
||||
#else
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Logging::setShowLevel(uint8_t slot, bool showLevel)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
_showLevel[slot] = showLevel;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Logging::getShowLevel(uint8_t slot) const
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
return _showLevel[slot];
|
||||
#else
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Logging::setPrefix(printfunction f)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
_prefix = f;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Logging::setSuffix(printfunction f)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
_suffix = f;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Logging::print(Print * logOutput, const __FlashStringHelper * format, va_list args)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
PGM_P p = reinterpret_cast<PGM_P>(format);
|
||||
char c = pgm_read_byte(p++);
|
||||
for(; c != 0; c = pgm_read_byte(p++)) {
|
||||
@ -120,12 +118,12 @@ void Logging::print(Print * logOutput, const __FlashStringHelper * format, va_li
|
||||
logOutput->print(c);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Logging::print(Print * logOutput, const char * format, va_list args)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
for(; *format != 0; ++format) {
|
||||
if(*format == '%') {
|
||||
++format;
|
||||
@ -134,12 +132,12 @@ void Logging::print(Print * logOutput, const char * format, va_list args)
|
||||
logOutput->print(*format);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void Logging::printFormat(Print * logOutput, const char format, va_list * args)
|
||||
{
|
||||
#ifndef DISABLE_LOGGING
|
||||
#ifndef DISABLE_LOGGING
|
||||
if(format == '%') {
|
||||
logOutput->print(format);
|
||||
} else if(format == 's') {
|
||||
@ -181,9 +179,7 @@ void Logging::printFormat(Print * logOutput, const char format, va_list * args)
|
||||
logOutput->print(F("false"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
Logging Log = Logging();
|
||||
|
||||
#endif // ARDUINO
|
@ -17,12 +17,12 @@ 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"
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
//#include "StringStream.h"
|
||||
typedef void (*printfunction)(uint8_t tag, int level, Print*);
|
||||
typedef void (*printfunction)(uint8_t tag, int level, Print *);
|
||||
|
||||
//#include <stdint.h>
|
||||
//#include <stddef.h>
|
||||
@ -92,7 +92,7 @@ class Logging {
|
||||
*/
|
||||
Logging()
|
||||
#ifndef DISABLE_LOGGING
|
||||
// : _level(LOG_LEVEL_SILENT), _showLevel(true)
|
||||
// : _level(LOG_LEVEL_SILENT), _showLevel(true)
|
||||
#endif
|
||||
{}
|
||||
|
||||
@ -116,7 +116,7 @@ class Logging {
|
||||
* \return void
|
||||
*
|
||||
*/
|
||||
void registerOutput(uint8_t slot, Print* logOutput, int level, bool showLevel);
|
||||
void registerOutput(uint8_t slot, Print * logOutput, int level, bool showLevel);
|
||||
|
||||
/**
|
||||
* Unregister the printer in a certain slot
|
||||
@ -311,11 +311,11 @@ class Logging {
|
||||
}
|
||||
|
||||
private:
|
||||
void print(Print* logOutput, const char* format, va_list args);
|
||||
void print(Print * logOutput, const char * format, va_list args);
|
||||
|
||||
void print(Print* logOutput, const __FlashStringHelper* format, va_list args);
|
||||
void print(Print * logOutput, const __FlashStringHelper * format, va_list args);
|
||||
|
||||
void printFormat(Print* logOutput, const char format, va_list* args);
|
||||
void printFormat(Print * logOutput, const char format, va_list * args);
|
||||
|
||||
template <class T> void printLevel(uint8_t tag, int level, T msg, ...)
|
||||
{
|
||||
@ -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;
|
||||
|
@ -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)
|
@ -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)
|
@ -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)
|
@ -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)
|
@ -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(ð_config_spi, ð_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
|
@ -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_ */
|
@ -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), ®_value, sizeof(reg_value)), err, TAG, "set rx buffer size failed");
|
||||
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_TXBUF_SIZE(0), ®_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), ®_value, sizeof(reg_value)), err, TAG, "set rx buffer size failed");
|
||||
ESP_GOTO_ON_ERROR(w5500_write(emac, W5500_REG_SOCK_TXBUF_SIZE(i), ®_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, ®_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, ®_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), ®_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), ®_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, ®_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, ®_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, ®_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
|
@ -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;
|
||||
}
|
@ -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
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 aselectroworks
|
||||
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
|
2
lib/FT5206_Library/README.md
Normal file
2
lib/FT5206_Library/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
FT5206 Library
|
||||
=====================================
|
29
lib/FT5206_Library/keywords.txt
Normal file
29
lib/FT5206_Library/keywords.txt
Normal 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)
|
||||
#######################################
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user