diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9c5d7c06..34f4da79 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,8 +20,10 @@ jobs: - name: "Build Tests" run: cmake --build build --target build-tests - name: "Run TactilityCore Tests" - run: build/Tests/TactilityCore/TactilityCoreTests --exit + run: build/Tests/TactilityCore/TactilityCoreTests - name: "Run TactilityFreeRtos Tests" - run: build/Tests/TactilityFreeRtos/TactilityFreeRtosTests --exit + run: build/Tests/TactilityFreeRtos/TactilityFreeRtosTests - name: "Run TactilityHeadless Tests" - run: build/Tests/Tactility/TactilityTests --exit + run: build/Tests/Tactility/TactilityTests + - name: "Run TactilityKernel Tests" + run: build/Tests/TactilityKernel/TactilityKernelTests diff --git a/Buildscripts/DevicetreeCompiler/.gitignore b/Buildscripts/DevicetreeCompiler/.gitignore new file mode 100644 index 00000000..5923bb7a --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/.gitignore @@ -0,0 +1,4 @@ +.venv/ +.idea/ +__pycache__/ +build/ \ No newline at end of file diff --git a/Documentation/license-tactilitysdk.md b/Buildscripts/DevicetreeCompiler/LICENSE-Apache-2.0.md similarity index 100% rename from Documentation/license-tactilitysdk.md rename to Buildscripts/DevicetreeCompiler/LICENSE-Apache-2.0.md diff --git a/Buildscripts/DevicetreeCompiler/compile.py b/Buildscripts/DevicetreeCompiler/compile.py new file mode 100644 index 00000000..b5db6034 --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/compile.py @@ -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) + diff --git a/Buildscripts/DevicetreeCompiler/source/binding_files.py b/Buildscripts/DevicetreeCompiler/source/binding_files.py new file mode 100644 index 00000000..d6973310 --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/binding_files.py @@ -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 \ No newline at end of file diff --git a/Buildscripts/DevicetreeCompiler/source/binding_parser.py b/Buildscripts/DevicetreeCompiler/source/binding_parser.py new file mode 100644 index 00000000..b6f7f116 --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/binding_parser.py @@ -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 + ) diff --git a/Buildscripts/DevicetreeCompiler/source/config.py b/Buildscripts/DevicetreeCompiler/source/config.py new file mode 100644 index 00000000..432a3f84 --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/config.py @@ -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 diff --git a/Buildscripts/DevicetreeCompiler/source/files.py b/Buildscripts/DevicetreeCompiler/source/files.py new file mode 100644 index 00000000..1e262672 --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/files.py @@ -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 diff --git a/Buildscripts/DevicetreeCompiler/source/generator.py b/Buildscripts/DevicetreeCompiler/source/generator.py new file mode 100644 index 00000000..ebb3e590 --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/generator.py @@ -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 + #include + #include + // 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) diff --git a/Buildscripts/DevicetreeCompiler/source/grammar.lark b/Buildscripts/DevicetreeCompiler/source/grammar.lark new file mode 100644 index 00000000..03a539d7 --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/grammar.lark @@ -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+ diff --git a/Buildscripts/DevicetreeCompiler/source/main.py b/Buildscripts/DevicetreeCompiler/source/main.py new file mode 100644 index 00000000..97b7f0be --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/main.py @@ -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) diff --git a/Buildscripts/DevicetreeCompiler/source/models.py b/Buildscripts/DevicetreeCompiler/source/models.py new file mode 100644 index 00000000..b747869f --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/models.py @@ -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 diff --git a/Buildscripts/DevicetreeCompiler/source/printing.py b/Buildscripts/DevicetreeCompiler/source/printing.py new file mode 100644 index 00000000..67b2ad80 --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/printing.py @@ -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) diff --git a/Buildscripts/DevicetreeCompiler/source/transformer.py b/Buildscripts/DevicetreeCompiler/source/transformer.py new file mode 100644 index 00000000..b4478543 --- /dev/null +++ b/Buildscripts/DevicetreeCompiler/source/transformer.py @@ -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) \ No newline at end of file diff --git a/Buildscripts/release-sdk.sh b/Buildscripts/release-sdk.sh index 8ac68ac6..eaa60399 100755 --- a/Buildscripts/release-sdk.sh +++ b/Buildscripts/release-sdk.sh @@ -20,37 +20,39 @@ tactility_library_path=$library_path/TactilityC mkdir -p $tactility_library_path/Binary cp build/esp-idf/TactilityC/libTactilityC.a $tactility_library_path/Binary/ mkdir -p $tactility_library_path/Include -find_target_dir=$build_dir/$tactility_library_path/Include/ -cp TactilityC/Include/* $find_target_dir -cp Documentation/license-tactilitysdk.md $build_dir/$tactility_library_path/LICENSE.md +find_target_dir="$build_dir/$tactility_library_path" +cp TactilityC/Include/* "$find_target_dir/Include" +cp TactilityC/*.txt "$find_target_dir" +cp TactilityC/*.md "$find_target_dir" # TactilityFreeRtos tactilityfreertos_library_path=$library_path/TactilityFreeRtos -mkdir -p $tactilityfreertos_library_path/Include -find_target_dir=$build_dir/$tactilityfreertos_library_path/Include/ -cp -r TactilityFreeRtos/Include/* $find_target_dir -cp Documentation/license-tactilitysdk.md $build_dir/$tactilityfreertos_library_path/LICENSE.md +mkdir -p "$tactilityfreertos_library_path/Include" +find_target_dir="$build_dir/$tactilityfreertos_library_path" +cp -r TactilityFreeRtos/Include/* "$find_target_dir/Include" +cp TactilityFreeRtos/*.txt "$find_target_dir" +cp TactilityFreeRtos/*.md "$find_target_dir" # lvgl lvgl_library_path=$library_path/lvgl -mkdir -p $lvgl_library_path/Binary -mkdir -p $lvgl_library_path/Include -cp build/esp-idf/lvgl/liblvgl.a $lvgl_library_path/Binary/ -find_target_dir=$build_dir/$lvgl_library_path/Include/ +mkdir -p "$lvgl_library_path/Binary" +mkdir -p "$lvgl_library_path/Include" +cp build/esp-idf/lvgl/liblvgl.a "$lvgl_library_path/Binary/" +find_target_dir="$build_dir/$lvgl_library_path" cd Libraries/lvgl -find src/ -name '*.h' | cpio -pdm $find_target_dir +find src/ -name '*.h' | cpio -pdm "$find_target_dir/Include" cd - -cp Libraries/lvgl/lvgl.h $find_target_dir -cp Libraries/lvgl/lv_version.h $find_target_dir -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/lvgl.h "$find_target_dir/Include" +cp Libraries/lvgl/lv_version.h "$find_target_dir/Include" +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" # elf_loader -elf_loader_library_path=$library_path/elf_loader -mkdir -p $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/ +elf_loader_library_path="$library_path/elf_loader" +mkdir -p "$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 Buildscripts/CMake/TactilitySDK.cmake $target_path/ -cp Buildscripts/CMake/CMakeLists.txt $target_path/ -printf '%s' "$ESP_IDF_VERSION" >> $target_path/idf-version.txt +cp Buildscripts/CMake/TactilitySDK.cmake "$target_path/" +cp Buildscripts/CMake/CMakeLists.txt "$target_path/" +printf '%s' "$ESP_IDF_VERSION" >> "$target_path/idf-version.txt" diff --git a/CMakeLists.txt b/CMakeLists.txt index 39e07512..f34cba51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.20) set(CMAKE_CXX_STANDARD 23) -set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_ASM_COMPILE_OBJECT "${CMAKE_CXX_COMPILER_TARGET}") include("Buildscripts/logo.cmake") @@ -13,20 +12,28 @@ set(Cyan "${Esc}[36m") file(READ version.txt 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}) message("Using ESP-IDF ${Cyan}v$ENV{ESP_IDF_VERSION}${ColorReset}") 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(EXTRA_COMPONENT_DIRS "Firmware" "Devices/${TACTILITY_DEVICE_PROJECT}" "Drivers" + "Platforms/PlatformEsp32" + "TactilityKernel" "Tactility" "TactilityC" "TactilityCore" @@ -69,6 +76,8 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION}) add_subdirectory(Tactility) add_subdirectory(TactilityCore) add_subdirectory(TactilityFreeRtos) + add_subdirectory(TactilityKernel) + add_subdirectory(Platforms/PlatformPosix) add_subdirectory(Devices/simulator) add_subdirectory(Libraries/cJSON) add_subdirectory(Libraries/lv_screenshot) diff --git a/Devices/LICENSE-GPL-3.0.md b/Devices/LICENSE-GPL-3.0.md new file mode 100644 index 00000000..496acdb2 --- /dev/null +++ b/Devices/LICENSE-GPL-3.0.md @@ -0,0 +1,675 @@ +# GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 . + +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 . diff --git a/Devices/btt-panda-touch/Source/Drivers.cpp b/Devices/btt-panda-touch/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/btt-panda-touch/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/btt-panda-touch/devicetree.yaml b/Devices/btt-panda-touch/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/btt-panda-touch/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/cyd-2432s024c/Source/Drivers.cpp b/Devices/cyd-2432s024c/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/cyd-2432s024c/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/cyd-2432s024c/devicetree.yaml b/Devices/cyd-2432s024c/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/cyd-2432s024c/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/cyd-2432s028r/Source/Drivers.cpp b/Devices/cyd-2432s028r/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/cyd-2432s028r/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/cyd-2432s028r/devicetree.yaml b/Devices/cyd-2432s028r/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/cyd-2432s028r/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/cyd-2432s028rv3/Source/Drivers.cpp b/Devices/cyd-2432s028rv3/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/cyd-2432s028rv3/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/cyd-2432s028rv3/devicetree.yaml b/Devices/cyd-2432s028rv3/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/cyd-2432s028rv3/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/cyd-2432s032c/Source/Drivers.cpp b/Devices/cyd-2432s032c/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/cyd-2432s032c/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/cyd-2432s032c/devicetree.yaml b/Devices/cyd-2432s032c/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/cyd-2432s032c/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/cyd-4848s040c/Source/Drivers.cpp b/Devices/cyd-4848s040c/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/cyd-4848s040c/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/cyd-4848s040c/devicetree.yaml b/Devices/cyd-4848s040c/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/cyd-4848s040c/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/cyd-8048s043c/Source/Drivers.cpp b/Devices/cyd-8048s043c/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/cyd-8048s043c/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/cyd-8048s043c/devicetree.yaml b/Devices/cyd-8048s043c/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/cyd-8048s043c/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/cyd-e32r28t/Source/Drivers.cpp b/Devices/cyd-e32r28t/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/cyd-e32r28t/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/cyd-e32r28t/devicetree.yaml b/Devices/cyd-e32r28t/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/cyd-e32r28t/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/cyd-e32r32p/Source/Drivers.cpp b/Devices/cyd-e32r32p/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/cyd-e32r32p/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/cyd-e32r32p/devicetree.yaml b/Devices/cyd-e32r32p/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/cyd-e32r32p/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/elecrow-crowpanel-advance-28/Source/Drivers.cpp b/Devices/elecrow-crowpanel-advance-28/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/elecrow-crowpanel-advance-28/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/elecrow-crowpanel-advance-28/devicetree.yaml b/Devices/elecrow-crowpanel-advance-28/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/elecrow-crowpanel-advance-28/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/elecrow-crowpanel-advance-35/Source/Drivers.cpp b/Devices/elecrow-crowpanel-advance-35/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/elecrow-crowpanel-advance-35/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/elecrow-crowpanel-advance-35/devicetree.yaml b/Devices/elecrow-crowpanel-advance-35/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/elecrow-crowpanel-advance-35/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/elecrow-crowpanel-advance-50/Source/Drivers.cpp b/Devices/elecrow-crowpanel-advance-50/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/elecrow-crowpanel-advance-50/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/elecrow-crowpanel-advance-50/devicetree.yaml b/Devices/elecrow-crowpanel-advance-50/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/elecrow-crowpanel-advance-50/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/elecrow-crowpanel-basic-28/Source/Drivers.cpp b/Devices/elecrow-crowpanel-basic-28/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/elecrow-crowpanel-basic-28/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/elecrow-crowpanel-basic-28/devicetree.yaml b/Devices/elecrow-crowpanel-basic-28/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/elecrow-crowpanel-basic-28/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/elecrow-crowpanel-basic-35/Source/Drivers.cpp b/Devices/elecrow-crowpanel-basic-35/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/elecrow-crowpanel-basic-35/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/elecrow-crowpanel-basic-35/devicetree.yaml b/Devices/elecrow-crowpanel-basic-35/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/elecrow-crowpanel-basic-35/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/elecrow-crowpanel-basic-50/Source/Drivers.cpp b/Devices/elecrow-crowpanel-basic-50/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/elecrow-crowpanel-basic-50/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/elecrow-crowpanel-basic-50/devicetree.yaml b/Devices/elecrow-crowpanel-basic-50/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/elecrow-crowpanel-basic-50/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/generic-esp32/Source/Drivers.cpp b/Devices/generic-esp32/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/generic-esp32/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/generic-esp32/devicetree.yaml b/Devices/generic-esp32/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/generic-esp32/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/generic-esp32c6/Source/Drivers.cpp b/Devices/generic-esp32c6/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/generic-esp32c6/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/generic-esp32c6/devicetree.yaml b/Devices/generic-esp32c6/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/generic-esp32c6/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/generic-esp32p4/Source/Drivers.cpp b/Devices/generic-esp32p4/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/generic-esp32p4/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/generic-esp32p4/devicetree.yaml b/Devices/generic-esp32p4/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/generic-esp32p4/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/generic-esp32s3/Source/Drivers.cpp b/Devices/generic-esp32s3/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/generic-esp32s3/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/generic-esp32s3/devicetree.yaml b/Devices/generic-esp32s3/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/generic-esp32s3/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/guition-jc1060p470ciwy/Source/Drivers.cpp b/Devices/guition-jc1060p470ciwy/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/guition-jc1060p470ciwy/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/guition-jc1060p470ciwy/devicetree.yaml b/Devices/guition-jc1060p470ciwy/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/guition-jc1060p470ciwy/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/guition-jc2432w328c/Source/Drivers.cpp b/Devices/guition-jc2432w328c/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/guition-jc2432w328c/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/guition-jc2432w328c/devicetree.yaml b/Devices/guition-jc2432w328c/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/guition-jc2432w328c/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/guition-jc8048w550c/Source/Drivers.cpp b/Devices/guition-jc8048w550c/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/guition-jc8048w550c/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/guition-jc8048w550c/devicetree.yaml b/Devices/guition-jc8048w550c/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/guition-jc8048w550c/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/heltec-wifi-lora-32-v3/Source/Drivers.cpp b/Devices/heltec-wifi-lora-32-v3/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/heltec-wifi-lora-32-v3/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/heltec-wifi-lora-32-v3/devicetree.yaml b/Devices/heltec-wifi-lora-32-v3/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/heltec-wifi-lora-32-v3/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/lilygo-tdeck/Source/Drivers.cpp b/Devices/lilygo-tdeck/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/lilygo-tdeck/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/lilygo-tdeck/devicetree.yaml b/Devices/lilygo-tdeck/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/lilygo-tdeck/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/lilygo-tdisplay-s3/Source/Drivers.cpp b/Devices/lilygo-tdisplay-s3/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/lilygo-tdisplay-s3/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/lilygo-tdisplay-s3/devicetree.yaml b/Devices/lilygo-tdisplay-s3/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/lilygo-tdisplay-s3/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/lilygo-tdisplay/Source/Drivers.cpp b/Devices/lilygo-tdisplay/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/lilygo-tdisplay/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/lilygo-tdisplay/devicetree.yaml b/Devices/lilygo-tdisplay/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/lilygo-tdisplay/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/lilygo-tdongle-s3/Source/Drivers.cpp b/Devices/lilygo-tdongle-s3/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/lilygo-tdongle-s3/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/lilygo-tdongle-s3/devicetree.yaml b/Devices/lilygo-tdongle-s3/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/lilygo-tdongle-s3/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/lilygo-tlora-pager/CMakeLists.txt b/Devices/lilygo-tlora-pager/CMakeLists.txt index 02e89f02..a15cda62 100644 --- a/Devices/lilygo-tlora-pager/CMakeLists.txt +++ b/Devices/lilygo-tlora-pager/CMakeLists.txt @@ -3,5 +3,5 @@ file(GLOB_RECURSE SOURCE_FILES Source/*.c*) idf_component_register( SRCS ${SOURCE_FILES} 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 ) diff --git a/Devices/lilygo-tlora-pager/Source/Drivers.cpp b/Devices/lilygo-tlora-pager/Source/Drivers.cpp new file mode 100644 index 00000000..1eee16a4 --- /dev/null +++ b/Devices/lilygo-tlora-pager/Source/Drivers.cpp @@ -0,0 +1,10 @@ +#include + +extern "C" { + +extern void register_device_drivers() { + extern Driver tlora_pager_driver; + driver_construct(&tlora_pager_driver); +} + +} diff --git a/Devices/lilygo-tlora-pager/Source/bindings/tlora_pager.h b/Devices/lilygo-tlora-pager/Source/bindings/tlora_pager.h new file mode 100644 index 00000000..b550f1d9 --- /dev/null +++ b/Devices/lilygo-tlora-pager/Source/bindings/tlora_pager.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +DEFINE_DEVICETREE(tlora_pager, struct RootConfig) + +#ifdef __cplusplus +} +#endif diff --git a/Devices/lilygo-tlora-pager/Source/drivers/Register.cpp b/Devices/lilygo-tlora-pager/Source/drivers/Register.cpp new file mode 100644 index 00000000..1eee16a4 --- /dev/null +++ b/Devices/lilygo-tlora-pager/Source/drivers/Register.cpp @@ -0,0 +1,10 @@ +#include + +extern "C" { + +extern void register_device_drivers() { + extern Driver tlora_pager_driver; + driver_construct(&tlora_pager_driver); +} + +} diff --git a/Devices/lilygo-tlora-pager/Source/drivers/TloraPager.cpp b/Devices/lilygo-tlora-pager/Source/drivers/TloraPager.cpp new file mode 100644 index 00000000..d1786e5a --- /dev/null +++ b/Devices/lilygo-tlora-pager/Source/drivers/TloraPager.cpp @@ -0,0 +1,27 @@ +#include "TloraPager.h" + +#include + +#include + +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 }, + .start_device = start, + .stop_device = stop, + .api = nullptr, + .device_type = nullptr, + .internal = { 0 } +}; + +} diff --git a/Devices/lilygo-tlora-pager/Source/drivers/TloraPager.h b/Devices/lilygo-tlora-pager/Source/drivers/TloraPager.h new file mode 100644 index 00000000..07a90010 --- /dev/null +++ b/Devices/lilygo-tlora-pager/Source/drivers/TloraPager.h @@ -0,0 +1,11 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifdef __cplusplus +} +#endif diff --git a/Devices/lilygo-tlora-pager/devicetree.yaml b/Devices/lilygo-tlora-pager/devicetree.yaml new file mode 100644 index 00000000..82fd189b --- /dev/null +++ b/Devices/lilygo-tlora-pager/devicetree.yaml @@ -0,0 +1,4 @@ +dependencies: + - Platforms/PlatformEsp32 +bindings: ./ +dts: lilygo,tlora-pager.dts diff --git a/Devices/lilygo-tlora-pager/lilygo,tlora-pager.dts b/Devices/lilygo-tlora-pager/lilygo,tlora-pager.dts new file mode 100644 index 00000000..bdd0f9b1 --- /dev/null +++ b/Devices/lilygo-tlora-pager/lilygo,tlora-pager.dts @@ -0,0 +1,23 @@ +/dts-v1/; + +#include +#include +#include + +/ { + 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 = ; + }; +}; diff --git a/Devices/lilygo-tlora-pager/lilygo,tlora-pager.yaml b/Devices/lilygo-tlora-pager/lilygo,tlora-pager.yaml new file mode 100644 index 00000000..9e5f0508 --- /dev/null +++ b/Devices/lilygo-tlora-pager/lilygo,tlora-pager.yaml @@ -0,0 +1,5 @@ +description: LilyGO T-Lora Pager + +include: ["root.yaml"] + +compatible: "lilygo,tlora-pager" diff --git a/Devices/m5stack-cardputer-adv/Source/Drivers.cpp b/Devices/m5stack-cardputer-adv/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/m5stack-cardputer-adv/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/m5stack-cardputer-adv/devicetree.yaml b/Devices/m5stack-cardputer-adv/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/m5stack-cardputer-adv/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/m5stack-cardputer/Source/Drivers.cpp b/Devices/m5stack-cardputer/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/m5stack-cardputer/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/m5stack-cardputer/devicetree.yaml b/Devices/m5stack-cardputer/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/m5stack-cardputer/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/m5stack-core2/Source/Drivers.cpp b/Devices/m5stack-core2/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/m5stack-core2/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/m5stack-core2/devicetree.yaml b/Devices/m5stack-core2/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/m5stack-core2/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/m5stack-cores3/Source/Drivers.cpp b/Devices/m5stack-cores3/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/m5stack-cores3/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/m5stack-cores3/devicetree.yaml b/Devices/m5stack-cores3/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/m5stack-cores3/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/m5stack-stickc-plus/Source/Drivers.cpp b/Devices/m5stack-stickc-plus/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/m5stack-stickc-plus/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/m5stack-stickc-plus/devicetree.yaml b/Devices/m5stack-stickc-plus/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/m5stack-stickc-plus/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/m5stack-stickc-plus2/Source/Drivers.cpp b/Devices/m5stack-stickc-plus2/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/m5stack-stickc-plus2/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/m5stack-stickc-plus2/devicetree.yaml b/Devices/m5stack-stickc-plus2/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/m5stack-stickc-plus2/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/placeholder.dts b/Devices/placeholder.dts new file mode 100644 index 00000000..dddca7a8 --- /dev/null +++ b/Devices/placeholder.dts @@ -0,0 +1,8 @@ +/dts-v1/; + +#include + +/ { + compatible = "root"; + model = "Placeholder"; +}; diff --git a/Devices/simulator/Source/Drivers.cpp b/Devices/simulator/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/simulator/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/simulator/devicetree.yaml b/Devices/simulator/devicetree.yaml new file mode 100644 index 00000000..72523d12 --- /dev/null +++ b/Devices/simulator/devicetree.yaml @@ -0,0 +1,4 @@ +dependencies: + - TactilityKernel + - Platforms/PlatformPosix +dts: ../placeholder.dts diff --git a/Devices/simulator/simulator.dts b/Devices/simulator/simulator.dts new file mode 100644 index 00000000..ce2f44c2 --- /dev/null +++ b/Devices/simulator/simulator.dts @@ -0,0 +1,8 @@ +/dts-v1/; + +#include + +/ { + model = "Simulator"; + compatible = "root"; +}; diff --git a/Devices/unphone/Source/Drivers.cpp b/Devices/unphone/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/unphone/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/unphone/devicetree.yaml b/Devices/unphone/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/unphone/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/waveshare-esp32-s3-geek/Source/Drivers.cpp b/Devices/waveshare-esp32-s3-geek/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/waveshare-esp32-s3-geek/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/waveshare-esp32-s3-geek/devicetree.yaml b/Devices/waveshare-esp32-s3-geek/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/waveshare-esp32-s3-geek/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/waveshare-s3-lcd-13/Source/Drivers.cpp b/Devices/waveshare-s3-lcd-13/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/waveshare-s3-lcd-13/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/waveshare-s3-lcd-13/devicetree.yaml b/Devices/waveshare-s3-lcd-13/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/waveshare-s3-lcd-13/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/waveshare-s3-touch-lcd-128/Source/Drivers.cpp b/Devices/waveshare-s3-touch-lcd-128/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/waveshare-s3-touch-lcd-128/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/waveshare-s3-touch-lcd-128/devicetree.yaml b/Devices/waveshare-s3-touch-lcd-128/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/waveshare-s3-touch-lcd-128/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/waveshare-s3-touch-lcd-147/Source/Drivers.cpp b/Devices/waveshare-s3-touch-lcd-147/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/waveshare-s3-touch-lcd-147/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/waveshare-s3-touch-lcd-147/devicetree.yaml b/Devices/waveshare-s3-touch-lcd-147/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/waveshare-s3-touch-lcd-147/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/waveshare-s3-touch-lcd-43/Source/Drivers.cpp b/Devices/waveshare-s3-touch-lcd-43/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/waveshare-s3-touch-lcd-43/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/waveshare-s3-touch-lcd-43/devicetree.yaml b/Devices/waveshare-s3-touch-lcd-43/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/waveshare-s3-touch-lcd-43/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Devices/wireless-tag-wt32-sc01-plus/Source/Drivers.cpp b/Devices/wireless-tag-wt32-sc01-plus/Source/Drivers.cpp new file mode 100644 index 00000000..c8a5c665 --- /dev/null +++ b/Devices/wireless-tag-wt32-sc01-plus/Source/Drivers.cpp @@ -0,0 +1,7 @@ +extern "C" { + +extern void register_device_drivers() { + /* NO-OP */ +} + +} diff --git a/Devices/wireless-tag-wt32-sc01-plus/devicetree.yaml b/Devices/wireless-tag-wt32-sc01-plus/devicetree.yaml new file mode 100644 index 00000000..a1f5d125 --- /dev/null +++ b/Devices/wireless-tag-wt32-sc01-plus/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +dts: ../placeholder.dts diff --git a/Documentation/LICENSE-Apache-2.0.md b/Documentation/LICENSE-Apache-2.0.md new file mode 100644 index 00000000..f5f4b8b5 --- /dev/null +++ b/Documentation/LICENSE-Apache-2.0.md @@ -0,0 +1,195 @@ +Apache License +============== + +_Version 2.0, January 2004_ +_<>_ + +### Terms and Conditions for use, reproduction, and distribution + +#### 1. Definitions + +“License” shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +“Licensor” shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +“Legal Entity” shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, “control” means **(i)** the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the +outstanding shares, or **(iii)** beneficial ownership of such entity. + +“You” (or “Your”) shall mean an individual or Legal Entity exercising +permissions granted by this License. + +“Source” form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +“Object” form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +“Work” shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +“Derivative Works” shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +“Contribution” shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +“submitted” means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as “Not a Contribution.” + +“Contributor” shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +#### 2. Grant of Copyright License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +#### 3. Grant of Patent License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +#### 4. Redistribution + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +* **(a)** You must give any other recipients of the Work or Derivative Works a copy of +this License; and +* **(b)** You must cause any modified files to carry prominent notices stating that You +changed the files; and +* **(c)** You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +#### 5. Submission of Contributions + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +#### 6. Trademarks + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +#### 7. Disclaimer of Warranty + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +#### 8. Limitation of Liability + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +#### 9. Accepting Warranty or Additional Liability + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +_END OF TERMS AND CONDITIONS_ + +### APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets `[]` replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same “printed page” as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/Documentation/LICENSE-GPL-3.0.md b/Documentation/LICENSE-GPL-3.0.md new file mode 100644 index 00000000..496acdb2 --- /dev/null +++ b/Documentation/LICENSE-GPL-3.0.md @@ -0,0 +1,675 @@ +# GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 . + +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 . diff --git a/Documentation/LICENSE-LGPL-3.0.md b/Documentation/LICENSE-LGPL-3.0.md new file mode 100644 index 00000000..6fb6a01e --- /dev/null +++ b/Documentation/LICENSE-LGPL-3.0.md @@ -0,0 +1,157 @@ +# GNU LESSER GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the +terms and conditions of version 3 of the GNU General Public License, +supplemented by the additional permissions listed below. + +## 0. Additional Definitions. + +As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the +GNU General Public License. + +"The Library" refers to a covered work governed by this License, other +than an Application or a Combined Work as defined below. + +An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + +A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + +The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + +The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + +## 1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + +## 2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + +- a) under this License, provided that you make a good faith effort + to ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or +- b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + +## 3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a +header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + +- a) Give prominent notice with each copy of the object code that + the Library is used in it and that the Library and its use are + covered by this License. +- b) Accompany the object code with a copy of the GNU GPL and this + license document. + +## 4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken +together, effectively do not restrict modification of the portions of +the Library contained in the Combined Work and reverse engineering for +debugging such modifications, if you also do each of the following: + +- a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. +- b) Accompany the Combined Work with a copy of the GNU GPL and this + license document. +- c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. +- d) Do one of the following: + - 0) Convey the Minimal Corresponding Source under the terms of + this License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + - 1) Use a suitable shared library mechanism for linking with + the Library. A suitable mechanism is one that (a) uses at run + time a copy of the Library already present on the user's + computer system, and (b) will operate properly with a modified + version of the Library that is interface-compatible with the + Linked Version. +- e) Provide Installation Information, but only if you would + otherwise be required to provide such information under section 6 + of the GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the Application + with a modified version of the Linked Version. (If you use option + 4d0, the Installation Information must accompany the Minimal + Corresponding Source and Corresponding Application Code. If you + use option 4d1, you must provide the Installation Information in + the manner specified by section 6 of the GNU GPL for conveying + Corresponding Source.) + +## 5. Combined Libraries. + +You may place library facilities that are a work based on the Library +side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + +- a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities, conveyed under the terms of this License. +- b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + +## 6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser 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 Library +as you received it specifies that a certain numbered version of the +GNU Lesser General Public License "or any later version" applies to +it, you have the option of following the terms and conditions either +of that published version or of any later version published by the +Free Software Foundation. If the Library as you received it does not +specify a version number of the GNU Lesser General Public License, you +may choose any version of the GNU Lesser General Public License ever +published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/Documentation/ideas.md b/Documentation/ideas.md index 76b8286a..96d1ce27 100644 --- a/Documentation/ideas.md +++ b/Documentation/ideas.md @@ -2,6 +2,7 @@ ## Before release +- Add `// SPDX-License-Identifier: LGPL-3.0-only` and similar license mentions to individual files in the project - Change ButtonControl to work with interrupts and xQueue - TCA9534 keyboards should use interrupts - GT911 drivers should use interrupts if it's stable diff --git a/Documentation/license-tactilitykernel.md b/Documentation/license-tactilitykernel.md new file mode 100644 index 00000000..6fb6a01e --- /dev/null +++ b/Documentation/license-tactilitykernel.md @@ -0,0 +1,157 @@ +# GNU LESSER GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the +terms and conditions of version 3 of the GNU General Public License, +supplemented by the additional permissions listed below. + +## 0. Additional Definitions. + +As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the +GNU General Public License. + +"The Library" refers to a covered work governed by this License, other +than an Application or a Combined Work as defined below. + +An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + +A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + +The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + +The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + +## 1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + +## 2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + +- a) under this License, provided that you make a good faith effort + to ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or +- b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + +## 3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a +header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + +- a) Give prominent notice with each copy of the object code that + the Library is used in it and that the Library and its use are + covered by this License. +- b) Accompany the object code with a copy of the GNU GPL and this + license document. + +## 4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken +together, effectively do not restrict modification of the portions of +the Library contained in the Combined Work and reverse engineering for +debugging such modifications, if you also do each of the following: + +- a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. +- b) Accompany the Combined Work with a copy of the GNU GPL and this + license document. +- c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. +- d) Do one of the following: + - 0) Convey the Minimal Corresponding Source under the terms of + this License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + - 1) Use a suitable shared library mechanism for linking with + the Library. A suitable mechanism is one that (a) uses at run + time a copy of the Library already present on the user's + computer system, and (b) will operate properly with a modified + version of the Library that is interface-compatible with the + Linked Version. +- e) Provide Installation Information, but only if you would + otherwise be required to provide such information under section 6 + of the GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the Application + with a modified version of the Linked Version. (If you use option + 4d0, the Installation Information must accompany the Minimal + Corresponding Source and Corresponding Application Code. If you + use option 4d1, you must provide the Installation Information in + the manner specified by section 6 of the GNU GPL for conveying + Corresponding Source.) + +## 5. Combined Libraries. + +You may place library facilities that are a work based on the Library +side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + +- a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities, conveyed under the terms of this License. +- b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + +## 6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser 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 Library +as you received it specifies that a certain numbered version of the +GNU Lesser General Public License "or any later version" applies to +it, you have the option of following the terms and conditions either +of that published version or of any later version published by the +Free Software Foundation. If the Library as you received it does not +specify a version number of the GNU Lesser General Public License, you +may choose any version of the GNU Lesser General Public License ever +published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/Firmware/.gitignore b/Firmware/.gitignore new file mode 100644 index 00000000..673b74ec --- /dev/null +++ b/Firmware/.gitignore @@ -0,0 +1 @@ +Generated/ diff --git a/Firmware/CMakeLists.txt b/Firmware/CMakeLists.txt index eb5d9ff9..8bde86d4 100644 --- a/Firmware/CMakeLists.txt +++ b/Firmware/CMakeLists.txt @@ -2,28 +2,58 @@ cmake_minimum_required(VERSION 3.20) file(GLOB_RECURSE SOURCE_FILES "Source/*.c*") +# For Generate target below if (DEFINED ENV{ESP_IDF_VERSION}) - # Read device id/project include("../Buildscripts/device.cmake") init_tactility_globals("../sdkconfig") get_property(TACTILITY_DEVICE_PROJECT GLOBAL PROPERTY TACTILITY_DEVICE_PROJECT) +else () + set(TACTILITY_DEVICE_ID simulator) + set(COMPONENT_LIB FirmwareSim) +endif () + +set(DEVICETREE_LOCATION "${CMAKE_SOURCE_DIR}/Devices/${TACTILITY_DEVICE_ID}") + +if (DEFINED ENV{ESP_IDF_VERSION}) idf_component_register( - SRCS ${SOURCE_FILES} - REQUIRES ${DEVICE_COMPONENTS} - REQUIRES Tactility TactilityC ${TACTILITY_DEVICE_PROJECT} + SRCS ${SOURCE_FILES} "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c" + REQUIRES Tactility TactilityC TactilityKernel PlatformEsp32 ${TACTILITY_DEVICE_PROJECT} ) + else () - add_executable(FirmwareSim ${SOURCE_FILES}) - target_link_libraries(FirmwareSim - PRIVATE Tactility - PRIVATE TactilityCore - PRIVATE TactilityFreeRtos - PRIVATE Simulator - PRIVATE SDL2::SDL2-static SDL2-static + add_executable(FirmwareSim ${SOURCE_FILES} "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c") + target_link_libraries(FirmwareSim PRIVATE + Tactility + TactilityCore + TactilityFreeRtos + TactilityKernel + Simulator + PlatformPosix + SDL2::SDL2-static SDL2-static ) add_definitions(-D_Nullable=) add_definitions(-D_Nonnull=) endif () + +file(MAKE_DIRECTORY "${CMAKE_SOURCE_DIR}/Firmware/Generated") + +# Generate devicetree code and attach to Firmware component +add_custom_command( + OUTPUT "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c" + "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.h" + COMMAND pip install lark pyyaml + COMMAND python "${CMAKE_SOURCE_DIR}/Buildscripts/DevicetreeCompiler/compile.py" + "${DEVICETREE_LOCATION}" "Firmware/Generated" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + DEPENDS "${DEVICETREE_LOCATION}/devicetree.yaml" # Optional: trigger rebuild if source changes + COMMENT "Generating devicetree source files..." +) +add_custom_target(Generated DEPENDS "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c") +set_source_files_properties("${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c" PROPERTIES GENERATED TRUE) +set_source_files_properties("${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.h" PROPERTIES GENERATED TRUE) +# Update target for generated code +target_sources(${COMPONENT_LIB} PRIVATE "${CMAKE_SOURCE_DIR}/Firmware/Generated/devicetree.c") +target_include_directories(${COMPONENT_LIB} PRIVATE "${CMAKE_SOURCE_DIR}/Firmware/Generated") diff --git a/Firmware/Source/Main.cpp b/Firmware/Source/Main.cpp index 926da64d..d5477ff5 100644 --- a/Firmware/Source/Main.cpp +++ b/Firmware/Source/Main.cpp @@ -1,5 +1,8 @@ #include +#include +#include + #ifdef ESP_PLATFORM #include #else @@ -11,6 +14,10 @@ extern const tt::hal::Configuration hardwareConfiguration; extern "C" { +extern void register_kernel_drivers(); +extern void register_platform_drivers(); +extern void register_device_drivers(); + void app_main() { static const tt::Configuration config = { /** @@ -24,6 +31,11 @@ void app_main() { tt_init_tactility_c(); // ELF bindings for side-loading on ESP32 #endif + register_kernel_drivers(); + register_platform_drivers(); + register_device_drivers(); + + devices_builtin_init(); tt::run(config); } diff --git a/LICENSE.md b/LICENSE.md index 6021f367..3a171c5d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,26 +1,72 @@ -# Tactility: Main License +# License Grant -The Tactility project code is available under the [GNU General Public License v3](Documentation/license-tactility.md). -Distributions and forks must adhere to the license terms. +## Definitions + +"external apps" or "external applications" refers to applications that are built with the TactilitySDK. +These applications are not part of the Tactility operating system's main firmware. + +"end-users" refers to people who install and/or use Tactility software on their devices. + +## Licensing Intent + +The main intention is to make sure forks of the operating system stay open source, +while external applications can have both open or closed source licenses. + +TactilitySDK combines several subprojects and should not have source code with a GPL licenses inside. + +## Past & Present + +Formerly, there was a mixed usage of [GPL v3.0](Documentation/LICENSE-GPL-3.0.md) for internal subprojects +and [Apache License v2.0](Documentation/LICENSE-Apache-2.0.md) for subprojects that would be used in external apps. + +For future subprojects, [LGPL v3.0](Documentation/LICENSE-LGPL-3.0.md) will be chosen for internal subprojects and +Apache License v2.0 will be chosen for header-only projects. +Existing GPL-licensed projects will retain this license, as it cannot be changed to LGPL. + +The reason is that LGPL allows for logic in header files, but it comes with limitations (e.g. limit of 10 lines of code in headers). +If we write C++ wrappers for C libraries then we want them to be usable for building external apps, without such LGPL limitations. + +## Overview + +Below is an overview of the licenses of some of the subprojects. + +| Project | License | +|--------------------|---------------------| +| Tactility | GPL v3.0 | +| TactilityCore | GPL v3.0 | +| TactilityC | Apache License v2.0 | +| TactilityFreeRTOS | Apache License v2.0 | +| TactilityKernel | LGPL v3.0 | +| Tests | GPL v3.0 | +| Devices/* | GPL v3.0 | +| Drivers/* | (varies) | +| DevicetreeCompiler | Apache License v2.0 | + +Subprojects and directories in this project can contain license files. + +The presence of such a license file indicates that this license applies to all the files and folders that are contained by the folder at the level where the license file resides. + +## Logo The Tactility logo copyrights are owned by Ken Van Hoeylandt. -Firmwares built from [the original repository](https://github.com/ByteWelder/Tactility) can be redistributed with the Tactility logo. -For other usages, [contact me](https://kenvanhoeylandt.net). -Third-party projects that were included in Tactility retain their licenses. +Logo usage is permitted in these scenarios: +- News, blog posts, articles and documentation that write about the official Tactility project. +- Firmwares built with unmodified source code from [the official repository](https://github.com/ByteWelder/Tactility) can be redistributed with the Tactility logo. +- Personal use for local builds that contain Tactility source code (original or modified), and aren't re-distributed online. -# Tactility: Secondary License +Logo usage is forbidden in all other scenarios unless an exception was granted by the author. +For other usages or exceptions, [contact me](https://kenvanhoeylandt.net). -The following projects are also available under [Apache License Version 2.0](Documentation/license-tactilitysdk.md): -- TactilityC -- TactilityFreeRtos -- TactilitySDK (source and binaries) +Practical examples: +- A blog post about Tactility can use screenshots and the logo itself when writing about Tactility +- A developer who forked Tactility to merge new features or fixes to the official Tactility repository is allowed to make builds with the logo, as long as these builds are not re-distributed to end-users. -# Other licenses & copyrights +## Third Party Notices -See [COPYRIGHT.md](COPYRIGHT.md). +Third-party licenses and copyrights are listed in [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md). -# FAQ +## FAQ - Q: Can I build closed source applications? -- A: Yes, but only if you build them as external apps with the TactilitySDK. Internal apps are part of the OS and currently remain licensed under GPL v3. +- A: Yes, external apps can be closed source. All subprojects with an Apache License or LGPL license can be used in this manner. If you fork the project and make an internal app, it must be redistributed under the GPL v3.0 license. diff --git a/Libraries/lv_screenshot/CMakeLists.txt b/Libraries/lv_screenshot/CMakeLists.txt index d6c43221..feee75d3 100644 --- a/Libraries/lv_screenshot/CMakeLists.txt +++ b/Libraries/lv_screenshot/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_minimum_required(VERSION 3.20) -set(CMAKE_CXX_STANDARD 23) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) - if (DEFINED ENV{ESP_IDF_VERSION}) idf_component_register( SRC_DIRS "Source/" diff --git a/Libraries/minmea/CMakeLists.txt b/Libraries/minmea/CMakeLists.txt index 060e07f4..89321e84 100644 --- a/Libraries/minmea/CMakeLists.txt +++ b/Libraries/minmea/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_minimum_required(VERSION 3.20) -set(CMAKE_CXX_STANDARD 23) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) - if (DEFINED ENV{ESP_IDF_VERSION}) idf_component_register( SRC_DIRS "Source/" diff --git a/Platforms/LICENSE-LGPL-3.0.md b/Platforms/LICENSE-LGPL-3.0.md new file mode 100644 index 00000000..6fb6a01e --- /dev/null +++ b/Platforms/LICENSE-LGPL-3.0.md @@ -0,0 +1,157 @@ +# GNU LESSER GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the +terms and conditions of version 3 of the GNU General Public License, +supplemented by the additional permissions listed below. + +## 0. Additional Definitions. + +As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the +GNU General Public License. + +"The Library" refers to a covered work governed by this License, other +than an Application or a Combined Work as defined below. + +An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + +A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + +The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + +The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + +## 1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + +## 2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + +- a) under this License, provided that you make a good faith effort + to ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or +- b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + +## 3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a +header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + +- a) Give prominent notice with each copy of the object code that + the Library is used in it and that the Library and its use are + covered by this License. +- b) Accompany the object code with a copy of the GNU GPL and this + license document. + +## 4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken +together, effectively do not restrict modification of the portions of +the Library contained in the Combined Work and reverse engineering for +debugging such modifications, if you also do each of the following: + +- a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. +- b) Accompany the Combined Work with a copy of the GNU GPL and this + license document. +- c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. +- d) Do one of the following: + - 0) Convey the Minimal Corresponding Source under the terms of + this License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + - 1) Use a suitable shared library mechanism for linking with + the Library. A suitable mechanism is one that (a) uses at run + time a copy of the Library already present on the user's + computer system, and (b) will operate properly with a modified + version of the Library that is interface-compatible with the + Linked Version. +- e) Provide Installation Information, but only if you would + otherwise be required to provide such information under section 6 + of the GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the Application + with a modified version of the Linked Version. (If you use option + 4d0, the Installation Information must accompany the Minimal + Corresponding Source and Corresponding Application Code. If you + use option 4d1, you must provide the Installation Information in + the manner specified by section 6 of the GNU GPL for conveying + Corresponding Source.) + +## 5. Combined Libraries. + +You may place library facilities that are a work based on the Library +side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + +- a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities, conveyed under the terms of this License. +- b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + +## 6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser 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 Library +as you received it specifies that a certain numbered version of the +GNU Lesser General Public License "or any later version" applies to +it, you have the option of following the terms and conditions either +of that published version or of any later version published by the +Free Software Foundation. If the Library as you received it does not +specify a version number of the GNU Lesser General Public License, you +may choose any version of the GNU Lesser General Public License ever +published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/Platforms/PlatformEsp32/Bindings/espressif,esp32-gpio.yaml b/Platforms/PlatformEsp32/Bindings/espressif,esp32-gpio.yaml new file mode 100644 index 00000000..917d14d3 --- /dev/null +++ b/Platforms/PlatformEsp32/Bindings/espressif,esp32-gpio.yaml @@ -0,0 +1,5 @@ +description: ESP32 GPIO Controller + +compatible: "espressif,esp32-gpio" + +include: ["gpio-controller.yaml"] diff --git a/Platforms/PlatformEsp32/Bindings/espressif,esp32-i2c.yaml b/Platforms/PlatformEsp32/Bindings/espressif,esp32-i2c.yaml new file mode 100644 index 00000000..96968f3d --- /dev/null +++ b/Platforms/PlatformEsp32/Bindings/espressif,esp32-i2c.yaml @@ -0,0 +1,12 @@ +description: ESP32 I2C Controller + +include: ["i2c-controller.yaml"] + +compatible: "espressif,esp32-i2c" + +properties: + port: + type: int + description: | + 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 diff --git a/Platforms/PlatformEsp32/CMakeLists.txt b/Platforms/PlatformEsp32/CMakeLists.txt new file mode 100644 index 00000000..d8114435 --- /dev/null +++ b/Platforms/PlatformEsp32/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.20) + +file(GLOB_RECURSE SOURCES "Source/*.c**") + +if (DEFINED ENV{ESP_IDF_VERSION}) + + idf_component_register( + SRCS ${SOURCES} + INCLUDE_DIRS "Include/" + REQUIRES TactilityKernel driver + ) + +else () + + add_library(PlatformEsp32 OBJECT) + target_sources(PlatformEsp32 PRIVATE ${SOURCES}) + target_include_directories(PlatformEsp32 PUBLIC Include/) + target_link_libraries(PlatformEsp32 PUBLIC TactilityKernel) + +endif () \ No newline at end of file diff --git a/Platforms/PlatformEsp32/Include/Tactility/bindings/esp32_gpio.h b/Platforms/PlatformEsp32/Include/Tactility/bindings/esp32_gpio.h new file mode 100644 index 00000000..30102715 --- /dev/null +++ b/Platforms/PlatformEsp32/Include/Tactility/bindings/esp32_gpio.h @@ -0,0 +1,14 @@ +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_DEVICETREE(esp32_gpio, struct Esp32GpioConfig) + +#ifdef __cplusplus +} +#endif diff --git a/Platforms/PlatformEsp32/Include/Tactility/bindings/esp32_i2c.h b/Platforms/PlatformEsp32/Include/Tactility/bindings/esp32_i2c.h new file mode 100644 index 00000000..e2826b74 --- /dev/null +++ b/Platforms/PlatformEsp32/Include/Tactility/bindings/esp32_i2c.h @@ -0,0 +1,14 @@ +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +DEFINE_DEVICETREE(esp32_i2c, struct Esp32I2cConfig) + +#ifdef __cplusplus +} +#endif diff --git a/Platforms/PlatformEsp32/Include/Tactility/drivers/Esp32Gpio.h b/Platforms/PlatformEsp32/Include/Tactility/drivers/Esp32Gpio.h new file mode 100644 index 00000000..04245c68 --- /dev/null +++ b/Platforms/PlatformEsp32/Include/Tactility/drivers/Esp32Gpio.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +struct Esp32GpioConfig { + uint8_t gpio_count; +}; + +#ifdef __cplusplus +} +#endif diff --git a/Platforms/PlatformEsp32/Include/Tactility/drivers/Esp32I2c.h b/Platforms/PlatformEsp32/Include/Tactility/drivers/Esp32I2c.h new file mode 100644 index 00000000..55b07b14 --- /dev/null +++ b/Platforms/PlatformEsp32/Include/Tactility/drivers/Esp32I2c.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct Esp32I2cConfig { + uint32_t clock_frequency; + struct GpioPinConfig pin_sda; + struct GpioPinConfig pin_scl; + const i2c_port_t port; +}; + +#ifdef __cplusplus +} +#endif diff --git a/Platforms/PlatformEsp32/Source/Esp32Gpio.cpp b/Platforms/PlatformEsp32/Source/Esp32Gpio.cpp new file mode 100644 index 00000000..51bd2e94 --- /dev/null +++ b/Platforms/PlatformEsp32/Source/Esp32Gpio.cpp @@ -0,0 +1,116 @@ +#include + +#include +#include +#include +#include +#include + +#define TAG LOG_TAG(esp32_gpio) + +#define GET_CONFIG(device) ((struct Esp32GpioConfig*)device->internal.driver_data) + +extern "C" { + +static bool set_level(Device* device, gpio_pin_t pin, bool high) { + return gpio_set_level(static_cast(pin), high) == ESP_OK; +} + +static bool get_level(Device* device, gpio_pin_t pin, bool* high) { + *high = gpio_get_level(static_cast(pin)) != 0; + return true; +} + +static bool set_options(Device* device, gpio_pin_t pin, gpio_flags_t options) { + const Esp32GpioConfig* config = GET_CONFIG(device); + + if (pin >= config->gpio_count) { + return false; + } + + gpio_mode_t mode; + if ((options & GPIO_DIRECTION_INPUT_OUTPUT) == GPIO_DIRECTION_INPUT_OUTPUT) { + mode = GPIO_MODE_INPUT_OUTPUT; + } else if (options & GPIO_DIRECTION_INPUT) { + mode = GPIO_MODE_INPUT; + } else if (options & GPIO_DIRECTION_OUTPUT) { + mode = GPIO_MODE_OUTPUT; + } else { + ESP_LOGE(TAG, "set_options: no direction flag specified for pin %d", pin); + return false; + } + + const gpio_config_t esp_config = { + .pin_bit_mask = 1ULL << pin, + .mode = mode, + .pull_up_en = (options & GPIO_PULL_UP) ? GPIO_PULLUP_ENABLE : GPIO_PULLUP_DISABLE, + .pull_down_en = (options & GPIO_PULL_DOWN) ? GPIO_PULLDOWN_ENABLE : GPIO_PULLDOWN_DISABLE, + .intr_type = GPIO_INTERRUPT_FROM_OPTIONS(options), +#if SOC_GPIO_SUPPORT_PIN_HYS_FILTER + .hys_ctrl_mode = GPIO_HYS_SOFT_DISABLE +#endif + }; + + return gpio_config(&esp_config) == ESP_OK; +} + +static bool get_options(Device* device, gpio_pin_t pin, gpio_flags_t* options) { + gpio_io_config_t esp_config; + if (gpio_get_io_config((gpio_num_t)pin, &esp_config) != ESP_OK) { + return false; + } + + gpio_flags_t output = 0; + + if (esp_config.pu) { + output |= GPIO_PULL_UP; + } + + if (esp_config.pd) { + output |= GPIO_PULL_DOWN; + } + + if (esp_config.ie) { + output |= GPIO_DIRECTION_INPUT; + } + + if (esp_config.oe) { + output |= GPIO_DIRECTION_OUTPUT; + } + + if (esp_config.oe_inv) { + output |= GPIO_ACTIVE_LOW; + } + + *options = output; + return true; +} + +static int start(Device* device) { + ESP_LOGI(TAG, "start %s", device->name); + return 0; +} + +static int stop(Device* device) { + ESP_LOGI(TAG, "stop %s", device->name); + return 0; +} + +const static GpioControllerApi esp32_gpio_api = { + .set_level = set_level, + .get_level = get_level, + .set_options = set_options, + .get_options = get_options +}; + +Driver esp32_gpio_driver = { + .name = "esp32_gpio", + .compatible = (const char*[]) { "espressif,esp32-gpio", nullptr }, + .start_device = start, + .stop_device = stop, + .api = (void*)&esp32_gpio_api, + .device_type = nullptr, + .internal = { 0 } +}; + +} // extern "C" diff --git a/Platforms/PlatformEsp32/Source/Esp32I2c.cpp b/Platforms/PlatformEsp32/Source/Esp32I2c.cpp new file mode 100644 index 00000000..4599f7db --- /dev/null +++ b/Platforms/PlatformEsp32/Source/Esp32I2c.cpp @@ -0,0 +1,91 @@ +#include + +#include +#include +#include +#include + +#define TAG LOG_TAG(esp32_i2c) + +struct InternalData { + Mutex mutex { 0 }; + + InternalData() { + mutex_construct(&mutex); + } + + ~InternalData() { + mutex_destruct(&mutex); + } +}; + +#define GET_CONFIG(device) ((Esp32I2cConfig*)device->config) +#define GET_DATA(device) ((InternalData*)device->internal.driver_data) + +#define lock(data) mutex_lock(&data->mutex); +#define unlock(data) mutex_unlock(&data->mutex); + +extern "C" { + +static bool read(Device* device, uint8_t address, uint8_t* data, size_t data_size, TickType_t timeout) { + vPortAssertIfInISR(); + auto* driver_data = GET_DATA(device); + lock(driver_data); + const esp_err_t result = i2c_master_read_from_device(GET_CONFIG(device)->port, address, data, data_size, timeout); + unlock(driver_data); + ESP_ERROR_CHECK_WITHOUT_ABORT(result); + return result == ESP_OK; +} + +static bool write(Device* device, uint8_t address, const uint8_t* data, uint16_t dataSize, TickType_t timeout) { + vPortAssertIfInISR(); + auto* driver_data = GET_DATA(device); + lock(driver_data); + const esp_err_t result = i2c_master_write_to_device(GET_CONFIG(device)->port, address, data, dataSize, timeout); + unlock(driver_data); + ESP_ERROR_CHECK_WITHOUT_ABORT(result); + return result == ESP_OK; +} + +static bool write_read(Device* device, uint8_t address, const uint8_t* write_data, size_t write_data_size, uint8_t* read_data, size_t read_data_size, TickType_t timeout) { + vPortAssertIfInISR(); + auto* driver_data = GET_DATA(device); + lock(driver_data); + const esp_err_t result = i2c_master_write_read_device(GET_CONFIG(device)->port, address, write_data, write_data_size, read_data, read_data_size, timeout); + unlock(driver_data); + ESP_ERROR_CHECK_WITHOUT_ABORT(result); + return result == ESP_OK; +} + +static int start(Device* device) { + ESP_LOGI(TAG, "start %s", device->name); + auto* data = new InternalData(); + device_set_driver_data(device, data); + return 0; +} + +static int stop(Device* device) { + ESP_LOGI(TAG, "stop %s", device->name); + auto* driver_data = static_cast(device_get_driver_data(device)); + device_set_driver_data(device, nullptr); + delete driver_data; + return 0; +} + +const I2cControllerApi esp32_i2c_api = { + .read = read, + .write = write, + .write_read = write_read +}; + +Driver esp32_i2c_driver = { + .name = "esp32_i2c", + .compatible = (const char*[]) { "espressif,esp32-i2c", nullptr }, + .start_device = start, + .stop_device = stop, + .api = (void*)&esp32_i2c_api, + .device_type = &I2C_CONTROLLER_TYPE, + .internal = { 0 } +}; + +} // extern "C" diff --git a/Platforms/PlatformEsp32/Source/Register.cpp b/Platforms/PlatformEsp32/Source/Register.cpp new file mode 100644 index 00000000..1293e28a --- /dev/null +++ b/Platforms/PlatformEsp32/Source/Register.cpp @@ -0,0 +1,12 @@ +#include + +extern "C" { + +extern void register_platform_drivers() { + extern Driver esp32_gpio_driver; + driver_construct(&esp32_gpio_driver); + extern Driver esp32_i2c_driver; + driver_construct(&esp32_i2c_driver); +} + +} diff --git a/Platforms/PlatformEsp32/devicetree.yaml b/Platforms/PlatformEsp32/devicetree.yaml new file mode 100644 index 00000000..df5465c0 --- /dev/null +++ b/Platforms/PlatformEsp32/devicetree.yaml @@ -0,0 +1,3 @@ +dependencies: + - TactilityKernel +bindings: Bindings diff --git a/Platforms/PlatformPosix/CMakeLists.txt b/Platforms/PlatformPosix/CMakeLists.txt new file mode 100644 index 00000000..0f794775 --- /dev/null +++ b/Platforms/PlatformPosix/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.20) + +file(GLOB_RECURSE SOURCES "Source/*.c**") + +if (DEFINED ENV{ESP_IDF_VERSION}) + + idf_component_register( + SRCS ${SOURCES} +# INCLUDE_DIRS "Include/" + REQUIRES TactilityKernel driver + ) + +else () + + add_library(PlatformPosix OBJECT) + target_sources(PlatformPosix PRIVATE ${SOURCES}) +# target_include_directories(PlatformPosix PUBLIC Include/) + target_link_libraries(PlatformPosix PUBLIC TactilityKernel) + +endif () \ No newline at end of file diff --git a/Platforms/PlatformPosix/Source/Register.cpp b/Platforms/PlatformPosix/Source/Register.cpp new file mode 100644 index 00000000..6453236e --- /dev/null +++ b/Platforms/PlatformPosix/Source/Register.cpp @@ -0,0 +1,9 @@ +#include + +extern "C" { + +extern void register_platform_drivers() { + /* Placeholder */ +} + +} diff --git a/Platforms/PlatformPosix/devicetree.yaml b/Platforms/PlatformPosix/devicetree.yaml new file mode 100644 index 00000000..6bbb2436 --- /dev/null +++ b/Platforms/PlatformPosix/devicetree.yaml @@ -0,0 +1,2 @@ +dependencies: + - TactilityKernel diff --git a/COPYRIGHT.md b/THIRD-PARTY-NOTICES.md similarity index 80% rename from COPYRIGHT.md rename to THIRD-PARTY-NOTICES.md index 943b3a4e..8fda14b6 100644 --- a/COPYRIGHT.md +++ b/THIRD-PARTY-NOTICES.md @@ -1,8 +1,4 @@ -# Tactility - -See [LICENSE.md](LICENSE.md) - -# Dependencies +# Third-Party Notices ### ESP-IDF @@ -10,12 +6,12 @@ This project uses ESP-IDF to compile the ESP32 firmware. Website: https://www.espressif.com/ -License: [GPL v3.0](https://github.com/espressif/esp-idf/blob/master/LICENSE) +License: [Apache License v2.0](https://github.com/espressif/esp-idf/blob/master/LICENSE) ### Flipper Zero Firmware -Some of the code in this project has originally been adapted from the Flipper Zero firmware. -It was changed to fit the Tactility project. +Some of the code in inside the Tactility or TactilityCore project has originally been adapted +from the Flipper Zero firmware it was changed to fit the Tactility project. Website: https://github.com/flipperdevices/flipperzero-firmware/ @@ -65,6 +61,6 @@ Website: https://github.com/UsefulElectronics/esp32s3-gc9a01-lvgl License: [Explicitly granted by author](https://github.com/ByteWelder/Tactility/pull/295#discussion_r2226215423) -### Other Components +### Other Dependencies -See `/components` for the respective projects and their licenses. +Some dependencies contain their own license. For example: the subprojects in `Libraries/` diff --git a/Tactility/CMakeLists.txt b/Tactility/CMakeLists.txt index 0f78a544..ba8c0430 100644 --- a/Tactility/CMakeLists.txt +++ b/Tactility/CMakeLists.txt @@ -1,12 +1,10 @@ cmake_minimum_required(VERSION 3.20) -set(CMAKE_CXX_STANDARD 23) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - if (DEFINED ENV{ESP_IDF_VERSION}) file(GLOB_RECURSE SOURCE_FILES Source/*.c*) list(APPEND REQUIRES_LIST + TactilityKernel TactilityCore TactilityFreeRtos lvgl @@ -29,6 +27,7 @@ if (DEFINED ENV{ESP_IDF_VERSION}) lwip spi_flash ) + if ("${IDF_TARGET}" STREQUAL "esp32s3") list(APPEND REQUIRES_LIST esp_tinyusb) endif () @@ -50,7 +49,6 @@ if (DEFINED ENV{ESP_IDF_VERSION}) # Read-write fatfs_create_spiflash_image(data "${CMAKE_CURRENT_SOURCE_DIR}/../Data/data" FLASH_IN_PROJECT PRESERVE_TIME) endif () - else() file(GLOB_RECURSE SOURCES "Source/*.c*") @@ -75,6 +73,7 @@ else() PUBLIC cJSON PUBLIC TactilityFreeRtos PUBLIC TactilityCore + PUBLIC TactilityKernel PUBLIC freertos_kernel PUBLIC lvgl PUBLIC lv_screenshot diff --git a/Tactility/Include/Tactility/Tactility.h b/Tactility/Include/Tactility/Tactility.h index bd229f9e..b0fc801e 100644 --- a/Tactility/Include/Tactility/Tactility.h +++ b/Tactility/Include/Tactility/Tactility.h @@ -7,8 +7,6 @@ namespace tt { -namespace app::launcher { extern const AppManifest manifest; } - /** @brief The configuration for the operating system * It contains the hardware configuration, apps and services */ diff --git a/Tactility/LICENSE-GPL-3.0.md b/Tactility/LICENSE-GPL-3.0.md new file mode 100644 index 00000000..496acdb2 --- /dev/null +++ b/Tactility/LICENSE-GPL-3.0.md @@ -0,0 +1,675 @@ +# GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 . + +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 . diff --git a/TactilityC/CMakeLists.txt b/TactilityC/CMakeLists.txt index 97c81c4a..c8f82b3c 100644 --- a/TactilityC/CMakeLists.txt +++ b/TactilityC/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.20) -set(CMAKE_CXX_STANDARD 23) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - if (DEFINED ENV{ESP_IDF_VERSION}) file(GLOB_RECURSE SOURCE_FILES Source/*.c*) diff --git a/TactilityC/LICENSE-Apache-2.0.md b/TactilityC/LICENSE-Apache-2.0.md new file mode 100644 index 00000000..f5f4b8b5 --- /dev/null +++ b/TactilityC/LICENSE-Apache-2.0.md @@ -0,0 +1,195 @@ +Apache License +============== + +_Version 2.0, January 2004_ +_<>_ + +### Terms and Conditions for use, reproduction, and distribution + +#### 1. Definitions + +“License” shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +“Licensor” shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +“Legal Entity” shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, “control” means **(i)** the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the +outstanding shares, or **(iii)** beneficial ownership of such entity. + +“You” (or “Your”) shall mean an individual or Legal Entity exercising +permissions granted by this License. + +“Source” form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +“Object” form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +“Work” shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +“Derivative Works” shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +“Contribution” shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +“submitted” means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as “Not a Contribution.” + +“Contributor” shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +#### 2. Grant of Copyright License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +#### 3. Grant of Patent License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +#### 4. Redistribution + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +* **(a)** You must give any other recipients of the Work or Derivative Works a copy of +this License; and +* **(b)** You must cause any modified files to carry prominent notices stating that You +changed the files; and +* **(c)** You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +#### 5. Submission of Contributions + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +#### 6. Trademarks + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +#### 7. Disclaimer of Warranty + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +#### 8. Limitation of Liability + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +#### 9. Accepting Warranty or Additional Liability + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +_END OF TERMS AND CONDITIONS_ + +### APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets `[]` replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same “printed page” as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/TactilityCore/CMakeLists.txt b/TactilityCore/CMakeLists.txt index b57398a1..b1c8891f 100644 --- a/TactilityCore/CMakeLists.txt +++ b/TactilityCore/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.20) -set(CMAKE_CXX_STANDARD 23) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - if (DEFINED ENV{ESP_IDF_VERSION}) file(GLOB_RECURSE SOURCE_FILES Source/*.c*) @@ -24,9 +21,7 @@ else() PRIVATE ${SOURCES} ) - target_include_directories(TactilityCore SYSTEM - PUBLIC Include/ - ) + target_include_directories(TactilityCore PUBLIC Include/) add_definitions(-D_Nullable=) add_definitions(-D_Nonnull=) diff --git a/TactilityCore/Include/Tactility/LoggerAdapterGeneric.h b/TactilityCore/Include/Tactility/LoggerAdapterGeneric.h index 6ed0a26f..72b2aa5f 100644 --- a/TactilityCore/Include/Tactility/LoggerAdapterGeneric.h +++ b/TactilityCore/Include/Tactility/LoggerAdapterGeneric.h @@ -29,7 +29,7 @@ static const LoggerAdapter genericLoggerAdapter = [](LogLevel level, const char* constexpr auto COLOR_GREY = "\033[37m"; std::stringstream buffer; buffer << COLOR_GREY << getLogTimestamp() << ' ' << toTagColour(level) << toPrefix(level) << COLOR_GREY << " [" << COLOR_RESET << tag << COLOR_GREY << "] " << toMessageColour(level) << message << COLOR_RESET << std::endl; - printf(buffer.str().c_str()); + printf("%s", buffer.str().c_str()); }; } \ No newline at end of file diff --git a/TactilityCore/LICENSE-GPL-3.0.md b/TactilityCore/LICENSE-GPL-3.0.md new file mode 100644 index 00000000..496acdb2 --- /dev/null +++ b/TactilityCore/LICENSE-GPL-3.0.md @@ -0,0 +1,675 @@ +# GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 . + +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 . diff --git a/TactilityCore/LICENSE.md b/TactilityCore/LICENSE.md deleted file mode 100644 index 85c7c696..00000000 --- a/TactilityCore/LICENSE.md +++ /dev/null @@ -1,636 +0,0 @@ -# GNU GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright (C) 2007 [Free Software Foundation, Inc.](http://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. - - - Copyright (C) - - 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 . - -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: - - Copyright (C) - 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 -[http://www.gnu.org/licenses/](http://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 -[http://www.gnu.org/philosophy/why-not-lgpl.html](http://www.gnu.org/philosophy/why-not-lgpl.html). diff --git a/TactilityFreeRtos/CMakeLists.txt b/TactilityFreeRtos/CMakeLists.txt index 072cb4f9..f23dce53 100644 --- a/TactilityFreeRtos/CMakeLists.txt +++ b/TactilityFreeRtos/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required(VERSION 3.20) -set(CMAKE_CXX_STANDARD 23) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - if (DEFINED ENV{ESP_IDF_VERSION}) idf_component_register( diff --git a/TactilityFreeRtos/Include/Tactility/freertoscompat/Queue.h b/TactilityFreeRtos/Include/Tactility/freertoscompat/Queue.h index b8db380a..ef370454 100644 --- a/TactilityFreeRtos/Include/Tactility/freertoscompat/Queue.h +++ b/TactilityFreeRtos/Include/Tactility/freertoscompat/Queue.h @@ -1,3 +1,5 @@ +#pragma once + #ifdef ESP_PLATFORM #include #include diff --git a/TactilityFreeRtos/LICENSE-Apache-2.0.md b/TactilityFreeRtos/LICENSE-Apache-2.0.md new file mode 100644 index 00000000..f5f4b8b5 --- /dev/null +++ b/TactilityFreeRtos/LICENSE-Apache-2.0.md @@ -0,0 +1,195 @@ +Apache License +============== + +_Version 2.0, January 2004_ +_<>_ + +### Terms and Conditions for use, reproduction, and distribution + +#### 1. Definitions + +“License” shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +“Licensor” shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +“Legal Entity” shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, “control” means **(i)** the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the +outstanding shares, or **(iii)** beneficial ownership of such entity. + +“You” (or “Your”) shall mean an individual or Legal Entity exercising +permissions granted by this License. + +“Source” form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +“Object” form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +“Work” shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +“Derivative Works” shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +“Contribution” shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +“submitted” means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as “Not a Contribution.” + +“Contributor” shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +#### 2. Grant of Copyright License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +#### 3. Grant of Patent License + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +#### 4. Redistribution + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +* **(a)** You must give any other recipients of the Work or Derivative Works a copy of +this License; and +* **(b)** You must cause any modified files to carry prominent notices stating that You +changed the files; and +* **(c)** You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +#### 5. Submission of Contributions + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +#### 6. Trademarks + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +#### 7. Disclaimer of Warranty + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +#### 8. Limitation of Liability + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +#### 9. Accepting Warranty or Additional Liability + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +_END OF TERMS AND CONDITIONS_ + +### APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets `[]` replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same “printed page” as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/TactilityKernel/Bindings/gpio-controller.yaml b/TactilityKernel/Bindings/gpio-controller.yaml new file mode 100644 index 00000000..e3a2f8bd --- /dev/null +++ b/TactilityKernel/Bindings/gpio-controller.yaml @@ -0,0 +1,6 @@ +properties: + gpio-count: + type: int + required: true + description: | + The number of available GPIOs. \ No newline at end of file diff --git a/TactilityKernel/Bindings/i2c-controller.yaml b/TactilityKernel/Bindings/i2c-controller.yaml new file mode 100644 index 00000000..5f14e180 --- /dev/null +++ b/TactilityKernel/Bindings/i2c-controller.yaml @@ -0,0 +1,10 @@ +bus: i2c + +properties: + clock-frequency: + type: int + description: Initial clock frequency in Hz + pin-sda: + type: phandle-array + pin-scl: + type: phandle-array diff --git a/TactilityKernel/Bindings/i2c-device.yaml b/TactilityKernel/Bindings/i2c-device.yaml new file mode 100644 index 00000000..cb1b52a5 --- /dev/null +++ b/TactilityKernel/Bindings/i2c-device.yaml @@ -0,0 +1,6 @@ +on-bus: i2c + +properties: + register: + required: true + description: device address on the bus \ No newline at end of file diff --git a/TactilityKernel/Bindings/root.yaml b/TactilityKernel/Bindings/root.yaml new file mode 100644 index 00000000..8db9050b --- /dev/null +++ b/TactilityKernel/Bindings/root.yaml @@ -0,0 +1,6 @@ +compatible: "root" + +properties: + model: + required: true + description: the name of hardware, usually vendor and model name diff --git a/TactilityKernel/CMakeLists.txt b/TactilityKernel/CMakeLists.txt new file mode 100644 index 00000000..5644a317 --- /dev/null +++ b/TactilityKernel/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.20) + +file(GLOB_RECURSE SOURCES "Source/*.c**") + +if (DEFINED ENV{ESP_IDF_VERSION}) + + idf_component_register( + SRCS ${SOURCES} + INCLUDE_DIRS "Include/" + ) + +else () + + add_library(TactilityKernel OBJECT ${SOURCES}) + target_include_directories(TactilityKernel PUBLIC Include/) + target_link_libraries(TactilityKernel PUBLIC freertos_kernel) + +endif () diff --git a/TactilityKernel/Include/Tactility/Device.h b/TactilityKernel/Include/Tactility/Device.h new file mode 100644 index 00000000..f7618960 --- /dev/null +++ b/TactilityKernel/Include/Tactility/Device.h @@ -0,0 +1,183 @@ +#pragma once + +#include "Driver.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include +#include +#include + +struct Driver; + +/** Enables discovering devices of the same type */ +struct DeviceType { + /* Placeholder because empty structs have a different size with C vs C++ compilers */ + uint8_t _; +}; + +/** Represents a piece of hardware */ +struct Device { + /** The name of the device. Valid characters: a-z a-Z 0-9 - _ . */ + const char* name; + /** The configuration data for the device's driver */ + const void* config; + /** The parent device that this device belongs to. Can be NULL, but only the root device should have a NULL parent. */ + struct Device* parent; + /** Internal data */ + struct { + /** Address of the API exposed by the device instance. */ + struct Driver* driver; + /** The driver data for this device (e.g. a mutex) */ + void* driver_data; + /** The mutex for device operations */ + struct Mutex mutex; + /** The device state */ + struct { + int start_result; + bool started : 1; + bool added : 1; + } state; + /** Private data */ + void* data; + } internal; +}; + +/** + * Initialize the properties of a device. + * + * @param[in] dev a device with all non-internal properties set + * @return the result code (0 for success) + */ +int device_construct(struct Device* device); + +/** + * Deinitialize the properties of a device. + * This fails when a device is busy or has children. + * + * @param[in] dev + * @return the result code (0 for success) + */ +int device_destruct(struct Device* device); + +/** + * Indicates whether the device is in a state where its API is available + * + * @param[in] dev non-null device pointer + * @return true if the device is ready for use + */ +static inline bool device_is_ready(const struct Device* device) { + return device->internal.state.started; +} + +/** + * Register a device to all relevant systems: + * - the global ledger + * - its parent (if any) + * - a bus (if any) + * + * @param[in] device non-null device pointer + * @return 0 on success + */ +int device_add(struct Device* device); + +/** + * Deregister a device. Remove it from all relevant systems: + * - the global ledger + * - its parent (if any) + * - a bus (if any) + * + * @param[in] device non-null device pointer + * @return 0 on success + */ +int device_remove(struct Device* device); + +/** + * Attach the driver. + * + * @warning must call device_construct() and device_add() first + * @param device + * @return ERROR_INVALID_STATE or otherwise the value of the driver binding result (0 on success) + */ +int device_start(struct Device* device); + +/** + * Detach the driver. + * + * @param device + * @return ERROR_INVALID_STATE or otherwise the value of the driver unbinding result (0 on success) + */ +int device_stop(struct Device* device); + +/** + * Set or unset a parent. + * @warning must call before device_add() + * @param device non-NULL device + * @param parent nullable parent device + */ +void device_set_parent(struct Device* device, struct Device* parent); + +static inline void device_set_driver(struct Device* device, struct Driver* driver) { + device->internal.driver = driver; +} + +static inline struct Driver* device_get_driver(struct Device* device) { + return device->internal.driver; +} + +static inline void device_set_driver_data(struct Device* device, void* driver_data) { + device->internal.driver_data = driver_data; +} + +static inline void* device_get_driver_data(struct Device* device) { + return device->internal.driver_data; +} + +static inline bool device_is_added(const struct Device* device) { + return device->internal.state.added; +} + +static inline void device_lock(struct Device* device) { + mutex_lock(&device->internal.mutex); +} + +static inline int device_try_lock(struct Device* device) { + return mutex_try_lock(&device->internal.mutex); +} + +static inline void device_unlock(struct Device* device) { + mutex_unlock(&device->internal.mutex); +} + +static inline const struct DeviceType* device_get_type(struct Device* device) { + return device->internal.driver ? device->internal.driver->device_type : NULL; +} +/** + * Iterate through all the known devices + * @param callback_context the parameter to pass to the callback. NULL is valid. + * @param on_device the function to call for each filtered device. return true to continue iterating or false to stop. + */ +void for_each_device(void* callback_context, bool(*on_device)(struct Device* device, void* context)); + +/** + * Iterate through all the child devices of the specified device + * @param callback_context the parameter to pass to the callback. NULL is valid. + * @param on_device the function to call for each filtered device. return true to continue iterating or false to stop. + */ +void for_each_device_child(struct Device* device, void* callback_context, bool(*on_device)(struct Device* device, void* context)); + +/** + * Iterate through all the known devices of a specific type + * @param type the type to filter + * @param callback_context the parameter to pass to the callback. NULL is valid. + * @param on_device the function to call for each filtered device. return true to continue iterating or false to stop. + */ +void for_each_device_of_type(const struct DeviceType* type, void* callback_context, bool(*on_device)(struct Device* device, void* context)); + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/Include/Tactility/Driver.h b/TactilityKernel/Include/Tactility/Driver.h new file mode 100644 index 00000000..ee0f88a3 --- /dev/null +++ b/TactilityKernel/Include/Tactility/Driver.h @@ -0,0 +1,50 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +struct Device; +struct DeviceType; + +struct Driver { + /** The driver name */ + const char* name; + /** Array of const char*, terminated by NULL */ + const char**compatible; + /** Function to initialize the driver for a device */ + int (*start_device)(struct Device* dev); + /** Function to deinitialize the driver for a device */ + int (*stop_device)(struct Device* dev); + /** Contains the driver's functions */ + const void* api; + /** Which type of devices this driver creates (can be NULL) */ + const struct DeviceType* device_type; + /** Internal data */ + struct { + /** Contains private data */ + void* data; + } internal; +}; + +int driver_construct(struct Driver* driver); + +int driver_destruct(struct Driver* driver); + +int driver_bind(struct Driver* driver, struct Device* device); + +int driver_unbind(struct Driver* driver, struct Device* device); + +bool driver_is_compatible(struct Driver* driver, const char* compatible); + +struct Driver* driver_find_compatible(const char* compatible); + +static inline const struct DeviceType* driver_get_device_type(struct Driver* driver) { + return driver->device_type; +} + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/Include/Tactility/Error.h b/TactilityKernel/Include/Tactility/Error.h new file mode 100644 index 00000000..fdfaaf45 --- /dev/null +++ b/TactilityKernel/Include/Tactility/Error.h @@ -0,0 +1,8 @@ +#pragma once + +#define ERROR_UNDEFINED 1 +#define ERROR_INVALID_STATE 2 +#define ERROR_INVALID_ARGUMENT 3 +#define ERROR_MISSING_PARAMETER 4 +#define ERROR_NOT_FOUND 5 + diff --git a/TactilityKernel/Include/Tactility/FreeRTOS/FreeRTOS.h b/TactilityKernel/Include/Tactility/FreeRTOS/FreeRTOS.h new file mode 100644 index 00000000..4d148d81 --- /dev/null +++ b/TactilityKernel/Include/Tactility/FreeRTOS/FreeRTOS.h @@ -0,0 +1,10 @@ +#pragma once + +#ifdef ESP_PLATFORM +#include +#else +#include +#endif + +// Custom port compatibility definitins, mainly for PC compatibility +#include "port.h" diff --git a/TactilityKernel/Include/Tactility/FreeRTOS/README.md b/TactilityKernel/Include/Tactility/FreeRTOS/README.md new file mode 100644 index 00000000..9b41539d --- /dev/null +++ b/TactilityKernel/Include/Tactility/FreeRTOS/README.md @@ -0,0 +1,3 @@ +Compatibility include files for FreeRTOS. +Custom FreeRTOS from ESP-IDF prefixes paths with "freertos/", +but this isn't the normal behaviour for the regular FreeRTOS project. diff --git a/TactilityKernel/Include/Tactility/FreeRTOS/event_groups.h b/TactilityKernel/Include/Tactility/FreeRTOS/event_groups.h new file mode 100644 index 00000000..665eeb64 --- /dev/null +++ b/TactilityKernel/Include/Tactility/FreeRTOS/event_groups.h @@ -0,0 +1,10 @@ +#pragma once + +#include "FreeRTOS.h" + +#ifdef ESP_PLATFORM +#include +#else +#include +#endif + diff --git a/TactilityKernel/Include/Tactility/FreeRTOS/port.h b/TactilityKernel/Include/Tactility/FreeRTOS/port.h new file mode 100644 index 00000000..d897dafc --- /dev/null +++ b/TactilityKernel/Include/Tactility/FreeRTOS/port.h @@ -0,0 +1,8 @@ +#pragma once + +#include "FreeRTOS.h" + +#ifndef ESP_PLATFORM +#define xPortInIsrContext(x) (false) +#define vPortAssertIfInISR() +#endif diff --git a/TactilityKernel/Include/Tactility/FreeRTOS/queue.h b/TactilityKernel/Include/Tactility/FreeRTOS/queue.h new file mode 100644 index 00000000..b22e3584 --- /dev/null +++ b/TactilityKernel/Include/Tactility/FreeRTOS/queue.h @@ -0,0 +1,10 @@ +#pragma once + +#include "FreeRTOS.h" + +#ifdef ESP_PLATFORM +#include +#else +#include +#endif + diff --git a/TactilityKernel/Include/Tactility/FreeRTOS/semphr.h b/TactilityKernel/Include/Tactility/FreeRTOS/semphr.h new file mode 100644 index 00000000..9aa7332b --- /dev/null +++ b/TactilityKernel/Include/Tactility/FreeRTOS/semphr.h @@ -0,0 +1,9 @@ +#pragma once + +#include "FreeRTOS.h" + +#ifdef ESP_PLATFORM +#include +#else +#include +#endif \ No newline at end of file diff --git a/TactilityKernel/Include/Tactility/FreeRTOS/task.h b/TactilityKernel/Include/Tactility/FreeRTOS/task.h new file mode 100644 index 00000000..cb01be7a --- /dev/null +++ b/TactilityKernel/Include/Tactility/FreeRTOS/task.h @@ -0,0 +1,10 @@ +#pragma once + +#include "FreeRTOS.h" + +#ifdef ESP_PLATFORM +#include +#else +#include +#endif + diff --git a/TactilityKernel/Include/Tactility/FreeRTOS/timers.h b/TactilityKernel/Include/Tactility/FreeRTOS/timers.h new file mode 100644 index 00000000..f1e60b47 --- /dev/null +++ b/TactilityKernel/Include/Tactility/FreeRTOS/timers.h @@ -0,0 +1,9 @@ +#pragma once + +#include "FreeRTOS.h" + +#ifdef ESP_PLATFORM +#include +#else +#include +#endif diff --git a/TactilityKernel/Include/Tactility/Log.h b/TactilityKernel/Include/Tactility/Log.h new file mode 100644 index 00000000..68939e20 --- /dev/null +++ b/TactilityKernel/Include/Tactility/Log.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef ESP_PLATFORM +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define LOG_TAG(x) "\033[37m"#x"\033[0m" + +#ifndef ESP_PLATFORM + +void log_generic(const char* tag, const char* format, ...); + +#define LOG_E(x, ...) log_generic(x, ##__VA_ARGS__) +#define LOG_W(x, ...) log_generic(x, ##__VA_ARGS__) +#define LOG_I(x, ...) log_generic(x, ##__VA_ARGS__) +#define LOG_D(x, ...) log_generic(x, ##__VA_ARGS__) +#define LOG_V(x, ...) log_generic(x, ##__VA_ARGS__) + +#else + +#define LOG_E(x, ...) ESP_LOGE(x, ##__VA_ARGS__) +#define LOG_W(x, ...) ESP_LOGW(x, ##__VA_ARGS__) +#define LOG_I(x, ...) ESP_LOGI(x, ##__VA_ARGS__) +#define LOG_D(x, ...) ESP_LOGD(x, ##__VA_ARGS__) +#define LOG_V(x, ...) ESP_LOGV(x, ##__VA_ARGS__) + +#endif + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/Include/Tactility/bindings/bindings.h b/TactilityKernel/Include/Tactility/bindings/bindings.h new file mode 100644 index 00000000..8d46255a --- /dev/null +++ b/TactilityKernel/Include/Tactility/bindings/bindings.h @@ -0,0 +1,8 @@ +#pragma once + +/** + * Creates required aliases for the devicetree generation. + * @param compatible_name the "compatible" value for the related driver + * @param config_type the internal configuration type for a device + */ +#define DEFINE_DEVICETREE(compatible_name, config_type) typedef config_type compatible_name##_config_dt; diff --git a/TactilityKernel/Include/Tactility/bindings/gpio.h b/TactilityKernel/Include/Tactility/bindings/gpio.h new file mode 100644 index 00000000..836daf73 --- /dev/null +++ b/TactilityKernel/Include/Tactility/bindings/gpio.h @@ -0,0 +1,3 @@ +#pragma once + +#include diff --git a/TactilityKernel/Include/Tactility/bindings/root.h b/TactilityKernel/Include/Tactility/bindings/root.h new file mode 100644 index 00000000..f345b5c7 --- /dev/null +++ b/TactilityKernel/Include/Tactility/bindings/root.h @@ -0,0 +1,7 @@ +#pragma once + +#include +#include + +DEFINE_DEVICETREE(root, struct RootConfig) + diff --git a/TactilityKernel/Include/Tactility/concurrent/Mutex.h b/TactilityKernel/Include/Tactility/concurrent/Mutex.h new file mode 100644 index 00000000..0297ac0a --- /dev/null +++ b/TactilityKernel/Include/Tactility/concurrent/Mutex.h @@ -0,0 +1,45 @@ +#pragma once + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct Mutex { + QueueHandle_t handle; +}; + +inline static void mutex_construct(struct Mutex* mutex) { + assert(mutex->handle == NULL); + mutex->handle = xSemaphoreCreateMutex(); +} + +inline static void mutex_destruct(struct Mutex* mutex) { + assert(mutex->handle != NULL); + vPortAssertIfInISR(); + vSemaphoreDelete(mutex->handle); + mutex->handle = NULL; +} + +inline static void mutex_lock(struct Mutex* mutex) { + xSemaphoreTake(mutex->handle, portMAX_DELAY); +} + +inline static bool mutex_try_lock(struct Mutex* mutex) { + return xSemaphoreTake(mutex->handle, 0) == pdTRUE; +} + +inline static bool mutex_is_locked(struct Mutex* mutex) { + return xSemaphoreGetMutexHolder(mutex->handle) != NULL; +} + +inline static void mutex_unlock(struct Mutex* mutex) { + xSemaphoreGive(mutex->handle); +} + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/Include/Tactility/concurrent/RecursiveMutex.h b/TactilityKernel/Include/Tactility/concurrent/RecursiveMutex.h new file mode 100644 index 00000000..aba6e0da --- /dev/null +++ b/TactilityKernel/Include/Tactility/concurrent/RecursiveMutex.h @@ -0,0 +1,44 @@ +#pragma once + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct RecursiveMutex { + QueueHandle_t handle; +}; + +inline static void recursive_mutex_construct(struct RecursiveMutex* mutex) { + mutex->handle = xSemaphoreCreateRecursiveMutex(); +} + +inline static void recursive_mutex_destruct(struct RecursiveMutex* mutex) { + assert(mutex->handle != NULL); + vPortAssertIfInISR(); + vSemaphoreDelete(mutex->handle); + mutex->handle = NULL; +} + +inline static void recursive_mutex_lock(struct RecursiveMutex* mutex) { + xSemaphoreTakeRecursive(mutex->handle, portMAX_DELAY); +} + +inline static bool recursive_mutex_is_locked(struct RecursiveMutex* mutex) { + return xSemaphoreGetMutexHolder(mutex->handle) != NULL; +} + +inline static bool recursive_mutex_try_lock(struct RecursiveMutex* mutex) { + return xSemaphoreTakeRecursive(mutex->handle, 0) == pdTRUE; +} + +inline static void recursive_mutex_unlock(struct RecursiveMutex* mutex) { + xSemaphoreGiveRecursive(mutex->handle); +} + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/Include/Tactility/drivers/Gpio.h b/TactilityKernel/Include/Tactility/drivers/Gpio.h new file mode 100644 index 00000000..0e90f1df --- /dev/null +++ b/TactilityKernel/Include/Tactility/drivers/Gpio.h @@ -0,0 +1,90 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#define GPIO_OPTIONS_MASK 0x1f + +#define GPIO_ACTIVE_HIGH (0 << 0) +#define GPIO_ACTIVE_LOW (1 << 0) + +#define GPIO_DIRECTION_INPUT (1 << 1) +#define GPIO_DIRECTION_OUTPUT (1 << 2) +#define GPIO_DIRECTION_INPUT_OUTPUT (GPIO_DIRECTION_INPUT | GPIO_DIRECTION_OUTPUT) + +#define GPIO_PULL_UP (0 << 3) +#define GPIO_PULL_DOWN (1 << 4) + +#define GPIO_INTERRUPT_BITMASK (0b111 << 5) // 3 bits to hold the values [0, 5] +#define GPIO_INTERRUPT_FROM_OPTIONS(options) (gpio_int_type_t)((options & GPIO_INTERRUPT_BITMASK) >> 5) +#define GPIO_INTERRUPT_TO_OPTIONS(options, interrupt) (options | (interrupt << 5)) + +typedef enum { + GPIO_INTERRUPT_DISABLE = 0, + GPIO_INTERRUPT_POS_EDGE = 1, + GPIO_INTERRUPT_NEG_EDGE = 2, + GPIO_INTERRUPT_ANY_EDGE = 3, + GPIO_INTERRUPT_LOW_LEVEL = 4, + GPIO_INTERRUPT_HIGH_LEVEL = 5, + GPIO__MAX, +} GpioInterruptType; + +/** + * @brief Provides a type to hold a GPIO pin index. + * + * This reduced-size type is sufficient to record a pin number, + * e.g. from a devicetree GPIOS property. + */ +typedef uint8_t gpio_pin_t; + +/** + * @brief Identifies a set of pins associated with a port. + * + * The pin with index n is present in the set if and only if the bit + * identified by (1U << n) is set. + */ +typedef uint32_t gpio_pinset_t; + +/** + * @brief Provides a type to hold GPIO devicetree flags. + * + * All GPIO flags that can be expressed in devicetree fit in the low 16 + * bits of the full flags field, so use a reduced-size type to record + * that part of a GPIOS property. + * + * The lower 8 bits are used for standard flags. The upper 8 bits are reserved + * for SoC specific flags. + */ +typedef uint16_t gpio_flags_t; + +/** + * @brief Container for GPIO pin information specified in dts files + * + * This type contains a pointer to a GPIO device, pin identifier for a pin + * controlled by that device, and the subset of pin configuration + * flags which may be given in devicetree. + */ +struct GpioPinConfig { + /** GPIO device controlling the pin */ + const struct Device* port; + /** The pin's number on the device */ + gpio_pin_t pin; + /** The pin's configuration flags as specified in devicetree */ + gpio_flags_t dt_flags; +}; + +/** + * Check if the pin is ready to be used. + * @param pin_config the specifications of the pin + * @return true if the pin is ready to be used + */ +static inline bool gpio_is_ready(const struct GpioPinConfig* pin_config) { + return device_is_ready(pin_config->port); +} + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/Include/Tactility/drivers/GpioController.h b/TactilityKernel/Include/Tactility/drivers/GpioController.h new file mode 100644 index 00000000..3d70923d --- /dev/null +++ b/TactilityKernel/Include/Tactility/drivers/GpioController.h @@ -0,0 +1,28 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "Gpio.h" +#include + +struct GpioControllerApi { + bool (*set_level)(struct Device* device, gpio_pin_t pin, bool high); + bool (*get_level)(struct Device* device, gpio_pin_t pin, bool* high); + bool (*set_options)(struct Device* device, gpio_pin_t pin, gpio_flags_t options); + bool (*get_options)(struct Device* device, gpio_pin_t pin, gpio_flags_t* options); +}; + +bool gpio_controller_set_level(struct Device* device, gpio_pin_t pin, bool high); +bool gpio_controller_get_level(struct Device* device, gpio_pin_t pin, bool* high); +bool gpio_controller_set_options(struct Device* device, gpio_pin_t pin, gpio_flags_t options); +bool gpio_controller_get_options(struct Device* device, gpio_pin_t pin, gpio_flags_t* options); + +inline bool gpio_set_options_config(struct Device* device, struct GpioPinConfig* config) { + return gpio_controller_set_options(device, config->pin, config->dt_flags); +} + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/Include/Tactility/drivers/I2cController.h b/TactilityKernel/Include/Tactility/drivers/I2cController.h new file mode 100644 index 00000000..beb932a9 --- /dev/null +++ b/TactilityKernel/Include/Tactility/drivers/I2cController.h @@ -0,0 +1,28 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "Gpio.h" +#include +#include +#include + +struct I2cControllerApi { + bool (*read)(struct Device* device, uint8_t address, uint8_t* data, size_t dataSize, TickType_t timeout); + bool (*write)(struct Device* device, uint8_t address, const uint8_t* data, uint16_t dataSize, TickType_t timeout); + bool (*write_read)(struct Device* device, uint8_t address, const uint8_t* write_data, size_t write_data_size, uint8_t* read_data, size_t read_data_size, TickType_t timeout); +}; + +bool i2c_controller_read(struct Device* device, uint8_t address, uint8_t* data, size_t dataSize, TickType_t timeout); + +bool i2c_controller_write(struct Device* device, uint8_t address, const uint8_t* data, uint16_t dataSize, TickType_t timeout); + +bool i2c_controller_write_read(struct Device* device, uint8_t address, const uint8_t* write_data, size_t write_data_size, uint8_t* read_data, size_t read_data_size, TickType_t timeout); + +extern const struct DeviceType I2C_CONTROLLER_TYPE; + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/Include/Tactility/drivers/Root.h b/TactilityKernel/Include/Tactility/drivers/Root.h new file mode 100644 index 00000000..00120801 --- /dev/null +++ b/TactilityKernel/Include/Tactility/drivers/Root.h @@ -0,0 +1,13 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +struct RootConfig { + const char* model; +}; + +#ifdef __cplusplus +} +#endif diff --git a/TactilityKernel/LICENSE-LGPL-3.0.md b/TactilityKernel/LICENSE-LGPL-3.0.md new file mode 100644 index 00000000..6fb6a01e --- /dev/null +++ b/TactilityKernel/LICENSE-LGPL-3.0.md @@ -0,0 +1,157 @@ +# GNU LESSER GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This version of the GNU Lesser General Public License incorporates the +terms and conditions of version 3 of the GNU General Public License, +supplemented by the additional permissions listed below. + +## 0. Additional Definitions. + +As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the +GNU General Public License. + +"The Library" refers to a covered work governed by this License, other +than an Application or a Combined Work as defined below. + +An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + +A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + +The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + +The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + +## 1. Exception to Section 3 of the GNU GPL. + +You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + +## 2. Conveying Modified Versions. + +If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + +- a) under this License, provided that you make a good faith effort + to ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or +- b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + +## 3. Object Code Incorporating Material from Library Header Files. + +The object code form of an Application may incorporate material from a +header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + +- a) Give prominent notice with each copy of the object code that + the Library is used in it and that the Library and its use are + covered by this License. +- b) Accompany the object code with a copy of the GNU GPL and this + license document. + +## 4. Combined Works. + +You may convey a Combined Work under terms of your choice that, taken +together, effectively do not restrict modification of the portions of +the Library contained in the Combined Work and reverse engineering for +debugging such modifications, if you also do each of the following: + +- a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. +- b) Accompany the Combined Work with a copy of the GNU GPL and this + license document. +- c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. +- d) Do one of the following: + - 0) Convey the Minimal Corresponding Source under the terms of + this License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + - 1) Use a suitable shared library mechanism for linking with + the Library. A suitable mechanism is one that (a) uses at run + time a copy of the Library already present on the user's + computer system, and (b) will operate properly with a modified + version of the Library that is interface-compatible with the + Linked Version. +- e) Provide Installation Information, but only if you would + otherwise be required to provide such information under section 6 + of the GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the Application + with a modified version of the Linked Version. (If you use option + 4d0, the Installation Information must accompany the Minimal + Corresponding Source and Corresponding Application Code. If you + use option 4d1, you must provide the Installation Information in + the manner specified by section 6 of the GNU GPL for conveying + Corresponding Source.) + +## 5. Combined Libraries. + +You may place library facilities that are a work based on the Library +side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + +- a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities, conveyed under the terms of this License. +- b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + +## 6. Revised Versions of the GNU Lesser General Public License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser 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 Library +as you received it specifies that a certain numbered version of the +GNU Lesser General Public License "or any later version" applies to +it, you have the option of following the terms and conditions either +of that published version or of any later version published by the +Free Software Foundation. If the Library as you received it does not +specify a version number of the GNU Lesser General Public License, you +may choose any version of the GNU Lesser General Public License ever +published by the Free Software Foundation. + +If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/TactilityKernel/Source/Device.cpp b/TactilityKernel/Source/Device.cpp new file mode 100644 index 00000000..47d28f9e --- /dev/null +++ b/TactilityKernel/Source/Device.cpp @@ -0,0 +1,225 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define TAG LOG_TAG(device) + +struct DeviceData { + std::vector children; +}; + +struct DeviceLedger { + std::vector devices; + Mutex mutex { 0 }; + + DeviceLedger() { + mutex_construct(&mutex); + } + + ~DeviceLedger() { + mutex_destruct(&mutex); + } +}; + +static DeviceLedger& get_ledger() { + static DeviceLedger ledger; + return ledger; +} + +#define ledger get_ledger() + +extern "C" { + +#define ledger_lock() mutex_lock(&ledger.mutex) +#define ledger_unlock() mutex_unlock(&ledger.mutex) + +#define get_device_data(device) static_cast(device->internal.data) + +int device_construct(Device* device) { + device->internal.data = new(std::nothrow) DeviceData; + if (device->internal.data == nullptr) { + return ENOMEM; + } + LOG_I(TAG, "construct %s", device->name); + mutex_construct(&device->internal.mutex); + return 0; +} + +int device_destruct(Device* device) { + if (device->internal.state.started || device->internal.state.added) { + return ERROR_INVALID_STATE; + } + if (!get_device_data(device)->children.empty()) { + return ERROR_INVALID_STATE; + } + LOG_I(TAG, "destruct %s", device->name); + mutex_destruct(&device->internal.mutex); + delete get_device_data(device); + device->internal.data = nullptr; + return 0; +} + +/** Add a child to the list of children */ +static void device_add_child(struct Device* device, struct Device* child) { + device_lock(device); + assert(device->internal.state.added); + get_device_data(device)->children.push_back(child); + device_unlock(device); +} + +/** Remove a child from the list of children */ +static void device_remove_child(struct Device* device, struct Device* child) { + device_lock(device); + auto* parent_data = get_device_data(device); + const auto iterator = std::ranges::find(parent_data->children, child); + if (iterator != parent_data->children.end()) { + parent_data->children.erase(iterator); + } + device_unlock(device); +} + +int device_add(Device* device) { + LOG_I(TAG, "add %s", device->name); + + // Already added + if (device->internal.state.started || device->internal.state.added) { + return ERROR_INVALID_STATE; + } + + // Add to ledger + ledger_lock(); + ledger.devices.push_back(device); + ledger_unlock(); + + // Add self to parent's children list + auto* parent = device->parent; + if (parent != nullptr) { + device_add_child(parent, device); + } + + device->internal.state.added = true; + return 0; +} + +int device_remove(Device* device) { + LOG_I(TAG, "remove %s", device->name); + + if (device->internal.state.started || !device->internal.state.added) { + return ERROR_INVALID_STATE; + } + + // Remove self from parent's children list + auto* parent = device->parent; + if (parent != nullptr) { + device_remove_child(parent, device); + } + + ledger_lock(); + const auto iterator = std::ranges::find(ledger.devices, device); + if (iterator == ledger.devices.end()) { + ledger_unlock(); + goto failed_ledger_lookup; + } + ledger.devices.erase(iterator); + ledger_unlock(); + + device->internal.state.added = false; + return 0; + +failed_ledger_lookup: + + // Re-add to parent + if (parent != nullptr) { + device_add_child(parent, device); + } + + return ERROR_NOT_FOUND; +} + +int device_start(Device* device) { + if (!device->internal.state.added) { + return ERROR_INVALID_STATE; + } + + if (device->internal.driver == nullptr) { + return ERROR_INVALID_STATE; + } + + // Already started + if (device->internal.state.started) { + return 0; + } + + int result = driver_bind(device->internal.driver, device); + device->internal.state.started = (result == 0); + device->internal.state.start_result = result; + return result; +} + +int device_stop(struct Device* device) { + if (!device->internal.state.added) { + return ERROR_INVALID_STATE; + } + + // Not started + if (!device->internal.state.started) { + return 0; + } + + int result = driver_unbind(device->internal.driver, device); + if (result != 0) { + return result; + } + + device->internal.state.started = false; + device->internal.state.start_result = 0; + return 0; +} + +void device_set_parent(Device* device, Device* parent) { + assert(!device->internal.state.started); + device->parent = parent; +} + +void for_each_device(void* callback_context, bool(*on_device)(Device* device, void* context)) { + ledger_lock(); + for (auto* device : ledger.devices) { + if (!on_device(device, callback_context)) { + break; + } + } + ledger_unlock(); +} + +void for_each_device_child(Device* device, void* callback_context, bool(*on_device)(struct Device* device, void* context)) { + auto* data = get_device_data(device); + for (auto* child_device : data->children) { + if (!on_device(child_device, callback_context)) { + break; + } + } +} + +void for_each_device_of_type(const DeviceType* type, void* callback_context, bool(*on_device)(Device* device, void* context)) { + ledger_lock(); + for (auto* device : ledger.devices) { + auto* driver = device->internal.driver; + if (driver != nullptr) { + if (driver->device_type == type) { + if (!on_device(device, callback_context)) { + break; + } + } + } + } + ledger_unlock(); +} + +} // extern "C" diff --git a/TactilityKernel/Source/Driver.cpp b/TactilityKernel/Source/Driver.cpp new file mode 100644 index 00000000..14c0d09d --- /dev/null +++ b/TactilityKernel/Source/Driver.cpp @@ -0,0 +1,188 @@ +#include +#include +#include + +#include +#include +#include +#include +#include + +#define TAG LOG_TAG(driver) + +struct DriverInternalData { + Mutex mutex { 0 }; + int use_count = 0; + + DriverInternalData() { + mutex_construct(&mutex); + } + + ~DriverInternalData() { + mutex_destruct(&mutex); + } +}; + +struct DriverLedger { + std::vector drivers; + Mutex mutex { 0 }; + + DriverLedger() { + mutex_construct(&mutex); + } + + ~DriverLedger() { + mutex_destruct(&mutex); + } + + void lock() { + mutex_lock(&mutex); + } + + void unlock() { + mutex_unlock(&mutex); + } +}; + +static DriverLedger& get_ledger() { + static DriverLedger ledger; + return ledger; +} + +#define ledger get_ledger() + +#define driver_internal_data(driver) static_cast(driver->internal.data) +#define driver_lock(driver) mutex_lock(&driver_internal_data(driver)->mutex); +#define driver_unlock(driver) mutex_unlock(&driver_internal_data(driver)->mutex); + +static void driver_add(Driver* driver) { + LOG_I(TAG, "add %s", driver->name); + ledger.lock(); + ledger.drivers.push_back(driver); + ledger.unlock(); +} + +static bool driver_remove(Driver* driver) { + LOG_I(TAG, "remove %s", driver->name); + + ledger.lock(); + const auto iterator = std::ranges::find(ledger.drivers, driver); + // check that there actually is a 3 in our vector + if (iterator == ledger.drivers.end()) { + ledger.unlock(); + return false; + } + ledger.drivers.erase(iterator); + ledger.unlock(); + + return true; +} + +extern "C" { + +int driver_construct(Driver* driver) { + driver->internal.data = new(std::nothrow) DriverInternalData; + if (driver->internal.data == nullptr) { + return ENOMEM; + } + driver_add(driver); + return 0; +} + +int driver_destruct(Driver* driver) { + // Check if in use + if (driver_internal_data(driver)->use_count != 0) { + return ERROR_INVALID_STATE; + } + + driver_remove(driver); + delete driver_internal_data(driver); + driver->internal.data = nullptr; + return 0; +} + +bool driver_is_compatible(Driver* driver, const char* compatible) { + if (compatible == nullptr || driver->compatible == nullptr) { + return false; + } + const char** compatible_iterator = driver->compatible; + while (*compatible_iterator != nullptr) { + if (strcmp(*compatible_iterator, compatible) == 0) { + return true; + } + compatible_iterator++; + } + return false; +} + +Driver* driver_find_compatible(const char* compatible) { + ledger.lock(); + Driver* result = nullptr; + for (auto* driver : ledger.drivers) { + if (driver_is_compatible(driver, compatible)) { + result = driver; + break; + } + } + ledger.unlock(); + return result; +} + +int driver_bind(Driver* driver, Device* device) { + driver_lock(driver); + + int err = 0; + if (!device_is_added(device)) { + err = ERROR_INVALID_STATE; + goto error; + } + + if (driver->start_device != nullptr) { + err = driver->start_device(device); + if (err != 0) { + goto error; + } + } + + driver_internal_data(driver)->use_count++; + driver_unlock(driver); + + LOG_I(TAG, "bound %s to %s", driver->name, device->name); + return 0; + +error: + + driver_unlock(driver); + return err; +} + +int driver_unbind(Driver* driver, Device* device) { + driver_lock(driver); + + int err = 0; + if (!device_is_added(device)) { + err = ERROR_INVALID_STATE; + goto error; + } + + if (driver->stop_device != nullptr) { + err = driver->stop_device(device); + if (err != 0) { + goto error; + } + } + + driver_internal_data(driver)->use_count--; + driver_unlock(driver); + + LOG_I(TAG, "unbound %s to %s", driver->name, device->name); + + return 0; + +error: + + driver_unlock(driver); + return err; +} + +} // extern "C" diff --git a/TactilityKernel/Source/Log.cpp b/TactilityKernel/Source/Log.cpp new file mode 100644 index 00000000..2d1c392c --- /dev/null +++ b/TactilityKernel/Source/Log.cpp @@ -0,0 +1,17 @@ +#ifndef ESP_PLATFORM + +#include + +#include +#include + +void log_generic(const char* tag, const char* format, ...) { + va_list args; + va_start(args, format); + printf("%s ", tag); + vprintf(format, args); + printf("\n"); + va_end(args); +} + +#endif \ No newline at end of file diff --git a/TactilityKernel/Source/drivers/GpioController.cpp b/TactilityKernel/Source/drivers/GpioController.cpp new file mode 100644 index 00000000..cd4e4971 --- /dev/null +++ b/TactilityKernel/Source/drivers/GpioController.cpp @@ -0,0 +1,28 @@ +#include +#include + +#define GPIO_DRIVER_API(driver) ((struct GpioControllerApi*)driver->api) + +extern "C" { + +bool gpio_controller_set_level(Device* device, gpio_pin_t pin, bool high) { + const auto* driver = device_get_driver(device); + return GPIO_DRIVER_API(driver)->set_level(device, pin, high); +} + +bool gpio_controller_get_level(Device* device, gpio_pin_t pin, bool* high) { + const auto* driver = device_get_driver(device); + return GPIO_DRIVER_API(driver)->get_level(device, pin, high); +} + +bool gpio_controller_set_options(Device* device, gpio_pin_t pin, gpio_flags_t options) { + const auto* driver = device_get_driver(device); + return GPIO_DRIVER_API(driver)->set_options(device, pin, options); +} + +bool gpio_controller_get_options(Device* device, gpio_pin_t pin, gpio_flags_t* options) { + const auto* driver = device_get_driver(device); + return GPIO_DRIVER_API(driver)->get_options(device, pin, options); +} + +} diff --git a/TactilityKernel/Source/drivers/I2cController.cpp b/TactilityKernel/Source/drivers/I2cController.cpp new file mode 100644 index 00000000..c6495534 --- /dev/null +++ b/TactilityKernel/Source/drivers/I2cController.cpp @@ -0,0 +1,25 @@ +#include +#include + +#define I2C_DRIVER_API(driver) ((struct I2cControllerApi*)driver->api) + +extern "C" { + +bool i2c_controller_read(Device* device, uint8_t address, uint8_t* data, size_t dataSize, TickType_t timeout) { + const auto* driver = device_get_driver(device); + return I2C_DRIVER_API(driver)->read(device, address, data, dataSize, timeout); +} + +bool i2c_controller_write(Device* device, uint8_t address, const uint8_t* data, uint16_t dataSize, TickType_t timeout) { + const auto* driver = device_get_driver(device); + return I2C_DRIVER_API(driver)->write(device, address, data, dataSize, timeout); +} + +bool i2c_controller_write_read(Device* device, uint8_t address, const uint8_t* write_data, size_t write_data_size, uint8_t* read_data, size_t read_data_size, TickType_t timeout) { + const auto* driver = device_get_driver(device); + return I2C_DRIVER_API(driver)->write_read(device, address, write_data, write_data_size, read_data, read_data_size, timeout); +} + +const struct DeviceType I2C_CONTROLLER_TYPE { 0 }; + +} diff --git a/TactilityKernel/Source/drivers/Register.cpp b/TactilityKernel/Source/drivers/Register.cpp new file mode 100644 index 00000000..4983fb49 --- /dev/null +++ b/TactilityKernel/Source/drivers/Register.cpp @@ -0,0 +1,10 @@ +#include + +extern "C" { + +extern void register_kernel_drivers() { + extern Driver root_driver; + driver_construct(&root_driver); +} + +} diff --git a/TactilityKernel/Source/drivers/Root.cpp b/TactilityKernel/Source/drivers/Root.cpp new file mode 100644 index 00000000..6afb64ce --- /dev/null +++ b/TactilityKernel/Source/drivers/Root.cpp @@ -0,0 +1,16 @@ +#include +#include + +extern "C" { + +Driver root_driver = { + .name = "root", + .compatible = (const char*[]) { "root", nullptr }, + .start_device = nullptr, + .stop_device = nullptr, + .api = nullptr, + .device_type = nullptr, + .internal = { 0 } +}; + +} diff --git a/TactilityKernel/devicetree.yaml b/TactilityKernel/devicetree.yaml new file mode 100644 index 00000000..6723f7af --- /dev/null +++ b/TactilityKernel/devicetree.yaml @@ -0,0 +1 @@ +bindings: Bindings diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3ab79bd1..5883c72c 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -5,9 +5,11 @@ set(DOCTESTINC ${PROJECT_SOURCE_DIR}/Include) enable_testing() add_subdirectory(TactilityCore) add_subdirectory(TactilityFreeRtos) +add_subdirectory(TactilityKernel) add_subdirectory(Tactility) add_custom_target(build-tests) add_dependencies(build-tests TactilityCoreTests) add_dependencies(build-tests TactilityFreeRtosTests) add_dependencies(build-tests TactilityTests) +add_dependencies(build-tests TactilityKernelTests) diff --git a/Tests/LICENSE-GPL-3.0.md b/Tests/LICENSE-GPL-3.0.md new file mode 100644 index 00000000..496acdb2 --- /dev/null +++ b/Tests/LICENSE-GPL-3.0.md @@ -0,0 +1,675 @@ +# GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 . + +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 . diff --git a/Tests/Tactility/Main.cpp b/Tests/Tactility/Main.cpp index cfa29e91..89eadd14 100644 --- a/Tests/Tactility/Main.cpp +++ b/Tests/Tactility/Main.cpp @@ -23,9 +23,7 @@ void test_task(void* parameter) { data->result = context.run(); - if (context.shouldExit()) { // important - query flags (and --exit) rely on the user doing this - vTaskEndScheduler(); - } + vTaskEndScheduler(); vTaskDelete(nullptr); } diff --git a/Tests/TactilityCore/Main.cpp b/Tests/TactilityCore/Main.cpp index 165c3d27..5866a9fe 100644 --- a/Tests/TactilityCore/Main.cpp +++ b/Tests/TactilityCore/Main.cpp @@ -23,9 +23,7 @@ void test_task(void* parameter) { data->result = context.run(); - if (context.shouldExit()) { // important - query flags (and --exit) rely on the user doing this - vTaskEndScheduler(); - } + vTaskEndScheduler(); vTaskDelete(nullptr); } diff --git a/Tests/TactilityFreeRtos/Main.cpp b/Tests/TactilityFreeRtos/Main.cpp index 165c3d27..5866a9fe 100644 --- a/Tests/TactilityFreeRtos/Main.cpp +++ b/Tests/TactilityFreeRtos/Main.cpp @@ -23,9 +23,7 @@ void test_task(void* parameter) { data->result = context.run(); - if (context.shouldExit()) { // important - query flags (and --exit) rely on the user doing this - vTaskEndScheduler(); - } + vTaskEndScheduler(); vTaskDelete(nullptr); } diff --git a/Tests/TactilityKernel/CMakeLists.txt b/Tests/TactilityKernel/CMakeLists.txt new file mode 100644 index 00000000..8c257f61 --- /dev/null +++ b/Tests/TactilityKernel/CMakeLists.txt @@ -0,0 +1,14 @@ +project(TactilityCoreTests) + +enable_language(C CXX ASM) + +set(CMAKE_CXX_COMPILER g++) + +file(GLOB_RECURSE TEST_SOURCES ${PROJECT_SOURCE_DIR}/*.cpp) +add_executable(TactilityKernelTests EXCLUDE_FROM_ALL ${TEST_SOURCES}) + +target_include_directories(TactilityKernelTests PRIVATE ${DOCTESTINC}) + +add_test(NAME TactilityKernelTests COMMAND TactilityKernelTests) + +target_link_libraries(TactilityKernelTests PUBLIC TactilityKernel) diff --git a/Tests/TactilityKernel/DeviceTest.cpp b/Tests/TactilityKernel/DeviceTest.cpp new file mode 100644 index 00000000..247af86d --- /dev/null +++ b/Tests/TactilityKernel/DeviceTest.cpp @@ -0,0 +1,190 @@ +#include "doctest.h" + +#include +#include + +#include + +TEST_CASE("device_construct and device_destruct should set and unset the correct fields") { + Device device = { 0 }; + + int error = device_construct(&device); + CHECK_EQ(error, 0); + + CHECK_NE(device.internal.data, nullptr); + CHECK_NE(device.internal.mutex.handle, nullptr); + + error = device_destruct(&device); + CHECK_EQ(error, 0); + + CHECK_EQ(device.internal.data, nullptr); + CHECK_EQ(device.internal.mutex.handle, nullptr); + + Device comparison_device = { 0 }; + comparison_device.internal.data = device.internal.data; + comparison_device.internal.mutex.handle = device.internal.mutex.handle; + + // Check that no other data was set + CHECK_EQ(memcmp(&device, &comparison_device, sizeof(Device)), 0); +} + +TEST_CASE("device_add should add the device to the list of all devices") { + Device device = { 0 }; + CHECK_EQ(device_construct(&device), 0); + CHECK_EQ(device_add(&device), 0); + + // Gather all devices + std::vector devices; + for_each_device(&devices, [](auto* device, auto* context) { + auto* devices_ptr = (std::vector*)context; + devices_ptr->push_back(device); + return true; + }); + + CHECK_EQ(devices.size(), 1); + CHECK_EQ(devices[0], &device); + + CHECK_EQ(device_remove(&device), 0); + CHECK_EQ(device_destruct(&device), 0); +} + +TEST_CASE("device_add should add the device to its parent") { + Device parent = { 0 }; + + Device child = { + .name = nullptr, + .config = nullptr, + .parent = &parent + }; + + CHECK_EQ(device_construct(&parent), 0); + CHECK_EQ(device_add(&parent), 0); + + CHECK_EQ(device_construct(&child), 0); + CHECK_EQ(device_add(&child), 0); + + // Gather all child devices + std::vector children; + for_each_device_child(&parent, &children, [](auto* child_device, auto* context) { + auto* children_ptr = (std::vector*)context; + children_ptr->push_back(child_device); + return true; + }); + + CHECK_EQ(children.size(), 1); + CHECK_EQ(children[0], &child); + + CHECK_EQ(device_remove(&child), 0); + CHECK_EQ(device_destruct(&child), 0); + + CHECK_EQ(device_remove(&parent), 0); + CHECK_EQ(device_destruct(&parent), 0); +} + +TEST_CASE("device_add should set the state to 'added'") { + Device device = { 0 }; + CHECK_EQ(device_construct(&device), 0); + + CHECK_EQ(device.internal.state.added, false); + CHECK_EQ(device_add(&device), 0); + CHECK_EQ(device.internal.state.added, true); + + CHECK_EQ(device_remove(&device), 0); + CHECK_EQ(device_destruct(&device), 0); +} + +TEST_CASE("device_remove should remove it from the list of all devices") { + Device device = { 0 }; + CHECK_EQ(device_construct(&device), 0); + CHECK_EQ(device_add(&device), 0); + CHECK_EQ(device_remove(&device), 0); + + // Gather all devices + std::vector devices; + for_each_device(&devices, [](auto* device, auto* context) { + auto* devices_ptr = (std::vector*)context; + devices_ptr->push_back(device); + return true; + }); + + CHECK_EQ(devices.size(), 0); + + CHECK_EQ(device_destruct(&device), 0); +} + +TEST_CASE("device_remove should remove the device from its parent") { + Device parent = { 0 }; + + Device child = { + .name = nullptr, + .config = nullptr, + .parent = &parent + }; + + CHECK_EQ(device_construct(&parent), 0); + CHECK_EQ(device_add(&parent), 0); + + CHECK_EQ(device_construct(&child), 0); + CHECK_EQ(device_add(&child), 0); + CHECK_EQ(device_remove(&child), 0); + + // Gather all child devices + std::vector children; + for_each_device_child(&parent, &children, [](auto* child_device, auto* context) { + auto* children_ptr = (std::vector*)context; + children_ptr->push_back(child_device); + return true; + }); + + CHECK_EQ(children.size(), 0); + + CHECK_EQ(device_destruct(&child), 0); + + CHECK_EQ(device_remove(&parent), 0); + CHECK_EQ(device_destruct(&parent), 0); +} + +TEST_CASE("device_remove should clear the state 'added'") { + Device device = { 0 }; + CHECK_EQ(device_construct(&device), 0); + + CHECK_EQ(device_add(&device), 0); + CHECK_EQ(device.internal.state.added, true); + CHECK_EQ(device_remove(&device), 0); + CHECK_EQ(device.internal.state.added, false); + + CHECK_EQ(device_destruct(&device), 0); +} + +TEST_CASE("device_is_ready should return true only when it is started") { + const char* compatible[] = { "test_compatible", nullptr }; + Driver driver = { + .name = "test_driver", + .compatible = compatible, + .start_device = nullptr, + .stop_device = nullptr, + .api = nullptr, + .device_type = nullptr, + .internal = { 0 } + }; + + Device device = { 0 }; + + CHECK_EQ(driver_construct(&driver), 0); + CHECK_EQ(device_construct(&device), 0); + + CHECK_EQ(device.internal.state.started, false); + device_set_driver(&device, &driver); + CHECK_EQ(device.internal.state.started, false); + CHECK_EQ(device_add(&device), 0); + CHECK_EQ(device.internal.state.started, false); + CHECK_EQ(device_start(&device), 0); + CHECK_EQ(device.internal.state.started, true); + CHECK_EQ(device_stop(&device), 0); + CHECK_EQ(device.internal.state.started, false); + CHECK_EQ(device_remove(&device), 0); + CHECK_EQ(device.internal.state.started, false); + + CHECK_EQ(driver_destruct(&driver), 0); + CHECK_EQ(device_destruct(&device), 0); +} diff --git a/Tests/TactilityKernel/DriverIntegrationTest.cpp b/Tests/TactilityKernel/DriverIntegrationTest.cpp new file mode 100644 index 00000000..f648cfff --- /dev/null +++ b/Tests/TactilityKernel/DriverIntegrationTest.cpp @@ -0,0 +1,64 @@ +#include "doctest.h" +#include +#include + +struct IntegrationDriverConfig { + int startResult; + int stopResult; +}; + +static int startCalled = 0; +static int stopCalled = 0; + +#define integration_data(device) static_cast(device_get_driver_data(device)) +#define integration_config(device) static_cast(device->config) + +static int start(Device* device) { + startCalled++; + return integration_config(device)->startResult; +} + +static int stop(Device* device) { + stopCalled++; + return integration_config(device)->stopResult; +} + +static Driver integration_driver = { + .name = "integration_test_driver", + .compatible = (const char*[]) { "integration", nullptr }, + .start_device = start, + .stop_device = stop, + .api = nullptr, + .device_type = nullptr, + .internal = { 0 } +}; + +TEST_CASE("driver with with start success and stop success should start and stop a device") { + startCalled = 0; + stopCalled = 0; + static const IntegrationDriverConfig config { + .startResult = 0, + .stopResult = 0 + }; + + static Device integration_device { + .name = "integration_device", + .config = &config, + .parent = nullptr, + }; + + CHECK_EQ(driver_construct(&integration_driver), 0); + + CHECK_EQ(device_construct(&integration_device), 0); + device_add(&integration_device); + CHECK_EQ(startCalled, 0); + CHECK_EQ(driver_bind(&integration_driver, &integration_device), 0); + CHECK_EQ(startCalled, 1); + CHECK_EQ(stopCalled, 0); + CHECK_EQ(driver_unbind(&integration_driver, &integration_device), 0); + CHECK_EQ(stopCalled, 1); + CHECK_EQ(device_remove(&integration_device), 0); + CHECK_EQ(device_destruct(&integration_device), 0); + + CHECK_EQ(driver_destruct(&integration_driver), 0); +} diff --git a/Tests/TactilityKernel/DriverTest.cpp b/Tests/TactilityKernel/DriverTest.cpp new file mode 100644 index 00000000..b85506a6 --- /dev/null +++ b/Tests/TactilityKernel/DriverTest.cpp @@ -0,0 +1,58 @@ +#include "doctest.h" +#include + +TEST_CASE("driver_construct and driver_destruct should set and unset the correct fields") { + Driver driver = { 0 }; + + int error = driver_construct(&driver); + CHECK_EQ(error, 0); + CHECK_NE(driver.internal.data, nullptr); + + error = driver_destruct(&driver); + CHECK_EQ(error, 0); + CHECK_EQ(driver.internal.data, nullptr); +} + +TEST_CASE("driver_is_compatible should return true if a compatible value is found") { + const char* compatible[] = { "test_compatible", nullptr }; + Driver driver = { + .name = "test_driver", + .compatible = compatible, + .start_device = nullptr, + .stop_device = nullptr, + .api = nullptr, + .device_type = nullptr, + .internal = { 0 } + }; + CHECK_EQ(driver_is_compatible(&driver, "test_compatible"), true); + CHECK_EQ(driver_is_compatible(&driver, "nope"), false); + CHECK_EQ(driver_is_compatible(&driver, nullptr), false); +} + +TEST_CASE("driver_find should only find a compatible driver when the driver was constructed") { + const char* compatible[] = { "test_compatible", nullptr }; + Driver driver = { + .name = "test_driver", + .compatible = compatible, + .start_device = nullptr, + .stop_device = nullptr, + .api = nullptr, + .device_type = nullptr, + .internal = { 0 } + }; + + Driver* found_driver = driver_find_compatible("test_compatible"); + CHECK_EQ(found_driver, nullptr); + + int error = driver_construct(&driver); + CHECK_EQ(error, 0); + + found_driver = driver_find_compatible("test_compatible"); + CHECK_EQ(found_driver, &driver); + + error = driver_destruct(&driver); + CHECK_EQ(error, 0); + + found_driver = driver_find_compatible("test_compatible"); + CHECK_EQ(found_driver, nullptr); +} diff --git a/Tests/TactilityKernel/Main.cpp b/Tests/TactilityKernel/Main.cpp new file mode 100644 index 00000000..6498121d --- /dev/null +++ b/Tests/TactilityKernel/Main.cpp @@ -0,0 +1,57 @@ +#define DOCTEST_CONFIG_IMPLEMENT +#include "doctest.h" +#include + +#include + +typedef struct { + int argc; + char** argv; + int result; +} TestTaskData; + +void test_task(void* parameter) { + auto* data = (TestTaskData*)parameter; + + doctest::Context context; + + context.applyCommandLine(data->argc, data->argv); + + // overrides + context.setOption("no-breaks", true); // don't break in the debugger when assertions fail + + data->result = context.run(); + + vTaskEndScheduler(); + + vTaskDelete(nullptr); +} + +int main(int argc, char** argv) { + TestTaskData data = { + .argc = argc, + .argv = argv, + .result = 0 + }; + + BaseType_t task_result = xTaskCreate( + test_task, + "test_task", + 8192, + &data, + 1, + nullptr + ); + assert(task_result == pdPASS); + + vTaskStartScheduler(); + + return data.result; +} + +extern "C" { + // Required for FreeRTOS + void vAssertCalled(unsigned long line, const char* const file) { + __assert_fail("assert failed", file, line, ""); + } +}