Compare commits

..

1 Commits

Author SHA1 Message Date
Hermes Reyna Bot 047c7c87d7 Export LVGL canvas symbols for side-loaded GameBoy app 2026-07-17 18:10:52 -04:00
4636 changed files with 4504 additions and 937990 deletions
-4
View File
@@ -11,8 +11,6 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Build"
uses: ./.github/actions/build-simulator
with:
@@ -23,8 +21,6 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Build"
uses: ./.github/actions/build-simulator
with:
+1 -4
View File
@@ -23,8 +23,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Build SDK"
uses: ./.github/actions/build-sdk
with:
@@ -68,6 +66,7 @@ jobs:
{ id: m5stack-cores3, arch: esp32s3 },
{ id: m5stack-papers3, arch: esp32s3 },
{ id: m5stack-stackchan, arch: esp32s3 },
{ id: m5stack-stickc-plus, arch: esp32 },
{ id: m5stack-stickc-plus2, arch: esp32 },
{ id: m5stack-sticks3, arch: esp32s3 },
{ id: m5stack-tab5, arch: esp32p4 },
@@ -83,8 +82,6 @@ jobs:
needs: [ BuildSdk ]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Build Firmware"
uses: ./.github/actions/build-firmware
with:
+1 -2
View File
@@ -31,9 +31,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
- uses: actions/checkout@v4
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- name: "Install Python Dependencies"
shell: bash
+26 -21
View File
@@ -2,9 +2,11 @@ import subprocess
from datetime import datetime, UTC
import os
import sys
import configparser
from dataclasses import dataclass, asdict
import json
import shutil
from configparser import RawConfigParser
VERBOSE = False
DEVICES_FOLDER = "Devices"
@@ -66,29 +68,32 @@ def exit_with_error(message):
sys.exit(1)
def read_properties_file(path):
properties = {}
with open(path, "r") as file:
for line in file:
stripped = line.strip()
if not stripped or stripped.startswith("#"):
continue
key, sep, value = line.partition("=")
if not sep:
continue
properties[key.strip()] = value.strip()
return properties
config = configparser.RawConfigParser()
# Don't convert keys to lowercase
config.optionxform = str
config.read(path)
return config
def get_property_or_none(properties: dict, group: str, key: str):
return properties.get(f"{group}.{key}")
def get_property_or_none(properties: RawConfigParser, group: str, key: str):
if group not in properties.sections():
return None
if key not in properties[group].keys():
return None
return properties[group][key]
def get_boolean_property_or_false(properties: dict, group: str, key: str):
return properties.get(f"{group}.{key}") == "true"
def get_boolean_property_or_false(properties: RawConfigParser, group: str, key: str):
if group not in properties.sections():
return False
if key not in properties[group].keys():
return False
return properties[group][key] == "true"
def get_property_or_exit(properties: dict, group: str, key: str):
full_key = f"{group}.{key}"
if full_key not in properties:
exit_with_error(f"Device properties does not contain key: {full_key}")
return properties[full_key]
def get_property_or_exit(properties: RawConfigParser, group: str, key: str):
if group not in properties.sections():
exit_with_error(f"Device properties does not contain group: {group}")
if key not in properties[group].keys():
exit_with_error(f"Device properties does not contain key: {key}")
return properties[group][key]
def read_device_properties(device_id):
mapping_file_path = os.path.join(DEVICES_FOLDER, device_id, "device.properties")
@@ -124,7 +129,7 @@ def to_manifest_chip_name(name):
return ""
def process_device(in_path: str, out_path: str, device_directory: str, device_id: str, device_properties: dict, version: str):
def process_device(in_path: str, out_path: str, device_directory: str, device_id: str, device_properties: RawConfigParser, version: str):
in_device_path = os.path.join(in_path, device_directory)
in_device_binaries_path = os.path.join(in_device_path, "Binaries")
if not os.path.isdir(in_device_binaries_path):
@@ -45,7 +45,6 @@ def parse_binding(file_path: str, binding_dirs: list[str]) -> Binding:
required=details.get('required', False),
description=details.get('description', '').strip(),
default=details.get('default', None),
element_type=details.get('element-type', None),
)
properties_dict[name] = prop
filename = os.path.basename(file_path)
@@ -80,7 +80,7 @@ def property_to_string(property: DeviceProperty, devices: list[Device]) -> str:
return "{ " + ",".join(value_list) + " }"
elif type == "phandle":
return find_phandle(devices, property.value)
elif type == "phandles":
elif type == "phandle-array":
value_list = list()
if isinstance(property.value, list):
for item in property.value:
@@ -93,26 +93,10 @@ def property_to_string(property: DeviceProperty, devices: list[Device]) -> str:
# If it's a string, assume it's a #define and show it as-is
return property.value
else:
raise Exception(f"Unsupported phandles type for {property.name} with value {property.value} ")
raise Exception(f"Unsupported phandle-array type for {property.value}")
else:
raise DevicetreeException(f"property_to_string() has an unsupported type: {type}")
def resolve_phandle_array_entries(device_property, devices):
"""Convert a phandle-array DTS property into a list of C initializer strings."""
entries = []
if device_property.type == "phandle-array":
items = device_property.value
elif device_property.type == "values":
items = [PropertyValue(type="values", value=device_property.value)]
else:
return []
for item in items:
if isinstance(item, PropertyValue):
entries.append(property_to_string(DeviceProperty(name="", type=item.type, value=item.value), devices))
else:
entries.append(str(item))
return entries
def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], devices: list[Device]) -> list:
compatible_property = find_device_property(device, "compatible")
if compatible_property is None:
@@ -135,32 +119,11 @@ def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], de
if device_property.name not in binding_property_names:
raise DevicetreeException(f"Device '{device.node_name}' has invalid property '{device_property.name}'")
node_name = get_device_node_name_safe(device)
result = []
phandle_arrays = []
for binding_property in binding_properties:
# Allocate total expected configuration arguments
result = [0] * len(binding_properties)
for index, binding_property in enumerate(binding_properties):
device_property = find_device_property(device, binding_property.name)
if binding_property.type == "phandle-array":
if binding_property.element_type is None:
raise DevicetreeException(f"phandle-array property '{binding_property.name}' requires 'element-type' in binding")
prop_safe = binding_property.name.replace("-", "_")
array_var = f"{node_name}_{prop_safe}"
if device_property is not None:
entries = resolve_phandle_array_entries(device_property, devices)
phandle_arrays.append((array_var, binding_property.element_type, entries))
result.append(f"({binding_property.element_type}*){array_var}")
result.append(str(len(entries)))
elif binding_property.default is not None:
result.append("NULL")
result.append("0")
elif binding_property.required:
raise DevicetreeException(f"device {device.node_name} doesn't have property '{binding_property.name}'")
else:
result.append("NULL")
result.append("0")
continue
# No property specified in DTS, use binding defaults
if device_property is None:
if binding_property.default is not None:
temp_prop = DeviceProperty(
@@ -168,38 +131,30 @@ def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], de
type=binding_property.type,
value=binding_property.default
)
result.append(property_to_string(temp_prop, devices))
result[index] = property_to_string(temp_prop, devices)
elif binding_property.required:
raise DevicetreeException(f"device {device.node_name} doesn't have property '{binding_property.name}'")
elif binding_property.type == "bool" or binding_property.type == "boolean":
if binding_property.default == "true" or binding_property.default == None:
result.append("true")
else:
result.append("false")
result[index] = "true"
else: # Explicit or implied false
result[index] = "false"
else:
raise DevicetreeException(f"Device {device.node_name} doesn't have property '{binding_property.name}' and no default value is set")
else:
result.append(property_to_string(device_property, devices))
return result, phandle_arrays
result[index] = property_to_string(device_property, devices)
return result
def write_config(file, device: Device, bindings: list[Binding], devices: list[Device], type_name: str):
node_name = get_device_node_name_safe(device)
config_type = f"{type_name}_config_dt"
config_variable_name = f"{node_name}_config"
config_params, phandle_arrays = resolve_parameters_from_bindings(device, bindings, devices)
# Write phandle-array variables before the config struct
for array_var, element_type, entries in phandle_arrays:
entries_str = ", ".join(entries)
file.write(f"static {element_type} {array_var}[] = {{ {entries_str} }};\n")
file.write(f"static const {config_type} {config_variable_name}" " = {\n")
config_params = resolve_parameters_from_bindings(device, bindings, devices)
# Indent all params
for index, config_param in enumerate(config_params):
config_params[index] = f"\t{config_param}"
# Join with comma and newline
# Join with command and newline
if len(config_params) > 0:
config_params_joined = ",\n".join(config_params)
file.write(f"{config_params_joined}\n")
@@ -223,9 +178,7 @@ def write_device_structs(file, device: Device, parent_device: Device, bindings:
# Write config struct
write_config(file, device, bindings, devices, type_name)
# Write device struct
address_value = device.node_address if device.node_address is not None else "0"
file.write(f"static struct Device {node_name}" " = {\n")
file.write(f"\t.address = {address_value},\n")
file.write(f"\t.name = \"{device.node_name}\",\n") # Use original name
file.write(f"\t.config = &{config_variable_name},\n")
file.write(f"\t.parent = {parent_value},\n")
@@ -37,17 +37,13 @@ value: VALUE
values: VALUE+
array: NUMBER+
phandle_array_entry: "<" values ">"
phandle_array: phandle_array_entry ("," phandle_array_entry)+
property_value: quoted_text_array | QUOTED_TEXT | phandle_array | "<" value ">" | "<" values ">" | "[" array "]" | PHANDLE
property_value: quoted_text_array | QUOTED_TEXT | "<" value ">" | "<" values ">" | "[" array "]" | PHANDLE
device_property: PROPERTY_NAME ["=" property_value] ";"
NODE_ALIAS: /[a-zA-Z0-9_\-\/]+/
NODE_NAME: /[a-zA-Z0-9_\-\/]+/
NODE_ADDRESS: /[0-9a-zA-Z_]+/
NODE_ALIAS: /[a-zA-Z0-9_\-\/@]+/
NODE_NAME: /[a-zA-Z0-9_\-\/@]+/
device: (NODE_ALIAS ":")? NODE_NAME ("@" NODE_ADDRESS)? "{" (device | device_property)* "};"
device: (NODE_ALIAS ":")? NODE_NAME "{" (device | device_property)* "};"
dts_version: /[0-9a-zA-Z\-]+/
@@ -8,7 +8,6 @@ class DtsVersion:
class Device:
node_name: str
node_alias: str
node_address: str
status: str
properties: list
devices: list
@@ -39,7 +38,6 @@ class BindingProperty:
required: bool
description: str
default: object = None
element_type: str = None
@dataclass
class Binding:
@@ -29,7 +29,6 @@ class DtsTransformer(Transformer):
def device(self, tokens: list):
node_name = None
node_alias = None
node_address = None
status = None
properties = list()
child_devices = list()
@@ -38,8 +37,6 @@ class DtsTransformer(Transformer):
node_name = item.value
elif type(item) is Token and item.type == 'NODE_ALIAS':
node_alias = item.value
elif type(item) is Token and item.type == 'NODE_ADDRESS':
node_address = item.value
elif type(item) is DeviceProperty:
if item.name == "status":
status = item.value
@@ -47,7 +44,7 @@ class DtsTransformer(Transformer):
properties.append(item)
elif type(item) is Device:
child_devices.append(item)
return Device(node_name, node_alias, node_address, status, properties, child_devices)
return Device(node_name, node_alias, status, properties, child_devices)
def device_property(self, objects: List[object]):
name = objects[0]
# Boolean property has no value as the value is implied to be true
@@ -70,10 +67,6 @@ class DtsTransformer(Transformer):
if isinstance(object[0], PropertyValue):
return object[0]
return PropertyValue(type="value", value=object[0])
def phandle_array_entry(self, tokens: list):
return tokens[0]
def phandle_array(self, tokens: list):
return PropertyValue(type="phandle-array", value=tokens)
def array(self, object):
return PropertyValue(type="array", value=object)
def VALUE(self, token: Token):
@@ -10,23 +10,21 @@ static const root_config_dt root_config = {
};
static struct Device root = {
.address = 0,
.name = "/",
.config = &root_config,
.parent = NULL,
.internal = NULL
};
static const generic_device_config_dt test_device_config = {
static const generic_device_config_dt test_device@0_config = {
0,
42,
"hello"
};
static struct Device test_device = {
.address = 0,
.name = "test-device",
.config = &test_device_config,
static struct Device test_device@0 = {
.name = "test-device@0",
.config = &test_device@0_config,
.parent = &root,
.internal = NULL
};
@@ -40,7 +38,6 @@ static const bool_device_config_dt bool_test_device_config = {
};
static struct Device bool_test_device = {
.address = 0,
.name = "bool-test-device",
.config = &bool_test_device_config,
.parent = &root,
@@ -49,7 +46,7 @@ static struct Device bool_test_device = {
struct DtsDevice dts_devices[] = {
{ &root, "test,root", DTS_DEVICE_STATUS_OKAY },
{ &test_device, "test,generic-device", DTS_DEVICE_STATUS_OKAY },
{ &test_device@0, "test,generic-device", DTS_DEVICE_STATUS_OKAY },
{ &bool_test_device, "test,bool-device", DTS_DEVICE_STATUS_OKAY },
DTS_DEVICE_TERMINATOR
};
-135
View File
@@ -1,135 +0,0 @@
#!/usr/bin/env python3
"""Download all artifacts from a GitHub Actions workflow run."""
import argparse
import os
import subprocess
import sys
import zipfile
from pathlib import Path
import requests
API_URL = "https://api.github.com"
def get_token(cli_token: str | None) -> str:
if cli_token:
return cli_token
env_token = os.environ.get("GITHUB_TOKEN") or os.environ.get("GH_TOKEN")
if env_token:
return env_token
try:
result = subprocess.run(
["gh", "auth", "token"], capture_output=True, text=True, check=True
)
return result.stdout.strip()
except (FileNotFoundError, subprocess.CalledProcessError):
sys.exit(
"No token found. Pass --token, set GITHUB_TOKEN/GH_TOKEN, or run `gh auth login`."
)
def get_repo(cli_repo: str | None) -> str:
if cli_repo:
return cli_repo
try:
result = subprocess.run(
["git", "remote", "get-url", "origin"],
capture_output=True,
text=True,
check=True,
)
url = result.stdout.strip()
except (FileNotFoundError, subprocess.CalledProcessError):
sys.exit("Could not detect repo from git remote. Pass --repo owner/name.")
# Handle both SSH and HTTPS remote URLs.
if url.startswith("git@"):
path = url.split(":", 1)[1]
else:
path = url.split("github.com/", 1)[-1]
return path.removesuffix(".git")
def download_artifacts(repo: str, run_id: str, token: str, out_dir: Path):
headers = {
"Authorization": f"Bearer {token}",
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
}
out_dir.mkdir(parents=True, exist_ok=True)
url = f"{API_URL}/repos/{repo}/actions/runs/{run_id}/artifacts"
artifacts = []
while url:
resp = requests.get(url, headers=headers, params={"per_page": 100})
resp.raise_for_status()
data = resp.json()
artifacts.extend(data["artifacts"])
url = resp.links.get("next", {}).get("url")
if not artifacts:
print(f"No artifacts found for run {run_id}.")
return
for artifact in artifacts:
name = artifact["name"]
if name == "all-artifacts":
print(f"Skipping {name}")
continue
if artifact.get("expired"):
print(f"Skipping expired artifact: {name}")
continue
print(f"Downloading {name} ({artifact['size_in_bytes']} bytes)...")
download_url = artifact["archive_download_url"]
resp = requests.get(download_url, headers=headers, stream=True)
resp.raise_for_status()
zip_path = out_dir / f"{name}.zip"
with open(zip_path, "wb") as f:
for chunk in resp.iter_content(chunk_size=8192):
f.write(chunk)
if name.endswith(".bin"):
with zipfile.ZipFile(zip_path) as zf:
zf.extractall(out_dir)
zip_path.unlink()
print(f" Extracted to {out_dir}")
else:
print(f" Saved to {zip_path}")
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("run_id", help="GitHub Actions run ID")
parser.add_argument(
"--repo",
help="owner/repo (default: detected from git remote 'origin')",
)
parser.add_argument(
"--token",
help="GitHub token (default: $GITHUB_TOKEN, $GH_TOKEN, or `gh auth token`)",
)
parser.add_argument(
"--out",
default="artifacts",
help="Output directory (default: ./artifacts)",
)
args = parser.parse_args()
repo = get_repo(args.repo)
token = get_token(args.token)
out_dir = Path(args.out)
print(f"Repo: {repo}")
print(f"Run ID: {args.run_id}")
print(f"Output: {out_dir.resolve()}")
download_artifacts(repo, args.run_id, token, out_dir)
if __name__ == "__main__":
main()
-126
View File
@@ -1,126 +0,0 @@
#!/usr/bin/env python3
"""Summarize commits between the last 2 pushed git tags into commits.md and pull-requests.md."""
import argparse
import re
import subprocess
import sys
from pathlib import Path
PR_REF_RE = re.compile(r"#(\d+)")
def get_repo(cli_repo: str | None) -> str:
if cli_repo:
return cli_repo
try:
result = subprocess.run(
["git", "remote", "get-url", "origin"],
capture_output=True,
text=True,
check=True,
)
url = result.stdout.strip()
except (FileNotFoundError, subprocess.CalledProcessError):
sys.exit("Could not detect repo from git remote. Pass --repo owner/name.")
if url.startswith("git@"):
path = url.split(":", 1)[1]
else:
path = url.split("github.com/", 1)[-1]
return path.removesuffix(".git")
def get_last_two_tags() -> tuple[str, str]:
result = subprocess.run(
["git", "tag", "--sort=-creatordate"],
capture_output=True,
text=True,
check=True,
)
tags = [t for t in result.stdout.splitlines() if t]
if len(tags) < 2:
sys.exit(f"Need at least 2 tags, found {len(tags)}.")
return tags[1], tags[0] # previous, latest
def get_commits(prev_tag: str, latest_tag: str) -> list[tuple[str, str]]:
result = subprocess.run(
[
"git",
"log",
"--pretty=format:%H\x1f%s",
f"{prev_tag}..{latest_tag}",
],
capture_output=True,
text=True,
check=True,
)
commits = []
for line in result.stdout.splitlines():
if not line:
continue
sha, subject = line.split("\x1f", 1)
commits.append((sha, subject))
return commits
def write_commits_md(path: Path, repo: str, prev_tag: str, latest_tag: str, commits: list[tuple[str, str]]):
lines = [f"# Commits: {prev_tag}..{latest_tag}", ""]
for sha, subject in commits:
link = f"https://github.com/{repo}/commit/{sha}"
lines.append(f"- [{subject}]({link})")
path.write_text("\n".join(lines) + "\n")
def write_pull_requests_md(path: Path, repo: str, commits: list[tuple[str, str]]):
pr_numbers = []
seen = set()
for _, subject in commits:
for match in PR_REF_RE.finditer(subject):
number = match.group(1)
if number not in seen:
seen.add(number)
pr_numbers.append(number)
lines = ["# Pull Requests", ""]
for number in pr_numbers:
lines.append(f"- https://github.com/{repo}/pull/{number}")
path.write_text("\n".join(lines) + "\n")
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--repo",
help="owner/repo (default: detected from git remote 'origin')",
)
parser.add_argument(
"--out",
default=".",
help="Output directory for commits.md and pull-requests.md (default: current directory)",
)
args = parser.parse_args()
repo = get_repo(args.repo)
prev_tag, latest_tag = get_last_two_tags()
commits = get_commits(prev_tag, latest_tag)
out_dir = Path(args.out)
out_dir.mkdir(parents=True, exist_ok=True)
commits_path = out_dir / "release-commits.md"
prs_path = out_dir / "release-pull-requests.md"
write_commits_md(commits_path, repo, prev_tag, latest_tag, commits)
write_pull_requests_md(prs_path, repo, commits)
print(f"Repo: {repo}")
print(f"Tags: {prev_tag}..{latest_tag}")
print(f"Commits: {len(commits)}")
print(f"Wrote {commits_path}")
print(f"Wrote {prs_path}")
if __name__ == "__main__":
main()
+5 -2
View File
@@ -28,6 +28,7 @@ function(READ_PROPERTIES_TO_MAP PROPERTY_FILE RESULT_VAR)
endif ()
file(STRINGS ${PROPERTY_FILE_ABS} lines)
set(current_section "")
set(map_content "")
foreach(line IN LISTS lines)
@@ -36,7 +37,9 @@ function(READ_PROPERTIES_TO_MAP PROPERTY_FILE RESULT_VAR)
continue()
endif ()
if (line MATCHES "^([^=]+)=(.*)$")
if (line MATCHES "^\\[.*\\]$")
set(current_section "${line}")
elseif (line MATCHES "^([^=]+)=(.*)$")
set(key "${CMAKE_MATCH_1}")
set(value "${CMAKE_MATCH_2}")
string(STRIP "${key}" key)
@@ -46,7 +49,7 @@ function(READ_PROPERTIES_TO_MAP PROPERTY_FILE RESULT_VAR)
set(value "${CMAKE_MATCH_1}")
endif ()
list(APPEND map_content "${key}" "${value}")
list(APPEND map_content "${current_section}${key}" "${value}")
endif ()
endforeach()
-84
View File
@@ -1,84 +0,0 @@
#!/usr/bin/env python3
"""Generate a release summary markdown by combining gh-release-summary.py output with Claude."""
import argparse
import subprocess
import sys
from pathlib import Path
SCRIPT_DIR = Path(__file__).resolve().parent
SECTIONS = [
"New Devices",
"New Features",
"New Apps",
"Improvements & Fixes",
"Other Changes",
"TactilitySDK",
"Known Issues",
]
def run_gh_release_summary(out_dir: Path, repo: str | None):
cmd = [sys.executable, str(SCRIPT_DIR / "gh-release-summary.py"), "--out", str(out_dir)]
if repo:
cmd += ["--repo", repo]
subprocess.run(cmd, check=True)
def build_prompt() -> str:
section_list = "\n".join(f"- {s}" for s in SECTIONS)
return (
"You are given a list of commits (with GitHub commit links) and a list of pull "
"request links from a software release. Write a release summary in Markdown, "
"organizing changes into these sections (omit a section if it has no relevant "
"changes):\n\n"
f"{section_list}\n\n"
"Use concise bullet points. Base every bullet strictly on the given commits and "
"pull requests, referencing the pull request link where applicable. Output only "
"the Markdown, no commentary before or after it."
"If a pull request or commit has multiple changes add them as separate entries."
"Ignore irrelevant changes: documentation, minor fixes, non-descript fixes, scripts, github workflows."
"For 'New Devices': only mention the device name, don't like pull request."
"For 'Improvements & Fixes': Avoid non-descript entries, write specifics."
"For 'TactilitySDK': Avoid generic changes, be specific. Mention API changes."
)
def run_claude(commits_md: str, prs_md: str) -> str:
prompt = build_prompt()
stdin_content = f"## Commits\n\n{commits_md}\n\n## Pull Requests\n\n{prs_md}"
result = subprocess.run(
["claude", "-p", prompt],
input=stdin_content,
capture_output=True,
text=True,
check=True,
)
return result.stdout
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--repo", help="owner/repo (default: detected from git remote 'origin')")
parser.add_argument("--out", default=".", help="Output directory (default: current directory)")
args = parser.parse_args()
out_dir = Path(args.out)
out_dir.mkdir(parents=True, exist_ok=True)
run_gh_release_summary(out_dir, args.repo)
commits_md = (out_dir / "release-commits.md").read_text()
prs_md = (out_dir / "release-pull-requests.md").read_text()
print("Generating release summary via claude...")
summary = run_claude(commits_md, prs_md)
summary_path = out_dir / "release-summary.md"
summary_path.write_text(summary)
print(f"Wrote {summary_path}")
if __name__ == "__main__":
main()
+1 -18
View File
@@ -2,8 +2,6 @@
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072
# Ensure large enough stack for network operations
CONFIG_ESP_MAIN_TASK_STACK_SIZE=6144
# HTTP server: need enough URI handler slots for WebServer (7 + internal) + DevServer
CONFIG_HTTPD_MAX_URI_HANDLERS=20
# Fixes static assertion: FLASH and PSRAM Mode configuration are not supported
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
# Free up IRAM
@@ -11,8 +9,7 @@ CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y
# EmbedTLS
# Use TLS 1.2 because 1.3 conflicts with MbedTLS dynamic buffer
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
CONFIG_MBEDTLS_SSL_PROTO_TLS1_3=y
# LVGL
CONFIG_LV_USE_USER_DATA=y
CONFIG_LV_USE_FS_STDIO=y
@@ -43,17 +40,3 @@ CONFIG_WL_SECTOR_MODE_SAFE=y
CONFIG_WL_SECTOR_MODE=1
# Allow new i2c_master API (used by Tab5Keyboard for LP_I2C_NUM_0) to coexist with legacy i2c driver
CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK=y
# Wi-Fi memory optimizations
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=3
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=5
CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y
CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0
CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=5
CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=5
CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y
CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0
CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5
CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP_WIFI_TX_BA_WIN=5
CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP_WIFI_RX_BA_WIN=5
+2 -6
View File
@@ -74,11 +74,8 @@ else ()
message("Building for sim target")
add_compile_definitions(CONFIG_TT_DEVICE_ID="simulator")
add_compile_definitions(CONFIG_TT_DEVICE_NAME="Simulator")
add_compile_definitions(CONFIG_TT_DEVICE_VENDOR="")
add_compile_definitions(CONFIG_TT_DEVICE_NAME_SIMPLE="Simulator")
add_compile_definitions(CONFIG_TT_LAUNCHER_APP_ID="Launcher")
add_compile_definitions(CONFIG_TT_AUTO_START_APP_ID="")
add_compile_definitions(CONFIG_TT_USER_DATA_LOCATION_INTERNAL)
endif ()
project(Tactility)
@@ -106,9 +103,8 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})
target_compile_definitions(freertos_kernel PUBLIC "projCOVERAGE_TEST=0")
# EmbedTLS
set(ENABLE_TESTING OFF CACHE BOOL "" FORCE)
set(ENABLE_PROGRAMS OFF CACHE BOOL "" FORCE)
set(MBEDTLS_FATAL_WARNINGS OFF CACHE BOOL "" FORCE)
set(ENABLE_TESTING OFF)
set(ENABLE_PROGRAMS OFF)
add_subdirectory(Libraries/mbedtls)
# SDL
@@ -0,0 +1 @@
enableOnBoot=false
@@ -0,0 +1 @@
enableOnBoot=false
@@ -0,0 +1 @@
enableOnBoot=false
+5
View File
@@ -0,0 +1,5 @@
language=en-US
timeFormat24h=true
dateFormat=DD/MM/YYYY
region=EU
timezone=Europe/Amsterdam
@@ -485,7 +485,7 @@
<button class="btn btn-secondary btn-sm" onclick="goUp()" id="upBtn">Up</button>
</div>
<div class="toolbar-sep"></div>
<input type="text" id="pathInput" value="" onkeydown="if(event.key==='Enter')refreshFiles()">
<input type="text" id="pathInput" value="/data" onkeydown="if(event.key==='Enter')refreshFiles()">
<button class="btn btn-primary btn-sm" onclick="refreshFiles()">Go</button>
<div class="toolbar-sep"></div>
<div class="toolbar-group">
@@ -739,6 +739,7 @@ function renderDashboard(data) {
<div class="card">
<h2>Quick Actions</h2>
<div class="actions">
<button class="btn btn-primary" onclick="syncAssets(this)">Sync Assets</button>
${data.features_enabled?.screenshot ? '<button class="btn btn-secondary" onclick="captureScreenshot(this)">Screenshot</button>' : ''}
<button class="btn btn-danger" onclick="rebootDevice(this)">Reboot</button>
</div>
+63
View File
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tactility Dashboard</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 20px auto;
padding: 20px;
background-color: #f5f5f5;
}
h1 {
color: #333;
text-align: center;
}
.placeholder {
background: white;
padding: 40px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
text-align: center;
margin: 20px 0;
}
.placeholder h2 {
color: #666;
}
.placeholder p {
color: #666;
line-height: 1.6;
}
a {
color: #007bff;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>Tactility Default Dashboard</h1>
<div class="placeholder">
<h2>Version 0 - Default Placeholder</h2>
<p>This is the default dashboard bundled with firmware.</p>
<p>To customize this interface:</p>
<ol style="text-align: left; display: inline-block;">
<li>Create your custom dashboard HTML/CSS/JS files</li>
<li>Add them to <code>/sdcard/tactility/webserver/</code></li>
<li>Create <code>version.json</code> with <code>{"version": 1}</code> or higher</li>
<li>Reboot or click "Sync Assets" on the <a href="/">Core Interface</a></li>
</ol>
<p><strong>Your custom assets will automatically replace this page!</strong></p>
</div>
<div class="placeholder">
<p><a href="/">← Back to Core Interface</a></p>
</div>
</body>
</html>
+3
View File
@@ -0,0 +1,3 @@
{
"version": 0
}
@@ -13,7 +13,6 @@
ble0 {
compatible = "espressif,esp32-ble";
status = "disabled";
};
gpio0 {
+21 -18
View File
@@ -1,22 +1,25 @@
general.vendor=BigTreeTech
general.name=Panda Touch,K Touch
[general]
vendor=BigTreeTech
name=Panda Touch,K Touch
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32S3
hardware.flashSize=16MB
hardware.spiRam=true
hardware.spiRamMode=OCT
hardware.spiRamSpeed=120M
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
hardware.usbHostEnabled=true
[hardware]
target=ESP32S3
flashSize=16MB
spiRam=true
spiRamMode=OCT
spiRamSpeed=120M
esptoolFlashFreq=120M
bluetooth=true
usbHostEnabled=true
storage.userDataLocation=Internal
[display]
size=5"
shape=rectangle
dpi=187
display.size=5"
display.shape=rectangle
display.dpi=187
lvgl.colorDepth=16
lvgl.fontSize=18
[lvgl]
colorDepth=16
fontSize=18
@@ -1,7 +1,9 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
static bool initBoot() {
@@ -21,6 +23,7 @@ static bool initBoot() {
static tt::hal::DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,34 @@
#include "SdCard.h"
#define TAG "twodotfour_sdcard"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/RecursiveMutex.h>
constexpr auto SDCARD_SPI_HOST = SPI3_HOST;
constexpr auto SDCARD_PIN_CS = GPIO_NUM_5;
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
SDCARD_PIN_CS,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
nullptr,
std::vector<gpio_num_t>(),
SDCARD_SPI_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(configuration),
spi_controller
);
}
@@ -0,0 +1,8 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
+2 -15
View File
@@ -4,8 +4,6 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
/ {
compatible = "root";
@@ -24,29 +22,18 @@
pin-scl = <&gpio0 32 GPIO_FLAG_NONE>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
display {
compatible = "display-placeholder";
};
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
};
+15 -12
View File
@@ -1,16 +1,19 @@
general.vendor=CYD
general.name=2432S024C
[general]
vendor=CYD
name=2432S024C
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
[hardware]
target=ESP32
flashSize=4MB
spiRam=false
storage.userDataLocation=SD
[display]
size=2.4"
shape=rectangle
dpi=167
display.size=2.4"
display.shape=rectangle
display.dpi=167
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -1,6 +1,9 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
using namespace tt::hal;
@@ -11,7 +14,8 @@ static bool initBoot() {
static DeviceVector createDevices() {
return {
createDisplay()
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,23 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto config = std::make_unique<SpiSdCardDevice::Config>(
GPIO_NUM_5,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
nullptr,
std::vector<gpio_num_t>(),
SPI3_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(std::move(config), spi_controller);
}
@@ -0,0 +1,8 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
+2 -21
View File
@@ -3,9 +3,6 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/touch_placeholder.h>
#include <tactility/bindings/esp32_uart.h>
/ {
@@ -17,36 +14,20 @@
gpio-count = <40>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 12 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display
<&gpio0 33 GPIO_FLAG_NONE>; // Touch
display@0 {
compatible = "display-placeholder";
};
touch@1 {
compatible = "touch-placeholder";
};
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
uart1 {
+15 -12
View File
@@ -1,16 +1,19 @@
general.vendor=CYD
general.name=2432S024R
[general]
vendor=CYD
name=2432S024R
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
[hardware]
target=ESP32
flashSize=4MB
spiRam=false
storage.userDataLocation=SD
[display]
size=2.4"
shape=rectangle
dpi=167
display.size=2.4"
display.shape=rectangle
display.dpi=167
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -1,7 +1,9 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
using namespace tt::hal;
@@ -23,6 +25,7 @@ static bool initBoot() {
static DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,25 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto config = std::make_unique<SpiSdCardDevice::Config>(
GPIO_NUM_5,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
nullptr,
std::vector<gpio_num_t>(),
SPI3_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(std::move(config), spi_controller);
}
@@ -0,0 +1,8 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
+2 -21
View File
@@ -5,9 +5,6 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/touch_placeholder.h>
/ {
compatible = "root";
@@ -26,36 +23,20 @@
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display
<&gpio0 33 GPIO_FLAG_NONE>; // Touch
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 12 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
display@0 {
compatible = "display-placeholder";
};
touch@1 {
compatible = "touch-placeholder";
};
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
uart1 {
+17 -13
View File
@@ -1,18 +1,22 @@
general.vendor=CYD
general.name=2432S028R
[general]
vendor=CYD
name=2432S028R
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
[hardware]
target=ESP32
flashSize=4MB
spiRam=false
storage.userDataLocation=SD
[display]
size=2.8"
shape=rectangle
dpi=143
display.size=2.8"
display.shape=rectangle
display.dpi=143
[cdn]
warningMessage=There are 3 hardware variants of this board. This build works on the original variant only ("v1").
cdn.warningMessage=There are 3 hardware variants of this board. This build works on the original variant only ("v1").
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -1,7 +1,9 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
using namespace tt::hal;
@@ -23,6 +25,7 @@ static bool initBoot() {
static DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,25 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto config = std::make_unique<SpiSdCardDevice::Config>(
GPIO_NUM_5,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
nullptr,
std::vector<gpio_num_t>(),
SPI3_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(std::move(config), spi_controller);
}
@@ -0,0 +1,8 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
+2 -21
View File
@@ -5,9 +5,6 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/touch_placeholder.h>
/ {
compatible = "root";
@@ -26,36 +23,20 @@
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display
<&gpio0 33 GPIO_FLAG_NONE>; // Touch
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 12 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
display@0 {
compatible = "display-placeholder";
};
touch@1 {
compatible = "touch-placeholder";
};
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
uart1 {
+17 -13
View File
@@ -1,18 +1,22 @@
general.vendor=CYD
general.name=2432S028R v3
[general]
vendor=CYD
name=2432S028R v3
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
[hardware]
target=ESP32
flashSize=4MB
spiRam=false
storage.userDataLocation=SD
[display]
size=2.8"
shape=rectangle
dpi=143
display.size=2.8"
display.shape=rectangle
display.dpi=143
[cdn]
warningMessage=There are 3 hardware variants of this board. This build only supports board version 3.
cdn.warningMessage=There are 3 hardware variants of this board. This build only supports board version 3.
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -1,4 +1,5 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
@@ -38,6 +39,7 @@ static bool initBoot() {
static tt::hal::DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,33 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/RecursiveMutex.h>
constexpr auto SDCARD_SPI_HOST = SPI3_HOST;
constexpr auto SDCARD_PIN_CS = GPIO_NUM_5;
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
SDCARD_PIN_CS,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SDCARD_SPI_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(configuration),
spi_controller
);
}
@@ -0,0 +1,8 @@
#pragma once
#include <Tactility/hal/sdcard/SdCardDevice.h>
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
+10 -23
View File
@@ -4,14 +4,12 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
/ {
compatible = "root";
model = "CYD 2432S032C";
gpio0 {
gpio1 {
compatible = "espressif,esp32-gpio";
gpio-count = <40>;
};
@@ -20,33 +18,22 @@
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_0>;
clock-frequency = <400000>;
pin-sda = <&gpio0 33 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 32 GPIO_FLAG_NONE>;
pin-sda = <&gpio1 33 GPIO_FLAG_NONE>;
pin-scl = <&gpio1 32 GPIO_FLAG_NONE>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
display {
compatible = "display-placeholder";
};
pin-mosi = <&gpio1 13 GPIO_FLAG_NONE>;
pin-sclk = <&gpio1 14 GPIO_FLAG_NONE>;
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
pin-mosi = <&gpio1 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio1 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio1 18 GPIO_FLAG_NONE>;
};
};
+15 -12
View File
@@ -1,16 +1,19 @@
general.vendor=CYD
general.name=2432S032C
[general]
vendor=CYD
name=2432S032C
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
[hardware]
target=ESP32
flashSize=4MB
spiRam=false
storage.userDataLocation=SD
[display]
size=3.2"
shape=rectangle
dpi=125
display.size=3.2"
display.shape=rectangle
display.dpi=125
lvgl.colorDepth=16
[lvgl]
colorDepth=16
+34 -32
View File
@@ -1,32 +1,34 @@
#include "devices/Display.h"
#include <driver/gpio.h>
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
using namespace tt::hal;
static bool initBoot() {
//Set the RGB Led Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); //Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); //Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); //Blue
//0 on, 1 off... yep it's backwards.
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); //Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); //Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); //Blue
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
}
static DeviceVector createDevices() {
return {
createDisplay(),
};
}
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices
};
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
using namespace tt::hal;
static bool initBoot() {
//Set the RGB Led Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); //Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); //Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); //Blue
//0 on, 1 off... yep it's backwards.
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); //Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); //Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); //Blue
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
}
static DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices
};
@@ -0,0 +1,31 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
constexpr auto SDCARD_SPI_HOST = SPI3_HOST;
constexpr auto SDCARD_PIN_CS = GPIO_NUM_5;
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
SDCARD_PIN_CS,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
nullptr,
std::vector<gpio_num_t>(),
SDCARD_SPI_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(configuration),
spi_controller
);
}
@@ -0,0 +1,8 @@
#pragma once
#include <Tactility/hal/sdcard/SdCardDevice.h>
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
+58 -71
View File
@@ -1,71 +1,58 @@
/dts-v1/;
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
/ {
compatible = "root";
model = "CYD 3248S035C";
gpio0 {
compatible = "espressif,esp32-gpio";
gpio-count = <40>;
};
i2c_internal: i2c0 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_0>;
clock-frequency = <400000>;
pin-sda = <&gpio0 33 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 32 GPIO_FLAG_NONE>;
};
// CN1 header
i2c_external: i2c1 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_1>;
clock-frequency = <400000>;
pin-sda = <&gpio0 21 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;
};
spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
display {
compatible = "display-placeholder";
};
};
spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
// CN1 header, JST SH 1.25, GND / IO22 / IO21 / 3.3V
uart1 {
compatible = "espressif,esp32-uart";
status = "disabled";
port = <UART_NUM_1>;
pin-tx = <&gpio0 22 GPIO_FLAG_NONE>;
pin-rx = <&gpio0 21 GPIO_FLAG_NONE>;
};
};
/dts-v1/;
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
/ {
compatible = "root";
model = "CYD 3248S035C";
gpio0 {
compatible = "espressif,esp32-gpio";
gpio-count = <40>;
};
i2c_internal: i2c0 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_0>;
clock-frequency = <400000>;
pin-sda = <&gpio0 33 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 32 GPIO_FLAG_NONE>;
};
// CN1 header
i2c_external: i2c1 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_1>;
clock-frequency = <400000>;
pin-sda = <&gpio0 21 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;
};
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
};
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
};
// CN1 header, JST SH 1.25, GND / IO22 / IO21 / 3.3V
uart1 {
compatible = "espressif,esp32-uart";
status = "disabled";
port = <UART_NUM_1>;
pin-tx = <&gpio0 22 GPIO_FLAG_NONE>;
pin-rx = <&gpio0 21 GPIO_FLAG_NONE>;
};
};
+19 -16
View File
@@ -1,16 +1,19 @@
general.vendor=CYD
general.name=3248S035C
apps.launcherAppId=Launcher
hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
storage.userDataLocation=SD
display.size=3.5"
display.shape=rectangle
display.dpi=165
lvgl.colorDepth=16
[general]
vendor=CYD
name=3248S035C
[apps]
launcherAppId=Launcher
[hardware]
target=ESP32
flashSize=4MB
spiRam=false
[display]
size=3.5"
shape=rectangle
dpi=165
[lvgl]
colorDepth=16
@@ -1,6 +1,10 @@
#include "devices/St7701Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/kernel/SystemEvents.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
using namespace tt::hal;
@@ -12,6 +16,7 @@ static bool initBoot() {
static DeviceVector createDevices() {
return {
std::make_shared<St7701Display>(),
createSdCard()
};
}
@@ -0,0 +1,28 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto config = std::make_unique<SpiSdCardDevice::Config>(
GPIO_NUM_42,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
tt::lvgl::getSyncLock(),
std::vector { GPIO_NUM_39 }
);
auto* spi_controller = device_find_by_name("spi0");
check(spi_controller, "spi0 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(config),
spi_controller
);
}
@@ -0,0 +1,8 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
@@ -12,25 +12,9 @@
#include <esp_lcd_panel_ops.h>
#include <esp_lcd_panel_io_additions.h>
#include <esp_lcd_st7701.h>
#include <esp_rom_gpio.h>
#include <soc/spi_periph.h>
#include <driver/spi_master.h>
static const auto LOGGER = tt::Logger("St7701Display");
// GPIO47/48 are physically shared between this bit-banged 3-wire command bus
// and the SD card's real SPI2 bus (no alternate pins exist on this PCB).
// esp_lcd_new_panel_io_3wire_spi() reconfigures them as plain GPIO via
// gpio_config(), severing their SPI2 matrix routing. Reconnect them here once
// the vendor init sequence is done, so SD card reads/writes keep working.
// Safe only because nothing else calls into the ST7701 IO handle after boot.
static void reclaimSpiPinsForSdCard() {
esp_rom_gpio_connect_out_signal(GPIO_NUM_47, spi_periph_signal[SPI2_HOST].spid_out, false, false);
esp_rom_gpio_connect_out_signal(GPIO_NUM_48, spi_periph_signal[SPI2_HOST].spiclk_out, false, false);
gpio_set_direction(GPIO_NUM_47, GPIO_MODE_OUTPUT);
gpio_set_direction(GPIO_NUM_48, GPIO_MODE_OUTPUT);
}
static const st7701_lcd_init_cmd_t st7701_lcd_init_cmds[] = {
// {cmd, { data }, data_size, delay_ms}
{0xFF, (uint8_t[]) {0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0},
@@ -197,8 +181,6 @@ bool St7701Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lc
return false;
}
reclaimSpiPinsForSdCard();
return true;
}
+1 -1
View File
@@ -12,7 +12,7 @@ static error_t stop() {
return ERROR_NONE;
}
Module cyd_4848s040c_module = {
struct Module cyd_4848s040c_module = {
.name = "cyd-4848s040c",
.start = start,
.stop = stop,
+9 -2
View File
@@ -5,7 +5,6 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
/ {
compatible = "root";
@@ -13,7 +12,6 @@
ble0 {
compatible = "espressif,esp32-ble";
status = "disabled";
};
gpio0 {
@@ -28,4 +26,13 @@
pin-sda = <&gpio0 19 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 45 GPIO_FLAG_NONE>;
};
spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
pin-mosi = <&gpio0 47 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 41 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 48 GPIO_FLAG_NONE>;
pin-hd = <&gpio0 42 GPIO_FLAG_NONE>;
};
};
+18 -15
View File
@@ -1,19 +1,22 @@
general.vendor=CYD
general.name=4848S040C
[general]
vendor=CYD
name=4848S040C
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32S3
hardware.flashSize=16MB
hardware.spiRam=true
hardware.spiRamMode=OCT
hardware.spiRamSpeed=80M
hardware.bluetooth=true
[hardware]
target=ESP32S3
flashSize=16MB
spiRam=true
spiRamMode=OCT
spiRamSpeed=80M
bluetooth=true
storage.userDataLocation=SD
[display]
size=4"
shape=rectangle
dpi=170
display.size=4"
display.shape=rectangle
display.dpi=170
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -1,5 +1,7 @@
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
@@ -13,6 +15,7 @@ static bool initBoot() {
static DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,25 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto config = std::make_unique<SpiSdCardDevice::Config>(
GPIO_NUM_10,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot
);
auto* spi_controller = device_find_by_name("spi0");
check(spi_controller, "spi0 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(config),
spi_controller
);
}
@@ -0,0 +1,7 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
-8
View File
@@ -6,7 +6,6 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
/ {
compatible = "root";
@@ -14,7 +13,6 @@
ble0 {
compatible = "espressif,esp32-ble";
status = "disabled";
};
gpio0 {
@@ -41,15 +39,9 @@
spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 10 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 11 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 13 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 12 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
uart1 {
+25 -21
View File
@@ -1,26 +1,30 @@
general.vendor=CYD
general.name=8048S043C
general.incubating=false
[general]
vendor=CYD
name=8048S043C
incubating=false
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32S3
hardware.flashSize=16MB
hardware.spiRam=true
hardware.spiRamMode=OCT
hardware.spiRamSpeed=80M
hardware.esptoolFlashFreq=80M
hardware.bluetooth=true
[hardware]
target=ESP32S3
flashSize=16MB
spiRam=true
spiRamMode=OCT
spiRamSpeed=80M
esptoolFlashFreq=80M
bluetooth=true
storage.userDataLocation=SD
[display]
size=4.3"
shape=rectangle
dpi=217
display.size=4.3"
display.shape=rectangle
display.dpi=217
[cdn]
infoMessage=
warningMessage=
cdn.infoMessage=
cdn.warningMessage=
lvgl.theme=DefaultDark
lvgl.colorDepth=16
lvgl.fontSize=18
[lvgl]
theme=DefaultDark
colorDepth=16
fontSize=18
@@ -1,6 +1,8 @@
#include "devices/SdCard.h"
#include "devices/Display.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
static bool initBoot() {
@@ -10,6 +12,7 @@ static bool initBoot() {
static tt::hal::DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,28 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/RecursiveMutex.h>
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
GPIO_NUM_5,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
nullptr,
std::vector<gpio_num_t>(),
SPI3_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(configuration),
spi_controller
);
}
@@ -0,0 +1,7 @@
#pragma once
#include <Tactility/hal/sdcard/SdCardDevice.h>
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
+2 -21
View File
@@ -3,9 +3,6 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/touch_placeholder.h>
/ {
compatible = "root";
@@ -16,35 +13,19 @@
gpio-count = <40>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display
<&gpio0 33 GPIO_FLAG_NONE>; // Touch
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 12 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
display@0 {
compatible = "display-placeholder";
};
touch@1 {
compatible = "touch-placeholder";
};
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
};
+15 -12
View File
@@ -1,16 +1,19 @@
general.vendor=CYD
general.name=E32R28T
[general]
vendor=CYD
name=E32R28T
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
[hardware]
target=ESP32
flashSize=4MB
spiRam=false
storage.userDataLocation=SD
[display]
size=2.8"
shape=rectangle
dpi=143
display.size=2.8"
display.shape=rectangle
display.dpi=143
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -1,7 +1,10 @@
#include "devices/SdCard.h"
#include "devices/Display.h"
#include "devices/Power.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
using namespace tt::hal;
@@ -14,6 +17,7 @@ static tt::hal::DeviceVector createDevices() {
return {
createPower(),
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,29 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/RecursiveMutex.h>
using tt::hal::sdcard::SpiSdCardDevice;
using SdCardDevice = tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
SD_CS_PIN, // CS pin (IO5 on the module)
GPIO_NUM_NC, // MOSI override: leave NC to use SPI host pins
GPIO_NUM_NC, // MISO override: leave NC
GPIO_NUM_NC, // SCLK override: leave NC
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SD_SPI_HOST // SPI host for SD card (SPI3_HOST)
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(configuration),
spi_controller
);
}
@@ -0,0 +1,13 @@
#pragma once
#include <Tactility/hal/sdcard/SdCardDevice.h>
#include "driver/gpio.h"
#include "driver/spi_common.h"
using tt::hal::sdcard::SdCardDevice;
// SD card (microSD)
constexpr auto SD_CS_PIN = GPIO_NUM_5;
constexpr auto SD_SPI_HOST = SPI3_HOST;
std::shared_ptr<SdCardDevice> createSdCard();
+2 -21
View File
@@ -4,9 +4,6 @@
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/touch_placeholder.h>
/ {
compatible = "root";
@@ -25,35 +22,19 @@
pin-scl = <&gpio0 25 GPIO_FLAG_NONE>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display
<&gpio0 33 GPIO_FLAG_NONE>; // Touch
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 12 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
display@0 {
compatible = "display-placeholder";
};
touch@1 {
compatible = "touch-placeholder";
};
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
};
+15 -12
View File
@@ -1,16 +1,19 @@
general.vendor=CYD
general.name=E32R32P
[general]
vendor=CYD
name=E32R32P
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
[hardware]
target=ESP32
flashSize=4MB
spiRam=false
storage.userDataLocation=SD
[display]
size=2.8"
shape=rectangle
dpi=125
display.size=2.8"
display.shape=rectangle
display.dpi=125
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -1,5 +1,7 @@
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
@@ -12,6 +14,7 @@ static bool initBoot() {
static DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,29 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
using tt::hal::sdcard::SpiSdCardDevice;
constexpr auto CROWPANEL_SDCARD_PIN_CS = GPIO_NUM_7;
std::shared_ptr<SdCardDevice> createSdCard() {
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
CROWPANEL_SDCARD_PIN_CS,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
nullptr,
std::vector<gpio_num_t>(),
SPI3_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(configuration),
spi_controller
);
}
@@ -0,0 +1,7 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
@@ -1,21 +1,24 @@
general.vendor=Elecrow
general.name=CrowPanel Advance 2.8"
[general]
vendor=Elecrow
name=CrowPanel Advance 2.8"
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32S3
hardware.flashSize=16MB
hardware.spiRam=true
hardware.spiRamMode=OCT
hardware.spiRamSpeed=120M
hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
[hardware]
target=ESP32S3
flashSize=16MB
spiRam=true
spiRamMode=OCT
spiRamSpeed=120M
tinyUsb=true
esptoolFlashFreq=120M
bluetooth=true
storage.userDataLocation=SD
[display]
size=2.8"
shape=rectangle
dpi=143
display.size=2.8"
display.shape=rectangle
display.dpi=143
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -6,8 +6,6 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
/ {
compatible = "root";
@@ -15,7 +13,6 @@
ble0 {
compatible = "espressif,esp32-ble";
status = "disabled";
};
gpio0 {
@@ -31,30 +28,19 @@
pin-scl = <&gpio0 16 GPIO_FLAG_NONE>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 40 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 39 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 42 GPIO_FLAG_NONE>;
display {
compatible = "display-placeholder";
};
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 7 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 6 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 4 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 5 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
uart0 {
@@ -1,4 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <PwmBacklight.h>
@@ -12,6 +14,7 @@ static bool initBoot() {
static DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,29 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
using tt::hal::sdcard::SpiSdCardDevice;
constexpr auto CROWPANEL_SDCARD_PIN_CS = GPIO_NUM_7;
std::shared_ptr<SdCardDevice> createSdCard() {
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
CROWPANEL_SDCARD_PIN_CS,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
nullptr,
std::vector<gpio_num_t>(),
SPI3_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(configuration),
spi_controller
);
}
@@ -0,0 +1,7 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
@@ -1,21 +1,24 @@
general.vendor=Elecrow
general.name=CrowPanel Advance 3.5"
[general]
vendor=Elecrow
name=CrowPanel Advance 3.5"
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32S3
hardware.flashSize=16MB
hardware.spiRam=true
hardware.spiRamMode=OCT
hardware.spiRamSpeed=120M
hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
[hardware]
target=ESP32S3
flashSize=16MB
spiRam=true
spiRamMode=OCT
spiRamSpeed=120M
tinyUsb=true
esptoolFlashFreq=120M
bluetooth=true
storage.userDataLocation=SD
[display]
size=3.5"
shape=rectangle
dpi=165
display.size=3.5"
display.shape=rectangle
display.dpi=165
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -6,8 +6,6 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
/ {
compatible = "root";
@@ -15,7 +13,6 @@
ble0 {
compatible = "espressif,esp32-ble";
status = "disabled";
};
gpio0 {
@@ -31,30 +28,19 @@
pin-scl = <&gpio0 16 GPIO_FLAG_NONE>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 40 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 39 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 42 GPIO_FLAG_NONE>;
display {
compatible = "display-placeholder";
};
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 7 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 6 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 4 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 5 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
uart0 {
@@ -1,4 +1,6 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <TCA9534.h>
@@ -23,6 +25,7 @@ static bool initBoot() {
static DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,25 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
// See https://github.com/Elecrow-RD/CrowPanel-Advance-HMI-ESP32-AI-Display/blob/master/5.0/factory_code/factory_code.ino
GPIO_NUM_0, // It's actually not connected, but in the demo pin 0 is used
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot
);
auto* spi_controller = device_find_by_name("spi0");
check(spi_controller, "spi0 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(configuration),
spi_controller
);
}
@@ -0,0 +1,7 @@
#pragma once
#include <Tactility/hal/sdcard/SdCardDevice.h>
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
@@ -1,22 +1,25 @@
general.vendor=Elecrow
general.name=CrowPanel Advance 5.0"
[general]
vendor=Elecrow
name=CrowPanel Advance 5.0"
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32S3
hardware.flashSize=16MB
hardware.spiRam=true
hardware.spiRamMode=OCT
hardware.spiRamSpeed=120M
hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
[hardware]
target=ESP32S3
flashSize=16MB
spiRam=true
spiRamMode=OCT
spiRamSpeed=120M
tinyUsb=true
esptoolFlashFreq=120M
bluetooth=true
storage.userDataLocation=SD
[display]
size=5"
shape=rectangle
dpi=187
display.size=5"
display.shape=rectangle
display.dpi=187
lvgl.colorDepth=16
lvgl.fontSize=18
[lvgl]
colorDepth=16
fontSize=18
@@ -6,7 +6,6 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_sdspi.h>
/ {
compatible = "root";
@@ -14,7 +13,6 @@
ble0 {
compatible = "espressif,esp32-ble";
status = "disabled";
};
gpio0 {
@@ -30,18 +28,12 @@
pin-scl = <&gpio0 16 GPIO_FLAG_NONE>;
};
spi0 {
sdcard_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 0 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 6 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 4 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 5 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
uart0 {
@@ -1,5 +1,7 @@
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
@@ -12,6 +14,7 @@ static bool initBoot() {
static DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}
@@ -0,0 +1,28 @@
#include "SdCard.h"
#include <tactility/device.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
GPIO_NUM_5,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
tt::lvgl::getSyncLock(),
std::vector<gpio_num_t>(),
SPI3_HOST
);
auto* spi_controller = device_find_by_name("spi1");
check(spi_controller, "spi1 not found");
return std::make_shared<SpiSdCardDevice>(
std::move(configuration),
spi_controller
);
}
@@ -0,0 +1,7 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();
@@ -1,16 +1,19 @@
general.vendor=Elecrow
general.name=CrowPanel Basic 2.8"
[general]
vendor=Elecrow
name=CrowPanel Basic 2.8"
apps.launcherAppId=Launcher
[apps]
launcherAppId=Launcher
hardware.target=ESP32
hardware.flashSize=4MB
hardware.spiRam=false
[hardware]
target=ESP32
flashSize=4MB
spiRam=false
storage.userDataLocation=SD
[display]
size=2.8"
shape=rectangle
dpi=143
display.size=2.8"
display.shape=rectangle
display.dpi=143
lvgl.colorDepth=16
[lvgl]
colorDepth=16
@@ -5,9 +5,6 @@
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/touch_placeholder.h>
/ {
compatible = "root";
@@ -26,37 +23,21 @@
pin-scl = <&gpio0 21 GPIO_FLAG_NONE>;
};
spi0 {
display_spi: spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display
<&gpio0 33 GPIO_FLAG_NONE>; // Touch
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 12 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
max-transfer-size = <65536>;
display@0 {
compatible = "display-placeholder";
};
touch@1 {
compatible = "touch-placeholder";
};
};
spi1 {
sdcard_spi: spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 5 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
};
uart1 {
@@ -1,21 +1,20 @@
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
using namespace tt::hal;
static bool initBoot() {
driver::pwmbacklight::init(GPIO_NUM_27);
// Delay is required, or GUI will lock up.
// It's possibly related to the increased power draw when turning on the backlight.
vTaskDelay(100);
return true;
return driver::pwmbacklight::init(GPIO_NUM_27);
}
static DeviceVector createDevices() {
return {
createDisplay(),
createSdCard()
};
}

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