mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-04-22 03:15:05 +00:00
Compare commits
No commits in common. "25c3f19e5d12a2d7393ad30377462fad4d8a7360" and "d27404964adb7289d3abbf2ed38b48f3b1f06122" have entirely different histories.
25c3f19e5d
...
d27404964a
2
.github/actions/build-simulator/action.yml
vendored
2
.github/actions/build-simulator/action.yml
vendored
@ -15,7 +15,7 @@ runs:
|
|||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout repo"
|
- name: "Checkout repo"
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Install Linux Dependencies for SDL
|
- name: Install Linux Dependencies for SDL
|
||||||
|
|||||||
18
.github/workflows/tests.yml
vendored
18
.github/workflows/tests.yml
vendored
@ -6,11 +6,11 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, synchronize, reopened ]
|
types: [ opened, synchronize, reopened ]
|
||||||
jobs:
|
jobs:
|
||||||
TactilityTests:
|
run:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout repo"
|
- name: "Checkout repo"
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: "Configure Project"
|
- name: "Configure Project"
|
||||||
@ -27,17 +27,3 @@ jobs:
|
|||||||
run: build/Tests/Tactility/TactilityTests
|
run: build/Tests/Tactility/TactilityTests
|
||||||
- name: "Run TactilityKernel Tests"
|
- name: "Run TactilityKernel Tests"
|
||||||
run: build/Tests/TactilityKernel/TactilityKernelTests
|
run: build/Tests/TactilityKernel/TactilityKernelTests
|
||||||
DevicetreeTests:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: "Checkout repo"
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: "Install Python Dependencies"
|
|
||||||
shell: bash
|
|
||||||
run: pip install lark==1.3.1 pyyaml==6.0.3
|
|
||||||
- name: "Run Devicetree Tests"
|
|
||||||
shell: bash
|
|
||||||
working-directory: Buildscripts/DevicetreeCompiler/tests
|
|
||||||
run: python test_integration.py
|
|
||||||
|
|||||||
@ -24,6 +24,5 @@ if __name__ == "__main__":
|
|||||||
is_verbose = "--verbose" in sys.argv
|
is_verbose = "--verbose" in sys.argv
|
||||||
devicetree_yaml_config = args[0]
|
devicetree_yaml_config = args[0]
|
||||||
output_path = args[1]
|
output_path = args[1]
|
||||||
result = main(devicetree_yaml_config, output_path, is_verbose)
|
main(devicetree_yaml_config, output_path, is_verbose)
|
||||||
sys.exit(result)
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import os
|
import os
|
||||||
from .exception import DevicetreeException
|
|
||||||
|
|
||||||
def find_bindings(directory_path: str) -> list[str]:
|
def find_bindings(directory_path: str) -> list[str]:
|
||||||
yaml_files = []
|
yaml_files = []
|
||||||
@ -15,6 +14,6 @@ def find_all_bindings(directory_paths: list[str]) -> list[str]:
|
|||||||
for directory_path in directory_paths:
|
for directory_path in directory_paths:
|
||||||
new_paths = find_bindings(directory_path)
|
new_paths = find_bindings(directory_path)
|
||||||
if len(new_paths) == 0:
|
if len(new_paths) == 0:
|
||||||
raise DevicetreeException(f"No bindings found in {directory_path}")
|
raise Exception(f"No bindings found in {directory_path}")
|
||||||
yaml_files += new_paths
|
yaml_files += new_paths
|
||||||
return yaml_files
|
return yaml_files
|
||||||
@ -44,7 +44,6 @@ def parse_binding(file_path: str, binding_dirs: list[str]) -> Binding:
|
|||||||
type=details.get('type', 'unknown'),
|
type=details.get('type', 'unknown'),
|
||||||
required=details.get('required', False),
|
required=details.get('required', False),
|
||||||
description=details.get('description', '').strip(),
|
description=details.get('description', '').strip(),
|
||||||
default=details.get('default', None),
|
|
||||||
)
|
)
|
||||||
properties_dict[name] = prop
|
properties_dict[name] = prop
|
||||||
filename = os.path.basename(file_path)
|
filename = os.path.basename(file_path)
|
||||||
|
|||||||
@ -1,2 +0,0 @@
|
|||||||
class DevicetreeException(Exception):
|
|
||||||
pass
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import os.path
|
import os.path
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
from source.models import *
|
from source.models import *
|
||||||
from .exception import DevicetreeException
|
|
||||||
|
|
||||||
def write_include(file, include: IncludeC, verbose: bool):
|
def write_include(file, include: IncludeC, verbose: bool):
|
||||||
if verbose:
|
if verbose:
|
||||||
@ -26,9 +26,9 @@ def get_device_node_name_safe(device: Device):
|
|||||||
def get_device_type_name(device: Device, bindings: list[Binding]):
|
def get_device_type_name(device: Device, bindings: list[Binding]):
|
||||||
device_binding = find_device_binding(device, bindings)
|
device_binding = find_device_binding(device, bindings)
|
||||||
if device_binding is None:
|
if device_binding is None:
|
||||||
raise DevicetreeException(f"Binding not found for {device.node_name}")
|
raise Exception(f"Binding not found for {device.node_name}")
|
||||||
if device_binding.compatible is None:
|
if device_binding.compatible is None:
|
||||||
raise DevicetreeException(f"Couldn't find compatible binding for {device.node_name}")
|
raise Exception(f"Couldn't find compatible binding for {device.node_name}")
|
||||||
compatible_safe = device_binding.compatible.split(",")[-1]
|
compatible_safe = device_binding.compatible.split(",")[-1]
|
||||||
return compatible_safe.replace("-", "_")
|
return compatible_safe.replace("-", "_")
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ def find_device_property(device: Device, name: str) -> DeviceProperty:
|
|||||||
def find_device_binding(device: Device, bindings: list[Binding]) -> Binding:
|
def find_device_binding(device: Device, bindings: list[Binding]) -> Binding:
|
||||||
compatible_property = find_device_property(device, "compatible")
|
compatible_property = find_device_property(device, "compatible")
|
||||||
if compatible_property is None:
|
if compatible_property is None:
|
||||||
raise DevicetreeException(f"property 'compatible' not found in device {device.node_name}")
|
raise Exception(f"property 'compatible' not found in device {device.node_name}")
|
||||||
for binding in bindings:
|
for binding in bindings:
|
||||||
if binding.compatible == compatible_property.value:
|
if binding.compatible == compatible_property.value:
|
||||||
return binding
|
return binding
|
||||||
@ -57,69 +57,44 @@ def find_phandle(devices: list[Device], phandle: str):
|
|||||||
for device in devices:
|
for device in devices:
|
||||||
if device.node_name == phandle or device.node_alias == phandle:
|
if device.node_name == phandle or device.node_alias == phandle:
|
||||||
return f"&{get_device_node_name_safe(device)}"
|
return f"&{get_device_node_name_safe(device)}"
|
||||||
raise DevicetreeException(f"phandle '{phandle}' not found in device tree")
|
raise Exception(f"phandle '{phandle}' not found in device tree")
|
||||||
|
|
||||||
def property_to_string(property: DeviceProperty, devices: list[Device]) -> str:
|
def property_to_string(property: DeviceProperty, devices: list[Device]) -> str:
|
||||||
type = property.type
|
type = property.type
|
||||||
if type == "value" or type == "int":
|
if type == "value":
|
||||||
return property.value
|
return property.value
|
||||||
elif type == "boolean" or type == "bool":
|
elif type == "boolean":
|
||||||
return "true"
|
return "true"
|
||||||
elif type == "text":
|
elif type == "text":
|
||||||
return f"\"{property.value}\""
|
return f"\"{property.value}\""
|
||||||
elif type == "values":
|
elif type == "values":
|
||||||
value_list = list()
|
return "{ " + ",".join(property.value) + " }"
|
||||||
for item in property.value:
|
|
||||||
if isinstance(item, PropertyValue):
|
|
||||||
value_list.append(property_to_string(DeviceProperty(name="", type=item.type, value=item.value), devices))
|
|
||||||
else:
|
|
||||||
value_list.append(str(item))
|
|
||||||
return "{ " + ",".join(value_list) + " }"
|
|
||||||
elif type == "phandle":
|
elif type == "phandle":
|
||||||
return find_phandle(devices, property.value)
|
return find_phandle(devices, property.value)
|
||||||
else:
|
else:
|
||||||
raise DevicetreeException(f"property_to_string() has an unsupported type: {type}")
|
raise Exception(f"property_to_string() has an unsupported type: {type}")
|
||||||
|
|
||||||
def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], devices: list[Device]) -> list:
|
def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], devices: list[Device]) -> list:
|
||||||
compatible_property = find_device_property(device, "compatible")
|
compatible_property = find_device_property(device, "compatible")
|
||||||
if compatible_property is None:
|
if compatible_property is None:
|
||||||
raise DevicetreeException(f"Cannot find 'compatible' property for {device.node_name}")
|
raise Exception(f"Cannot find 'compatible' property for {device.node_name}")
|
||||||
device_binding = find_binding(compatible_property.value, bindings)
|
device_binding = find_binding(compatible_property.value, bindings)
|
||||||
if device_binding is None:
|
if device_binding is None:
|
||||||
raise DevicetreeException(f"Binding not found for {device.node_name} and compatible '{compatible_property.value}'")
|
raise Exception(f"Binding not found for {device.node_name} and compatible '{compatible_property.value}'")
|
||||||
# Filter out system properties
|
# Filter out system properties
|
||||||
binding_properties = []
|
binding_properties = []
|
||||||
binding_property_names = set()
|
|
||||||
for property in device_binding.properties:
|
for property in device_binding.properties:
|
||||||
if property.name != "compatible":
|
if property.name != "compatible":
|
||||||
binding_properties.append(property)
|
binding_properties.append(property)
|
||||||
binding_property_names.add(property.name)
|
|
||||||
|
|
||||||
# Check for invalid properties in device
|
|
||||||
for device_property in device.properties:
|
|
||||||
if device_property.name in ["compatible"]:
|
|
||||||
continue
|
|
||||||
if device_property.name not in binding_property_names:
|
|
||||||
raise DevicetreeException(f"Device '{device.node_name}' has invalid property '{device_property.name}'")
|
|
||||||
|
|
||||||
# Allocate total expected configuration arguments
|
# Allocate total expected configuration arguments
|
||||||
result = [0] * len(binding_properties)
|
result = [0] * len(binding_properties)
|
||||||
for index, binding_property in enumerate(binding_properties):
|
for index, binding_property in enumerate(binding_properties):
|
||||||
device_property = find_device_property(device, binding_property.name)
|
device_property = find_device_property(device, binding_property.name)
|
||||||
if device_property is None:
|
if device_property is None:
|
||||||
if binding_property.default is not None:
|
if binding_property.required:
|
||||||
temp_prop = DeviceProperty(
|
raise Exception(f"device {device.node_name} doesn't have property '{binding_property.name}'")
|
||||||
name=binding_property.name,
|
|
||||||
type=binding_property.type,
|
|
||||||
value=binding_property.default
|
|
||||||
)
|
|
||||||
result[index] = property_to_string(temp_prop, devices)
|
|
||||||
elif binding_property.required:
|
|
||||||
raise DevicetreeException(f"device {device.node_name} doesn't have property '{binding_property.name}'")
|
|
||||||
elif binding_property.type == "bool":
|
|
||||||
result[index] = "false"
|
|
||||||
else:
|
else:
|
||||||
raise DevicetreeException(f"Device {device.node_name} doesn't have property '{binding_property.name}' and no default value is set")
|
result[index] = '0'
|
||||||
else:
|
else:
|
||||||
result[index] = property_to_string(device_property, devices)
|
result[index] = property_to_string(device_property, devices)
|
||||||
return result
|
return result
|
||||||
@ -146,7 +121,7 @@ def write_device_structs(file, device: Device, parent_device: Device, bindings:
|
|||||||
type_name = get_device_type_name(device, bindings)
|
type_name = get_device_type_name(device, bindings)
|
||||||
compatible_property = find_device_property(device, "compatible")
|
compatible_property = find_device_property(device, "compatible")
|
||||||
if compatible_property is None:
|
if compatible_property is None:
|
||||||
raise DevicetreeException(f"Cannot find 'compatible' property for {device.node_name}")
|
raise Exception(f"Cannot find 'compatible' property for {device.node_name}")
|
||||||
node_name = get_device_node_name_safe(device)
|
node_name = get_device_node_name_safe(device)
|
||||||
config_variable_name = f"{node_name}_config"
|
config_variable_name = f"{node_name}_config"
|
||||||
if parent_device is not None:
|
if parent_device is not None:
|
||||||
@ -173,7 +148,7 @@ def write_device_init(file, device: Device, bindings: list[Binding], verbose: bo
|
|||||||
# Assemble some pre-requisites
|
# Assemble some pre-requisites
|
||||||
compatible_property = find_device_property(device, "compatible")
|
compatible_property = find_device_property(device, "compatible")
|
||||||
if compatible_property is None:
|
if compatible_property is None:
|
||||||
raise DevicetreeException(f"Cannot find 'compatible' property for {device.node_name}")
|
raise Exception(f"Cannot find 'compatible' property for {device.node_name}")
|
||||||
# Type & instance names
|
# Type & instance names
|
||||||
node_name = get_device_node_name_safe(device)
|
node_name = get_device_node_name_safe(device)
|
||||||
device_variable = node_name
|
device_variable = node_name
|
||||||
|
|||||||
@ -9,45 +9,38 @@ from source.generator import *
|
|||||||
from source.binding_files import find_all_bindings
|
from source.binding_files import find_all_bindings
|
||||||
from source.binding_parser import parse_binding
|
from source.binding_parser import parse_binding
|
||||||
from source.config import *
|
from source.config import *
|
||||||
from source.exception import DevicetreeException
|
|
||||||
|
|
||||||
def main(config_path: str, output_path: str, verbose: bool) -> int:
|
def main(config_path: str, output_path: str, verbose: bool):
|
||||||
print(f"Generating devicetree code\n config: {config_path}\n output: {output_path}")
|
print(f"Generating devicetree code\n config: {config_path}\n output: {output_path}")
|
||||||
if not os.path.isdir(config_path):
|
if not os.path.isdir(config_path):
|
||||||
print(f"Directory not found: {config_path}")
|
raise Exception(f"Directory not found: {config_path}")
|
||||||
return 1
|
|
||||||
|
|
||||||
config = parse_config(config_path, os.getcwd())
|
config = parse_config(config_path, os.getcwd())
|
||||||
if verbose:
|
if verbose:
|
||||||
pprint(config)
|
pprint(config)
|
||||||
|
|
||||||
try:
|
project_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
project_dir = os.path.dirname(os.path.realpath(__file__))
|
grammar_path = os.path.join(project_dir, "grammar.lark")
|
||||||
grammar_path = os.path.join(project_dir, "grammar.lark")
|
lark_data = read_file(grammar_path)
|
||||||
lark_data = read_file(grammar_path)
|
dts_data = read_file(config.dts)
|
||||||
dts_data = read_file(config.dts)
|
lark = Lark(lark_data)
|
||||||
lark = Lark(lark_data)
|
parsed = lark.parse(dts_data)
|
||||||
parsed = lark.parse(dts_data)
|
if verbose:
|
||||||
if verbose:
|
print(parsed.pretty())
|
||||||
print(parsed.pretty())
|
transformed = DtsTransformer().transform(parsed)
|
||||||
transformed = DtsTransformer().transform(parsed)
|
if verbose:
|
||||||
if verbose:
|
pprint(transformed)
|
||||||
pprint(transformed)
|
binding_files = find_all_bindings(config.bindings)
|
||||||
binding_files = find_all_bindings(config.bindings)
|
if verbose:
|
||||||
if verbose:
|
print(f"Bindings found:")
|
||||||
print("Bindings found:")
|
|
||||||
for binding_file in binding_files:
|
|
||||||
print(f" {binding_file}")
|
|
||||||
if verbose:
|
|
||||||
print("Parsing bindings")
|
|
||||||
bindings = []
|
|
||||||
for binding_file in binding_files:
|
for binding_file in binding_files:
|
||||||
bindings.append(parse_binding(binding_file, config.bindings))
|
print(f" {binding_file}")
|
||||||
if verbose:
|
if verbose:
|
||||||
for binding in bindings:
|
print(f"Parsing bindings")
|
||||||
pprint(binding)
|
bindings = []
|
||||||
generate(output_path, transformed, bindings, verbose)
|
for binding_file in binding_files:
|
||||||
return 0
|
bindings.append(parse_binding(binding_file, config.bindings))
|
||||||
except DevicetreeException as caught:
|
if verbose:
|
||||||
print("\033[31mError: ", caught, "\033[0m")
|
for binding in bindings:
|
||||||
return 1
|
pprint(binding)
|
||||||
|
generate(output_path, transformed, bindings, verbose)
|
||||||
|
|||||||
@ -36,7 +36,6 @@ class BindingProperty:
|
|||||||
type: str
|
type: str
|
||||||
required: bool
|
required: bool
|
||||||
description: str
|
description: str
|
||||||
default: object = None
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Binding:
|
class Binding:
|
||||||
|
|||||||
@ -4,7 +4,6 @@ from lark import Transformer
|
|||||||
from lark import Token
|
from lark import Token
|
||||||
from source.models import *
|
from source.models import *
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from .exception import DevicetreeException
|
|
||||||
|
|
||||||
def flatten_token_array(tokens: List[Token], name: str):
|
def flatten_token_array(tokens: List[Token], name: str):
|
||||||
result_list = list()
|
result_list = list()
|
||||||
@ -24,7 +23,7 @@ class DtsTransformer(Transformer):
|
|||||||
def dts_version(self, tokens: List[Token]):
|
def dts_version(self, tokens: List[Token]):
|
||||||
version = tokens[0].value
|
version = tokens[0].value
|
||||||
if version != "dts-v1":
|
if version != "dts-v1":
|
||||||
raise DevicetreeException(f"Unsupported DTS version: {version}")
|
raise Exception(f"Unsupported DTS version: {version}")
|
||||||
return DtsVersion(version)
|
return DtsVersion(version)
|
||||||
def device(self, tokens: list):
|
def device(self, tokens: list):
|
||||||
node_name = None
|
node_name = None
|
||||||
@ -47,12 +46,12 @@ class DtsTransformer(Transformer):
|
|||||||
if (len(objects) == 1) or (objects[1] is None):
|
if (len(objects) == 1) or (objects[1] is None):
|
||||||
return DeviceProperty(name, "boolean", True)
|
return DeviceProperty(name, "boolean", True)
|
||||||
if type(objects[1]) is not PropertyValue:
|
if type(objects[1]) is not PropertyValue:
|
||||||
raise DevicetreeException(f"Object was not converted to PropertyValue: {objects[1]}")
|
raise Exception(f"Object was not converted to PropertyValue: {objects[1]}")
|
||||||
return DeviceProperty(name, objects[1].type, objects[1].value)
|
return DeviceProperty(name, objects[1].type, objects[1].value)
|
||||||
def property_value(self, tokens: List):
|
def property_value(self, tokens: List):
|
||||||
token = tokens[0]
|
token = tokens[0]
|
||||||
if type(token) is Token:
|
if type(token) is Token:
|
||||||
raise DevicetreeException(f"Failed to convert token to PropertyValue: {token}")
|
raise Exception(f"Failed to convert token to PropertyValue: {token}")
|
||||||
return token
|
return token
|
||||||
def PHANDLE(self, token: Token):
|
def PHANDLE(self, token: Token):
|
||||||
return PropertyValue(type="phandle", value=token.value[1:])
|
return PropertyValue(type="phandle", value=token.value[1:])
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
description: Test device binding
|
|
||||||
compatible: "test,device"
|
|
||||||
properties:
|
|
||||||
reg:
|
|
||||||
type: int
|
|
||||||
required: true
|
|
||||||
status:
|
|
||||||
type: string
|
|
||||||
boolean-prop:
|
|
||||||
type: boolean
|
|
||||||
int-prop:
|
|
||||||
type: int
|
|
||||||
string-prop:
|
|
||||||
type: string
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
description: Test root binding
|
|
||||||
compatible: "test,root"
|
|
||||||
properties:
|
|
||||||
model:
|
|
||||||
type: string
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
dts: test.dts
|
|
||||||
bindings: bindings
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
/dts-v1/;
|
|
||||||
|
|
||||||
#include <test_include.h>
|
|
||||||
|
|
||||||
/ {
|
|
||||||
compatible = "test,root";
|
|
||||||
model = "Test Model";
|
|
||||||
|
|
||||||
test_device: test-device@0 {
|
|
||||||
compatible = "test,device";
|
|
||||||
reg = <0>;
|
|
||||||
status = "okay";
|
|
||||||
boolean-prop;
|
|
||||||
int-prop = <42>;
|
|
||||||
string-prop = "hello";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@ -1,102 +0,0 @@
|
|||||||
import os
|
|
||||||
import subprocess
|
|
||||||
import shutil
|
|
||||||
import sys
|
|
||||||
import tempfile
|
|
||||||
|
|
||||||
# Path to the compile.py script
|
|
||||||
# We assume this script is in Buildscripts/DevicetreeCompiler/tests/
|
|
||||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
PROJECT_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, ".."))
|
|
||||||
COMPILE_SCRIPT = os.path.join(PROJECT_ROOT, "compile.py")
|
|
||||||
TEST_DATA_DIR = os.path.join(SCRIPT_DIR, "data")
|
|
||||||
|
|
||||||
def run_compiler(config_path, output_path):
|
|
||||||
result = subprocess.run(
|
|
||||||
[sys.executable, COMPILE_SCRIPT, config_path, output_path],
|
|
||||||
capture_output=True,
|
|
||||||
text=True,
|
|
||||||
cwd=PROJECT_ROOT,
|
|
||||||
timeout=60
|
|
||||||
)
|
|
||||||
return result
|
|
||||||
|
|
||||||
def test_compile_success():
|
|
||||||
print("Running test_compile_success...")
|
|
||||||
with tempfile.TemporaryDirectory() as output_dir:
|
|
||||||
result = run_compiler(TEST_DATA_DIR, output_dir)
|
|
||||||
|
|
||||||
if result.returncode != 0:
|
|
||||||
print(f"FAILED: Compilation failed: {result.stderr}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(output_dir, "devicetree.c")):
|
|
||||||
print("FAILED: devicetree.c not generated")
|
|
||||||
return False
|
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(output_dir, "devicetree.h")):
|
|
||||||
print("FAILED: devicetree.h not generated")
|
|
||||||
return False
|
|
||||||
|
|
||||||
print("PASSED")
|
|
||||||
return True
|
|
||||||
|
|
||||||
def test_compile_invalid_dts():
|
|
||||||
print("Running test_compile_invalid_dts...")
|
|
||||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
|
||||||
bad_data_dir = os.path.join(tmp_dir, "bad_data")
|
|
||||||
os.makedirs(bad_data_dir)
|
|
||||||
output_dir = os.path.join(tmp_dir, "output")
|
|
||||||
os.makedirs(output_dir)
|
|
||||||
|
|
||||||
with open(os.path.join(bad_data_dir, "devicetree.yaml"), "w") as f:
|
|
||||||
f.write("dts: bad.dts\nbindings: bindings")
|
|
||||||
|
|
||||||
with open(os.path.join(bad_data_dir, "bad.dts"), "w") as f:
|
|
||||||
f.write("/dts-v1/;\n / { invalid syntax }")
|
|
||||||
|
|
||||||
os.makedirs(os.path.join(bad_data_dir, "bindings"))
|
|
||||||
|
|
||||||
result = run_compiler(bad_data_dir, output_dir)
|
|
||||||
|
|
||||||
if result.returncode == 0:
|
|
||||||
print("FAILED: Compilation should have failed but succeeded")
|
|
||||||
return False
|
|
||||||
|
|
||||||
print("PASSED")
|
|
||||||
return True
|
|
||||||
|
|
||||||
def test_compile_missing_config():
|
|
||||||
print("Running test_compile_missing_config...")
|
|
||||||
with tempfile.TemporaryDirectory() as output_dir:
|
|
||||||
result = run_compiler("/non/existent/path", output_dir)
|
|
||||||
|
|
||||||
if result.returncode == 0:
|
|
||||||
print("FAILED: Compilation should have failed for non-existent path")
|
|
||||||
return False
|
|
||||||
|
|
||||||
if "Directory not found" not in result.stdout:
|
|
||||||
print(f"FAILED: Expected 'Directory not found' error message, got: {result.stdout}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
print("PASSED")
|
|
||||||
return True
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
tests = [
|
|
||||||
test_compile_success,
|
|
||||||
test_compile_invalid_dts,
|
|
||||||
test_compile_missing_config
|
|
||||||
]
|
|
||||||
|
|
||||||
failed = 0
|
|
||||||
for test in tests:
|
|
||||||
if not test():
|
|
||||||
failed += 1
|
|
||||||
|
|
||||||
if failed > 0:
|
|
||||||
print(f"\n{failed} tests failed")
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
|
||||||
print("\nAll tests passed")
|
|
||||||
sys.exit(0)
|
|
||||||
@ -28,6 +28,9 @@
|
|||||||
pin-mosi = <13>;
|
pin-mosi = <13>;
|
||||||
pin-miso = <GPIO_PIN_NONE>;
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <14>;
|
pin-sclk = <14>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -36,5 +39,8 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <19>;
|
pin-miso = <19>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,6 +29,9 @@
|
|||||||
pin-mosi = <13>;
|
pin-mosi = <13>;
|
||||||
pin-miso = <12>;
|
pin-miso = <12>;
|
||||||
pin-sclk = <14>;
|
pin-sclk = <14>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -37,6 +40,9 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <19>;
|
pin-miso = <19>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -44,5 +50,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <3>;
|
pin-tx = <3>;
|
||||||
pin-rx = <1>;
|
pin-rx = <1>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,6 +29,9 @@
|
|||||||
pin-mosi = <13>;
|
pin-mosi = <13>;
|
||||||
pin-miso = <12>;
|
pin-miso = <12>;
|
||||||
pin-sclk = <14>;
|
pin-sclk = <14>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -37,6 +40,9 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <19>;
|
pin-miso = <19>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -44,5 +50,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <3>;
|
pin-tx = <3>;
|
||||||
pin-rx = <1>;
|
pin-rx = <1>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,6 +28,9 @@
|
|||||||
pin-mosi = <13>;
|
pin-mosi = <13>;
|
||||||
pin-miso = <GPIO_PIN_NONE>;
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <14>;
|
pin-sclk = <14>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -36,5 +39,8 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <19>;
|
pin-miso = <19>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,6 +28,8 @@
|
|||||||
pin-mosi = <47>;
|
pin-mosi = <47>;
|
||||||
pin-miso = <41>;
|
pin-miso = <41>;
|
||||||
pin-sclk = <48>;
|
pin-sclk = <48>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
pin-hd = <42>;
|
pin-hd = <42>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -37,6 +37,9 @@
|
|||||||
pin-mosi = <11>;
|
pin-mosi = <11>;
|
||||||
pin-miso = <13>;
|
pin-miso = <13>;
|
||||||
pin-sclk = <12>;
|
pin-sclk = <12>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -44,5 +47,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <18>;
|
pin-tx = <18>;
|
||||||
pin-rx = <17>;
|
pin-rx = <17>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -19,6 +19,9 @@
|
|||||||
pin-mosi = <13>;
|
pin-mosi = <13>;
|
||||||
pin-miso = <12>;
|
pin-miso = <12>;
|
||||||
pin-sclk = <14>;
|
pin-sclk = <14>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -27,5 +30,8 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <19>;
|
pin-miso = <19>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,6 +28,9 @@
|
|||||||
pin-mosi = <13>;
|
pin-mosi = <13>;
|
||||||
pin-miso = <12>;
|
pin-miso = <12>;
|
||||||
pin-sclk = <14>;
|
pin-sclk = <14>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -36,5 +39,8 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <19>;
|
pin-miso = <19>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
#include <St7789Display.h>
|
#include <St7789Display.h>
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||||
|
// Note for future changes: Reset pin is 48 and interrupt pin is 47
|
||||||
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
|
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
|
||||||
I2C_NUM_0,
|
I2C_NUM_0,
|
||||||
LCD_HORIZONTAL_RESOLUTION,
|
LCD_HORIZONTAL_RESOLUTION,
|
||||||
|
|||||||
@ -27,7 +27,11 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <39>;
|
pin-mosi = <39>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <42>;
|
pin-sclk = <42>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -36,6 +40,9 @@
|
|||||||
pin-mosi = <6>;
|
pin-mosi = <6>;
|
||||||
pin-miso = <4>;
|
pin-miso = <4>;
|
||||||
pin-sclk = <5>;
|
pin-sclk = <5>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart0 {
|
uart0 {
|
||||||
@ -43,6 +50,8 @@
|
|||||||
port = <UART_NUM_0>;
|
port = <UART_NUM_0>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -50,5 +59,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <17>;
|
pin-tx = <17>;
|
||||||
pin-rx = <18>;
|
pin-rx = <18>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
#include <Ili9488Display.h>
|
#include <Ili9488Display.h>
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||||
|
// Note for future changes: Reset pin is 48 and interrupt pin is 47
|
||||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
||||||
I2C_NUM_0,
|
I2C_NUM_0,
|
||||||
320,
|
320,
|
||||||
|
|||||||
@ -29,6 +29,9 @@
|
|||||||
pin-mosi = <39>;
|
pin-mosi = <39>;
|
||||||
pin-miso = <GPIO_PIN_NONE>;
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <42>;
|
pin-sclk = <42>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -37,6 +40,9 @@
|
|||||||
pin-mosi = <6>;
|
pin-mosi = <6>;
|
||||||
pin-miso = <4>;
|
pin-miso = <4>;
|
||||||
pin-sclk = <5>;
|
pin-sclk = <5>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart0 {
|
uart0 {
|
||||||
@ -44,6 +50,8 @@
|
|||||||
port = <UART_NUM_0>;
|
port = <UART_NUM_0>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -51,5 +59,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <17>;
|
pin-tx = <17>;
|
||||||
pin-rx = <18>;
|
pin-rx = <18>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,6 +29,9 @@
|
|||||||
pin-mosi = <6>;
|
pin-mosi = <6>;
|
||||||
pin-miso = <4>;
|
pin-miso = <4>;
|
||||||
pin-sclk = <5>;
|
pin-sclk = <5>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart0 {
|
uart0 {
|
||||||
@ -36,6 +39,8 @@
|
|||||||
port = <UART_NUM_0>;
|
port = <UART_NUM_0>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -43,5 +48,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <20>;
|
pin-tx = <20>;
|
||||||
pin-rx = <19>;
|
pin-rx = <19>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,6 +29,8 @@
|
|||||||
pin-mosi = <13>;
|
pin-mosi = <13>;
|
||||||
pin-miso = <12>;
|
pin-miso = <12>;
|
||||||
pin-sclk = <14>;
|
pin-sclk = <14>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
max-transfer-size = <65536>;
|
max-transfer-size = <65536>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -38,6 +40,9 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <19>;
|
pin-miso = <19>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -45,5 +50,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <17>;
|
pin-tx = <17>;
|
||||||
pin-rx = <16>;
|
pin-rx = <16>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,6 +29,8 @@
|
|||||||
pin-mosi = <13>;
|
pin-mosi = <13>;
|
||||||
pin-miso = <33>;
|
pin-miso = <33>;
|
||||||
pin-sclk = <14>;
|
pin-sclk = <14>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
max-transfer-size = <65536>;
|
max-transfer-size = <65536>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -38,6 +40,9 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <19>;
|
pin-miso = <19>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -45,5 +50,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <1>;
|
pin-tx = <1>;
|
||||||
pin-rx = <3>;
|
pin-rx = <3>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,6 +29,9 @@
|
|||||||
pin-mosi = <11>;
|
pin-mosi = <11>;
|
||||||
pin-miso = <13>;
|
pin-miso = <13>;
|
||||||
pin-sclk = <12>;
|
pin-sclk = <12>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart0 {
|
uart0 {
|
||||||
@ -36,5 +39,7 @@
|
|||||||
port = <UART_NUM_0>;
|
port = <UART_NUM_0>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -36,7 +36,11 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <13>;
|
pin-mosi = <13>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <14>;
|
pin-sclk = <14>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -45,6 +49,9 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <19>;
|
pin-miso = <19>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// CN1 header, JST SH 1.25, GND / IO22 / IO21 / 3.3V
|
// CN1 header, JST SH 1.25, GND / IO22 / IO21 / 3.3V
|
||||||
@ -53,5 +60,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <22>;
|
pin-tx = <22>;
|
||||||
pin-rx = <21>;
|
pin-rx = <21>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -39,6 +39,7 @@
|
|||||||
pin-sclk = <47>;
|
pin-sclk = <47>;
|
||||||
pin-wp = <40>;
|
pin-wp = <40>;
|
||||||
pin-hd = <39>;
|
pin-hd = <39>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -47,6 +48,9 @@
|
|||||||
pin-mosi = <11>;
|
pin-mosi = <11>;
|
||||||
pin-miso = <13>;
|
pin-miso = <13>;
|
||||||
pin-sclk = <12>;
|
pin-sclk = <12>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// P1 header
|
// P1 header
|
||||||
@ -55,5 +59,7 @@
|
|||||||
port = <UART_NUM_0>;
|
port = <UART_NUM_0>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -37,6 +37,9 @@
|
|||||||
pin-mosi = <11>;
|
pin-mosi = <11>;
|
||||||
pin-miso = <13>;
|
pin-miso = <13>;
|
||||||
pin-sclk = <12>;
|
pin-sclk = <12>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -44,5 +47,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <18>;
|
pin-tx = <18>;
|
||||||
pin-rx = <17>;
|
pin-rx = <17>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,15 +5,14 @@
|
|||||||
#include <St7789Display.h>
|
#include <St7789Display.h>
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||||
|
// Note for future changes: Reset pin is 48 and interrupt pin is 47
|
||||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
||||||
I2C_NUM_0,
|
I2C_NUM_0,
|
||||||
240,
|
240,
|
||||||
320,
|
320,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
false,
|
false
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_16
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
return std::make_shared<Gt911Touch>(std::move(configuration));
|
||||||
|
|||||||
@ -39,6 +39,8 @@
|
|||||||
pin-bclk = <7>;
|
pin-bclk = <7>;
|
||||||
pin-ws = <5>;
|
pin-ws = <5>;
|
||||||
pin-data-out = <6>;
|
pin-data-out = <6>;
|
||||||
|
pin-data-in = <GPIO_PIN_NONE>;
|
||||||
|
pin-mclk = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
|
|
||||||
spi0 {
|
spi0 {
|
||||||
@ -47,6 +49,9 @@
|
|||||||
pin-mosi = <41>;
|
pin-mosi = <41>;
|
||||||
pin-miso = <38>;
|
pin-miso = <38>;
|
||||||
pin-sclk = <40>;
|
pin-sclk = <40>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -54,5 +59,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -18,6 +18,10 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <7>;
|
pin-mosi = <7>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <6>;
|
pin-sclk = <6>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -18,6 +18,10 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <19>;
|
pin-mosi = <19>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -27,7 +27,11 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <3>;
|
pin-mosi = <3>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <5>;
|
pin-sclk = <5>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
stemma_qt: uart1 {
|
stemma_qt: uart1 {
|
||||||
@ -35,5 +39,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -31,6 +31,9 @@
|
|||||||
pin-mosi = <34>;
|
pin-mosi = <34>;
|
||||||
pin-miso = <33>;
|
pin-miso = <33>;
|
||||||
pin-sclk = <35>;
|
pin-sclk = <35>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ES8311
|
// ES8311
|
||||||
@ -50,6 +53,8 @@
|
|||||||
port = <UART_NUM_0>;
|
port = <UART_NUM_0>;
|
||||||
pin-tx = <12>;
|
pin-tx = <12>;
|
||||||
pin-rx = <4>;
|
pin-rx = <4>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart_external: uart1 {
|
uart_external: uart1 {
|
||||||
@ -57,5 +62,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -37,7 +37,11 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <35>;
|
pin-mosi = <35>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <36>;
|
pin-sclk = <36>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -46,6 +50,9 @@
|
|||||||
pin-mosi = <14>;
|
pin-mosi = <14>;
|
||||||
pin-miso = <39>;
|
pin-miso = <39>;
|
||||||
pin-sclk = <40>;
|
pin-sclk = <40>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Speaker and microphone (ES8311)
|
// Speaker and microphone (ES8311)
|
||||||
@ -56,6 +63,7 @@
|
|||||||
pin-ws = <43>;
|
pin-ws = <43>;
|
||||||
pin-data-out = <42>;
|
pin-data-out = <42>;
|
||||||
pin-data-in = <46>;
|
pin-data-in = <46>;
|
||||||
|
pin-mclk = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart_port_a: uart1 {
|
uart_port_a: uart1 {
|
||||||
@ -63,5 +71,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <1>;
|
pin-tx = <1>;
|
||||||
pin-rx = <2>;
|
pin-rx = <2>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,7 +29,11 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <35>;
|
pin-mosi = <35>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <36>;
|
pin-sclk = <36>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -38,6 +42,9 @@
|
|||||||
pin-mosi = <14>;
|
pin-mosi = <14>;
|
||||||
pin-miso = <39>;
|
pin-miso = <39>;
|
||||||
pin-sclk = <40>;
|
pin-sclk = <40>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Speaker and microphone
|
// Speaker and microphone
|
||||||
@ -49,6 +56,7 @@
|
|||||||
pin-ws = <43>;
|
pin-ws = <43>;
|
||||||
pin-data-out = <42>;
|
pin-data-out = <42>;
|
||||||
pin-data-in = <46>;
|
pin-data-in = <46>;
|
||||||
|
pin-mclk = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart_port_a: uart1 {
|
uart_port_a: uart1 {
|
||||||
@ -56,5 +64,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <1>;
|
pin-tx = <1>;
|
||||||
pin-rx = <2>;
|
pin-rx = <2>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -39,6 +39,9 @@
|
|||||||
pin-mosi = <23>;
|
pin-mosi = <23>;
|
||||||
pin-miso = <38>;
|
pin-miso = <38>;
|
||||||
pin-sclk = <18>;
|
pin-sclk = <18>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// NS4168: Speaker and microphone
|
// NS4168: Speaker and microphone
|
||||||
@ -50,6 +53,7 @@
|
|||||||
pin-ws = <0>;
|
pin-ws = <0>;
|
||||||
pin-data-out = <2>;
|
pin-data-out = <2>;
|
||||||
pin-data-in = <34>;
|
pin-data-in = <34>;
|
||||||
|
pin-mclk = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart_port_a: uart1 {
|
uart_port_a: uart1 {
|
||||||
@ -57,5 +61,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <33>;
|
pin-tx = <33>;
|
||||||
pin-rx = <32>;
|
pin-rx = <32>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -17,6 +17,7 @@ static void setBacklightDuty(uint8_t backlightDuty) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||||
|
// Note for future changes: Reset pin is 48 and interrupt pin is 47
|
||||||
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
|
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
|
||||||
I2C_NUM_0,
|
I2C_NUM_0,
|
||||||
LCD_HORIZONTAL_RESOLUTION,
|
LCD_HORIZONTAL_RESOLUTION,
|
||||||
|
|||||||
@ -55,6 +55,9 @@
|
|||||||
pin-mosi = <37>;
|
pin-mosi = <37>;
|
||||||
pin-miso = <35>;
|
pin-miso = <35>;
|
||||||
pin-sclk = <36>;
|
pin-sclk = <36>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Enable speaker via ES7210 I2C: https://github.com/m5stack/M5Unified/blob/a6256725481f1bc366655fa48cf03b6095e30ad1/src/M5Unified.cpp#L417
|
// TODO: Enable speaker via ES7210 I2C: https://github.com/m5stack/M5Unified/blob/a6256725481f1bc366655fa48cf03b6095e30ad1/src/M5Unified.cpp#L417
|
||||||
@ -76,5 +79,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <1>;
|
pin-tx = <1>;
|
||||||
pin-rx = <2>;
|
pin-rx = <2>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,6 +28,8 @@
|
|||||||
pin-mosi = <38>;
|
pin-mosi = <38>;
|
||||||
pin-miso = <40>;
|
pin-miso = <40>;
|
||||||
pin-sclk = <39>;
|
pin-sclk = <39>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
max-transfer-size = <4096>;
|
max-transfer-size = <4096>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -35,7 +35,11 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <15>;
|
pin-mosi = <15>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <13>;
|
pin-sclk = <13>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart_grove: uart1 {
|
uart_grove: uart1 {
|
||||||
@ -43,5 +47,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <33>;
|
pin-tx = <33>;
|
||||||
pin-rx = <32>;
|
pin-rx = <32>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -34,7 +34,11 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <15>;
|
pin-mosi = <15>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <13>;
|
pin-sclk = <13>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart_grove: uart1 {
|
uart_grove: uart1 {
|
||||||
@ -42,5 +46,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <33>;
|
pin-tx = <33>;
|
||||||
pin-rx = <32>;
|
pin-rx = <32>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -36,5 +36,8 @@
|
|||||||
pin-mosi = <44>;
|
pin-mosi = <44>;
|
||||||
pin-miso = <39>;
|
pin-miso = <39>;
|
||||||
pin-sclk = <43>;
|
pin-sclk = <43>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,6 +28,8 @@
|
|||||||
pin-mosi = <40>;
|
pin-mosi = <40>;
|
||||||
pin-miso = <41>;
|
pin-miso = <41>;
|
||||||
pin-sclk = <39>;
|
pin-sclk = <39>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
max-transfer-size = <65536>;
|
max-transfer-size = <65536>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -27,7 +27,11 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <11>;
|
pin-mosi = <11>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <12>;
|
pin-sclk = <12>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart0 {
|
uart0 {
|
||||||
@ -35,5 +39,7 @@
|
|||||||
port = <UART_NUM_0>;
|
port = <UART_NUM_0>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -27,7 +27,11 @@
|
|||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <41>;
|
pin-mosi = <41>;
|
||||||
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <40>;
|
pin-sclk = <40>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
spi1 {
|
spi1 {
|
||||||
@ -36,5 +40,8 @@
|
|||||||
pin-mosi = <18>;
|
pin-mosi = <18>;
|
||||||
pin-miso = <16>;
|
pin-miso = <16>;
|
||||||
pin-sclk = <21>;
|
pin-sclk = <21>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,6 +29,9 @@
|
|||||||
pin-mosi = <11>;
|
pin-mosi = <11>;
|
||||||
pin-miso = <12>;
|
pin-miso = <12>;
|
||||||
pin-sclk = <10>;
|
pin-sclk = <10>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -37,5 +40,8 @@
|
|||||||
pin-mosi = <16>;
|
pin-mosi = <16>;
|
||||||
pin-miso = <15>;
|
pin-miso = <15>;
|
||||||
pin-sclk = <17>;
|
pin-sclk = <17>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -12,6 +12,7 @@ constexpr auto LCD_VERTICAL_RESOLUTION = 320;
|
|||||||
void setBacklightDuty(uint8_t level);
|
void setBacklightDuty(uint8_t level);
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||||
|
// Note for future changes: Reset pin is 48 and interrupt pin is 47
|
||||||
auto configuration = std::make_unique<Axs5106Touch::Configuration>(
|
auto configuration = std::make_unique<Axs5106Touch::Configuration>(
|
||||||
I2C_NUM_0,
|
I2C_NUM_0,
|
||||||
172,
|
172,
|
||||||
|
|||||||
@ -29,6 +29,9 @@
|
|||||||
pin-mosi = <39>;
|
pin-mosi = <39>;
|
||||||
pin-miso = <GPIO_PIN_NONE>;
|
pin-miso = <GPIO_PIN_NONE>;
|
||||||
pin-sclk = <38>;
|
pin-sclk = <38>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
sdcard_spi: spi1 {
|
sdcard_spi: spi1 {
|
||||||
@ -37,5 +40,8 @@
|
|||||||
pin-mosi = <15>;
|
pin-mosi = <15>;
|
||||||
pin-miso = <17>;
|
pin-miso = <17>;
|
||||||
pin-sclk = <16>;
|
pin-sclk = <16>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,6 +29,9 @@
|
|||||||
pin-mosi = <11>;
|
pin-mosi = <11>;
|
||||||
pin-miso = <13>;
|
pin-miso = <13>;
|
||||||
pin-sclk = <12>;
|
pin-sclk = <12>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
uart1 {
|
uart1 {
|
||||||
@ -36,5 +39,7 @@
|
|||||||
port = <UART_NUM_1>;
|
port = <UART_NUM_1>;
|
||||||
pin-tx = <43>;
|
pin-tx = <43>;
|
||||||
pin-rx = <44>;
|
pin-rx = <44>;
|
||||||
|
pin-cts = <GPIO_PIN_NONE>;
|
||||||
|
pin-rts = <GPIO_PIN_NONE>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,5 +28,8 @@
|
|||||||
pin-mosi = <40>;
|
pin-mosi = <40>;
|
||||||
pin-miso = <38>;
|
pin-miso = <38>;
|
||||||
pin-sclk = <39>;
|
pin-sclk = <39>;
|
||||||
|
pin-wp = <GPIO_PIN_NONE>;
|
||||||
|
pin-hd = <GPIO_PIN_NONE>;
|
||||||
|
max-transfer-size = <0>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -12,6 +12,8 @@
|
|||||||
## Higher Priority
|
## Higher Priority
|
||||||
|
|
||||||
- Make a root device type so it can be discovered more easily.
|
- Make a root device type so it can be discovered more easily.
|
||||||
|
- DTS/yaml: Consider support for default values.
|
||||||
|
- DTS: throw custom exceptions and catch them to show cleaner error messages.
|
||||||
- When device.py selects a new device, it should automatically delete the build dirs (build/, cmake-*/) when it detects that the platform has changed.
|
- When device.py selects a new device, it should automatically delete the build dirs (build/, cmake-*/) when it detects that the platform has changed.
|
||||||
- Add font design tokens such as "regular", "title" and "smaller". Perhaps via the LVGL kernel module.
|
- Add font design tokens such as "regular", "title" and "smaller". Perhaps via the LVGL kernel module.
|
||||||
- Add kernel listening mechanism so that the root device init can be notified when a device becomes available:
|
- Add kernel listening mechanism so that the root device init can be notified when a device becomes available:
|
||||||
@ -67,6 +69,8 @@
|
|||||||
|
|
||||||
## Lower Priority
|
## Lower Priority
|
||||||
|
|
||||||
|
- Rename `Lock::lock()` and `Lock::unlock()` to `Lock::acquire()` and `Lock::release()`?
|
||||||
|
- Implement system suspend that turns off the screen
|
||||||
- The boot button on some devices can be used as GPIO_NUM_0 at runtime
|
- The boot button on some devices can be used as GPIO_NUM_0 at runtime
|
||||||
- Localize all apps
|
- Localize all apps
|
||||||
- Support hot-plugging SD card (note: this is not possible if they require the CS pin hack)
|
- Support hot-plugging SD card (note: this is not possible if they require the CS pin hack)
|
||||||
|
|||||||
@ -51,7 +51,7 @@ add_custom_target(AlwaysRun
|
|||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${GENERATED_DIR}/devicetree.c"
|
OUTPUT "${GENERATED_DIR}/devicetree.c"
|
||||||
"${GENERATED_DIR}/devicetree.h"
|
"${GENERATED_DIR}/devicetree.h"
|
||||||
COMMAND pip install lark==1.3.1 pyyaml==6.0.3
|
COMMAND pip install lark pyyaml
|
||||||
COMMAND python "${CMAKE_SOURCE_DIR}/Buildscripts/DevicetreeCompiler/compile.py"
|
COMMAND python "${CMAKE_SOURCE_DIR}/Buildscripts/DevicetreeCompiler/compile.py"
|
||||||
"${DEVICETREE_LOCATION}" "${GENERATED_DIR}"
|
"${DEVICETREE_LOCATION}" "${GENERATED_DIR}"
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
|
|||||||
@ -6,13 +6,7 @@ menu "Tactility App"
|
|||||||
config TT_DEVICE_ID
|
config TT_DEVICE_ID
|
||||||
string "Device Identifier"
|
string "Device Identifier"
|
||||||
default ""
|
default ""
|
||||||
# T-Deck device-related code was directly referenced from Tactility in a pull request.
|
config TT_SPLASH_DURATION
|
||||||
# This breaks other devices because the code does not exist in those implementations.
|
|
||||||
# Until we move it out into a proper driver, we have to have pre-processor definition for that.
|
|
||||||
config TT_TDECK_WORKAROUND
|
|
||||||
bool "Temporary work-around until we fix the T-Deck keyboard and trackball settings"
|
|
||||||
default n
|
|
||||||
config TT_SPLASH_DURATION
|
|
||||||
int "Splash Duration (ms)"
|
int "Splash Duration (ms)"
|
||||||
default 1000
|
default 1000
|
||||||
range 0 3000
|
range 0 3000
|
||||||
|
|||||||
@ -54,7 +54,7 @@ dependencies:
|
|||||||
version: "1.7.6~1"
|
version: "1.7.6~1"
|
||||||
rules:
|
rules:
|
||||||
- if: "target == esp32s3"
|
- if: "target == esp32s3"
|
||||||
espressif/esp_lvgl_port: "2.5.0"
|
espressif/esp_lvgl_port: "2.7.0"
|
||||||
lvgl/lvgl: "9.3.0"
|
lvgl/lvgl: "9.3.0"
|
||||||
FastEPD:
|
FastEPD:
|
||||||
git: https://github.com/bitbank2/FastEPD.git
|
git: https://github.com/bitbank2/FastEPD.git
|
||||||
|
|||||||
@ -7,20 +7,16 @@ compatible: "espressif,esp32-i2c"
|
|||||||
properties:
|
properties:
|
||||||
port:
|
port:
|
||||||
type: int
|
type: int
|
||||||
required: true
|
|
||||||
description: |
|
description: |
|
||||||
The port number, defined by i2c_port_t.
|
The port number, defined by i2c_port_t.
|
||||||
Depending on the hardware, these values are available: I2C_NUM_0, I2C_NUM_1, LP_I2C_NUM_0
|
Depending on the hardware, these values are available: I2C_NUM_0, I2C_NUM_1, LP_I2C_NUM_0
|
||||||
clock-frequency:
|
clock-frequency:
|
||||||
type: int
|
type: int
|
||||||
required: true
|
|
||||||
description: Initial clock frequency in Hz
|
description: Initial clock frequency in Hz
|
||||||
pin-sda:
|
pin-sda:
|
||||||
type: int
|
type: int
|
||||||
required: true
|
|
||||||
pin-scl:
|
pin-scl:
|
||||||
type: int
|
type: int
|
||||||
required: true
|
|
||||||
pin-sda-pull-up:
|
pin-sda-pull-up:
|
||||||
type: bool
|
type: bool
|
||||||
description: enable internal pull-up resistor for SDA pin
|
description: enable internal pull-up resistor for SDA pin
|
||||||
|
|||||||
@ -21,14 +21,13 @@ properties:
|
|||||||
description: WS pin
|
description: WS pin
|
||||||
pin-data-out:
|
pin-data-out:
|
||||||
type: int
|
type: int
|
||||||
default: GPIO_PIN_NONE
|
required: true
|
||||||
description: DATA OUT pin
|
description: DATA OUT pin
|
||||||
pin-data-in:
|
pin-data-in:
|
||||||
type: int
|
type: int
|
||||||
default: GPIO_PIN_NONE
|
required: true
|
||||||
description: DATA IN pin
|
description: DATA IN pin
|
||||||
pin-mclk:
|
pin-mclk:
|
||||||
type: int
|
type: int
|
||||||
required: false
|
required: true
|
||||||
default: GPIO_PIN_NONE
|
|
||||||
description: MCLK pin
|
description: MCLK pin
|
||||||
|
|||||||
@ -13,11 +13,11 @@ properties:
|
|||||||
Defined by spi_host_device_t (e.g. SPI2_HOST, SPI3_HOST).
|
Defined by spi_host_device_t (e.g. SPI2_HOST, SPI3_HOST).
|
||||||
pin-mosi:
|
pin-mosi:
|
||||||
type: int
|
type: int
|
||||||
default: GPIO_PIN_NONE
|
required: true
|
||||||
description: MOSI (Data 0) pin
|
description: MOSI (Data 0) pin
|
||||||
pin-miso:
|
pin-miso:
|
||||||
type: int
|
type: int
|
||||||
default: GPIO_PIN_NONE
|
required: true
|
||||||
description: MISO (Data 1) pin
|
description: MISO (Data 1) pin
|
||||||
pin-sclk:
|
pin-sclk:
|
||||||
type: int
|
type: int
|
||||||
@ -25,15 +25,12 @@ properties:
|
|||||||
description: Clock pin
|
description: Clock pin
|
||||||
pin-wp:
|
pin-wp:
|
||||||
type: int
|
type: int
|
||||||
default: GPIO_PIN_NONE
|
|
||||||
description: WP (Data 2) pin
|
description: WP (Data 2) pin
|
||||||
pin-hd:
|
pin-hd:
|
||||||
type: int
|
type: int
|
||||||
default: GPIO_PIN_NONE
|
|
||||||
description: HD (Data 3) pin
|
description: HD (Data 3) pin
|
||||||
max-transfer-size:
|
max-transfer-size:
|
||||||
type: int
|
type: int
|
||||||
default: 0
|
|
||||||
description: |
|
description: |
|
||||||
Data transfer size limit in bytes.
|
Data transfer size limit in bytes.
|
||||||
0 means the platform decides the limit.
|
0 means the platform decides the limit.
|
||||||
|
|||||||
@ -21,9 +21,7 @@ properties:
|
|||||||
description: RX pin
|
description: RX pin
|
||||||
pin-cts:
|
pin-cts:
|
||||||
type: int
|
type: int
|
||||||
default: GPIO_PIN_NONE
|
|
||||||
description: CTS pin
|
description: CTS pin
|
||||||
pin-rts:
|
pin-rts:
|
||||||
type: int
|
type: int
|
||||||
default: GPIO_PIN_NONE
|
|
||||||
description: RTS pin
|
description: RTS pin
|
||||||
|
|||||||
@ -32,7 +32,6 @@
|
|||||||
#include <tactility/lvgl_module.h>
|
#include <tactility/lvgl_module.h>
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
#include "tactility/drivers/root.h"
|
|
||||||
#include <Tactility/InitEsp.h>
|
#include <Tactility/InitEsp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -62,6 +61,8 @@ namespace service {
|
|||||||
namespace statusbar { extern const ServiceManifest manifest; }
|
namespace statusbar { extern const ServiceManifest manifest; }
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
namespace displayidle { extern const ServiceManifest manifest; }
|
namespace displayidle { extern const ServiceManifest manifest; }
|
||||||
|
#endif
|
||||||
|
#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
|
||||||
namespace keyboardidle { extern const ServiceManifest manifest; }
|
namespace keyboardidle { extern const ServiceManifest manifest; }
|
||||||
#endif
|
#endif
|
||||||
#if TT_FEATURE_SCREENSHOT_ENABLED
|
#if TT_FEATURE_SCREENSHOT_ENABLED
|
||||||
@ -111,10 +112,11 @@ namespace app {
|
|||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
namespace crashdiagnostics { extern const AppManifest manifest; }
|
namespace crashdiagnostics { extern const AppManifest manifest; }
|
||||||
namespace webserversettings { extern const AppManifest manifest; }
|
namespace webserversettings { extern const AppManifest manifest; }
|
||||||
#if CONFIG_TT_TDECK_WORKAROUND == 1
|
|
||||||
namespace keyboardsettings { extern const AppManifest manifest; } // T-Deck only for now
|
|
||||||
namespace trackballsettings { extern const AppManifest manifest; } // T-Deck only for now
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
|
||||||
|
namespace keyboardsettings { extern const AppManifest manifest; }
|
||||||
|
namespace trackballsettings { extern const AppManifest manifest; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TT_FEATURE_SCREENSHOT_ENABLED
|
#if TT_FEATURE_SCREENSHOT_ENABLED
|
||||||
@ -160,10 +162,11 @@ static void registerInternalApps() {
|
|||||||
addAppManifest(app::webserversettings::manifest);
|
addAppManifest(app::webserversettings::manifest);
|
||||||
addAppManifest(app::crashdiagnostics::manifest);
|
addAppManifest(app::crashdiagnostics::manifest);
|
||||||
addAppManifest(app::development::manifest);
|
addAppManifest(app::development::manifest);
|
||||||
#if defined(CONFIG_TT_TDECK_WORKAROUND)
|
|
||||||
addAppManifest(app::keyboardsettings::manifest);
|
|
||||||
addAppManifest(app::trackballsettings::manifest);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
|
||||||
|
addAppManifest(app::keyboardsettings::manifest);
|
||||||
|
addAppManifest(app::trackballsettings::manifest);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_TINYUSB_MSC_ENABLED) && CONFIG_TINYUSB_MSC_ENABLED
|
#if defined(CONFIG_TINYUSB_MSC_ENABLED) && CONFIG_TINYUSB_MSC_ENABLED
|
||||||
@ -248,13 +251,13 @@ static void registerAndStartSecondaryServices() {
|
|||||||
addService(service::loader::manifest);
|
addService(service::loader::manifest);
|
||||||
addService(service::gui::manifest);
|
addService(service::gui::manifest);
|
||||||
addService(service::statusbar::manifest);
|
addService(service::statusbar::manifest);
|
||||||
addService(service::memorychecker::manifest);
|
#ifdef ESP_PLATFORM
|
||||||
#if defined(ESP_PLATFORM)
|
|
||||||
addService(service::displayidle::manifest);
|
addService(service::displayidle::manifest);
|
||||||
#if defined(CONFIG_TT_TDECK_WORKAROUND)
|
#endif
|
||||||
|
#if defined(ESP_PLATFORM) && defined(CONFIG_TT_DEVICE_LILYGO_TDECK)
|
||||||
addService(service::keyboardidle::manifest);
|
addService(service::keyboardidle::manifest);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
addService(service::memorychecker::manifest);
|
||||||
#if TT_FEATURE_SCREENSHOT_ENABLED
|
#if TT_FEATURE_SCREENSHOT_ENABLED
|
||||||
addService(service::screenshot::manifest);
|
addService(service::screenshot::manifest);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -178,14 +178,6 @@ struct Device* device_get_parent(struct Device* device);
|
|||||||
*/
|
*/
|
||||||
bool device_is_ready(const struct Device* device);
|
bool device_is_ready(const struct Device* device);
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether the device is compatible with the given compatible string.
|
|
||||||
* @param[in] device non-null device pointer
|
|
||||||
* @param[in] compatible compatible string
|
|
||||||
* @return true if the device is compatible
|
|
||||||
*/
|
|
||||||
bool device_is_compatible(const struct Device* device, const char* compatible);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the driver data for a device.
|
* Set the driver data for a device.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -12,14 +10,6 @@ struct RootConfig {
|
|||||||
const char* model;
|
const char* model;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates whether the device's model matches the specified model.
|
|
||||||
* @param[in] device the device to check (non-null)
|
|
||||||
* @param[in] model the model to check against
|
|
||||||
* @return true if the device's model matches the specified model
|
|
||||||
*/
|
|
||||||
bool root_is_model(const struct Device* device, const char* model);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -23,7 +23,6 @@ typedef int error_t;
|
|||||||
#define ERROR_OUT_OF_MEMORY 9
|
#define ERROR_OUT_OF_MEMORY 9
|
||||||
#define ERROR_NOT_SUPPORTED 10
|
#define ERROR_NOT_SUPPORTED 10
|
||||||
#define ERROR_NOT_ALLOWED 11
|
#define ERROR_NOT_ALLOWED 11
|
||||||
#define ERROR_BUFFER_OVERFLOW 12
|
|
||||||
|
|
||||||
/** Convert an error_t to a human-readable text. Useful for logging. */
|
/** Convert an error_t to a human-readable text. Useful for logging. */
|
||||||
const char* error_to_string(error_t error);
|
const char* error_to_string(error_t error);
|
||||||
|
|||||||
@ -277,11 +277,6 @@ bool device_is_ready(const struct Device* device) {
|
|||||||
return device->internal->state.started;
|
return device->internal->state.started;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool device_is_compatible(const struct Device* device, const char* compatible) {
|
|
||||||
if (device->internal->driver == nullptr) return false;
|
|
||||||
return driver_is_compatible(device->internal->driver, compatible);
|
|
||||||
}
|
|
||||||
|
|
||||||
void device_set_driver_data(struct Device* device, void* driver_data) {
|
void device_set_driver_data(struct Device* device, void* driver_data) {
|
||||||
device->internal->driver_data = driver_data;
|
device->internal->driver_data = driver_data;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,10 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
#include <tactility/device.h>
|
|
||||||
#include <tactility/driver.h>
|
#include <tactility/driver.h>
|
||||||
#include <tactility/drivers/root.h>
|
#include <tactility/drivers/root.h>
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
bool root_is_model(const struct Device* device, const char* buffer) {
|
|
||||||
auto* config = static_cast<const RootConfig*>(device->config);
|
|
||||||
return strcmp(config->model, buffer) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Driver root_driver = {
|
Driver root_driver = {
|
||||||
.name = "root",
|
.name = "root",
|
||||||
.compatible = (const char*[]) { "root", nullptr },
|
.compatible = (const char*[]) { "root", nullptr },
|
||||||
@ -19,8 +12,7 @@ Driver root_driver = {
|
|||||||
.stop_device = nullptr,
|
.stop_device = nullptr,
|
||||||
.api = nullptr,
|
.api = nullptr,
|
||||||
.device_type = nullptr,
|
.device_type = nullptr,
|
||||||
.owner = nullptr,
|
.owner = nullptr
|
||||||
.internal = nullptr
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,8 +29,6 @@ const char* error_to_string(error_t error) {
|
|||||||
return "not supported";
|
return "not supported";
|
||||||
case ERROR_NOT_ALLOWED:
|
case ERROR_NOT_ALLOWED:
|
||||||
return "not allowed";
|
return "not allowed";
|
||||||
case ERROR_BUFFER_OVERFLOW:
|
|
||||||
return "buffer overflow";
|
|
||||||
default:
|
default:
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
#include <tactility/drivers/gpio_controller.h>
|
#include <tactility/drivers/gpio_controller.h>
|
||||||
#include <tactility/drivers/i2c_controller.h>
|
#include <tactility/drivers/i2c_controller.h>
|
||||||
#include <tactility/drivers/i2s_controller.h>
|
#include <tactility/drivers/i2s_controller.h>
|
||||||
#include <tactility/drivers/root.h>
|
|
||||||
#include <tactility/drivers/spi_controller.h>
|
#include <tactility/drivers/spi_controller.h>
|
||||||
#include <tactility/drivers/uart_controller.h>
|
#include <tactility/drivers/uart_controller.h>
|
||||||
#include <tactility/concurrent/dispatcher.h>
|
#include <tactility/concurrent/dispatcher.h>
|
||||||
@ -37,7 +36,6 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = {
|
|||||||
DEFINE_MODULE_SYMBOL(device_get_driver_data),
|
DEFINE_MODULE_SYMBOL(device_get_driver_data),
|
||||||
DEFINE_MODULE_SYMBOL(device_is_added),
|
DEFINE_MODULE_SYMBOL(device_is_added),
|
||||||
DEFINE_MODULE_SYMBOL(device_is_ready),
|
DEFINE_MODULE_SYMBOL(device_is_ready),
|
||||||
DEFINE_MODULE_SYMBOL(device_is_compatible),
|
|
||||||
DEFINE_MODULE_SYMBOL(device_lock),
|
DEFINE_MODULE_SYMBOL(device_lock),
|
||||||
DEFINE_MODULE_SYMBOL(device_try_lock),
|
DEFINE_MODULE_SYMBOL(device_try_lock),
|
||||||
DEFINE_MODULE_SYMBOL(device_unlock),
|
DEFINE_MODULE_SYMBOL(device_unlock),
|
||||||
@ -81,8 +79,6 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = {
|
|||||||
DEFINE_MODULE_SYMBOL(i2s_controller_get_config),
|
DEFINE_MODULE_SYMBOL(i2s_controller_get_config),
|
||||||
DEFINE_MODULE_SYMBOL(i2s_controller_reset),
|
DEFINE_MODULE_SYMBOL(i2s_controller_reset),
|
||||||
DEFINE_MODULE_SYMBOL(I2S_CONTROLLER_TYPE),
|
DEFINE_MODULE_SYMBOL(I2S_CONTROLLER_TYPE),
|
||||||
// drivers/root
|
|
||||||
DEFINE_MODULE_SYMBOL(root_is_model),
|
|
||||||
// drivers/spi_controller
|
// drivers/spi_controller
|
||||||
DEFINE_MODULE_SYMBOL(spi_controller_lock),
|
DEFINE_MODULE_SYMBOL(spi_controller_lock),
|
||||||
DEFINE_MODULE_SYMBOL(spi_controller_try_lock),
|
DEFINE_MODULE_SYMBOL(spi_controller_try_lock),
|
||||||
|
|||||||
@ -105,9 +105,6 @@ def write_tactility_variables(output_file, device_properties: ConfigParser, devi
|
|||||||
else:
|
else:
|
||||||
output_file.write(f"CONFIG_TT_DEVICE_NAME=\"{board_vendor} {board_name}\"\n")
|
output_file.write(f"CONFIG_TT_DEVICE_NAME=\"{board_vendor} {board_name}\"\n")
|
||||||
output_file.write(f"CONFIG_TT_DEVICE_ID=\"{device_id}\"\n")
|
output_file.write(f"CONFIG_TT_DEVICE_ID=\"{device_id}\"\n")
|
||||||
if device_id == "lilygo-tdeck":
|
|
||||||
output_file.write("CONFIG_TT_TDECK_WORKAROUND=y\n")
|
|
||||||
|
|
||||||
|
|
||||||
def write_core_variables(output_file, device_properties: ConfigParser):
|
def write_core_variables(output_file, device_properties: ConfigParser):
|
||||||
idf_target = get_property_or_exit(device_properties, "hardware", "target").lower()
|
idf_target = get_property_or_exit(device_properties, "hardware", "target").lower()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user