mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-23 00:45:05 +00:00
Compare commits
14 Commits
e73b5f317f
...
e74f2c0664
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e74f2c0664 | ||
|
|
e22dd87775 | ||
|
|
6534bd3841 | ||
|
|
1a071312ab | ||
|
|
10381b10cd | ||
|
|
dfe2c865d1 | ||
|
|
96eccbdc8d | ||
|
|
2839ea4c35 | ||
|
|
51b9547e99 | ||
|
|
d3797abf4e | ||
|
|
4b6ed871a9 | ||
|
|
0d16eb606f | ||
|
|
b8214fd378 | ||
|
|
01ffe420eb |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -30,4 +30,4 @@ If applicable, add screenshots to help explain your problem.
|
|||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
Add your oops.tactility.one URL if you had a crash (scanned from QR).
|
Add your oops.tactilityproject.org URL if you had a crash (scanned from QR).
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
### Checklist
|
### Checklist
|
||||||
|
|
||||||
- [ ] I read [contribution guidelines](https://github.com/ByteWelder/Tactility/blob/main/CONTRIBUTING.md)
|
- [ ] I read [contribution guidelines](https://github.com/TactilityProject/Tactility/blob/main/CONTRIBUTING.md)
|
||||||
- [ ] Code adheres to the [coding style](https://github.com/ByteWelder/Tactility/blob/main/CODING_STYLE.md)
|
- [ ] Code adheres to the [coding style](https://github.com/TactilityProject/Tactility/blob/main/CODING_STYLE.md)
|
||||||
|
|
||||||
### Description
|
### Description
|
||||||
|
|
||||||
|
|||||||
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
@ -20,8 +20,10 @@ jobs:
|
|||||||
- name: "Build Tests"
|
- name: "Build Tests"
|
||||||
run: cmake --build build --target build-tests
|
run: cmake --build build --target build-tests
|
||||||
- name: "Run TactilityCore Tests"
|
- name: "Run TactilityCore Tests"
|
||||||
run: build/Tests/TactilityCore/TactilityCoreTests --exit
|
run: build/Tests/TactilityCore/TactilityCoreTests
|
||||||
- name: "Run TactilityFreeRtos Tests"
|
- name: "Run TactilityFreeRtos Tests"
|
||||||
run: build/Tests/TactilityFreeRtos/TactilityFreeRtosTests --exit
|
run: build/Tests/TactilityFreeRtos/TactilityFreeRtosTests
|
||||||
- name: "Run TactilityHeadless Tests"
|
- name: "Run TactilityHeadless Tests"
|
||||||
run: build/Tests/Tactility/TactilityTests --exit
|
run: build/Tests/Tactility/TactilityTests
|
||||||
|
- name: "Run TactilityKernel Tests"
|
||||||
|
run: build/Tests/TactilityKernel/TactilityKernelTests
|
||||||
|
|||||||
4
Buildscripts/DevicetreeCompiler/.gitignore
vendored
Normal file
4
Buildscripts/DevicetreeCompiler/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.venv/
|
||||||
|
.idea/
|
||||||
|
__pycache__/
|
||||||
|
build/
|
||||||
28
Buildscripts/DevicetreeCompiler/compile.py
Normal file
28
Buildscripts/DevicetreeCompiler/compile.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
from source.printing import print_error
|
||||||
|
from source.main import main
|
||||||
|
|
||||||
|
def print_help():
|
||||||
|
print("Usage: python compile.py [in_file] [out_path] [arguments]\n")
|
||||||
|
print(f"\t[in_path] the path where the root devicetree.yaml file is")
|
||||||
|
print(f"\t[out_path] output folder for C file output")
|
||||||
|
print("")
|
||||||
|
print("Optional arguments:\n")
|
||||||
|
print("\t--help prints this help text")
|
||||||
|
print("\t--verbose output debug info")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if "--help" in sys.argv:
|
||||||
|
print_help()
|
||||||
|
sys.exit()
|
||||||
|
args = [a for a in sys.argv[1:] if not a.startswith("--")]
|
||||||
|
if len(args) < 2:
|
||||||
|
print_error("Missing argument")
|
||||||
|
print_help()
|
||||||
|
sys.exit()
|
||||||
|
is_verbose = "--verbose" in sys.argv
|
||||||
|
devicetree_yaml_config = args[0]
|
||||||
|
output_path = args[1]
|
||||||
|
main(devicetree_yaml_config, output_path, is_verbose)
|
||||||
|
|
||||||
19
Buildscripts/DevicetreeCompiler/source/binding_files.py
Normal file
19
Buildscripts/DevicetreeCompiler/source/binding_files.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
def find_bindings(directory_path: str) -> list[str]:
|
||||||
|
yaml_files = []
|
||||||
|
for root, dirs, files in os.walk(directory_path):
|
||||||
|
for file in files:
|
||||||
|
if file.endswith(".yaml"):
|
||||||
|
full_path = os.path.join(root, file)
|
||||||
|
yaml_files.append(os.path.abspath(full_path))
|
||||||
|
return yaml_files
|
||||||
|
|
||||||
|
def find_all_bindings(directory_paths: list[str]) -> list[str]:
|
||||||
|
yaml_files = []
|
||||||
|
for directory_path in directory_paths:
|
||||||
|
new_paths = find_bindings(directory_path)
|
||||||
|
if len(new_paths) == 0:
|
||||||
|
raise Exception(f"No bindings found in {directory_path}")
|
||||||
|
yaml_files += new_paths
|
||||||
|
return yaml_files
|
||||||
57
Buildscripts/DevicetreeCompiler/source/binding_parser.py
Normal file
57
Buildscripts/DevicetreeCompiler/source/binding_parser.py
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import yaml
|
||||||
|
import os
|
||||||
|
from .models import Binding, BindingProperty
|
||||||
|
|
||||||
|
def parse_binding(file_path: str, binding_dirs: list[str]) -> Binding:
|
||||||
|
with open(file_path, 'r') as f:
|
||||||
|
data = yaml.safe_load(f)
|
||||||
|
|
||||||
|
description = data.get('description', '')
|
||||||
|
bus = data.get('bus', None)
|
||||||
|
properties_dict = {}
|
||||||
|
|
||||||
|
# Handle inclusions
|
||||||
|
includes = data.get('include', [])
|
||||||
|
all_includes = list(includes) # Copy for iteration
|
||||||
|
for include_file in includes:
|
||||||
|
include_path = None
|
||||||
|
for binding_dir in binding_dirs:
|
||||||
|
potential_path = os.path.join(binding_dir, include_file)
|
||||||
|
if os.path.exists(potential_path):
|
||||||
|
include_path = potential_path
|
||||||
|
break
|
||||||
|
|
||||||
|
if not include_path:
|
||||||
|
print(f"Warning: Could not find include file {include_file}")
|
||||||
|
continue
|
||||||
|
|
||||||
|
parent_binding = parse_binding(include_path, binding_dirs)
|
||||||
|
if not description and parent_binding.description:
|
||||||
|
description = parent_binding.description
|
||||||
|
if not bus and parent_binding.bus:
|
||||||
|
bus = parent_binding.bus
|
||||||
|
for prop in parent_binding.properties:
|
||||||
|
properties_dict[prop.name] = prop
|
||||||
|
for include in parent_binding.includes:
|
||||||
|
all_includes.append(include)
|
||||||
|
|
||||||
|
# Parse local properties
|
||||||
|
compatible = data.get('compatible', None)
|
||||||
|
properties_raw = data.get('properties', {})
|
||||||
|
for name, details in properties_raw.items():
|
||||||
|
prop = BindingProperty(
|
||||||
|
name=name,
|
||||||
|
type=details.get('type', 'unknown'),
|
||||||
|
required=details.get('required', False),
|
||||||
|
description=details.get('description', '').strip(),
|
||||||
|
)
|
||||||
|
properties_dict[name] = prop
|
||||||
|
filename = os.path.basename(file_path)
|
||||||
|
return Binding(
|
||||||
|
filename=filename,
|
||||||
|
compatible=compatible,
|
||||||
|
description=description.strip(),
|
||||||
|
properties=list(properties_dict.values()),
|
||||||
|
includes=all_includes,
|
||||||
|
bus=bus
|
||||||
|
)
|
||||||
50
Buildscripts/DevicetreeCompiler/source/config.py
Normal file
50
Buildscripts/DevicetreeCompiler/source/config.py
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
from dataclasses import dataclass, field
|
||||||
|
import yaml
|
||||||
|
import os
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class DeviceTreeConfig:
|
||||||
|
dependencies: list[str] = field(default_factory=list)
|
||||||
|
bindings: list[str] = field(default_factory=list)
|
||||||
|
dts: str = ""
|
||||||
|
|
||||||
|
def parse_config(file_path: str, project_root: str) -> DeviceTreeConfig:
|
||||||
|
"""
|
||||||
|
Parses devicetree.yaml and recursively finds dependencies.
|
||||||
|
Returns a list of DeviceTreeConfig objects in post-order (dependencies first).
|
||||||
|
"""
|
||||||
|
config = DeviceTreeConfig([], [], "")
|
||||||
|
visited = set()
|
||||||
|
|
||||||
|
def _parse_recursive(current_path: str, is_root: bool):
|
||||||
|
abs_path = os.path.abspath(current_path)
|
||||||
|
if abs_path in visited:
|
||||||
|
return
|
||||||
|
visited.add(abs_path)
|
||||||
|
|
||||||
|
# Try to see if it's a directory and contains devicetree.yaml
|
||||||
|
if os.path.isdir(abs_path):
|
||||||
|
abs_path = os.path.join(abs_path, "devicetree.yaml")
|
||||||
|
|
||||||
|
with open(abs_path, 'r') as f:
|
||||||
|
data = yaml.safe_load(f) or {}
|
||||||
|
|
||||||
|
# Handle dependencies before adding current config (post-order)
|
||||||
|
deps = data.get("dependencies", [])
|
||||||
|
for dep in deps:
|
||||||
|
# Dependencies are relative to project_root
|
||||||
|
dep_path = os.path.join(project_root, dep)
|
||||||
|
_parse_recursive(dep_path, False)
|
||||||
|
|
||||||
|
if is_root:
|
||||||
|
config.dependencies += deps
|
||||||
|
dts_path = data.get("dts", "")
|
||||||
|
config.dts = os.path.join(current_path, dts_path)
|
||||||
|
|
||||||
|
bindings = data.get("bindings", "")
|
||||||
|
if bindings:
|
||||||
|
bindings_resolved = os.path.join(current_path, bindings)
|
||||||
|
config.bindings.append(bindings_resolved)
|
||||||
|
|
||||||
|
_parse_recursive(file_path, True)
|
||||||
|
return config
|
||||||
9
Buildscripts/DevicetreeCompiler/source/files.py
Normal file
9
Buildscripts/DevicetreeCompiler/source/files.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
def read_file(path: str):
|
||||||
|
with open(path, "r") as file:
|
||||||
|
result = file.read()
|
||||||
|
return result
|
||||||
|
|
||||||
|
def write_file(path: str, content: str):
|
||||||
|
with open(path, "w") as file:
|
||||||
|
result = file.write(content)
|
||||||
|
return result
|
||||||
217
Buildscripts/DevicetreeCompiler/source/generator.py
Normal file
217
Buildscripts/DevicetreeCompiler/source/generator.py
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
import os.path
|
||||||
|
from textwrap import dedent
|
||||||
|
|
||||||
|
from source.models import *
|
||||||
|
|
||||||
|
def write_include(file, include: IncludeC, verbose: bool):
|
||||||
|
if verbose:
|
||||||
|
print("Processing include:")
|
||||||
|
print(f" {include.statement}")
|
||||||
|
file.write(include.statement)
|
||||||
|
file.write('\n')
|
||||||
|
|
||||||
|
def get_device_identifier_safe(device: Device):
|
||||||
|
if device.identifier == "/":
|
||||||
|
return "root"
|
||||||
|
else:
|
||||||
|
return device.identifier
|
||||||
|
|
||||||
|
def get_device_type_name(device: Device, bindings: list[Binding]):
|
||||||
|
device_binding = find_device_binding(device, bindings)
|
||||||
|
if device_binding is None:
|
||||||
|
raise Exception(f"Binding not found for {device.identifier}")
|
||||||
|
if device_binding.compatible is None:
|
||||||
|
raise Exception(f"Couldn't find compatible binding for {device.identifier}")
|
||||||
|
compatible_safe = device_binding.compatible.split(",")[-1]
|
||||||
|
return compatible_safe.replace("-", "_")
|
||||||
|
|
||||||
|
def find_device_property(device: Device, name: str) -> DeviceProperty:
|
||||||
|
for property in device.properties:
|
||||||
|
if property.name == name:
|
||||||
|
return property
|
||||||
|
return None
|
||||||
|
|
||||||
|
def find_device_binding(device: Device, bindings: list[Binding]) -> Binding:
|
||||||
|
compatible_property = find_device_property(device, "compatible")
|
||||||
|
if compatible_property is None:
|
||||||
|
raise Exception(f"property 'compatible' not found in device {device.identifier}")
|
||||||
|
for binding in bindings:
|
||||||
|
if binding.compatible == compatible_property.value:
|
||||||
|
return binding
|
||||||
|
return None
|
||||||
|
|
||||||
|
def find_binding(compatible: str, bindings: list[Binding]) -> Binding:
|
||||||
|
for binding in bindings:
|
||||||
|
if binding.compatible == compatible:
|
||||||
|
return binding
|
||||||
|
return None
|
||||||
|
|
||||||
|
def property_to_string(property: DeviceProperty) -> str:
|
||||||
|
type = property.type
|
||||||
|
if type == "value":
|
||||||
|
return property.value
|
||||||
|
elif type == "text":
|
||||||
|
return f"\"{property.value}\""
|
||||||
|
elif type == "values":
|
||||||
|
return "{ " + ",".join(property.value) + " }"
|
||||||
|
else:
|
||||||
|
raise Exception(f"property_to_string() has an unsupported type: {type}")
|
||||||
|
|
||||||
|
def resolve_parameters_from_bindings(device: Device, bindings: list[Binding]) -> list:
|
||||||
|
compatible_property = find_device_property(device, "compatible")
|
||||||
|
if compatible_property is None:
|
||||||
|
raise Exception(f"Cannot find 'compatible' property for {device.identifier}")
|
||||||
|
device_binding = find_binding(compatible_property.value, bindings)
|
||||||
|
if device_binding is None:
|
||||||
|
raise Exception(f"Binding not found for {device.identifier} and compatible '{compatible_property.value}'")
|
||||||
|
# Filter out system properties
|
||||||
|
binding_properties = []
|
||||||
|
for property in device_binding.properties:
|
||||||
|
if property.name != "compatible":
|
||||||
|
binding_properties.append(property)
|
||||||
|
# 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 device_property is None:
|
||||||
|
if binding_property.required:
|
||||||
|
raise Exception(f"device {device.identifier} doesn't have property '{binding_property.name}'")
|
||||||
|
else:
|
||||||
|
result[index] = '0'
|
||||||
|
else:
|
||||||
|
result[index] = property_to_string(device_property)
|
||||||
|
return result
|
||||||
|
|
||||||
|
def write_config(file, device: Device, bindings: list[Binding], type_name: str):
|
||||||
|
device_identifier = get_device_identifier_safe(device)
|
||||||
|
config_type = f"{type_name}_config_dt"
|
||||||
|
config_variable_name = f"{device_identifier}_config"
|
||||||
|
file.write(f"static const {config_type} {config_variable_name}" " = {\n")
|
||||||
|
config_params = resolve_parameters_from_bindings(device, bindings)
|
||||||
|
# Indent all params
|
||||||
|
for index, config_param in enumerate(config_params):
|
||||||
|
config_params[index] = f"\t{config_param}"
|
||||||
|
# Join with command and newline
|
||||||
|
if len(config_params) > 0:
|
||||||
|
config_params_joined = ",\n".join(config_params)
|
||||||
|
file.write(f"{config_params_joined}\n")
|
||||||
|
file.write("};\n\n")
|
||||||
|
|
||||||
|
def write_device_structs(file, device: Device, parent_device: Device, bindings: list[Binding], verbose: bool):
|
||||||
|
if verbose:
|
||||||
|
print(f"Writing device struct for '{device.identifier}'")
|
||||||
|
# Assemble some pre-requisites
|
||||||
|
type_name = get_device_type_name(device, bindings)
|
||||||
|
compatible_property = find_device_property(device, "compatible")
|
||||||
|
if compatible_property is None:
|
||||||
|
raise Exception(f"Cannot find 'compatible' property for {device.identifier}")
|
||||||
|
identifier = get_device_identifier_safe(device)
|
||||||
|
config_variable_name = f"{identifier}_config"
|
||||||
|
if parent_device is not None:
|
||||||
|
parent_identifier = get_device_identifier_safe(parent_device)
|
||||||
|
parent_value = f"&{parent_identifier}"
|
||||||
|
else:
|
||||||
|
parent_value = "NULL"
|
||||||
|
# Write config struct
|
||||||
|
write_config(file, device, bindings, type_name)
|
||||||
|
# Write device struct
|
||||||
|
file.write(f"static struct Device {identifier}" " = {\n")
|
||||||
|
file.write(f"\t.name = \"{device.identifier}\",\n") # Use original name
|
||||||
|
file.write(f"\t.config = &{config_variable_name},\n")
|
||||||
|
file.write(f"\t.parent = {parent_value},\n")
|
||||||
|
file.write("};\n\n")
|
||||||
|
# Child devices
|
||||||
|
for child_device in device.devices:
|
||||||
|
write_device_structs(file, child_device, device, bindings, verbose)
|
||||||
|
|
||||||
|
def write_device_init(file, device: Device, bindings: list[Binding], verbose: bool):
|
||||||
|
if verbose:
|
||||||
|
print(f"Processing device init code for '{device.identifier}'")
|
||||||
|
# Assemble some pre-requisites
|
||||||
|
compatible_property = find_device_property(device, "compatible")
|
||||||
|
if compatible_property is None:
|
||||||
|
raise Exception(f"Cannot find 'compatible' property for {device.identifier}")
|
||||||
|
# Type & instance names
|
||||||
|
identifier = get_device_identifier_safe(device)
|
||||||
|
device_variable = identifier
|
||||||
|
# Write device struct
|
||||||
|
file.write(f"\tif (init_builtin_device(&{device_variable}, \"{compatible_property.value}\") != 0) return -1;\n")
|
||||||
|
# Write children
|
||||||
|
for child_device in device.devices:
|
||||||
|
write_device_init(file, child_device, bindings, verbose)
|
||||||
|
|
||||||
|
def generate_devicetree_c(filename: str, items: list[object], bindings: list[Binding], verbose: bool):
|
||||||
|
with open(filename, "w") as file:
|
||||||
|
file.write(dedent('''\
|
||||||
|
// Default headers
|
||||||
|
#include <Tactility/Device.h>
|
||||||
|
#include <Tactility/Driver.h>
|
||||||
|
#include <Tactility/Log.h>
|
||||||
|
// DTS headers
|
||||||
|
'''))
|
||||||
|
|
||||||
|
# Write all headers first
|
||||||
|
for item in items:
|
||||||
|
if type(item) is IncludeC:
|
||||||
|
write_include(file, item, verbose)
|
||||||
|
file.write("\n")
|
||||||
|
|
||||||
|
file.write(dedent('''\
|
||||||
|
#define TAG LOG_TAG(devicetree)
|
||||||
|
|
||||||
|
static int init_builtin_device(struct Device* device, const char* compatible) {
|
||||||
|
struct Driver* driver = driver_find_compatible(compatible);
|
||||||
|
if (driver == NULL) {
|
||||||
|
LOG_E(TAG, "Can't find driver: %s", compatible);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
device_construct(device);
|
||||||
|
device_set_driver(device, driver);
|
||||||
|
device_add(device);
|
||||||
|
const int err = device_start(device);
|
||||||
|
if (err != 0) {
|
||||||
|
LOG_E(TAG, "Failed to start device %s with driver %s: error code %d", device->name, compatible, err);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
'''))
|
||||||
|
|
||||||
|
# Then write all devices
|
||||||
|
for item in items:
|
||||||
|
if type(item) is Device:
|
||||||
|
write_device_structs(file, item, None, bindings, verbose)
|
||||||
|
# Init function body start
|
||||||
|
file.write("int devices_builtin_init() {\n")
|
||||||
|
# Init function body logic
|
||||||
|
for item in items:
|
||||||
|
if type(item) is Device:
|
||||||
|
write_device_init(file, item, bindings, verbose)
|
||||||
|
file.write("\treturn 0;\n")
|
||||||
|
# Init function body end
|
||||||
|
file.write("}\n")
|
||||||
|
|
||||||
|
def generate_devicetree_h(filename: str):
|
||||||
|
with open(filename, "w") as file:
|
||||||
|
file.write(dedent('''\
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern int devices_builtin_init();
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
'''))
|
||||||
|
|
||||||
|
def generate(output_path: str, items: list[object], bindings: list[Binding], verbose: bool):
|
||||||
|
if not os.path.exists(output_path):
|
||||||
|
os.makedirs(output_path)
|
||||||
|
devicetree_c_filename = os.path.join(output_path, "devicetree.c")
|
||||||
|
generate_devicetree_c(devicetree_c_filename, items, bindings, verbose)
|
||||||
|
devicetree_h_filename = os.path.join(output_path, "devicetree.h")
|
||||||
|
generate_devicetree_h(devicetree_h_filename)
|
||||||
46
Buildscripts/DevicetreeCompiler/source/grammar.lark
Normal file
46
Buildscripts/DevicetreeCompiler/source/grammar.lark
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
%import common.DIGIT -> DIGIT
|
||||||
|
%import common.LETTER -> LETTER
|
||||||
|
%import common.HEXDIGIT -> HEXDIGIT
|
||||||
|
%import common.SIGNED_INT -> SIGNED_INT
|
||||||
|
%import common.WS -> WS
|
||||||
|
%import common.SIGNED_NUMBER -> SIGNED_NUMBER
|
||||||
|
%import common.ESCAPED_STRING -> ESCAPED_STRING
|
||||||
|
%ignore WS
|
||||||
|
|
||||||
|
// Comment
|
||||||
|
|
||||||
|
COMMENT: /\/\*([^*]|\*+[^*\/])*\*+\//
|
||||||
|
%ignore COMMENT
|
||||||
|
|
||||||
|
// Boolean
|
||||||
|
|
||||||
|
BOOLEAN: "true" | "false"
|
||||||
|
|
||||||
|
// Main
|
||||||
|
|
||||||
|
INCLUDE_C: /#include <[\w\/.\-]+>/
|
||||||
|
|
||||||
|
PROPERTY_NAME: /#?[a-zA-Z0-9_\-,]+/
|
||||||
|
|
||||||
|
QUOTE: "\""
|
||||||
|
QUOTED_TEXT: QUOTE /[^"]+/ QUOTE
|
||||||
|
quoted_text_array: QUOTED_TEXT ("," " "* QUOTED_TEXT)+
|
||||||
|
HEX_NUMBER: "0x" HEXDIGIT+
|
||||||
|
NUMBER: SIGNED_NUMBER | HEX_NUMBER
|
||||||
|
PHANDLE: /&[0-9a-zA-Z\-]+/
|
||||||
|
C_VARIABLE: /[0-9a-zA-Z_]+/
|
||||||
|
VALUE: NUMBER | PHANDLE | C_VARIABLE
|
||||||
|
value: VALUE
|
||||||
|
values: VALUE+
|
||||||
|
array: NUMBER+
|
||||||
|
|
||||||
|
property_value: quoted_text_array | QUOTED_TEXT | "<" value ">" | "<" values ">" | "[" array "]"
|
||||||
|
device_property: PROPERTY_NAME ["=" property_value] ";"
|
||||||
|
|
||||||
|
DEVICE_IDENTIFIER: /[a-zA-Z0-9_\-\/@]+/
|
||||||
|
|
||||||
|
device: DEVICE_IDENTIFIER "{" (device | device_property)* "};"
|
||||||
|
|
||||||
|
dts_version: /[0-9a-zA-Z\-]+/
|
||||||
|
|
||||||
|
start: "/" dts_version "/;" INCLUDE_C* device+
|
||||||
46
Buildscripts/DevicetreeCompiler/source/main.py
Normal file
46
Buildscripts/DevicetreeCompiler/source/main.py
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import os
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
from lark import Lark
|
||||||
|
|
||||||
|
from source.files import *
|
||||||
|
from source.transformer import *
|
||||||
|
from source.generator import *
|
||||||
|
from source.binding_files import find_all_bindings
|
||||||
|
from source.binding_parser import parse_binding
|
||||||
|
from source.config import *
|
||||||
|
|
||||||
|
def main(config_path: str, output_path: str, verbose: bool):
|
||||||
|
print(f"Generating devicetree code\n config: {config_path}\n output: {output_path}")
|
||||||
|
if not os.path.isdir(config_path):
|
||||||
|
raise Exception(f"Directory not found: {config_path}")
|
||||||
|
|
||||||
|
config = parse_config(config_path, os.getcwd())
|
||||||
|
if verbose:
|
||||||
|
pprint(config)
|
||||||
|
|
||||||
|
project_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
grammar_path = os.path.join(project_dir, "grammar.lark")
|
||||||
|
lark_data = read_file(grammar_path)
|
||||||
|
dts_data = read_file(config.dts)
|
||||||
|
lark = Lark(lark_data)
|
||||||
|
parsed = lark.parse(dts_data)
|
||||||
|
if verbose:
|
||||||
|
print(parsed.pretty())
|
||||||
|
transformed = DtsTransformer().transform(parsed)
|
||||||
|
if verbose:
|
||||||
|
pprint(transformed)
|
||||||
|
binding_files = find_all_bindings(config.bindings)
|
||||||
|
if verbose:
|
||||||
|
print(f"Bindings found:")
|
||||||
|
for binding_file in binding_files:
|
||||||
|
print(f" {binding_file}")
|
||||||
|
if verbose:
|
||||||
|
print(f"Parsing bindings")
|
||||||
|
bindings = []
|
||||||
|
for binding_file in binding_files:
|
||||||
|
bindings.append(parse_binding(binding_file, config.bindings))
|
||||||
|
if verbose:
|
||||||
|
for binding in bindings:
|
||||||
|
pprint(binding)
|
||||||
|
generate(output_path, transformed, bindings, verbose)
|
||||||
42
Buildscripts/DevicetreeCompiler/source/models.py
Normal file
42
Buildscripts/DevicetreeCompiler/source/models.py
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class DtsVersion:
|
||||||
|
version: str
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Device:
|
||||||
|
identifier: str
|
||||||
|
properties: list
|
||||||
|
devices: list
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class DeviceProperty:
|
||||||
|
name: str
|
||||||
|
type: str
|
||||||
|
value: object
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class PropertyValue:
|
||||||
|
type: str
|
||||||
|
value: object
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class IncludeC:
|
||||||
|
statement: str
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class BindingProperty:
|
||||||
|
name: str
|
||||||
|
type: str
|
||||||
|
required: bool
|
||||||
|
description: str
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Binding:
|
||||||
|
filename: str
|
||||||
|
compatible: list[str]
|
||||||
|
description: str
|
||||||
|
properties: list[BindingProperty]
|
||||||
|
includes: list[str]
|
||||||
|
bus: str = None
|
||||||
20
Buildscripts/DevicetreeCompiler/source/printing.py
Normal file
20
Buildscripts/DevicetreeCompiler/source/printing.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
if sys.platform == "win32":
|
||||||
|
SHELL_COLOR_RED = ""
|
||||||
|
SHELL_COLOR_ORANGE = ""
|
||||||
|
SHELL_COLOR_RESET = ""
|
||||||
|
else:
|
||||||
|
SHELL_COLOR_RED = "\033[91m"
|
||||||
|
SHELL_COLOR_ORANGE = "\033[93m"
|
||||||
|
SHELL_COLOR_RESET = "\033[m"
|
||||||
|
|
||||||
|
def print_warning(message):
|
||||||
|
print(f"{SHELL_COLOR_ORANGE}WARNING: {message}{SHELL_COLOR_RESET}")
|
||||||
|
|
||||||
|
def print_error(message):
|
||||||
|
print(f"{SHELL_COLOR_RED}ERROR: {message}{SHELL_COLOR_RESET}")
|
||||||
|
|
||||||
|
def exit_with_error(message):
|
||||||
|
print_error(message)
|
||||||
|
sys.exit(1)
|
||||||
67
Buildscripts/DevicetreeCompiler/source/transformer.py
Normal file
67
Buildscripts/DevicetreeCompiler/source/transformer.py
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
from typing import List
|
||||||
|
|
||||||
|
from lark import Transformer
|
||||||
|
from lark import Token
|
||||||
|
from source.models import *
|
||||||
|
|
||||||
|
def flatten_token_array(tokens: List[Token], name: str):
|
||||||
|
result_list = list()
|
||||||
|
for token in tokens:
|
||||||
|
result_list.append(token.value)
|
||||||
|
return Token(name, result_list)
|
||||||
|
|
||||||
|
class DtsTransformer(Transformer):
|
||||||
|
# Flatten the start node into a list
|
||||||
|
def start(self, tokens):
|
||||||
|
return tokens
|
||||||
|
def dts_version(self, tokens: List[Token]):
|
||||||
|
version = tokens[0].value
|
||||||
|
if version != "dts-v1":
|
||||||
|
raise Exception(f"Unsupported DTS version: {version}")
|
||||||
|
return DtsVersion(version)
|
||||||
|
def device(self, tokens: list):
|
||||||
|
identifier = "UNKNOWN"
|
||||||
|
properties = list()
|
||||||
|
devices = list()
|
||||||
|
for index, entry in enumerate(tokens):
|
||||||
|
if index == 0:
|
||||||
|
identifier = entry.value
|
||||||
|
elif type(entry) is DeviceProperty:
|
||||||
|
properties.append(entry)
|
||||||
|
elif type(entry) is Device:
|
||||||
|
devices.append(entry)
|
||||||
|
return Device(identifier, properties, devices)
|
||||||
|
def device_property(self, objects: List[object]):
|
||||||
|
name = objects[0]
|
||||||
|
if len(objects) == 1:
|
||||||
|
# Boolean property with no value
|
||||||
|
return DeviceProperty(name, "boolean", True)
|
||||||
|
if type(objects[1]) is not PropertyValue:
|
||||||
|
raise Exception(f"Object was not converted to PropertyValue: {objects[1]}")
|
||||||
|
return DeviceProperty(name, objects[1].type, objects[1].value)
|
||||||
|
def property_value(self, tokens: List):
|
||||||
|
token = tokens[0]
|
||||||
|
if type(token) is Token:
|
||||||
|
raise Exception(f"Failed to convert token to PropertyValue: {token}")
|
||||||
|
return token
|
||||||
|
def values(self, object):
|
||||||
|
return PropertyValue(type="values", value=object)
|
||||||
|
def value(self, object):
|
||||||
|
return PropertyValue(type="value", value=object[0])
|
||||||
|
def array(self, object):
|
||||||
|
return PropertyValue(type="array", value=object)
|
||||||
|
def VALUE(self, token: Token):
|
||||||
|
return token.value
|
||||||
|
def NUMBER(self, token: Token):
|
||||||
|
return token.value
|
||||||
|
def PROPERTY_NAME(self, token: Token):
|
||||||
|
return token.value
|
||||||
|
def QUOTED_TEXT(self, token: Token):
|
||||||
|
return PropertyValue("text", token.value[1:-1])
|
||||||
|
def quoted_text_array(self, tokens: List[Token]):
|
||||||
|
result_list = list()
|
||||||
|
for token in tokens:
|
||||||
|
result_list.append(token.value)
|
||||||
|
return PropertyValue("text_array", result_list)
|
||||||
|
def INCLUDE_C(self, token: Token):
|
||||||
|
return IncludeC(token.value)
|
||||||
@ -20,37 +20,39 @@ tactility_library_path=$library_path/TactilityC
|
|||||||
mkdir -p $tactility_library_path/Binary
|
mkdir -p $tactility_library_path/Binary
|
||||||
cp build/esp-idf/TactilityC/libTactilityC.a $tactility_library_path/Binary/
|
cp build/esp-idf/TactilityC/libTactilityC.a $tactility_library_path/Binary/
|
||||||
mkdir -p $tactility_library_path/Include
|
mkdir -p $tactility_library_path/Include
|
||||||
find_target_dir=$build_dir/$tactility_library_path/Include/
|
find_target_dir="$build_dir/$tactility_library_path"
|
||||||
cp TactilityC/Include/* $find_target_dir
|
cp TactilityC/Include/* "$find_target_dir/Include"
|
||||||
cp Documentation/license-tactilitysdk.md $build_dir/$tactility_library_path/LICENSE.md
|
cp TactilityC/*.txt "$find_target_dir"
|
||||||
|
cp TactilityC/*.md "$find_target_dir"
|
||||||
|
|
||||||
# TactilityFreeRtos
|
# TactilityFreeRtos
|
||||||
tactilityfreertos_library_path=$library_path/TactilityFreeRtos
|
tactilityfreertos_library_path=$library_path/TactilityFreeRtos
|
||||||
mkdir -p $tactilityfreertos_library_path/Include
|
mkdir -p "$tactilityfreertos_library_path/Include"
|
||||||
find_target_dir=$build_dir/$tactilityfreertos_library_path/Include/
|
find_target_dir="$build_dir/$tactilityfreertos_library_path"
|
||||||
cp -r TactilityFreeRtos/Include/* $find_target_dir
|
cp -r TactilityFreeRtos/Include/* "$find_target_dir/Include"
|
||||||
cp Documentation/license-tactilitysdk.md $build_dir/$tactilityfreertos_library_path/LICENSE.md
|
cp TactilityFreeRtos/*.txt "$find_target_dir"
|
||||||
|
cp TactilityFreeRtos/*.md "$find_target_dir"
|
||||||
|
|
||||||
# lvgl
|
# lvgl
|
||||||
lvgl_library_path=$library_path/lvgl
|
lvgl_library_path=$library_path/lvgl
|
||||||
mkdir -p $lvgl_library_path/Binary
|
mkdir -p "$lvgl_library_path/Binary"
|
||||||
mkdir -p $lvgl_library_path/Include
|
mkdir -p "$lvgl_library_path/Include"
|
||||||
cp build/esp-idf/lvgl/liblvgl.a $lvgl_library_path/Binary/
|
cp build/esp-idf/lvgl/liblvgl.a "$lvgl_library_path/Binary/"
|
||||||
find_target_dir=$build_dir/$lvgl_library_path/Include/
|
find_target_dir="$build_dir/$lvgl_library_path"
|
||||||
cd Libraries/lvgl
|
cd Libraries/lvgl
|
||||||
find src/ -name '*.h' | cpio -pdm $find_target_dir
|
find src/ -name '*.h' | cpio -pdm "$find_target_dir/Include"
|
||||||
cd -
|
cd -
|
||||||
cp Libraries/lvgl/lvgl.h $find_target_dir
|
cp Libraries/lvgl/lvgl.h "$find_target_dir/Include"
|
||||||
cp Libraries/lvgl/lv_version.h $find_target_dir
|
cp Libraries/lvgl/lv_version.h "$find_target_dir/Include"
|
||||||
cp Libraries/lvgl/LICENCE.txt $lvgl_library_path/LICENSE.txt
|
cp Libraries/lvgl/LICENCE.txt "$lvgl_library_path/LICENSE.txt"
|
||||||
cp Libraries/lvgl/src/lv_conf_kconfig.h $lvgl_library_path/Include/lv_conf.h
|
cp Libraries/lvgl/src/lv_conf_kconfig.h "$lvgl_library_path/Include/lv_conf.h"
|
||||||
|
|
||||||
# elf_loader
|
# elf_loader
|
||||||
elf_loader_library_path=$library_path/elf_loader
|
elf_loader_library_path="$library_path/elf_loader"
|
||||||
mkdir -p $elf_loader_library_path
|
mkdir -p "$elf_loader_library_path"
|
||||||
cp Libraries/elf_loader/elf_loader.cmake $elf_loader_library_path/
|
cp Libraries/elf_loader/elf_loader.cmake "$elf_loader_library_path/"
|
||||||
cp Libraries/elf_loader/license.txt $elf_loader_library_path/
|
cp Libraries/elf_loader/license.txt "$elf_loader_library_path/"
|
||||||
|
|
||||||
cp Buildscripts/CMake/TactilitySDK.cmake $target_path/
|
cp Buildscripts/CMake/TactilitySDK.cmake "$target_path/"
|
||||||
cp Buildscripts/CMake/CMakeLists.txt $target_path/
|
cp Buildscripts/CMake/CMakeLists.txt "$target_path/"
|
||||||
printf '%s' "$ESP_IDF_VERSION" >> $target_path/idf-version.txt
|
printf '%s' "$ESP_IDF_VERSION" >> "$target_path/idf-version.txt"
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
set(CMAKE_ASM_COMPILE_OBJECT "${CMAKE_CXX_COMPILER_TARGET}")
|
set(CMAKE_ASM_COMPILE_OBJECT "${CMAKE_CXX_COMPILER_TARGET}")
|
||||||
|
|
||||||
include("Buildscripts/logo.cmake")
|
include("Buildscripts/logo.cmake")
|
||||||
@ -13,20 +12,28 @@ set(Cyan "${Esc}[36m")
|
|||||||
file(READ version.txt TACTILITY_VERSION)
|
file(READ version.txt TACTILITY_VERSION)
|
||||||
add_compile_definitions(TT_VERSION="${TACTILITY_VERSION}")
|
add_compile_definitions(TT_VERSION="${TACTILITY_VERSION}")
|
||||||
|
|
||||||
|
# Determine device identifier and project location
|
||||||
|
if (DEFINED ENV{ESP_IDF_VERSION})
|
||||||
|
include("Buildscripts/device.cmake")
|
||||||
|
init_tactility_globals("sdkconfig")
|
||||||
|
get_property(TACTILITY_DEVICE_PROJECT GLOBAL PROPERTY TACTILITY_DEVICE_PROJECT)
|
||||||
|
get_property(TACTILITY_DEVICE_ID GLOBAL PROPERTY TACTILITY_DEVICE_ID)
|
||||||
|
else ()
|
||||||
|
set(TACTILITY_DEVICE_PROJECT "Devices/simulator")
|
||||||
|
set(TACTILITY_DEVICE_ID "simulator")
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (DEFINED ENV{ESP_IDF_VERSION})
|
if (DEFINED ENV{ESP_IDF_VERSION})
|
||||||
message("Using ESP-IDF ${Cyan}v$ENV{ESP_IDF_VERSION}${ColorReset}")
|
message("Using ESP-IDF ${Cyan}v$ENV{ESP_IDF_VERSION}${ColorReset}")
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
|
|
||||||
include("Buildscripts/device.cmake")
|
|
||||||
|
|
||||||
init_tactility_globals("sdkconfig")
|
|
||||||
get_property(TACTILITY_DEVICE_PROJECT GLOBAL PROPERTY TACTILITY_DEVICE_PROJECT)
|
|
||||||
|
|
||||||
set(COMPONENTS Firmware)
|
set(COMPONENTS Firmware)
|
||||||
set(EXTRA_COMPONENT_DIRS
|
set(EXTRA_COMPONENT_DIRS
|
||||||
"Firmware"
|
"Firmware"
|
||||||
"Devices/${TACTILITY_DEVICE_PROJECT}"
|
"Devices/${TACTILITY_DEVICE_PROJECT}"
|
||||||
"Drivers"
|
"Drivers"
|
||||||
|
"Platforms/PlatformEsp32"
|
||||||
|
"TactilityKernel"
|
||||||
"Tactility"
|
"Tactility"
|
||||||
"TactilityC"
|
"TactilityC"
|
||||||
"TactilityCore"
|
"TactilityCore"
|
||||||
@ -69,6 +76,8 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
|||||||
add_subdirectory(Tactility)
|
add_subdirectory(Tactility)
|
||||||
add_subdirectory(TactilityCore)
|
add_subdirectory(TactilityCore)
|
||||||
add_subdirectory(TactilityFreeRtos)
|
add_subdirectory(TactilityFreeRtos)
|
||||||
|
add_subdirectory(TactilityKernel)
|
||||||
|
add_subdirectory(Platforms/PlatformPosix)
|
||||||
add_subdirectory(Devices/simulator)
|
add_subdirectory(Devices/simulator)
|
||||||
add_subdirectory(Libraries/cJSON)
|
add_subdirectory(Libraries/cJSON)
|
||||||
add_subdirectory(Libraries/lv_screenshot)
|
add_subdirectory(Libraries/lv_screenshot)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## New features and boards
|
## New features and boards
|
||||||
|
|
||||||
Feel free to open an [issue](https://github.com/ByteWelder/Tactility/issues/new)
|
Feel free to open an [issue](https://github.com/TactilityProject/Tactility/issues/new)
|
||||||
to discuss ideas you have regarding the implementation of new boards or features.
|
to discuss ideas you have regarding the implementation of new boards or features.
|
||||||
|
|
||||||
Keep in mind that the internal APIs are changing rapidly. They might change considerably in a short timespan.
|
Keep in mind that the internal APIs are changing rapidly. They might change considerably in a short timespan.
|
||||||
@ -28,7 +28,7 @@ Some examples of non-serious issues include:
|
|||||||
|
|
||||||
## Anything that doesn't fall in the above categories?
|
## Anything that doesn't fall in the above categories?
|
||||||
|
|
||||||
Please [contact me](https://tactility.one/#/support) first!
|
Please [contact me](https://tactilityproject.org/#/support) first!
|
||||||
|
|
||||||
## Pull Requests
|
## Pull Requests
|
||||||
|
|
||||||
|
|||||||
27
Data/data/service/webserver/settings.properties
Normal file
27
Data/data/service/webserver/settings.properties
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Web Server Settings
|
||||||
|
# WiFi and HTTP server configuration
|
||||||
|
|
||||||
|
# WiFi Enable (0=disabled, 1=enabled)
|
||||||
|
wifiEnabled=0
|
||||||
|
|
||||||
|
# WiFi Mode (0=Station/Client, 1=Access Point)
|
||||||
|
wifiMode=0
|
||||||
|
|
||||||
|
# Access Point Mode Settings (create own WiFi network)
|
||||||
|
# apSsid will be auto-generated as Tactility-XXXX if empty
|
||||||
|
# apPassword will be auto-generated if empty or insecure (WPA2 requires 8-63 chars)
|
||||||
|
# apOpenNetwork: if 1, create open network without password (ignores apPassword)
|
||||||
|
apSsid=
|
||||||
|
apPassword=
|
||||||
|
apOpenNetwork=0
|
||||||
|
apChannel=1
|
||||||
|
|
||||||
|
# Web Server Settings
|
||||||
|
webServerEnabled=0
|
||||||
|
webServerPort=80
|
||||||
|
|
||||||
|
# HTTP Basic Authentication (optional)
|
||||||
|
# When auth is enabled with empty/insecure credentials, strong random credentials are auto-generated
|
||||||
|
webServerAuthEnabled=0
|
||||||
|
webServerUsername=
|
||||||
|
webServerPassword=
|
||||||
1147
Data/data/webserver/dashboard.html
Normal file
1147
Data/data/webserver/dashboard.html
Normal file
File diff suppressed because it is too large
Load Diff
3
Data/data/webserver/version.json
Normal file
3
Data/data/webserver/version.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"version": 0
|
||||||
|
}
|
||||||
BIN
Data/system/cursor.png
Normal file
BIN
Data/system/cursor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 546 B |
BIN
Data/system/service/Statusbar/assets/webserver_ap_white.png
Normal file
BIN
Data/system/service/Statusbar/assets/webserver_ap_white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 663 B |
BIN
Data/system/service/Statusbar/assets/webserver_station_white.png
Normal file
BIN
Data/system/service/Statusbar/assets/webserver_station_white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 755 B |
44
Data/system_sources/cursor.svg
Normal file
44
Data/system_sources/cursor.svg
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
height="24px"
|
||||||
|
viewBox="0 -960 960 960"
|
||||||
|
width="24px"
|
||||||
|
fill="#e3e3e3"
|
||||||
|
version="1.1"
|
||||||
|
id="svg1"
|
||||||
|
sodipodi:docname="cursor.svg"
|
||||||
|
inkscape:version="1.4.3 (0d15f75042, 2025-12-25)"
|
||||||
|
inkscape:export-filename="cursor.png"
|
||||||
|
inkscape:export-xdpi="64"
|
||||||
|
inkscape:export-ydpi="64"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs
|
||||||
|
id="defs1" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#000000"
|
||||||
|
borderopacity="0.25"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:zoom="27.754563"
|
||||||
|
inkscape:cx="8.2689106"
|
||||||
|
inkscape:cy="12.538479"
|
||||||
|
inkscape:window-width="3440"
|
||||||
|
inkscape:window-height="1371"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg1" />
|
||||||
|
<path
|
||||||
|
d="m 557.97643,-402.02357 331.52219,-134.40089 c 11.09341,-4.26669 19.20013,-10.88007 24.32016,-19.84013 5.12004,-8.96006 7.68005,-18.13346 7.68005,-27.52018 0,-9.38673 -2.77335,-18.56012 -8.32005,-27.52018 -5.5467,-8.96006 -13.86676,-15.57344 -24.96017,-19.84013 l -785.9252,-291.84191 c -10.240066,-4.2667 -20.053468,-5.1201 -29.440193,-2.56 -9.386724,2.56 -17.493453,7.2533 -24.320161,14.0801 -6.826707,6.82666 -11.520076,14.93339 -14.080093,24.32011 -2.560017,9.38673 -1.706673,19.20013 2.560017,29.4402 l 291.84194,785.925186 c 4.26669,11.09341 10.88007,19.41346 19.84013,24.96016 8.96006,5.5467 18.13345,8.32006 27.52018,8.32006 9.38672,0 18.56012,-2.56002 27.52018,-7.68005 8.96006,-5.12004 15.57344,-13.22675 19.84013,-24.32016 z"
|
||||||
|
id="path1"
|
||||||
|
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:66.24;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
||||||
|
sodipodi:nodetypes="ccsssccsssccssscc"
|
||||||
|
inkscape:label="cursor" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.1 KiB |
63
Data/webserver/default.html
Normal file
63
Data/webserver/default.html
Normal 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
Data/webserver/version.json
Normal file
3
Data/webserver/version.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"version": 0
|
||||||
|
}
|
||||||
675
Devices/LICENSE-GPL-3.0.md
Normal file
675
Devices/LICENSE-GPL-3.0.md
Normal file
@ -0,0 +1,675 @@
|
|||||||
|
# GNU GENERAL PUBLIC LICENSE
|
||||||
|
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
<https://fsf.org/>
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
|
license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
## Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom
|
||||||
|
to share and change all versions of a program--to make sure it remains
|
||||||
|
free software for all its users. We, the Free Software Foundation, use
|
||||||
|
the GNU General Public License for most of our software; it applies
|
||||||
|
also to any other work released this way by its authors. You can apply
|
||||||
|
it to your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you
|
||||||
|
have certain responsibilities if you distribute copies of the
|
||||||
|
software, or if you modify it: responsibilities to respect the freedom
|
||||||
|
of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the
|
||||||
|
manufacturer can do so. This is fundamentally incompatible with the
|
||||||
|
aim of protecting users' freedom to change the software. The
|
||||||
|
systematic pattern of such abuse occurs in the area of products for
|
||||||
|
individuals to use, which is precisely where it is most unacceptable.
|
||||||
|
Therefore, we have designed this version of the GPL to prohibit the
|
||||||
|
practice for those products. If such problems arise substantially in
|
||||||
|
other domains, we stand ready to extend this provision to those
|
||||||
|
domains in future versions of the GPL, as needed to protect the
|
||||||
|
freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish
|
||||||
|
to avoid the special danger that patents applied to a free program
|
||||||
|
could make it effectively proprietary. To prevent this, the GPL
|
||||||
|
assures that patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
## TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
### 0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds
|
||||||
|
of works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of
|
||||||
|
an exact copy. The resulting work is called a "modified version" of
|
||||||
|
the earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user
|
||||||
|
through a computer network, with no transfer of a copy, is not
|
||||||
|
conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices" to
|
||||||
|
the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
### 1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work for
|
||||||
|
making modifications to it. "Object code" means any non-source form of
|
||||||
|
a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users can
|
||||||
|
regenerate automatically from other parts of the Corresponding Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that same
|
||||||
|
work.
|
||||||
|
|
||||||
|
### 2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not convey,
|
||||||
|
without conditions so long as your license otherwise remains in force.
|
||||||
|
You may convey covered works to others for the sole purpose of having
|
||||||
|
them make modifications exclusively for you, or provide you with
|
||||||
|
facilities for running those works, provided that you comply with the
|
||||||
|
terms of this License in conveying all material for which you do not
|
||||||
|
control copyright. Those thus making or running the covered works for
|
||||||
|
you must do so exclusively on your behalf, under your direction and
|
||||||
|
control, on terms that prohibit them from making any copies of your
|
||||||
|
copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under the
|
||||||
|
conditions stated below. Sublicensing is not allowed; section 10 makes
|
||||||
|
it unnecessary.
|
||||||
|
|
||||||
|
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such
|
||||||
|
circumvention is effected by exercising rights under this License with
|
||||||
|
respect to the covered work, and you disclaim any intention to limit
|
||||||
|
operation or modification of the work as a means of enforcing, against
|
||||||
|
the work's users, your or third parties' legal rights to forbid
|
||||||
|
circumvention of technological measures.
|
||||||
|
|
||||||
|
### 4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
### 5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these
|
||||||
|
conditions:
|
||||||
|
|
||||||
|
- a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
- b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under
|
||||||
|
section 7. This requirement modifies the requirement in section 4
|
||||||
|
to "keep intact all notices".
|
||||||
|
- c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
- d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
### 6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms of
|
||||||
|
sections 4 and 5, provided that you also convey the machine-readable
|
||||||
|
Corresponding Source under the terms of this License, in one of these
|
||||||
|
ways:
|
||||||
|
|
||||||
|
- a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
- b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the Corresponding
|
||||||
|
Source from a network server at no charge.
|
||||||
|
- c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
- d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
- e) Convey the object code using peer-to-peer transmission,
|
||||||
|
provided you inform other peers where the object code and
|
||||||
|
Corresponding Source of the work are being offered to the general
|
||||||
|
public at no charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal,
|
||||||
|
family, or household purposes, or (2) anything designed or sold for
|
||||||
|
incorporation into a dwelling. In determining whether a product is a
|
||||||
|
consumer product, doubtful cases shall be resolved in favor of
|
||||||
|
coverage. For a particular product received by a particular user,
|
||||||
|
"normally used" refers to a typical or common use of that class of
|
||||||
|
product, regardless of the status of the particular user or of the way
|
||||||
|
in which the particular user actually uses, or expects or is expected
|
||||||
|
to use, the product. A product is a consumer product regardless of
|
||||||
|
whether the product has substantial commercial, industrial or
|
||||||
|
non-consumer uses, unless such uses represent the only significant
|
||||||
|
mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to
|
||||||
|
install and execute modified versions of a covered work in that User
|
||||||
|
Product from a modified version of its Corresponding Source. The
|
||||||
|
information must suffice to ensure that the continued functioning of
|
||||||
|
the modified object code is in no case prevented or interfered with
|
||||||
|
solely because modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or
|
||||||
|
updates for a work that has been modified or installed by the
|
||||||
|
recipient, or for the User Product in which it has been modified or
|
||||||
|
installed. Access to a network may be denied when the modification
|
||||||
|
itself materially and adversely affects the operation of the network
|
||||||
|
or violates the rules and protocols for communication across the
|
||||||
|
network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
### 7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders
|
||||||
|
of that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
- a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
- b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
- c) Prohibiting misrepresentation of the origin of that material,
|
||||||
|
or requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
- d) Limiting the use for publicity purposes of names of licensors
|
||||||
|
or authors of the material; or
|
||||||
|
- e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
- f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions
|
||||||
|
of it) with contractual assumptions of liability to the recipient,
|
||||||
|
for any liability that these contractual assumptions directly
|
||||||
|
impose on those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions; the
|
||||||
|
above requirements apply either way.
|
||||||
|
|
||||||
|
### 8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your license
|
||||||
|
from a particular copyright holder is reinstated (a) provisionally,
|
||||||
|
unless and until the copyright holder explicitly and finally
|
||||||
|
terminates your license, and (b) permanently, if the copyright holder
|
||||||
|
fails to notify you of the violation by some reasonable means prior to
|
||||||
|
60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
### 9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or run
|
||||||
|
a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
### 10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
### 11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims owned
|
||||||
|
or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within the
|
||||||
|
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||||
|
the non-exercise of one or more of the rights that are specifically
|
||||||
|
granted under this License. You may not convey a covered work if you
|
||||||
|
are a party to an arrangement with a third party that is in the
|
||||||
|
business of distributing software, under which you make payment to the
|
||||||
|
third party based on the extent of your activity of conveying the
|
||||||
|
work, and under which the third party grants, to any of the parties
|
||||||
|
who would receive the covered work from you, a discriminatory patent
|
||||||
|
license (a) in connection with copies of the covered work conveyed by
|
||||||
|
you (or copies made from those copies), or (b) primarily for and in
|
||||||
|
connection with specific products or compilations that contain the
|
||||||
|
covered work, unless you entered into that arrangement, or that patent
|
||||||
|
license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
### 12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under
|
||||||
|
this License and any other pertinent obligations, then as a
|
||||||
|
consequence you may not convey it at all. For example, if you agree to
|
||||||
|
terms that obligate you to collect a royalty for further conveying
|
||||||
|
from those to whom you convey the Program, the only way you could
|
||||||
|
satisfy both those terms and this License would be to refrain entirely
|
||||||
|
from conveying the Program.
|
||||||
|
|
||||||
|
### 13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
### 14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in
|
||||||
|
detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies that a certain numbered version of the GNU General Public
|
||||||
|
License "or any later version" applies to it, you have the option of
|
||||||
|
following the terms and conditions either of that numbered version or
|
||||||
|
of any later version published by the Free Software Foundation. If the
|
||||||
|
Program does not specify a version number of the GNU General Public
|
||||||
|
License, you may choose any version ever published by the Free
|
||||||
|
Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future versions
|
||||||
|
of the GNU General Public License can be used, that proxy's public
|
||||||
|
statement of acceptance of a version permanently authorizes you to
|
||||||
|
choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
### 15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
||||||
|
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||||
|
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||||
|
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||||
|
CORRECTION.
|
||||||
|
|
||||||
|
### 16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||||
|
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||||
|
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||||
|
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||||
|
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||||
|
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||||
|
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
### 17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
## How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these
|
||||||
|
terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest to
|
||||||
|
attach them to the start of each source file to most effectively state
|
||||||
|
the exclusion of warranty; and each file should have at least the
|
||||||
|
"copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper
|
||||||
|
mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands \`show w' and \`show c' should show the
|
||||||
|
appropriate parts of the General Public License. Of course, your
|
||||||
|
program's commands might be different; for a GUI interface, you would
|
||||||
|
use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
|
necessary. For more information on this, and how to apply and follow
|
||||||
|
the GNU GPL, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your
|
||||||
|
program into proprietary programs. If your program is a subroutine
|
||||||
|
library, you may consider it more useful to permit linking proprietary
|
||||||
|
applications with the library. If this is what you want to do, use the
|
||||||
|
GNU Lesser General Public License instead of this License. But first,
|
||||||
|
please read <https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
7
Devices/btt-panda-touch/Source/Drivers.cpp
Normal file
7
Devices/btt-panda-touch/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/btt-panda-touch/devicetree.yaml
Normal file
3
Devices/btt-panda-touch/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/cyd-2432s024c/Source/Drivers.cpp
Normal file
7
Devices/cyd-2432s024c/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/cyd-2432s024c/devicetree.yaml
Normal file
3
Devices/cyd-2432s024c/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/cyd-2432s028r/Source/Drivers.cpp
Normal file
7
Devices/cyd-2432s028r/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/cyd-2432s028r/devicetree.yaml
Normal file
3
Devices/cyd-2432s028r/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/cyd-2432s028rv3/Source/Drivers.cpp
Normal file
7
Devices/cyd-2432s028rv3/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/cyd-2432s028rv3/devicetree.yaml
Normal file
3
Devices/cyd-2432s028rv3/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/cyd-2432s032c/Source/Drivers.cpp
Normal file
7
Devices/cyd-2432s032c/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/cyd-2432s032c/devicetree.yaml
Normal file
3
Devices/cyd-2432s032c/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/cyd-4848s040c/Source/Drivers.cpp
Normal file
7
Devices/cyd-4848s040c/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/cyd-4848s040c/devicetree.yaml
Normal file
3
Devices/cyd-4848s040c/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/cyd-8048s043c/Source/Drivers.cpp
Normal file
7
Devices/cyd-8048s043c/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/cyd-8048s043c/devicetree.yaml
Normal file
3
Devices/cyd-8048s043c/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/cyd-e32r28t/Source/Drivers.cpp
Normal file
7
Devices/cyd-e32r28t/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/cyd-e32r28t/devicetree.yaml
Normal file
3
Devices/cyd-e32r28t/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/cyd-e32r32p/Source/Drivers.cpp
Normal file
7
Devices/cyd-e32r32p/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/cyd-e32r32p/devicetree.yaml
Normal file
3
Devices/cyd-e32r32p/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/elecrow-crowpanel-advance-28/Source/Drivers.cpp
Normal file
7
Devices/elecrow-crowpanel-advance-28/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/elecrow-crowpanel-advance-28/devicetree.yaml
Normal file
3
Devices/elecrow-crowpanel-advance-28/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/elecrow-crowpanel-advance-35/Source/Drivers.cpp
Normal file
7
Devices/elecrow-crowpanel-advance-35/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/elecrow-crowpanel-advance-35/devicetree.yaml
Normal file
3
Devices/elecrow-crowpanel-advance-35/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/elecrow-crowpanel-advance-50/Source/Drivers.cpp
Normal file
7
Devices/elecrow-crowpanel-advance-50/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/elecrow-crowpanel-advance-50/devicetree.yaml
Normal file
3
Devices/elecrow-crowpanel-advance-50/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/elecrow-crowpanel-basic-28/Source/Drivers.cpp
Normal file
7
Devices/elecrow-crowpanel-basic-28/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/elecrow-crowpanel-basic-28/devicetree.yaml
Normal file
3
Devices/elecrow-crowpanel-basic-28/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/elecrow-crowpanel-basic-35/Source/Drivers.cpp
Normal file
7
Devices/elecrow-crowpanel-basic-35/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/elecrow-crowpanel-basic-35/devicetree.yaml
Normal file
3
Devices/elecrow-crowpanel-basic-35/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/elecrow-crowpanel-basic-50/Source/Drivers.cpp
Normal file
7
Devices/elecrow-crowpanel-basic-50/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/elecrow-crowpanel-basic-50/devicetree.yaml
Normal file
3
Devices/elecrow-crowpanel-basic-50/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/generic-esp32/Source/Drivers.cpp
Normal file
7
Devices/generic-esp32/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/generic-esp32/devicetree.yaml
Normal file
3
Devices/generic-esp32/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/generic-esp32c6/Source/Drivers.cpp
Normal file
7
Devices/generic-esp32c6/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/generic-esp32c6/devicetree.yaml
Normal file
3
Devices/generic-esp32c6/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/generic-esp32p4/Source/Drivers.cpp
Normal file
7
Devices/generic-esp32p4/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/generic-esp32p4/devicetree.yaml
Normal file
3
Devices/generic-esp32p4/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/generic-esp32s3/Source/Drivers.cpp
Normal file
7
Devices/generic-esp32s3/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/generic-esp32s3/devicetree.yaml
Normal file
3
Devices/generic-esp32s3/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/guition-jc1060p470ciwy/Source/Drivers.cpp
Normal file
7
Devices/guition-jc1060p470ciwy/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/guition-jc1060p470ciwy/devicetree.yaml
Normal file
3
Devices/guition-jc1060p470ciwy/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/guition-jc2432w328c/Source/Drivers.cpp
Normal file
7
Devices/guition-jc2432w328c/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/guition-jc2432w328c/devicetree.yaml
Normal file
3
Devices/guition-jc2432w328c/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/guition-jc8048w550c/Source/Drivers.cpp
Normal file
7
Devices/guition-jc8048w550c/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/guition-jc8048w550c/devicetree.yaml
Normal file
3
Devices/guition-jc8048w550c/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/heltec-wifi-lora-32-v3/Source/Drivers.cpp
Normal file
7
Devices/heltec-wifi-lora-32-v3/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/heltec-wifi-lora-32-v3/devicetree.yaml
Normal file
3
Devices/heltec-wifi-lora-32-v3/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/lilygo-tdeck/Source/Drivers.cpp
Normal file
7
Devices/lilygo-tdeck/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -3,14 +3,11 @@
|
|||||||
#include "devices/TrackballDevice.h"
|
#include "devices/TrackballDevice.h"
|
||||||
|
|
||||||
#include <Tactility/hal/gps/GpsConfiguration.h>
|
#include <Tactility/hal/gps/GpsConfiguration.h>
|
||||||
|
#include <Tactility/kernel/Kernel.h>
|
||||||
#include <Tactility/kernel/SystemEvents.h>
|
#include <Tactility/kernel/SystemEvents.h>
|
||||||
#include <Tactility/Logger.h>
|
#include <Tactility/Logger.h>
|
||||||
#include <Tactility/LogMessages.h>
|
#include <Tactility/LogMessages.h>
|
||||||
#include <Tactility/service/gps/GpsService.h>
|
#include <Tactility/service/gps/GpsService.h>
|
||||||
#include <Tactility/settings/KeyboardSettings.h>
|
|
||||||
#include <Trackball/Trackball.h>
|
|
||||||
|
|
||||||
#include <KeyboardBacklight/KeyboardBacklight.h>
|
|
||||||
|
|
||||||
static const auto LOGGER = tt::Logger("T-Deck");
|
static const auto LOGGER = tt::Logger("T-Deck");
|
||||||
|
|
||||||
@ -34,6 +31,9 @@ static bool powerOn() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoids crash when no SD card is inserted. It's unknown why, but likely is related to power draw.
|
||||||
|
tt::kernel::delayMillis(100);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,21 +89,6 @@ bool initBoot() {
|
|||||||
LOGGER.error("{} start failed", trackball->getName());
|
LOGGER.error("{} start failed", trackball->getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Backlight doesn't seem to turn on until toggled on and off from keyboard settings...
|
|
||||||
// Or let the display and backlight sleep then wake it up.
|
|
||||||
// Then it works fine...until reboot, then you need to toggle again.
|
|
||||||
// The current keyboard firmware sets backlight duty to 0 on boot.
|
|
||||||
// https://github.com/Xinyuan-LilyGO/T-Deck/blob/master/firmware/T-Keyboard_Keyboard_ESP32C3_250620.bin
|
|
||||||
// https://github.com/Xinyuan-LilyGO/T-Deck/blob/master/examples/Keyboard_ESP32C3/Keyboard_ESP32C3.ino#L25
|
|
||||||
// https://github.com/Xinyuan-LilyGO/T-Deck/blob/master/examples/Keyboard_ESP32C3/Keyboard_ESP32C3.ino#L217
|
|
||||||
auto kbSettings = tt::settings::keyboard::loadOrGetDefault();
|
|
||||||
bool result = keyboardbacklight::setBrightness(kbSettings.backlightEnabled ? kbSettings.backlightBrightness : 0);
|
|
||||||
if (!result) {
|
|
||||||
LOGGER.warn("Failed to set keyboard backlight brightness");
|
|
||||||
}
|
|
||||||
|
|
||||||
trackball::setEnabled(kbSettings.trackballEnabled);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#include "Trackball.h"
|
#include "Trackball.h"
|
||||||
|
|
||||||
|
#include <Tactility/Assets.h>
|
||||||
#include <Tactility/Logger.h>
|
#include <Tactility/Logger.h>
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
static const auto LOGGER = tt::Logger("Trackball");
|
static const auto LOGGER = tt::Logger("Trackball");
|
||||||
|
|
||||||
@ -8,19 +10,292 @@ namespace trackball {
|
|||||||
|
|
||||||
static TrackballConfig g_config;
|
static TrackballConfig g_config;
|
||||||
static lv_indev_t* g_indev = nullptr;
|
static lv_indev_t* g_indev = nullptr;
|
||||||
static bool g_initialized = false;
|
static std::atomic<bool> g_initialized{false};
|
||||||
static bool g_enabled = true;
|
static std::atomic<bool> g_enabled{true};
|
||||||
|
static std::atomic<Mode> g_mode{Mode::Encoder};
|
||||||
|
|
||||||
// Track last GPIO states for edge detection
|
// Interrupt-driven position tracking (atomic for ISR safety)
|
||||||
static bool g_lastState[5] = {false, false, false, false, false};
|
static std::atomic<int32_t> g_cursorX{160};
|
||||||
|
static std::atomic<int32_t> g_cursorY{120};
|
||||||
|
static std::atomic<bool> g_buttonPressed{false};
|
||||||
|
|
||||||
static void read_cb(lv_indev_t* indev, lv_indev_data_t* data) {
|
// Encoder mode: accumulated diff since last read
|
||||||
if (!g_initialized || !g_enabled) {
|
static std::atomic<int32_t> g_encoderDiff{0};
|
||||||
data->state = LV_INDEV_STATE_RELEASED;
|
|
||||||
data->enc_diff = 0;
|
// Sensitivity cached for ISR access (atomic for thread safety)
|
||||||
|
static std::atomic<int32_t> g_encoderSensitivity{1}; // Steps per tick for encoder
|
||||||
|
static std::atomic<int32_t> g_pointerSensitivity{10}; // Pixels per tick for pointer
|
||||||
|
|
||||||
|
// Cursor object for pointer mode
|
||||||
|
static lv_obj_t* g_cursor = nullptr;
|
||||||
|
|
||||||
|
// Screen dimensions (T-Deck: 320x240)
|
||||||
|
static constexpr int32_t SCREEN_WIDTH = 320;
|
||||||
|
static constexpr int32_t SCREEN_HEIGHT = 240;
|
||||||
|
|
||||||
|
static constexpr int32_t CURSOR_SIZE = 16;
|
||||||
|
|
||||||
|
// ISR handler for trackball directions
|
||||||
|
static void IRAM_ATTR trackball_isr_handler(void* arg) {
|
||||||
|
// Skip accumulating movement when disabled
|
||||||
|
if (!g_enabled.load(std::memory_order_relaxed)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gpio_num_t pin = static_cast<gpio_num_t>(reinterpret_cast<intptr_t>(arg));
|
||||||
|
|
||||||
|
if (g_mode.load(std::memory_order_relaxed) == Mode::Pointer) {
|
||||||
|
// Pointer mode: update absolute position using atomic fetch_add/sub
|
||||||
|
// Clamping is done in read_cb to avoid race conditions
|
||||||
|
int32_t step = g_pointerSensitivity.load(std::memory_order_relaxed);
|
||||||
|
if (pin == g_config.pinRight) {
|
||||||
|
g_cursorX.fetch_add(step, std::memory_order_relaxed);
|
||||||
|
} else if (pin == g_config.pinLeft) {
|
||||||
|
g_cursorX.fetch_sub(step, std::memory_order_relaxed);
|
||||||
|
} else if (pin == g_config.pinUp) {
|
||||||
|
g_cursorY.fetch_sub(step, std::memory_order_relaxed);
|
||||||
|
} else if (pin == g_config.pinDown) {
|
||||||
|
g_cursorY.fetch_add(step, std::memory_order_relaxed);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Encoder mode: accumulate diff
|
||||||
|
int32_t step = g_encoderSensitivity.load(std::memory_order_relaxed);
|
||||||
|
if (pin == g_config.pinRight || pin == g_config.pinDown) {
|
||||||
|
g_encoderDiff.fetch_add(step, std::memory_order_relaxed);
|
||||||
|
} else if (pin == g_config.pinLeft || pin == g_config.pinUp) {
|
||||||
|
g_encoderDiff.fetch_sub(step, std::memory_order_relaxed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ISR handler for button (any edge)
|
||||||
|
static void IRAM_ATTR button_isr_handler(void* arg) {
|
||||||
|
// Read current button state (active low)
|
||||||
|
bool pressed = gpio_get_level(g_config.pinClick) == 0;
|
||||||
|
g_buttonPressed.store(pressed, std::memory_order_relaxed);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper to clamp value to range
|
||||||
|
static inline int32_t clamp(int32_t val, int32_t minVal, int32_t maxVal) {
|
||||||
|
if (val < minVal) return minVal;
|
||||||
|
if (val > maxVal) return maxVal;
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void read_cb(lv_indev_t* indev, lv_indev_data_t* data) {
|
||||||
|
Mode currentMode = g_mode.load(std::memory_order_relaxed);
|
||||||
|
|
||||||
|
if (!g_initialized.load(std::memory_order_relaxed) || !g_enabled.load(std::memory_order_relaxed)) {
|
||||||
|
data->state = LV_INDEV_STATE_RELEASED;
|
||||||
|
if (currentMode == Mode::Encoder) {
|
||||||
|
data->enc_diff = 0;
|
||||||
|
} else {
|
||||||
|
// Clamp cursor position to screen bounds
|
||||||
|
int32_t x = clamp(g_cursorX.load(std::memory_order_relaxed), 0, SCREEN_WIDTH - CURSOR_SIZE - 1);
|
||||||
|
int32_t y = clamp(g_cursorY.load(std::memory_order_relaxed), 0, SCREEN_HEIGHT - CURSOR_SIZE - 1);
|
||||||
|
g_cursorX.store(x, std::memory_order_relaxed);
|
||||||
|
g_cursorY.store(y, std::memory_order_relaxed);
|
||||||
|
data->point.x = static_cast<int16_t>(x);
|
||||||
|
data->point.y = static_cast<int16_t>(y);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentMode == Mode::Encoder) {
|
||||||
|
// Read and reset accumulated encoder diff
|
||||||
|
int32_t diff = g_encoderDiff.exchange(0);
|
||||||
|
data->enc_diff = static_cast<int16_t>(clamp(diff, INT16_MIN, INT16_MAX));
|
||||||
|
|
||||||
|
if (diff != 0) {
|
||||||
|
lv_disp_trig_activity(nullptr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Pointer mode: read and clamp cursor position
|
||||||
|
int32_t x = clamp(g_cursorX.load(std::memory_order_relaxed), 0, SCREEN_WIDTH - CURSOR_SIZE - 1);
|
||||||
|
int32_t y = clamp(g_cursorY.load(std::memory_order_relaxed), 0, SCREEN_HEIGHT - CURSOR_SIZE - 1);
|
||||||
|
|
||||||
|
// Store clamped values back to prevent unbounded growth
|
||||||
|
g_cursorX.store(x, std::memory_order_relaxed);
|
||||||
|
g_cursorY.store(y, std::memory_order_relaxed);
|
||||||
|
|
||||||
|
data->point.x = static_cast<int16_t>(x);
|
||||||
|
data->point.y = static_cast<int16_t>(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Button state (same for both modes)
|
||||||
|
bool pressed = g_buttonPressed.load(std::memory_order_relaxed);
|
||||||
|
data->state = pressed ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED;
|
||||||
|
|
||||||
|
if (pressed) {
|
||||||
|
lv_disp_trig_activity(nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_indev_t* init(const TrackballConfig& config) {
|
||||||
|
if (g_initialized.load(std::memory_order_relaxed)) {
|
||||||
|
LOGGER.warn("Already initialized");
|
||||||
|
return g_indev;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_config = config;
|
||||||
|
|
||||||
|
// Set default sensitivities if not specified
|
||||||
|
if (g_config.encoderSensitivity == 0) {
|
||||||
|
g_config.encoderSensitivity = 1;
|
||||||
|
}
|
||||||
|
if (g_config.pointerSensitivity == 0) {
|
||||||
|
g_config.pointerSensitivity = 10;
|
||||||
|
}
|
||||||
|
g_encoderSensitivity.store(g_config.encoderSensitivity, std::memory_order_relaxed);
|
||||||
|
g_pointerSensitivity.store(g_config.pointerSensitivity, std::memory_order_relaxed);
|
||||||
|
|
||||||
|
// Initialize cursor position to center
|
||||||
|
g_cursorX.store(SCREEN_WIDTH / 2, std::memory_order_relaxed);
|
||||||
|
g_cursorY.store(SCREEN_HEIGHT / 2, std::memory_order_relaxed);
|
||||||
|
g_encoderDiff.store(0, std::memory_order_relaxed);
|
||||||
|
g_buttonPressed.store(false, std::memory_order_relaxed);
|
||||||
|
|
||||||
|
// Configure direction pins as interrupt inputs (falling edge)
|
||||||
|
const gpio_num_t dirPins[4] = {
|
||||||
|
config.pinRight,
|
||||||
|
config.pinUp,
|
||||||
|
config.pinLeft,
|
||||||
|
config.pinDown
|
||||||
|
};
|
||||||
|
|
||||||
|
gpio_config_t io_conf = {};
|
||||||
|
io_conf.intr_type = GPIO_INTR_NEGEDGE; // Falling edge (active low)
|
||||||
|
io_conf.mode = GPIO_MODE_INPUT;
|
||||||
|
io_conf.pull_up_en = GPIO_PULLUP_ENABLE;
|
||||||
|
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
|
||||||
|
|
||||||
|
// Install GPIO ISR service (if not already installed)
|
||||||
|
static bool isr_service_installed = false;
|
||||||
|
if (!isr_service_installed) {
|
||||||
|
esp_err_t err = gpio_install_isr_service(ESP_INTR_FLAG_IRAM);
|
||||||
|
if (err == ESP_OK || err == ESP_ERR_INVALID_STATE) {
|
||||||
|
// ESP_ERR_INVALID_STATE means already installed, which is fine
|
||||||
|
isr_service_installed = true;
|
||||||
|
} else {
|
||||||
|
LOGGER.error("Failed to install GPIO ISR service: {}", esp_err_to_name(err));
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Track added handlers for cleanup on failure
|
||||||
|
int handlersAdded = 0;
|
||||||
|
|
||||||
|
// Configure and attach ISR for direction pins
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
io_conf.pin_bit_mask = (1ULL << dirPins[i]);
|
||||||
|
esp_err_t err = gpio_config(&io_conf);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
LOGGER.error("Failed to configure GPIO {}: {}", static_cast<int>(dirPins[i]), esp_err_to_name(err));
|
||||||
|
// Cleanup previously added handlers
|
||||||
|
for (int j = 0; j < handlersAdded; j++) {
|
||||||
|
gpio_isr_handler_remove(dirPins[j]);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = gpio_isr_handler_add(dirPins[i], trackball_isr_handler, reinterpret_cast<void*>(static_cast<intptr_t>(dirPins[i])));
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
LOGGER.error("Failed to add ISR for GPIO {}: {}", static_cast<int>(dirPins[i]), esp_err_to_name(err));
|
||||||
|
// Cleanup previously added handlers
|
||||||
|
for (int j = 0; j < handlersAdded; j++) {
|
||||||
|
gpio_isr_handler_remove(dirPins[j]);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
handlersAdded++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Configure button pin (any edge for press/release detection)
|
||||||
|
io_conf.intr_type = GPIO_INTR_ANYEDGE;
|
||||||
|
io_conf.pin_bit_mask = (1ULL << config.pinClick);
|
||||||
|
esp_err_t err = gpio_config(&io_conf);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
LOGGER.error("Failed to configure button GPIO {}: {}", static_cast<int>(config.pinClick), esp_err_to_name(err));
|
||||||
|
// Cleanup direction handlers
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
gpio_isr_handler_remove(dirPins[i]);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = gpio_isr_handler_add(config.pinClick, button_isr_handler, nullptr);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
LOGGER.error("Failed to add button ISR: {}", esp_err_to_name(err));
|
||||||
|
// Cleanup direction handlers
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
gpio_isr_handler_remove(dirPins[i]);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read initial button state
|
||||||
|
g_buttonPressed.store(gpio_get_level(config.pinClick) == 0);
|
||||||
|
|
||||||
|
// Register as LVGL encoder input device for group navigation (default mode)
|
||||||
|
g_indev = lv_indev_create();
|
||||||
|
if (g_indev == nullptr) {
|
||||||
|
LOGGER.error("Failed to register LVGL input device");
|
||||||
|
// Cleanup ISR handlers on failure
|
||||||
|
const gpio_num_t pins[5] = {
|
||||||
|
config.pinRight, config.pinUp, config.pinLeft,
|
||||||
|
config.pinDown, config.pinClick
|
||||||
|
};
|
||||||
|
for (int i = 0; i < 5; i++) {
|
||||||
|
gpio_intr_disable(pins[i]);
|
||||||
|
gpio_isr_handler_remove(pins[i]);
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
lv_indev_set_type(g_indev, LV_INDEV_TYPE_ENCODER);
|
||||||
|
lv_indev_set_read_cb(g_indev, read_cb);
|
||||||
|
g_initialized.store(true, std::memory_order_relaxed);
|
||||||
|
LOGGER.info("Initialized with interrupts (R:{} U:{} L:{} D:{} Click:{})",
|
||||||
|
static_cast<int>(config.pinRight),
|
||||||
|
static_cast<int>(config.pinUp),
|
||||||
|
static_cast<int>(config.pinLeft),
|
||||||
|
static_cast<int>(config.pinDown),
|
||||||
|
static_cast<int>(config.pinClick));
|
||||||
|
|
||||||
|
return g_indev;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create cursor for pointer mode
|
||||||
|
static void createCursor() {
|
||||||
|
if (g_cursor != nullptr || g_indev == nullptr) return;
|
||||||
|
|
||||||
|
g_cursor = lv_image_create(lv_layer_sys());
|
||||||
|
if (g_cursor != nullptr) {
|
||||||
|
lv_obj_remove_flag(g_cursor, LV_OBJ_FLAG_CLICKABLE);
|
||||||
|
|
||||||
|
// Set cursor image
|
||||||
|
lv_image_set_src(g_cursor, TT_ASSETS_UI_CURSOR);
|
||||||
|
lv_indev_set_cursor(g_indev, g_cursor);
|
||||||
|
LOGGER.debug("Cursor created");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Destroy cursor when switching back to encoder mode
|
||||||
|
static void destroyCursor() {
|
||||||
|
if (g_cursor == nullptr) return;
|
||||||
|
|
||||||
|
// Delete the cursor object - this automatically detaches it from the indev
|
||||||
|
lv_obj_delete(g_cursor);
|
||||||
|
g_cursor = nullptr;
|
||||||
|
LOGGER.debug("Cursor destroyed");
|
||||||
|
}
|
||||||
|
|
||||||
|
void deinit() {
|
||||||
|
if (!g_initialized.load(std::memory_order_relaxed)) return;
|
||||||
|
|
||||||
|
destroyCursor();
|
||||||
|
|
||||||
|
// Disable interrupts and remove ISR handlers
|
||||||
const gpio_num_t pins[5] = {
|
const gpio_num_t pins[5] = {
|
||||||
g_config.pinRight,
|
g_config.pinRight,
|
||||||
g_config.pinUp,
|
g_config.pinUp,
|
||||||
@ -29,121 +304,95 @@ static void read_cb(lv_indev_t* indev, lv_indev_data_t* data) {
|
|||||||
g_config.pinClick
|
g_config.pinClick
|
||||||
};
|
};
|
||||||
|
|
||||||
// Read GPIO states and detect changes (active low with pull-up)
|
|
||||||
bool currentStates[5];
|
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
currentStates[i] = gpio_get_level(pins[i]) == 0;
|
gpio_intr_disable(pins[i]);
|
||||||
|
gpio_isr_handler_remove(pins[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process directional inputs as encoder steps
|
|
||||||
// Right/Down = positive diff (next item), Left/Up = negative diff (prev item)
|
|
||||||
int16_t diff = 0;
|
|
||||||
|
|
||||||
// Right pressed (rising edge)
|
|
||||||
if (currentStates[0] && !g_lastState[0]) {
|
|
||||||
diff += g_config.movementStep;
|
|
||||||
}
|
|
||||||
// Up pressed (rising edge)
|
|
||||||
if (currentStates[1] && !g_lastState[1]) {
|
|
||||||
diff -= g_config.movementStep;
|
|
||||||
}
|
|
||||||
// Left pressed (rising edge)
|
|
||||||
if (currentStates[2] && !g_lastState[2]) {
|
|
||||||
diff -= g_config.movementStep;
|
|
||||||
}
|
|
||||||
// Down pressed (rising edge)
|
|
||||||
if (currentStates[3] && !g_lastState[3]) {
|
|
||||||
diff += g_config.movementStep;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update last states
|
|
||||||
for (int i = 0; i < 5; i++) {
|
|
||||||
g_lastState[i] = currentStates[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update encoder diff and button state
|
|
||||||
data->enc_diff = diff;
|
|
||||||
data->state = currentStates[4] ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED;
|
|
||||||
|
|
||||||
// Trigger activity for wake-on-trackball
|
|
||||||
if (diff != 0 || currentStates[4]) {
|
|
||||||
lv_disp_trig_activity(nullptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lv_indev_t* init(const TrackballConfig& config) {
|
|
||||||
if (g_initialized) {
|
|
||||||
LOGGER.warn("Already initialized");
|
|
||||||
return g_indev;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_config = config;
|
|
||||||
|
|
||||||
// Set default movement step if not specified
|
|
||||||
if (g_config.movementStep == 0) {
|
|
||||||
g_config.movementStep = 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Configure all GPIO pins as inputs with pull-ups (active low)
|
|
||||||
const gpio_num_t pins[5] = {
|
|
||||||
config.pinRight,
|
|
||||||
config.pinUp,
|
|
||||||
config.pinLeft,
|
|
||||||
config.pinDown,
|
|
||||||
config.pinClick
|
|
||||||
};
|
|
||||||
|
|
||||||
gpio_config_t io_conf = {};
|
|
||||||
io_conf.intr_type = GPIO_INTR_DISABLE;
|
|
||||||
io_conf.mode = GPIO_MODE_INPUT;
|
|
||||||
io_conf.pull_up_en = GPIO_PULLUP_ENABLE;
|
|
||||||
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
|
|
||||||
|
|
||||||
for (int i = 0; i < 5; i++) {
|
|
||||||
io_conf.pin_bit_mask = (1ULL << pins[i]);
|
|
||||||
gpio_config(&io_conf);
|
|
||||||
g_lastState[i] = gpio_get_level(pins[i]) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register as LVGL encoder input device for group navigation
|
|
||||||
g_indev = lv_indev_create();
|
|
||||||
lv_indev_set_type(g_indev, LV_INDEV_TYPE_ENCODER);
|
|
||||||
lv_indev_set_read_cb(g_indev, read_cb);
|
|
||||||
|
|
||||||
if (g_indev != nullptr) {
|
|
||||||
g_initialized = true;
|
|
||||||
LOGGER.info("Initialized as encoder (R:{} U:{} L:{} D:{} Click:{})",
|
|
||||||
static_cast<int>(config.pinRight),
|
|
||||||
static_cast<int>(config.pinUp),
|
|
||||||
static_cast<int>(config.pinLeft),
|
|
||||||
static_cast<int>(config.pinDown),
|
|
||||||
static_cast<int>(config.pinClick));
|
|
||||||
} else {
|
|
||||||
LOGGER.error("Failed to register LVGL input device");
|
|
||||||
}
|
|
||||||
|
|
||||||
return g_indev;
|
|
||||||
}
|
|
||||||
|
|
||||||
void deinit() {
|
|
||||||
if (g_indev) {
|
if (g_indev) {
|
||||||
lv_indev_delete(g_indev);
|
lv_indev_delete(g_indev);
|
||||||
g_indev = nullptr;
|
g_indev = nullptr;
|
||||||
}
|
}
|
||||||
g_initialized = false;
|
|
||||||
|
g_initialized.store(false, std::memory_order_relaxed);
|
||||||
|
g_mode.store(Mode::Encoder, std::memory_order_relaxed);
|
||||||
|
g_enabled.store(true, std::memory_order_relaxed);
|
||||||
LOGGER.info("Deinitialized");
|
LOGGER.info("Deinitialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMovementStep(uint8_t step) {
|
void setEncoderSensitivity(uint8_t sensitivity) {
|
||||||
if (step > 0) {
|
if (sensitivity > 0) {
|
||||||
g_config.movementStep = step;
|
// Only update the atomic - ISR reads from atomic, not g_config
|
||||||
LOGGER.debug("Movement step set to {}", step);
|
g_encoderSensitivity.store(sensitivity, std::memory_order_relaxed);
|
||||||
|
LOGGER.debug("Encoder sensitivity set to {}", sensitivity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setPointerSensitivity(uint8_t sensitivity) {
|
||||||
|
if (sensitivity > 0) {
|
||||||
|
// Only update the atomic - ISR reads from atomic, not g_config
|
||||||
|
g_pointerSensitivity.store(sensitivity, std::memory_order_relaxed);
|
||||||
|
LOGGER.debug("Pointer sensitivity set to {}", sensitivity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setEnabled(bool enabled) {
|
void setEnabled(bool enabled) {
|
||||||
g_enabled = enabled;
|
g_enabled.store(enabled, std::memory_order_relaxed);
|
||||||
|
|
||||||
|
if (!enabled) {
|
||||||
|
// Clear accumulated state to prevent jumps on re-enable
|
||||||
|
g_encoderDiff.store(0, std::memory_order_relaxed);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide/show cursor based on enabled state when in pointer mode
|
||||||
|
// Note: Must be called from LVGL thread (main thread) for thread safety
|
||||||
|
lv_obj_t* cursor = g_cursor; // Local copy to avoid race with setMode
|
||||||
|
if (cursor != nullptr) {
|
||||||
|
if (enabled) {
|
||||||
|
lv_obj_clear_flag(cursor, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
} else {
|
||||||
|
lv_obj_add_flag(cursor, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LOGGER.info("{}", enabled ? "Enabled" : "Disabled");
|
LOGGER.info("{}", enabled ? "Enabled" : "Disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setMode(Mode mode) {
|
||||||
|
// Note: Must be called from LVGL thread (main thread) for thread safety
|
||||||
|
if (!g_initialized.load(std::memory_order_relaxed) || g_indev == nullptr) {
|
||||||
|
LOGGER.warn("Cannot set mode - not initialized");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_mode.load(std::memory_order_relaxed) == mode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_mode.store(mode, std::memory_order_relaxed);
|
||||||
|
|
||||||
|
if (mode == Mode::Pointer) {
|
||||||
|
// Switch to pointer mode
|
||||||
|
lv_indev_set_type(g_indev, LV_INDEV_TYPE_POINTER);
|
||||||
|
createCursor();
|
||||||
|
if (!g_enabled.load(std::memory_order_relaxed) && g_cursor != nullptr) {
|
||||||
|
lv_obj_add_flag(g_cursor, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
}
|
||||||
|
// Reset cursor to center when switching modes
|
||||||
|
g_cursorX.store(SCREEN_WIDTH / 2, std::memory_order_relaxed);
|
||||||
|
g_cursorY.store(SCREEN_HEIGHT / 2, std::memory_order_relaxed);
|
||||||
|
LOGGER.info("Switched to Pointer mode");
|
||||||
|
} else {
|
||||||
|
// Switch to encoder mode
|
||||||
|
destroyCursor();
|
||||||
|
lv_indev_set_type(g_indev, LV_INDEV_TYPE_ENCODER);
|
||||||
|
g_encoderDiff.store(0, std::memory_order_relaxed); // Reset encoder diff
|
||||||
|
LOGGER.info("Switched to Encoder mode");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Mode getMode() {
|
||||||
|
return g_mode.load(std::memory_order_relaxed);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,16 +5,25 @@
|
|||||||
|
|
||||||
namespace trackball {
|
namespace trackball {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Trackball operating mode
|
||||||
|
*/
|
||||||
|
enum class Mode {
|
||||||
|
Encoder, // Navigation via enc_diff (scroll wheel behavior)
|
||||||
|
Pointer // Mouse cursor via point.x/y
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Trackball configuration structure
|
* @brief Trackball configuration structure
|
||||||
*/
|
*/
|
||||||
struct TrackballConfig {
|
struct TrackballConfig {
|
||||||
gpio_num_t pinRight; // Right direction GPIO
|
gpio_num_t pinRight; // Right direction GPIO
|
||||||
gpio_num_t pinUp; // Up direction GPIO
|
gpio_num_t pinUp; // Up direction GPIO
|
||||||
gpio_num_t pinLeft; // Left direction GPIO
|
gpio_num_t pinLeft; // Left direction GPIO
|
||||||
gpio_num_t pinDown; // Down direction GPIO
|
gpio_num_t pinDown; // Down direction GPIO
|
||||||
gpio_num_t pinClick; // Click/select button GPIO
|
gpio_num_t pinClick; // Click/select button GPIO
|
||||||
uint8_t movementStep; // Pixels to move per trackball event (default: 10)
|
uint8_t encoderSensitivity = 1; // Encoder mode: steps per tick
|
||||||
|
uint8_t pointerSensitivity = 10; // Pointer mode: pixels per tick
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,10 +39,16 @@ lv_indev_t* init(const TrackballConfig& config);
|
|||||||
void deinit();
|
void deinit();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set movement step size
|
* @brief Set encoder mode sensitivity
|
||||||
* @param step Encoder steps per trackball event
|
* @param sensitivity Steps per trackball tick (1-10, default: 1)
|
||||||
*/
|
*/
|
||||||
void setMovementStep(uint8_t step);
|
void setEncoderSensitivity(uint8_t sensitivity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set pointer mode sensitivity
|
||||||
|
* @param sensitivity Pixels per trackball tick (1-10, default: 10)
|
||||||
|
*/
|
||||||
|
void setPointerSensitivity(uint8_t sensitivity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable or disable trackball input processing
|
* @brief Enable or disable trackball input processing
|
||||||
@ -41,4 +56,16 @@ void setMovementStep(uint8_t step);
|
|||||||
*/
|
*/
|
||||||
void setEnabled(bool enabled);
|
void setEnabled(bool enabled);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set trackball operating mode
|
||||||
|
* @param mode Encoder or Pointer mode
|
||||||
|
*/
|
||||||
|
void setMode(Mode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get current trackball operating mode
|
||||||
|
* @return Current mode
|
||||||
|
*/
|
||||||
|
Mode getMode();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#include "KeyboardBacklight.h"
|
#include "KeyboardBacklight.h"
|
||||||
#include <KeyboardBacklight/KeyboardBacklight.h> // Driver
|
#include <KeyboardBacklight/KeyboardBacklight.h> // Driver
|
||||||
#include <Tactility/hal/i2c/I2c.h>
|
#include <Tactility/hal/i2c/I2c.h>
|
||||||
|
#include <Tactility/settings/KeyboardSettings.h>
|
||||||
|
|
||||||
// TODO: Add Mutex and consider refactoring into a class
|
// TODO: Add Mutex and consider refactoring into a class
|
||||||
bool KeyboardBacklightDevice::start() {
|
bool KeyboardBacklightDevice::start() {
|
||||||
@ -10,7 +11,21 @@ bool KeyboardBacklightDevice::start() {
|
|||||||
|
|
||||||
// T-Deck uses I2C_NUM_0 for internal peripherals
|
// T-Deck uses I2C_NUM_0 for internal peripherals
|
||||||
initialized = keyboardbacklight::init(I2C_NUM_0);
|
initialized = keyboardbacklight::init(I2C_NUM_0);
|
||||||
return initialized;
|
if (!initialized) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Backlight doesn't seem to turn on until toggled on and off from keyboard settings...
|
||||||
|
// Or let the display and backlight sleep then wake it up.
|
||||||
|
// Then it works fine...until reboot, then you need to toggle again.
|
||||||
|
// The current keyboard firmware sets backlight duty to 0 on boot.
|
||||||
|
// https://github.com/Xinyuan-LilyGO/T-Deck/blob/master/firmware/T-Keyboard_Keyboard_ESP32C3_250620.bin
|
||||||
|
// https://github.com/Xinyuan-LilyGO/T-Deck/blob/master/examples/Keyboard_ESP32C3/Keyboard_ESP32C3.ino#L25
|
||||||
|
// https://github.com/Xinyuan-LilyGO/T-Deck/blob/master/examples/Keyboard_ESP32C3/Keyboard_ESP32C3.ino#L217
|
||||||
|
auto kbSettings = tt::settings::keyboard::loadOrGetDefault();
|
||||||
|
keyboardbacklight::setBrightness(kbSettings.backlightEnabled ? kbSettings.backlightBrightness : 0);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KeyboardBacklightDevice::stop() {
|
bool KeyboardBacklightDevice::stop() {
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
#include "TrackballDevice.h"
|
#include "TrackballDevice.h"
|
||||||
#include <Trackball/Trackball.h> // Driver
|
#include <Trackball/Trackball.h> // Driver
|
||||||
|
#include <Tactility/Logger.h>
|
||||||
|
#include <Tactility/lvgl/LvglSync.h>
|
||||||
|
#include <Tactility/settings/TrackballSettings.h>
|
||||||
|
|
||||||
|
static const auto LOGGER = tt::Logger("TrackballDevice");
|
||||||
|
|
||||||
bool TrackballDevice::start() {
|
bool TrackballDevice::start() {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
@ -8,21 +13,37 @@ bool TrackballDevice::start() {
|
|||||||
|
|
||||||
// T-Deck trackball GPIO configuration from LilyGo reference
|
// T-Deck trackball GPIO configuration from LilyGo reference
|
||||||
trackball::TrackballConfig config = {
|
trackball::TrackballConfig config = {
|
||||||
.pinRight = GPIO_NUM_2, // BOARD_TBOX_G02
|
.pinRight = GPIO_NUM_2, // BOARD_TBOX_G02
|
||||||
.pinUp = GPIO_NUM_3, // BOARD_TBOX_G01
|
.pinUp = GPIO_NUM_3, // BOARD_TBOX_G01
|
||||||
.pinLeft = GPIO_NUM_1, // BOARD_TBOX_G04
|
.pinLeft = GPIO_NUM_1, // BOARD_TBOX_G04
|
||||||
.pinDown = GPIO_NUM_15, // BOARD_TBOX_G03
|
.pinDown = GPIO_NUM_15, // BOARD_TBOX_G03
|
||||||
.pinClick = GPIO_NUM_0, // BOARD_BOOT_PIN
|
.pinClick = GPIO_NUM_0, // BOARD_BOOT_PIN
|
||||||
.movementStep = 1 // pixels per movement
|
.encoderSensitivity = 1, // 1 step per tick for menu navigation
|
||||||
|
.pointerSensitivity = 10 // 10 pixels per tick for cursor movement
|
||||||
};
|
};
|
||||||
|
|
||||||
indev = trackball::init(config);
|
indev = trackball::init(config);
|
||||||
if (indev != nullptr) {
|
if (indev == nullptr) {
|
||||||
initialized = true;
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
initialized = true;
|
||||||
|
|
||||||
|
// Apply persisted trackball settings (requires LVGL lock for cursor manipulation)
|
||||||
|
auto tbSettings = tt::settings::trackball::loadOrGetDefault();
|
||||||
|
if (tt::lvgl::lock(100)) {
|
||||||
|
trackball::setMode(tbSettings.trackballMode == tt::settings::trackball::TrackballMode::Pointer
|
||||||
|
? trackball::Mode::Pointer
|
||||||
|
: trackball::Mode::Encoder);
|
||||||
|
trackball::setEncoderSensitivity(tbSettings.encoderSensitivity);
|
||||||
|
trackball::setPointerSensitivity(tbSettings.pointerSensitivity);
|
||||||
|
trackball::setEnabled(tbSettings.trackballEnabled);
|
||||||
|
tt::lvgl::unlock();
|
||||||
|
} else {
|
||||||
|
LOGGER.warn("Failed to acquire LVGL lock for trackball settings");
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TrackballDevice::stop() {
|
bool TrackballDevice::stop() {
|
||||||
|
|||||||
3
Devices/lilygo-tdeck/devicetree.yaml
Normal file
3
Devices/lilygo-tdeck/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/lilygo-tdisplay-s3/Source/Drivers.cpp
Normal file
7
Devices/lilygo-tdisplay-s3/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/lilygo-tdisplay-s3/devicetree.yaml
Normal file
3
Devices/lilygo-tdisplay-s3/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/lilygo-tdisplay/Source/Drivers.cpp
Normal file
7
Devices/lilygo-tdisplay/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/lilygo-tdisplay/devicetree.yaml
Normal file
3
Devices/lilygo-tdisplay/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/lilygo-tdongle-s3/Source/Drivers.cpp
Normal file
7
Devices/lilygo-tdongle-s3/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/lilygo-tdongle-s3/devicetree.yaml
Normal file
3
Devices/lilygo-tdongle-s3/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
@ -3,5 +3,5 @@ file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
|||||||
idf_component_register(
|
idf_component_register(
|
||||||
SRCS ${SOURCE_FILES}
|
SRCS ${SOURCE_FILES}
|
||||||
INCLUDE_DIRS "Source"
|
INCLUDE_DIRS "Source"
|
||||||
REQUIRES Tactility esp_lcd ST7796 BQ25896 BQ27220 TCA8418 DRV2605 PwmBacklight driver esp_adc
|
REQUIRES Tactility esp_lcd ST7796 BQ25896 BQ27220 TCA8418 DRV2605 PwmBacklight driver esp_adc PlatformEsp32
|
||||||
)
|
)
|
||||||
|
|||||||
10
Devices/lilygo-tlora-pager/Source/Drivers.cpp
Normal file
10
Devices/lilygo-tlora-pager/Source/Drivers.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <Tactility/Driver.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
extern Driver tlora_pager_driver;
|
||||||
|
driver_construct(&tlora_pager_driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
15
Devices/lilygo-tlora-pager/Source/bindings/tlora_pager.h
Normal file
15
Devices/lilygo-tlora-pager/Source/bindings/tlora_pager.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <Tactility/bindings/bindings.h>
|
||||||
|
#include <Tactility/drivers/Root.h>
|
||||||
|
#include <drivers/TloraPager.h>
|
||||||
|
|
||||||
|
DEFINE_DEVICETREE(tlora_pager, struct RootConfig)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
10
Devices/lilygo-tlora-pager/Source/drivers/Register.cpp
Normal file
10
Devices/lilygo-tlora-pager/Source/drivers/Register.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <Tactility/Driver.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
extern Driver tlora_pager_driver;
|
||||||
|
driver_construct(&tlora_pager_driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
27
Devices/lilygo-tlora-pager/Source/drivers/TloraPager.cpp
Normal file
27
Devices/lilygo-tlora-pager/Source/drivers/TloraPager.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include "TloraPager.h"
|
||||||
|
|
||||||
|
#include <Tactility/Driver.h>
|
||||||
|
|
||||||
|
#include <esp_log.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
static int start(Device* device) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int stop(Device* device) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Driver tlora_pager_driver = {
|
||||||
|
.name = "T-Lora Pager",
|
||||||
|
.compatible = (const char*[]) { "lilygo,tlora-pager", nullptr },
|
||||||
|
.startDevice = start,
|
||||||
|
.stopDevice = stop,
|
||||||
|
.api = nullptr,
|
||||||
|
.deviceType = nullptr,
|
||||||
|
.internal = { 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
11
Devices/lilygo-tlora-pager/Source/drivers/TloraPager.h
Normal file
11
Devices/lilygo-tlora-pager/Source/drivers/TloraPager.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <Tactility/drivers/Root.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
4
Devices/lilygo-tlora-pager/devicetree.yaml
Normal file
4
Devices/lilygo-tlora-pager/devicetree.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
dependencies:
|
||||||
|
- Platforms/PlatformEsp32
|
||||||
|
bindings: ./
|
||||||
|
dts: lilygo,tlora-pager.dts
|
||||||
23
Devices/lilygo-tlora-pager/lilygo,tlora-pager.dts
Normal file
23
Devices/lilygo-tlora-pager/lilygo,tlora-pager.dts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/dts-v1/;
|
||||||
|
|
||||||
|
#include <bindings/tlora_pager.h>
|
||||||
|
#include <Tactility/bindings/esp32_gpio.h>
|
||||||
|
#include <Tactility/bindings/esp32_i2c.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
compatible = "lilygo,tlora-pager";
|
||||||
|
model = "LilyGO T-Lora Pager";
|
||||||
|
|
||||||
|
gpio0 {
|
||||||
|
compatible = "espressif,esp32-gpio";
|
||||||
|
gpio-count = <49>;
|
||||||
|
};
|
||||||
|
|
||||||
|
i2c0 {
|
||||||
|
compatible = "espressif,esp32-i2c";
|
||||||
|
clock-frequency = <100000>;
|
||||||
|
pin-sda = <&gpio0 3 GPIO_ACTIVE_HIGH>;
|
||||||
|
pin-scl = <&gpio0 2 GPIO_ACTIVE_HIGH>;
|
||||||
|
port = <I2C_NUM_0>;
|
||||||
|
};
|
||||||
|
};
|
||||||
5
Devices/lilygo-tlora-pager/lilygo,tlora-pager.yaml
Normal file
5
Devices/lilygo-tlora-pager/lilygo,tlora-pager.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
description: LilyGO T-Lora Pager
|
||||||
|
|
||||||
|
include: ["root.yaml"]
|
||||||
|
|
||||||
|
compatible: "lilygo,tlora-pager"
|
||||||
7
Devices/m5stack-cardputer-adv/Source/Drivers.cpp
Normal file
7
Devices/m5stack-cardputer-adv/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
3
Devices/m5stack-cardputer-adv/devicetree.yaml
Normal file
3
Devices/m5stack-cardputer-adv/devicetree.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- TactilityKernel
|
||||||
|
dts: ../placeholder.dts
|
||||||
7
Devices/m5stack-cardputer/Source/Drivers.cpp
Normal file
7
Devices/m5stack-cardputer/Source/Drivers.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extern "C" {
|
||||||
|
|
||||||
|
extern void register_device_drivers() {
|
||||||
|
/* NO-OP */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
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