diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.sourcegraph/cody_settings.json b/.idea/.sourcegraph/cody_settings.json new file mode 100644 index 0000000..077404a --- /dev/null +++ b/.idea/.sourcegraph/cody_settings.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/.idea/.sourcegraph/cody_settings.schema.json b/.idea/.sourcegraph/cody_settings.schema.json new file mode 100644 index 0000000..e9c2642 --- /dev/null +++ b/.idea/.sourcegraph/cody_settings.schema.json @@ -0,0 +1 @@ +{"$schema":"http://json-schema.org/draft-07/schema#","title":"Schema for Cody settings in the Cody VSCode Extension.","description":"This prevents invalid Cody specific configuration in the settings file.","type":"object","allOf":[{"$ref":"https://json.schemastore.org/package"}],"properties":{"cody.serverEndpoint":{"order":1,"type":"string","description":"URL to the Sourcegraph instance.","examples":"https://example.sourcegraph.com","markdownDeprecationMessage":"**Deprecated**: Please sign in via the UI instead. If you are already signed in, you can empty this field to remove this warning.","deprecationMessage":"Deprecated: Please sign in via the UI instead."},"cody.codebase":{"order":2,"type":"string","markdownDescription":"A Git repository URL to use instead of allowing Cody to infer the Git repository from the workspace.","examples":["https://github.com/sourcegraph/cody","ssh://git@github.com/sourcegraph/cody"]},"cody.useContext":{"order":99,"type":"string","enum":["embeddings","keyword","blended","none"],"default":"blended","markdownDescription":"Controls which context providers Cody uses for chat, commands and inline edits. Use 'blended' for best results. For debugging other context sources, 'embeddings' will use an embeddings-based index if available. 'keyword' will use a search-based index. 'none' will not use embeddings or search-based indexes."},"cody.customHeaders":{"order":4,"type":"object","markdownDescription":"Adds custom HTTP headers to all network requests to the Sourcegraph endpoint. Defining required headers here ensures requests are properly forwarded through intermediary proxy servers, which may mandate certain custom headers for internal or external communication.","default":{},"examples":[{"Cache-Control":"no-cache","Proxy-Authenticate":"Basic"}]},"cody.autocomplete.enabled":{"order":5,"type":"boolean","markdownDescription":"Enables code autocompletions.","default":true},"cody.autocomplete.languages":{"order":5,"type":"object","markdownDescription":"Enables or disables code autocompletions for specified [language ids](https://code.visualstudio.com/docs/languages/identifiers). `\"*\"` is the default fallback if no language-specific setting is found.\n\nThe default setting: \n\n```json\n{\n \"*\": true\n}\n```\n\nTo disable autocomplete for a given [language id](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) set its value to `false`, for example:\n\n```json\n{\n \"*\": true,\n \"plaintext\": false\n}\n```","default":{"*":true},"examples":[{"*":true,"plaintext":false}]},"cody.commandCodeLenses":{"order":8,"type":"boolean","markdownDescription":"Adds code lenses to current file for quick access to Cody commands.","default":false},"cody.chat.preInstruction":{"order":6,"type":"string","markdownDescription":"A custom instruction to be included at the start of all chat messages (e.g. \"Answer all my questions in Spanish.\")","examples":["Answer all my questions in Spanish."]},"cody.chat.defaultLocation":{"order":6,"type":"string","enum":["sticky","sidebar","editor"],"markdownDescription":"Controls where the Cody chat view opens when the user invokes the `Cody: New Chat` command, or the Alt+L and Alt+/ shortcuts.","enumDescriptions":["Opens in the last-activated view location, which is set whenever the user explicitly chooses to open chat in a given location","Opens in the sidebar","Opens in an editor panel"],"default":"sticky"},"cody.edit.preInstruction":{"order":7,"type":"string","markdownDescription":"A custom instruction to be included at the end of all instructions for edit commands (e.g. \"Write all unit tests with Jest instead of detected framework.\")","examples":["Write all unit tests with Jest instead of detected framework."]},"cody.codeActions.enabled":{"order":11,"title":"Cody Code Actions","type":"boolean","markdownDescription":"Add Cody options to Quick Fix menus for fixing, explaining, documenting, and editing code.","default":true},"cody.commandHints.enabled":{"order":12,"title":"Cody Command Hints","type":"boolean","markdownDescription":"Enable hints for Cody commands such as \"Opt+K to Edit\" or \"Opt+D to Document\"","default":true},"cody.experimental.tracing":{"order":99,"type":"boolean","markdownDescription":"Enable OpenTelemetry tracing","default":false},"cody.experimental.commitMessage":{"order":99,"type":"boolean","markdownDescription":"Enable commit message generation","default":false},"cody.experimental.minion.anthropicKey":{"order":99,"type":"string","default":""},"cody.debug.verbose":{"order":99,"type":"boolean","markdownDescription":"Enables verbose debug output. Debug messages may contain more details if the invocation includes verbose information."},"cody.debug.filter":{"order":99,"type":"string","markdownDescription":"Regular expression to filter debug output. If empty, defaults to '.*', which prints all messages."},"cody.telemetry.level":{"order":99,"type":"string","enum":["all","off"],"enumDescriptions":["Sends usage data and errors.","Disables all extension telemetry."],"markdownDescription":"Controls the telemetry about Cody usage and errors. See [Cody usage and privacy notice](https://about.sourcegraph.com/terms/cody-notice).","default":"all"},"cody.autocomplete.advanced.provider":{"type":"string","default":null,"enum":[null,"anthropic","fireworks","unstable-gemini","unstable-openai","experimental-ollama","experimental-openaicompatible"],"markdownDescription":"The provider used for code autocomplete. Most providers other than `anthropic` require the `cody.autocomplete.advanced.serverEndpoint` and `cody.autocomplete.advanced.accessToken` settings to also be set. Check the Cody output channel for error messages if autocomplete is not working as expected."},"cody.autocomplete.advanced.serverEndpoint":{"type":"string","markdownDescription":"The server endpoint used for code autocomplete. This is only supported with a provider other than `anthropic`."},"cody.autocomplete.advanced.accessToken":{"type":"string","markdownDescription":"The access token used for code autocomplete. This is only supported with a provider other than `anthropic`."},"cody.autocomplete.advanced.model":{"type":"string","default":null,"enum":[null,"starcoder-16b","starcoder-7b"],"markdownDescription":"Overwrite the model used for code autocompletion inference. This is only supported with the `fireworks` provider"},"cody.autocomplete.completeSuggestWidgetSelection":{"type":"boolean","default":true,"markdownDescription":"Autocomplete based on the currently selection in the suggest widget. Requires the VS Code user setting `editor.inlineSuggest.suppressSuggestions` set to true and will change it to true in user settings if it is not true."},"cody.autocomplete.formatOnAccept":{"type":"boolean","default":false,"markdownDescription":"Format completions on accept using [the default document formatter](https://code.visualstudio.com/docs/editor/codebasics#_formatting)."},"cody.autocomplete.disableInsideComments":{"type":"boolean","default":false,"markdownDescription":"Prevent autocomplete requests while inside code comments."},"cody.experimental.foldingRanges":{"type":"string","enum":["lsp","indentation-based"],"enumDescriptions":["Use folding ranges that are enabled by default in VS Code, and are usually powered by LSP","Use custom implementation of folding ranges that is indentation based. This is the implementation that is used by other Cody clients like the JetBrains plugin"],"markdownDescription":"Determines the algorithm Cody uses to detect folding ranges. Cody uses folding ranges for several features like the 'Document code' command","default":"all"},"cody.autocomplete.experimental.graphContext":{"type":"string","default":null,"enum":[null,"bfg","bfg-mixed","tsc","tsc-mixed"],"markdownDescription":"Use the code graph to retrieve context for autocomplete requests."},"cody.autocomplete.experimental.fireworksOptions":{"type":"object","markdownDescription":"Experimental options for the direct-Fireworks autocomplete provider.","properties":{"url":{"type":"string","description":"The URL of the Fireworks API.","default":"https://api.fireworks.ai/inference/v1/completions"},"token":{"type":"string","description":"The access token of the Fireworks API."},"model":{"type":"string","description":"The model ID can be acquired from `firectl list deployments`","default":"accounts/sourcegraph/models/starcoder2-7b"},"parameters":{"type":"object","description":"Parameters for querying the the model.","properties":{"temperature":"number","top_k":"number","top_p":"number","stop":{"type":"array","default":[],"items":{"type":"string"}}}}}},"cody.autocomplete.experimental.ollamaOptions":{"type":"object","markdownDescription":"Options for the [Ollama](https://ollama.ai/) experimental autocomplete provider.","default":{"url":"http://localhost:11434","model":"deepseek-coder:6.7b-base-q4_K_M"},"properties":{"url":{"type":"string","description":"The URL of the Ollama API.","default":"http://localhost:11434"},"model":{"type":"string","default":"deepseek-coder:6.7b-base-q4_K_M","examples":["codellama:7b-code","codellama:13b-code","deepseek-coder:6.7b-base-q4_K_M","starcoder2:7b","starcoder2:15b"]},"parameters":{"type":"object","description":"Parameters for how Ollama will run the model. See Ollama [PARAMETER documentation](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-request-with-options).","properties":{"num_ctx":"number","temperature":"number","top_k":"number","top_p":"number"}}}},"cody.autocomplete.experimental.preloadDebounceInterval":{"type":"number","default":0,"markdownDescription":"Changes the preload debounce interval for autocomplete requests triggered on cursor movement."},"openctx.enable":{"type":"boolean","markdownDescription":"Enable OpenCtx providers for Cody.","default":true},"openctx.providers":{"type":"object","markdownDescription":"OpenCtx providers configuration.","default":{}},"cody.internal.unstable":{"order":999,"type":"boolean","markdownDescription":"[INTERNAL ONLY] Enable all unstable experimental features.","default":false}}} \ No newline at end of file diff --git a/.idea/cody_history.xml b/.idea/cody_history.xml new file mode 100644 index 0000000..b907d75 --- /dev/null +++ b/.idea/cody_history.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + <usage> + <list> + <option value="chat" /> + <option value="edit" /> + </list> + </usage> + </llm> + </defaultLlm> + </AccountData> + </list> + </accountData> + </component> +</project> \ No newline at end of file diff --git a/.idea/git_toolbox_blame.xml b/.idea/git_toolbox_blame.xml new file mode 100644 index 0000000..7dc1249 --- /dev/null +++ b/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GitToolBoxBlameSettings"> + <option name="version" value="2" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/jsonSchemas.xml b/.idea/jsonSchemas.xml new file mode 100644 index 0000000..57ccb50 --- /dev/null +++ b/.idea/jsonSchemas.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="JsonSchemaMappingsProjectConfiguration"> + <state> + <map> + <entry key="Cody Settings"> + <value> + <SchemaInfo> + <option name="name" value="Cody Settings" /> + <option name="relativePathToSchema" value="$PROJECT_DIR$/.idea/.sourcegraph/cody_settings.schema.json" /> + <option name="schemaVersion" value="JSON Schema 7" /> + <option name="patterns"> + <list> + <Item> + <option name="pattern" value="true" /> + <option name="path" value="*/cody_settings.json" /> + <option name="mappingKind" value="Pattern" /> + </Item> + </list> + </option> + </SchemaInfo> + </value> + </entry> + </map> + </state> + </component> +</project> \ No newline at end of file diff --git a/.idea/kolibri-cyd-tester-app-embassy.iml b/.idea/kolibri-cyd-tester-app-embassy.iml new file mode 100644 index 0000000..72348da --- /dev/null +++ b/.idea/kolibri-cyd-tester-app-embassy.iml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="EMPTY_MODULE" version="4"> + <component name="NewModuleRootManager"> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/app/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/embedded-graphics-profiler-display/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + <excludeFolder url="file://$MODULE_DIR$/app/target" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..146e574 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/kolibri-cyd-tester-app-embassy.iml" filepath="$PROJECT_DIR$/.idea/kolibri-cyd-tester-app-embassy.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..201e87c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["rust-lang.rust-analyzer", "tamasfe.even-better-toml"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4228ffd --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "editor.formatOnSave": true, + + // Even Better TOML: + "evenBetterToml.formatter.alignComments": true, + "evenBetterToml.formatter.alignEntries": true, + "evenBetterToml.formatter.arrayAutoExpand": true, + "evenBetterToml.formatter.arrayTrailingComma": true, + "evenBetterToml.formatter.reorderArrays": true +} diff --git a/Cargo.lock b/Cargo.lock index bb66823..0e8f911 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,9 +53,18 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" + +[[package]] +name = "atomic" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +dependencies = [ + "bytemuck", +] [[package]] name = "atomic-polyfill" @@ -101,9 +110,9 @@ checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" [[package]] name = "bitfield" -version = "0.16.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8655230d3b9bcaa07b9c013a523afa39d3454e631d32794c8a0df71cb22139" +checksum = "d5acf59e2452f0c4b968b15ce4b9468f57b45f7733b919d68b19fcc39264bfb8" [[package]] name = "bitflags" @@ -163,7 +172,7 @@ version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.77", @@ -415,6 +424,15 @@ dependencies = [ "byteorder", ] +[[package]] +name = "embedded-graphics-profiler-display" +version = "0.1.0" +dependencies = [ + "atomic", + "embassy-time", + "embedded-graphics", +] + [[package]] name = "embedded-hal" version = "0.2.7" @@ -477,6 +495,18 @@ dependencies = [ "embedded-io", ] +[[package]] +name = "embedded-sdmmc" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "150f320125310e179b9e73b081173b349e63c5c7d4ca44db4e5b9121b10387ec" +dependencies = [ + "byteorder", + "embedded-hal 1.0.0", + "heapless 0.8.0", + "log", +] + [[package]] name = "embedded-storage" version = "0.3.1" @@ -494,11 +524,11 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "syn 2.0.77", @@ -784,12 +814,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -822,6 +846,7 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" name = "kolibri-cyd-tester-app-embassy" version = "0.1.0" dependencies = [ + "bit_field", "display-interface", "display-interface-spi", "embassy-embedded-hal", @@ -829,7 +854,9 @@ dependencies = [ "embassy-sync 0.6.0", "embassy-time", "embedded-graphics", + "embedded-graphics-profiler-display", "embedded-hal 1.0.0", + "embedded-sdmmc", "esp-backtrace", "esp-hal", "esp-hal-embassy", @@ -844,7 +871,7 @@ dependencies = [ [[package]] name = "kolibri-embedded-gui" version = "0.0.0-alpha.1" -source = "git+https://github.com/Yandrik/kolibri.git#91555d8c53b2280ce7af0f1ae169a2e86d37fa99" +source = "git+https://github.com/Yandrik/kolibri.git?branch=optimizations#1bd7d733a6772f208a8a08f05cf33f5467c02d34" dependencies = [ "embedded-graphics", "embedded-iconoir", @@ -1167,7 +1194,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", @@ -1247,9 +1274,9 @@ checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "utf8parse" @@ -1378,7 +1405,7 @@ dependencies = [ [[package]] name = "xpt2046" version = "0.3.1" -source = "git+https://github.com/Yandrik/xpt2046.git#7dcacbe3018d2da4d7c5547f9b516eff289924cc" +source = "git+https://github.com/Yandrik/xpt2046.git#8d8cf9481268f61580e3dccf90717bbbeb50aa99" dependencies = [ "embedded-graphics", "embedded-graphics-core", diff --git a/Cargo.toml b/Cargo.toml index 33ba4c5..3a2e235 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,35 +1,6 @@ -[package] -name = "kolibri-cyd-tester-app-embassy" -version = "0.1.0" -edition = "2021" -rust-version = "1.76.0" - -[[bin]] -name = "firmware" -path = "src/bin/firmware.rs" - -[lib] - -[dependencies] -display-interface = "0.5.0" -display-interface-spi = "0.5.0" -embassy-embedded-hal = "0.2.0" -# defmt = "0.3.8" -# defmt-rtt = "0.4.1" -embassy-executor = { version = "0.6.0", features = ["log"] } -embassy-sync = "0.6.0" -embassy-time = { version = "0.3.1", features = ["generic-queue-8"] } -embedded-graphics = "0.8.1" -embedded-hal = "1.0.0" -esp-backtrace = { version = "0.14.1", features = ["esp32", "println", "exception-handler", "panic-handler"] } -esp-hal = { version = "0.20.1", features = ["esp32", "log", "async"] } -esp-hal-embassy = { version = "0.3.0", features = ["esp32", "log"] } -esp-println = { version = "0.11.0", features = ["esp32", "log"] } -heapless = { version = "0.8.0", features = ["serde"] } -kolibri-embedded-gui = { git = "https://github.com/Yandrik/kolibri.git", version = "0.0.0-alpha.1" } -mipidsi = "0.8.0" -static_cell = { version = "2.1.0", features = ["nightly"] } -xpt2046 = { git = "https://github.com/Yandrik/xpt2046.git", version = "0.3.1" } +[workspace] +members = [ "app" , "embedded-graphics-profiler-display"] +resolver = "2" [profile.release] debug = true # Debug info is useful, and does not affect the size of the final binary diff --git a/app/Cargo.lock b/app/Cargo.lock new file mode 100644 index 0000000..d734430 --- /dev/null +++ b/app/Cargo.lock @@ -0,0 +1,1442 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" + +[[package]] +name = "bare-metal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603" + +[[package]] +name = "basic-toml" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" +dependencies = [ + "serde", +] + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + +[[package]] +name = "bitfield" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8655230d3b9bcaa07b9c013a523afa39d3454e631d32794c8a0df71cb22139" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "bytemuck" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "critical-section" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.77", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "delegate" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e018fccbeeb50ff26562ece792ed06659b9c2dae79ece77c4456bb10d9bf79b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "display-interface" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba2aab1ef3793e6f7804162debb5ac5edb93b3d650fbcc5aeb72fcd0e6c03a0" + +[[package]] +name = "display-interface-spi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9ec30048b1955da2038fcc3c017f419ab21bb0001879d16c0a3749dc6b7a" +dependencies = [ + "byte-slice-cast", + "display-interface", + "embedded-hal 1.0.0", + "embedded-hal-async", +] + +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", +] + +[[package]] +name = "embassy-embedded-hal" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5794414bc20e0d750f145bc0e82366b19dd078e9e075e8331fb8dd069a1cb6a2" +dependencies = [ + "embassy-futures", + "embassy-sync 0.6.0", + "embassy-time", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-storage", + "embedded-storage-async", + "nb 1.1.0", +] + +[[package]] +name = "embassy-executor" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ed0e24bdd4a5f4ff1b72ee4f264b1d23e179ea71a77d984b5fd24877a2bbe1" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor-macros", + "log", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d4c0c34b32c2c653c9eecce1cefaf8539dd9a54e61deb5499254f01e2fcac2" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" + +[[package]] +name = "embassy-sync" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd938f25c0798db4280fcd8026bf4c2f48789aebf8f77b6e5cf8a7693ba114ec" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-util", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-sync" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3e0c49ff02ebe324faf3a8653ba91582e2d0a7fdef5bc88f449d5aa1bfcc05c" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-util", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-time" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "158080d48f824fad101d7b2fae2d83ac39e3f7a6fa01811034f7ab8ffc6e7309" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embassy-time-queue-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-time-driver" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e0c214077aaa9206958b16411c157961fb7990d4ea628120a78d1a5a28aed24" +dependencies = [ + "document-features", +] + +[[package]] +name = "embassy-time-queue-driver" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1177859559ebf42cd24ae7ba8fe6ee707489b01d0bf471f8827b7b12dcb0bc0" + +[[package]] +name = "embassy-usb-driver" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970" + +[[package]] +name = "embassy-usb-synopsys-otg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d46be92e72bcf39e623ff74d739a8ab29b02f4909a9b05986ca81c2157ac254a" +dependencies = [ + "critical-section", + "embassy-sync 0.5.0", + "embassy-usb-driver", +] + +[[package]] +name = "embedded-can" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "embedded-graphics" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0649998afacf6d575d126d83e68b78c0ab0e00ca2ac7e9b3db11b4cbe8274ef0" +dependencies = [ + "az", + "byteorder", + "embedded-graphics-core", + "float-cmp", + "micromath", +] + +[[package]] +name = "embedded-graphics-core" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba9ecd261f991856250d2207f6d8376946cd9f412a2165d3b75bc87a0bc7a044" +dependencies = [ + "az", + "byteorder", +] + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[package]] +name = "embedded-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" + +[[package]] +name = "embedded-hal-async" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" +dependencies = [ + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-hal-nb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" +dependencies = [ + "embedded-hal 1.0.0", + "nb 1.1.0", +] + +[[package]] +name = "embedded-iconoir" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c52b9899b636b56d4e66834f7a90766d0bc6600c0f067d91ed0711b11fa3f5c8" +dependencies = [ + "bit_field", + "embedded-graphics", + "paste", + "static_assertions", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io", +] + +[[package]] +name = "embedded-sdmmc" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "150f320125310e179b9e73b081173b349e63c5c7d4ca44db4e5b9121b10387ec" +dependencies = [ + "byteorder", + "embedded-hal 1.0.0", + "heapless 0.8.0", + "log", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "embedded-storage-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc" +dependencies = [ + "embedded-storage", +] + +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "enumset" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "esp-backtrace" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2ff4bce686f28fe48a5d16aaa48c30b627a423bb689be57949bb210b8551d0" +dependencies = [ + "esp-build", + "esp-println", + "semihosting", +] + +[[package]] +name = "esp-build" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94a4b8d74e7cc7baabcca5b2277b41877e039ad9cd49959d48ef94dac7eab4b" +dependencies = [ + "quote", + "syn 2.0.77", + "termcolor", +] + +[[package]] +name = "esp-hal" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f5393b8f7e7f055455d9f86706ddb675f943c12f12a7b80b8a79c3a94233ff" +dependencies = [ + "basic-toml", + "bitfield", + "bitflags", + "bytemuck", + "cfg-if", + "critical-section", + "delegate", + "document-features", + "embassy-futures", + "embassy-sync 0.6.0", + "embassy-usb-driver", + "embassy-usb-synopsys-otg", + "embedded-can", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-hal-nb", + "embedded-io", + "embedded-io-async", + "enumset", + "esp-build", + "esp-hal-procmacros", + "esp-metadata", + "esp-riscv-rt", + "esp32", + "fugit", + "log", + "nb 1.1.0", + "paste", + "portable-atomic", + "rand_core", + "serde", + "strum", + "void", + "xtensa-lx", + "xtensa-lx-rt", +] + +[[package]] +name = "esp-hal-embassy" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46e47f06e0d7ddf411c3a582ec8fdc4fbc91713aa14bad736618677df0ffb606" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-executor", + "embassy-time-driver", + "esp-build", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata", + "log", + "portable-atomic", + "static_cell", +] + +[[package]] +name = "esp-hal-procmacros" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eac531546027909a355fc9c2449f22c839955fa4b7f1976b64ddd04b2f22f83" +dependencies = [ + "darling", + "document-features", + "litrs", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "esp-metadata" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b471bc61fa817ca4ae41a31d5d453258328b31e5ad82db72b473621d36cc4cb6" +dependencies = [ + "anyhow", + "basic-toml", + "clap", + "lazy_static", + "serde", + "strum", +] + +[[package]] +name = "esp-println" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d9dd4fc40306450e432cdf104ab00c8f6bd5c4f6c77b76c5fc3024c0e2a535d" +dependencies = [ + "critical-section", + "esp-build", + "log", + "portable-atomic", +] + +[[package]] +name = "esp-riscv-rt" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfc32298ed7c263b06c8b031704d8517cc62c819f2a9d5c261d0cb119634d6e9" +dependencies = [ + "document-features", + "riscv", + "riscv-rt-macros", +] + +[[package]] +name = "esp32" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85287b57fae3e318b62fd860787b1ac85a5e7bf91ad43eb66837c5e567218009" +dependencies = [ + "critical-section", + "vcell", + "xtensa-lx", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fugit" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" +dependencies = [ + "gcd", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version", + "serde", + "spin", + "stable_deref_trait", + "ufmt-write", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "serde", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "kolibri-cyd-tester-app-embassy" +version = "0.1.0" +dependencies = [ + "bit_field", + "display-interface", + "display-interface-spi", + "embassy-embedded-hal", + "embassy-executor", + "embassy-sync 0.6.0", + "embassy-time", + "embedded-graphics", + "embedded-hal 1.0.0", + "embedded-sdmmc", + "esp-backtrace", + "esp-hal", + "esp-hal-embassy", + "esp-println", + "heapless 0.8.0", + "kolibri-embedded-gui", + "mipidsi", + "static_cell", + "xpt2046", +] + +[[package]] +name = "kolibri-embedded-gui" +version = "0.0.0-alpha.1" +source = "git+https://github.com/Yandrik/kolibri.git#91555d8c53b2280ce7af0f1ae169a2e86d37fa99" +dependencies = [ + "embedded-graphics", + "embedded-iconoir", + "heapless 0.7.17", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "micromath" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c8dda44ff03a2f238717214da50f65d5a53b45cd213a7370424ffdb6fae815" + +[[package]] +name = "minijinja" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7d3e3a3eece1fa4618237ad41e1de855ced47eab705cec1c9a920e1d1c5aad" +dependencies = [ + "serde", +] + +[[package]] +name = "mipidsi" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44e2bbd372d8ae9ccd0fc6eb4d91742b971ed8149968bbc623f025506989bd30" +dependencies = [ + "display-interface", + "embedded-graphics-core", + "embedded-hal 1.0.0", + "heapless 0.8.0", + "nb 1.1.0", +] + +[[package]] +name = "mutex-trait" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4bb1638d419e12f8b1c43d9e639abd0d1424285bdea2f76aa231e233c63cd3a" + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "portable-atomic" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r0" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "riscv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f5c1b8bf41ea746266cdee443d1d1e9125c86ce1447e1a2615abd34330d33a9" +dependencies = [ + "critical-section", + "embedded-hal 1.0.0", +] + +[[package]] +name = "riscv-rt-macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d100d466dbb76681ef6a9386f3da9abc570d57394e86da0ba5af8c4408486d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semihosting" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11f0f8bcc4088e72905fcd826b820e72de6113218c22f1734cd94a3a5cf9172" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "static_cell" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89b0684884a883431282db1e4343f34afc2ff6996fe1f4a1664519b66e14c1e" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.77", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "ufmt-write" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87a2ed6b42ec5e28cc3b94c09982969e9227600b2e3dcbc1db927a84c06bd69" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "vcell" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + +[[package]] +name = "xpt2046" +version = "0.3.1" +source = "git+https://github.com/Yandrik/xpt2046.git#8d8cf9481268f61580e3dccf90717bbbeb50aa99" +dependencies = [ + "embedded-graphics", + "embedded-graphics-core", + "embedded-hal 1.0.0", +] + +[[package]] +name = "xtensa-lx" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e758f94e1a1f71758f94052a2766dcb12604998eb372b8b2e30576e3ab1ba1e6" +dependencies = [ + "bare-metal", + "mutex-trait", + "spin", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ceb69c1487b78d83531c5d94fb81d0dceef1ccb0affba29f29420b1f72d3ddb" +dependencies = [ + "anyhow", + "bare-metal", + "document-features", + "enum-as-inner", + "minijinja", + "r0", + "serde", + "strum", + "toml", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11277b1e4cbb7ffe44678c668518b249c843c81df249b8f096701757bc50d7ee" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.77", +] diff --git a/app/Cargo.toml b/app/Cargo.toml new file mode 100644 index 0000000..e9d57fb --- /dev/null +++ b/app/Cargo.toml @@ -0,0 +1,44 @@ +[package] +name = "kolibri-cyd-tester-app-embassy" +version = "0.1.0" +edition = "2021" +rust-version = "1.76.0" + +[[bin]] +name = "firmware" +path = "src/bin/firmware.rs" + +[[bin]] +name = "xpt" +path = "src/bin/xpt.rs" + +[[bin]] +name = "calibrate" +path = "src/bin/calibrate.rs" + +[lib] + +[dependencies] +bit_field = "0.10.2" +display-interface = "0.5.0" +display-interface-spi = "0.5.0" +embassy-embedded-hal = "0.2.0" +# defmt = "0.3.8" +# defmt-rtt = "0.4.1" +embassy-executor = { version = "0.6.0", features = ["log"] } +embassy-sync = "0.6.0" +embassy-time = { version = "0.3.1", features = ["generic-queue-8"] } +embedded-graphics = "0.8.1" +embedded-graphics-profiler-display = { version = "0.1.0", path = "../embedded-graphics-profiler-display" } +embedded-hal = "1.0.0" +embedded-sdmmc = "0.8.0" +esp-backtrace = { version = "0.14.1", features = ["esp32", "println", "exception-handler", "panic-handler"] } +esp-hal = { version = "0.20.1", features = ["esp32", "log", "async"] } +esp-hal-embassy = { version = "0.3.0", features = ["esp32", "log"] } +esp-println = { version = "0.11.0", features = ["esp32", "log"] } +heapless = { version = "0.8.0", features = ["serde"] } +kolibri-embedded-gui = { git = "https://github.com/Yandrik/kolibri.git", version = "0.0.0-alpha.1", branch = "optimizations" } +mipidsi = "0.8.0" +static_cell = { version = "2.1.0", features = ["nightly"] } +xpt2046 = { git = "https://github.com/Yandrik/xpt2046.git", version = "0.3.1" } + diff --git a/src/bin/firmware.rs b/app/src/bin/basic-display.rs similarity index 87% rename from src/bin/firmware.rs rename to app/src/bin/basic-display.rs index 7895ab0..d426462 100644 --- a/src/bin/firmware.rs +++ b/app/src/bin/basic-display.rs @@ -11,9 +11,11 @@ use embassy_sync::{ signal::Signal, }; use embassy_time::{Duration, Timer}; -use embedded_graphics::{mono_font::ascii, prelude::Point}; -use embedded_graphics::pixelcolor::Rgb565; -use embedded_graphics::prelude::RgbColor; +use embedded_graphics::{ + mono_font::ascii, + pixelcolor::Rgb565, + prelude::{DrawTarget, Point, RgbColor}, +}; use esp_backtrace as _; use esp_hal::{ clock::ClockControl, @@ -28,8 +30,12 @@ use esp_hal::{ }; use esp_println::println; use kolibri_cyd_tester_app_embassy::Debouncer; -use kolibri_embedded_gui::{button::Button, label::Label, style::medsize_rgb565_style, ui::Ui}; -use kolibri_embedded_gui::ui::Interaction; +use kolibri_embedded_gui::{ + button::Button, + label::Label, + style::medsize_rgb565_style, + ui::{Interaction, Ui}, +}; use mipidsi::{ models::{ILI9486Rgb565, ILI9486Rgb666}, options::{ColorInversion, ColorOrder, Orientation, Rotation}, @@ -50,7 +56,7 @@ async fn touch_task( Input::new(touch_irq, Pull::Up), xpt2046::Orientation::LandscapeFlipped, ); - touch_driver.set_num_samples(32); + touch_driver.set_num_samples(16); touch_driver.init(&mut embassy_time::Delay).unwrap(); let mut debounce = Debouncer::new(); @@ -60,7 +66,7 @@ async fn touch_task( touch_driver.run().expect("Running Touch driver failed"); if touch_driver.is_touched() { let point = touch_driver.get_touch_point(); - touch_signal.signal(Some(Point::new(point.x, 240-point.y))); + touch_signal.signal(Some(Point::new(point.x + 25, 240 - point.y))); } else { touch_signal.signal(None); } @@ -140,7 +146,8 @@ async fn main(spawner: Spawner) { let touch_clk = io.pins.gpio25; let touch_cs = io.pins.gpio33; - let mut touch_spi = Spi::new(peripherals.SPI3, 10.MHz(), SpiMode::Mode0, &mut clocks) + // 2MHz is the MAX! DO NOT DECREASE! This is really important. + let mut touch_spi = Spi::new(peripherals.SPI3, 2.MHz(), SpiMode::Mode0, &mut clocks) .with_pins(Some(touch_clk), Some(touch_mosi), Some(touch_miso), NO_PIN); static TOUCH_SPI_BUS: StaticCell<NoopMutex<RefCell<Spi<SPI3, FullDuplexMode>>>> = StaticCell::new(); @@ -152,12 +159,7 @@ async fn main(spawner: Spawner) { let touch_signal = &*TOUCH_SIGNAL.init(touch_signal); spawner - .spawn(touch_task( - touch_irq, - touch_spi_bus, - touch_cs, - touch_signal, - )) + .spawn(touch_task(touch_irq, touch_spi_bus, touch_cs, touch_signal)) .unwrap(); // init RGB LED pins @@ -166,12 +168,23 @@ async fn main(spawner: Spawner) { let mut green_led = Output::new(io.pins.gpio16, Level::High); let mut blue_led = Output::new(io.pins.gpio17, Level::High); + + // init SD card pins + let sd_miso = io.pins.gpio19; + let sd_mosi = io.pins.gpio23; + let sd_sck = io.pins.gpio18; + let sd_cs = io.pins.gpio5; + + + + + // TODO: Spawn some tasks let _ = spawner; let mut last_touch = None; - static BUF_CELL: StaticCell<[Rgb565; 100*100]> = StaticCell::new(); + static BUF_CELL: StaticCell<[Rgb565; 100 * 100]> = StaticCell::new(); let buf = BUF_CELL.init([Rgb565::BLACK; 100 * 100]); // Periodically feed the RWDT watchdog timer when our tasks are not running: @@ -195,7 +208,7 @@ async fn main(spawner: Spawner) { ui.add(Label::new("Kolibri Tester")); Ok(()) }) - .ok(); + .ok(); ui.add_horizontal(Button::new("Works!")); ui.add(Button::new("And pretty nicely!")); rtc.rwdt.feed(); diff --git a/app/src/bin/calibrate.rs b/app/src/bin/calibrate.rs new file mode 100644 index 0000000..e366e91 --- /dev/null +++ b/app/src/bin/calibrate.rs @@ -0,0 +1,179 @@ +#![no_std] +#![no_main] + +use core::cell::RefCell; + +use display_interface_spi::SPIInterface; +use embassy_embedded_hal::shared_bus::blocking::spi::SpiDevice; +use embassy_executor::Spawner; +use embassy_sync::{ + blocking_mutex::{raw::NoopRawMutex, NoopMutex}, + signal::Signal, +}; +use embassy_time::{Duration, Timer}; +use embedded_graphics::{mono_font::ascii, prelude::Point}; +use embedded_graphics::pixelcolor::Rgb565; +use embedded_graphics::prelude::{DrawTarget, RgbColor}; +use esp_backtrace as _; +use esp_hal::{ + clock::ClockControl, + gpio, + gpio::{GpioPin, Input, Io, Level, Output, Pull, NO_PIN}, + peripherals::{Peripherals, SPI2, SPI3}, + prelude::*, + rtc_cntl::Rtc, + spi::{master::Spi, FullDuplexMode, SpiMode}, + system::SystemControl, + timer::{timg::TimerGroup, OneShotTimer}, +}; +use esp_println::println; +use kolibri_cyd_tester_app_embassy::Debouncer; +use kolibri_embedded_gui::{button::Button, label::Label, style::medsize_rgb565_style, ui::Ui}; +use kolibri_embedded_gui::ui::Interaction; +use mipidsi::{ + models::{ILI9486Rgb565, ILI9486Rgb666}, + options::{ColorInversion, ColorOrder, Orientation, Rotation}, + Builder, +}; +use static_cell::{make_static, StaticCell}; +use xpt2046::Xpt2046; + +#[main] +async fn main(spawner: Spawner) { + let peripherals = Peripherals::take(); + let system = SystemControl::new(peripherals.SYSTEM); + let mut clocks = ClockControl::boot_defaults(system.clock_control).freeze(); + + // Enable the RWDT watchdog timer: + let mut rtc = Rtc::new(peripherals.LPWR); + rtc.rwdt.set_timeout(200000.secs()); + rtc.rwdt.enable(); + println!("RWDT watchdog enabled!"); + + // Initialize the SYSTIMER peripheral, and then Embassy: + let timg0 = TimerGroup::new(peripherals.TIMG0, &clocks); + esp_hal_embassy::init(&clocks, timg0.timer0); + println!("Embassy initialized!"); + + let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); + // let mut led = Output::new(io.pins.gpio5, Level::High); + // Initialize SPI + let sclk = io.pins.gpio14; + let miso = io.pins.gpio12; + let mosi = io.pins.gpio13; + let cs = io.pins.gpio15; + let dc = io.pins.gpio2; + let mut backlight = Output::new(io.pins.gpio21, Level::Low); + + // Note: RST is not initialized as it's set to -1 in the instructions + + // up to 80MHz is possible (even tho the display driver isn't supposed to be + // that fast) Dataseheet sais 10MHz, so we're gonna go with that + let mut spi = Spi::new(peripherals.SPI2, 10.MHz(), SpiMode::Mode0, &mut clocks).with_pins( + Some(sclk), + Some(mosi), + Some(miso), + NO_PIN, + ); + + static DISP_SPI_BUS: StaticCell<NoopMutex<RefCell<Spi<SPI2, FullDuplexMode>>>> = + StaticCell::new(); + let spi_bus = NoopMutex::new(RefCell::new(spi)); + let spi_bus = DISP_SPI_BUS.init(spi_bus); + + let di = SPIInterface::new( + SpiDevice::new(spi_bus, Output::new(cs, Level::Low)), + Output::new(dc, Level::Low), + ); + let mut display = Builder::new(ILI9486Rgb565, di) + .orientation(Orientation { + rotation: Rotation::Deg90, + mirrored: true, + }) + .color_order(ColorOrder::Bgr) + .invert_colors(ColorInversion::Inverted) + .init(&mut embassy_time::Delay) + .unwrap(); + + { + let mut ui = Ui::new_fullscreen(&mut display, medsize_rgb565_style()); + ui.clear_background().ok(); + } + backlight.set_high(); + + // init touchscreen pins + let touch_irq = io.pins.gpio36; + let touch_mosi = io.pins.gpio32; + let touch_miso = io.pins.gpio39; + let touch_clk = io.pins.gpio25; + let touch_cs = io.pins.gpio33; + + let mut touch_spi = Spi::new(peripherals.SPI3, 10.MHz(), SpiMode::Mode0, &mut clocks) + .with_pins(Some(touch_clk), Some(touch_mosi), Some(touch_miso), NO_PIN); + static TOUCH_SPI_BUS: StaticCell<NoopMutex<RefCell<Spi<SPI3, FullDuplexMode>>>> = + StaticCell::new(); + let touch_spi_bus = NoopMutex::new(RefCell::new(touch_spi)); + let touch_spi_bus = TOUCH_SPI_BUS.init(touch_spi_bus); + + let touch_signal = Signal::new(); + static TOUCH_SIGNAL: StaticCell<Signal<NoopRawMutex, Option<Point>>> = StaticCell::new(); + let touch_signal = &*TOUCH_SIGNAL.init(touch_signal); + + let mut touch_driver = Xpt2046::new( + SpiDevice::new(touch_spi_bus, Output::new(touch_cs, Level::Low)), + Input::new(touch_irq, Pull::Up), + xpt2046::Orientation::LandscapeFlipped, + ); + touch_driver.set_num_samples(128); + touch_driver.init(&mut embassy_time::Delay).unwrap(); + touch_driver.calibrate(&mut display, &mut embassy_time::Delay).unwrap(); + + // println!("{:?}", touch_driver.calibration_data); + + loop { + touch_driver.run(); + println!("{:?}", touch_driver.get_touch_point()); + } + + // init RGB LED pins + + let mut red_led = Output::new(io.pins.gpio4, Level::High); + let mut green_led = Output::new(io.pins.gpio16, Level::High); + let mut blue_led = Output::new(io.pins.gpio17, Level::High); + + // TODO: Spawn some tasks + let _ = spawner; + + let mut last_touch = None; + + static BUF_CELL: StaticCell<[Rgb565; 100*100]> = StaticCell::new(); + let buf = BUF_CELL.init([Rgb565::BLACK; 100 * 100]); + + // Periodically feed the RWDT watchdog timer when our tasks are not running: + loop { + let mut ui = Ui::new_fullscreen(&mut display, medsize_rgb565_style()); + ui.set_buffer(buf); + if let Some(touch) = touch_signal.try_take() { + let interact = match (touch, last_touch) { + (Some(point), Some(_)) => Interaction::Drag(point), + (Some(point), None) => Interaction::Click(point), + (None, Some(point)) => Interaction::Release(point), + (None, None) => Interaction::None, + }; + ui.interact(interact); + println!("{:?}, {:?}, {:?}", last_touch, touch, interact); + + last_touch = touch; + } + ui.sub_ui(|ui| { + ui.style_mut().default_font = ascii::FONT_9X18_BOLD; + ui.add(Label::new("Kolibri Tester")); + Ok(()) + }) + .ok(); + ui.add_horizontal(Button::new("Works!")); + ui.add(Button::new("And pretty nicely!")); + rtc.rwdt.feed(); + Timer::after(Duration::from_millis(17)).await; // 60 a second + } +} diff --git a/app/src/bin/firmware.rs b/app/src/bin/firmware.rs new file mode 100644 index 0000000..001aded --- /dev/null +++ b/app/src/bin/firmware.rs @@ -0,0 +1,243 @@ +#![no_std] +#![no_main] + +use core::cell::RefCell; +use core::cmp::min; +use display_interface_spi::SPIInterface; +use embassy_embedded_hal::shared_bus::blocking::spi::SpiDevice; +use embassy_executor::Spawner; +use embassy_sync::{ + blocking_mutex::{raw::NoopRawMutex, NoopMutex}, + signal::Signal, +}; +use embassy_time::{Duration, Timer}; +use embedded_graphics::{ + mono_font::ascii, + pixelcolor::Rgb565, + prelude::{DrawTarget, Point, RgbColor}, +}; +use embedded_graphics_profiler_display::ProfilerDisplay; +use esp_backtrace as _; +use esp_hal::{ + clock::ClockControl, + gpio, + gpio::{GpioPin, Input, Io, Level, Output, Pull, NO_PIN}, + peripherals::{Peripherals, SPI2, SPI3}, + prelude::*, + rtc_cntl::Rtc, + spi::{master::Spi, FullDuplexMode, SpiMode}, + system::SystemControl, + timer::{timg::TimerGroup, OneShotTimer}, +}; +use esp_println::println; +use kolibri_cyd_tester_app_embassy::Debouncer; +use kolibri_embedded_gui::{ + button::Button, + label::Label, + smartstate::SmartstateProvider, + style::medsize_rgb565_style, + ui::{Interaction, Ui}, +}; +use kolibri_embedded_gui::helpers::keyboard::draw_keyboard; +use mipidsi::{ + models::{ILI9486Rgb565, ILI9486Rgb666}, + options::{ColorInversion, ColorOrder, Orientation, Rotation}, + Builder, +}; +use static_cell::{make_static, StaticCell}; +use xpt2046::Xpt2046; + +#[embassy_executor::task] +async fn touch_task( + touch_irq: GpioPin<36>, + spi: &'static mut NoopMutex<RefCell<Spi<'static, SPI3, FullDuplexMode>>>, + touch_cs: GpioPin<33>, + touch_signal: &'static Signal<NoopRawMutex, Option<Point>>, +) -> ! { + let mut touch_driver = Xpt2046::new( + SpiDevice::new(spi, Output::new(touch_cs, Level::Low)), + Input::new(touch_irq, Pull::Up), + xpt2046::Orientation::LandscapeFlipped, + ); + touch_driver.set_num_samples(16); + touch_driver.init(&mut embassy_time::Delay).unwrap(); + + let mut debounce = Debouncer::new(); + println!("touch task"); + + loop { + touch_driver.run().expect("Running Touch driver failed"); + if touch_driver.is_touched() { + let point = touch_driver.get_touch_point(); + touch_signal.signal(Some(Point::new(point.x + 25, 240 - point.y))); + } else { + touch_signal.signal(None); + } + Timer::after(Duration::from_millis(1)).await; // 100 a second + + // Your touch handling logic here + } +} + +#[main] +async fn main(spawner: Spawner) { + let peripherals = Peripherals::take(); + let system = SystemControl::new(peripherals.SYSTEM); + let mut clocks = ClockControl::boot_defaults(system.clock_control).freeze(); + + // Enable the RWDT watchdog timer: + let mut rtc = Rtc::new(peripherals.LPWR); + rtc.rwdt.set_timeout(2.secs()); + rtc.rwdt.enable(); + println!("RWDT watchdog enabled!"); + + // Initialize the SYSTIMER peripheral, and then Embassy: + let timg0 = TimerGroup::new(peripherals.TIMG0, &clocks); + esp_hal_embassy::init(&clocks, timg0.timer0); + println!("Embassy initialized!"); + + let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); + // let mut led = Output::new(io.pins.gpio5, Level::High); + // Initialize SPI + let sclk = io.pins.gpio14; + let miso = io.pins.gpio12; + let mosi = io.pins.gpio13; + let cs = io.pins.gpio15; + let dc = io.pins.gpio2; + let mut backlight = Output::new(io.pins.gpio21, Level::Low); + + // Note: RST is not initialized as it's set to -1 in the instructions + + // up to 80MHz is possible (even tho the display driver isn't supposed to be + // that fast) Dataseheet sais 10MHz, so we're gonna go with that + let mut spi = Spi::new(peripherals.SPI2, 10.MHz(), SpiMode::Mode0, &mut clocks).with_pins( + Some(sclk), + Some(mosi), + Some(miso), + NO_PIN, + ); + + static DISP_SPI_BUS: StaticCell<NoopMutex<RefCell<Spi<SPI2, FullDuplexMode>>>> = + StaticCell::new(); + let spi_bus = NoopMutex::new(RefCell::new(spi)); + let spi_bus = DISP_SPI_BUS.init(spi_bus); + + let di = SPIInterface::new( + SpiDevice::new(spi_bus, Output::new(cs, Level::Low)), + Output::new(dc, Level::Low), + ); + let display = Builder::new(ILI9486Rgb565, di) + .orientation(Orientation { + rotation: Rotation::Deg90, + mirrored: true, + }) + .color_order(ColorOrder::Bgr) + .invert_colors(ColorInversion::Inverted) + .init(&mut embassy_time::Delay) + .unwrap(); + + let mut display = ProfilerDisplay::new(display); + + { + let mut ui = Ui::new_fullscreen(&mut display, medsize_rgb565_style()); + ui.clear_background().ok(); + } + backlight.set_high(); + + // init touchscreen pins + let touch_irq = io.pins.gpio36; + let touch_mosi = io.pins.gpio32; + let touch_miso = io.pins.gpio39; + let touch_clk = io.pins.gpio25; + let touch_cs = io.pins.gpio33; + + // 2MHz is the MAX! DO NOT DECREASE! This is really important. + let mut touch_spi = Spi::new(peripherals.SPI3, 2.MHz(), SpiMode::Mode0, &mut clocks).with_pins( + Some(touch_clk), + Some(touch_mosi), + Some(touch_miso), + NO_PIN, + ); + static TOUCH_SPI_BUS: StaticCell<NoopMutex<RefCell<Spi<SPI3, FullDuplexMode>>>> = + StaticCell::new(); + let touch_spi_bus = NoopMutex::new(RefCell::new(touch_spi)); + let touch_spi_bus = TOUCH_SPI_BUS.init(touch_spi_bus); + + let touch_signal = Signal::new(); + static TOUCH_SIGNAL: StaticCell<Signal<NoopRawMutex, Option<Point>>> = StaticCell::new(); + let touch_signal = &*TOUCH_SIGNAL.init(touch_signal); + + spawner + .spawn(touch_task(touch_irq, touch_spi_bus, touch_cs, touch_signal)) + .unwrap(); + + // init RGB LED pins + + let mut red_led = Output::new(io.pins.gpio4, Level::High); + let mut green_led = Output::new(io.pins.gpio16, Level::High); + let mut blue_led = Output::new(io.pins.gpio17, Level::High); + + // init SD card pins + let sd_miso = io.pins.gpio19; + let sd_mosi = io.pins.gpio23; + let sd_sck = io.pins.gpio18; + let sd_cs = io.pins.gpio5; + + // TODO: Spawn some tasks + let _ = spawner; + + let mut last_touch = None; + + static BUF_CELL: StaticCell<[Rgb565; 100 * 100]> = StaticCell::new(); + let buf = BUF_CELL.init([Rgb565::BLACK; 100 * 100]); + + // Periodically feed the RWDT watchdog timer when our tasks are not running: + let mut sm = SmartstateProvider::<20>::new(); + loop { + let start_time = embassy_time::Instant::now(); + sm.restart_counter(); + let mut ui = Ui::new_fullscreen(&mut display, medsize_rgb565_style()); + ui.set_buffer(buf); + if let Some(touch) = touch_signal.try_take() { + let interact = match (touch, last_touch) { + (Some(point), Some(_)) => Interaction::Drag(point), + (Some(point), None) => Interaction::Click(point), + (None, Some(point)) => Interaction::Release(point), + (None, None) => Interaction::None, + }; + ui.interact(interact); + // println!("{:?}, {:?}, {:?}", last_touch, touch, interact); + + last_touch = touch; + } + let start_draw_time = embassy_time::Instant::now(); + ui.sub_ui(|ui| { + ui.style_mut().default_font = ascii::FONT_9X18_BOLD; + ui.add(Label::new("Kolibri Tester").smartstate(sm.next())); + Ok(()) + }) + .ok(); + ui.add_horizontal(Button::new("Works!").smartstate(sm.next())); + ui.add(Button::new("And pretty nicely!").smartstate(sm.next())); + rtc.rwdt.feed(); + let draw_time = display.get_time(); + let prep_time = start_draw_time - start_time; + let proc_time = embassy_time::Instant::now() - start_draw_time; + let proc_time = proc_time - min(draw_time, proc_time); + + if draw_time.as_micros() > 0 { + println!( + "draw time: {}.{:03}ms | prep time: {}.{:03}ms | proc time: {}.{:03}ms ", + draw_time.as_millis(), + draw_time.as_micros() % 100, + prep_time.as_millis(), + prep_time.as_micros() % 100, + proc_time.as_millis(), + proc_time.as_micros() % 100, + ); + + } + display.reset_time(); + Timer::after(Duration::from_millis(17)).await; // 60 a second + } +} diff --git a/app/src/bin/xpt.rs b/app/src/bin/xpt.rs new file mode 100644 index 0000000..e25701a --- /dev/null +++ b/app/src/bin/xpt.rs @@ -0,0 +1,170 @@ +#![no_std] +#![no_main] + +use core::cell::RefCell; +use bit_field::{BitArray, BitField}; +use display_interface_spi::SPIInterface; +use embassy_embedded_hal::shared_bus::blocking::spi::SpiDevice; +use embassy_executor::Spawner; +use embassy_sync::{ + blocking_mutex::{raw::NoopRawMutex, NoopMutex}, + signal::Signal, +}; +use embassy_time::{Duration, Timer}; +use embedded_graphics::{ + mono_font::ascii, + pixelcolor::Rgb565, + prelude::{DrawTarget, Point, RgbColor}, +}; +use esp_backtrace as _; +use esp_hal::{ + clock::ClockControl, + gpio, + gpio::{GpioPin, Input, Io, Level, Output, Pull, NO_PIN}, + peripherals::{Peripherals, SPI2, SPI3}, + prelude::*, + rtc_cntl::Rtc, + spi::{master::Spi, FullDuplexMode, SpiMode}, + system::SystemControl, + timer::{timg::TimerGroup, OneShotTimer}, +}; +use esp_println::println; +use kolibri_cyd_tester_app_embassy::Debouncer; +use kolibri_embedded_gui::{ + button::Button, + label::Label, + style::medsize_rgb565_style, + ui::{Interaction, Ui}, +}; +use mipidsi::{ + models::{ILI9486Rgb565, ILI9486Rgb666}, + options::{ColorInversion, ColorOrder, Orientation, Rotation}, + Builder, +}; +use static_cell::{make_static, StaticCell}; +use xpt2046::Xpt2046; + +#[main] +async fn main(spawner: Spawner) { + let peripherals = Peripherals::take(); + let system = SystemControl::new(peripherals.SYSTEM); + let mut clocks = ClockControl::boot_defaults(system.clock_control).freeze(); + + // Enable the RWDT watchdog timer: + let mut rtc = Rtc::new(peripherals.LPWR); + rtc.rwdt.set_timeout(2.secs()); + rtc.rwdt.enable(); + println!("RWDT watchdog enabled!"); + + // Initialize the SYSTIMER peripheral, and then Embassy: + let timg0 = TimerGroup::new(peripherals.TIMG0, &clocks); + esp_hal_embassy::init(&clocks, timg0.timer0); + println!("Embassy initialized!"); + + let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); + // let mut led = Output::new(io.pins.gpio5, Level::High); + // Initialize SPI + let sclk = io.pins.gpio14; + let miso = io.pins.gpio12; + let mosi = io.pins.gpio13; + let cs = io.pins.gpio15; + let dc = io.pins.gpio2; + let mut backlight = Output::new(io.pins.gpio21, Level::Low); + + // Note: RST is not initialized as it's set to -1 in the instructions + + // up to 80MHz is possible (even tho the display driver isn't supposed to be + // that fast) Dataseheet sais 10MHz, so we're gonna go with that + let mut spi = Spi::new(peripherals.SPI2, 10.MHz(), SpiMode::Mode0, &mut clocks).with_pins( + Some(sclk), + Some(mosi), + Some(miso), + NO_PIN, + ); + + static DISP_SPI_BUS: StaticCell<NoopMutex<RefCell<Spi<SPI2, FullDuplexMode>>>> = + StaticCell::new(); + let spi_bus = NoopMutex::new(RefCell::new(spi)); + let spi_bus = DISP_SPI_BUS.init(spi_bus); + + let di = SPIInterface::new( + SpiDevice::new(spi_bus, Output::new(cs, Level::Low)), + Output::new(dc, Level::Low), + ); + let mut display = Builder::new(ILI9486Rgb565, di) + .orientation(Orientation { + rotation: Rotation::Deg90, + mirrored: true, + }) + .color_order(ColorOrder::Bgr) + .invert_colors(ColorInversion::Inverted) + .init(&mut embassy_time::Delay) + .unwrap(); + + { + let mut ui = Ui::new_fullscreen(&mut display, medsize_rgb565_style()); + ui.clear_background().ok(); + } + backlight.set_high(); + + // init touchscreen pins + let touch_irq = io.pins.gpio36; + let touch_mosi = io.pins.gpio32; + let touch_miso = io.pins.gpio39; + let touch_clk = io.pins.gpio25; + let touch_cs = io.pins.gpio33; + + let mut touch_spi = Spi::new(peripherals.SPI3, 2.MHz(), SpiMode::Mode0, &mut clocks) + .with_pins(Some(touch_clk), Some(touch_mosi), Some(touch_miso), NO_PIN); + // static TOUCH_SPI_BUS: StaticCell<NoopMutex<RefCell<Spi<SPI3, + // FullDuplexMode>>>> = StaticCell::new(); + // let touch_spi_bus = NoopMutex::new(RefCell::new(touch_spi)); + // let touch_spi_bus = TOUCH_SPI_BUS.init(touch_spi_bus); + + let touch_signal = Signal::new(); + static TOUCH_SIGNAL: StaticCell<Signal<NoopRawMutex, Option<Point>>> = StaticCell::new(); + let touch_signal = &*TOUCH_SIGNAL.init(touch_signal); + + // init RGB LED pins + + let mut red_led = Output::new(io.pins.gpio4, Level::High); + let mut green_led = Output::new(io.pins.gpio16, Level::High); + let mut blue_led = Output::new(io.pins.gpio17, Level::High); + + // TODO: Spawn some tasks + let _ = spawner; + + static BUF_CELL: StaticCell<[Rgb565; 100 * 100]> = StaticCell::new(); + let buf = BUF_CELL.init([Rgb565::BLACK; 100 * 100]); + + // Periodically feed the RWDT watchdog timer when our tasks are not running: + loop { + // XPT read raw + let mut input = [0x91, 0x00, 0x00]; // measure X pos + touch_spi.transfer(&mut input).unwrap(); + let mut input = [0x91, 0x00, 0x00]; // measure X pos + touch_spi.transfer(&mut input).unwrap(); + + let mut input = [0x91, 0x00, 0x00]; // measure X pos + touch_spi.transfer(&mut input).unwrap(); + // println!("read: {:08b} {:08b} {:08b}", input[0], input[1], input[2]); + let x = u16::from_be_bytes([input[1], input[2]]) >> 3; + // println!("{:16b} ({})", num, num); + + let mut input = [0xD1, 0x00, 0x00]; // measure y pos + touch_spi.transfer(&mut input).unwrap(); + let mut input = [0xD1, 0x00, 0x00]; // measure y pos + touch_spi.transfer(&mut input).unwrap(); + let mut input = [0xD1, 0x00, 0x00]; // measure y pos + touch_spi.transfer(&mut input).unwrap(); + // println!("read: {:08b} {:08b} {:08b}", input[0], input[1], input[2]); + let y = u16::from_be_bytes([input[1], input[2]]) >> 3; + // println!("{:16b} ({})", num, num); + println!("x: {}, y: {}", (x as f32 * 0.078125) as u16, (y as f32 * 0.05859375) as u16); + + + + rtc.rwdt.feed(); + Timer::after(Duration::from_millis(17)).await; // 60 a second + } +} diff --git a/src/debouncer.rs b/app/src/debouncer.rs similarity index 100% rename from src/debouncer.rs rename to app/src/debouncer.rs diff --git a/src/lib.rs b/app/src/lib.rs similarity index 100% rename from src/lib.rs rename to app/src/lib.rs diff --git a/embedded-graphics-profiler-display/Cargo.toml b/embedded-graphics-profiler-display/Cargo.toml new file mode 100644 index 0000000..78754ca --- /dev/null +++ b/embedded-graphics-profiler-display/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "embedded-graphics-profiler-display" +version = "0.1.0" +edition = "2021" + +[dependencies] +atomic = "0.6.0" +embassy-time = "0.3.2" +embedded-graphics = "0.8" diff --git a/embedded-graphics-profiler-display/src/lib.rs b/embedded-graphics-profiler-display/src/lib.rs new file mode 100644 index 0000000..42b896f --- /dev/null +++ b/embedded-graphics-profiler-display/src/lib.rs @@ -0,0 +1,5 @@ +#![no_std] +#![no_main] + +mod profiler; +pub use profiler::ProfilerDisplay; diff --git a/embedded-graphics-profiler-display/src/profiler/mod.rs b/embedded-graphics-profiler-display/src/profiler/mod.rs new file mode 100644 index 0000000..d5715bc --- /dev/null +++ b/embedded-graphics-profiler-display/src/profiler/mod.rs @@ -0,0 +1,109 @@ +use atomic::Atomic; +use embassy_time::{Duration, Instant}; +use embedded_graphics::draw_target::DrawTarget; +use embedded_graphics::{Drawable, Pixel}; +use embedded_graphics::geometry::Dimensions; +use embedded_graphics::primitives::Rectangle; + +pub struct ProfilerDisplay<DRAW_TARGET: DrawTarget> { + drawtarget: DRAW_TARGET, + time_draw: Duration, + time_draw_iter: Duration, + time_fill_contiguous: Duration, + time_fill_solid: Duration, +} + +impl<DRAW_TARGET: DrawTarget> Dimensions for ProfilerDisplay<DRAW_TARGET> { + fn bounding_box(&self) -> Rectangle { + self.drawtarget.bounding_box() + } +} + +impl<DRAW_TARGET: DrawTarget> DrawTarget for ProfilerDisplay<DRAW_TARGET> { + type Color = DRAW_TARGET::Color; + type Error = DRAW_TARGET::Error; + + fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error> + where + I: IntoIterator<Item=Pixel<Self::Color>> + { + let start = Instant::now(); + let res = self.drawtarget.draw_iter(pixels); + self.time_draw_iter += Instant::now() - start; + res + } + + fn fill_contiguous<I>(&mut self, area: &Rectangle, colors: I) -> Result<(), Self::Error> + where + I: IntoIterator<Item=Self::Color> + { + let start = Instant::now(); + let res = self.drawtarget.fill_contiguous(area, colors); + self.time_fill_contiguous += Instant::now() - start; + res + } + + fn fill_solid(&mut self, area: &Rectangle, color: Self::Color) -> Result<(), Self::Error> { + let start = Instant::now(); + let res = self.drawtarget.fill_solid(area, color); + self.time_fill_solid += Instant::now() - start; + res + } + + fn clear(&mut self, color: Self::Color) -> Result<(), Self::Error> { + let start = Instant::now(); + let res = self.drawtarget.clear(color); + self.time_fill_solid += Instant::now() - start; + res + } +} + +impl<DRAW_TARGET: DrawTarget> ProfilerDisplay<DRAW_TARGET> { + /// Creates a new `ProfilerDisplay` instance with the given drawable target. + /// + /// # Arguments + /// + /// * `drawable` - The draw target to be profiled. + pub fn new(drawable: DRAW_TARGET) -> Self { + ProfilerDisplay { + drawtarget: drawable, + time_draw: Duration::from_millis(0), + time_draw_iter: Duration::from_millis(0), + time_fill_contiguous: Duration::from_millis(0), + time_fill_solid: Duration::from_millis(0), + } + } + + /// Returns the total time spent in the `draw` operation. + pub fn get_time_draw(&self) -> Duration { + self.time_draw + } + + /// Returns the total time spent in the `draw_iter` operation. + pub fn get_time_draw_iter(&self) -> Duration { + self.time_draw_iter + } + + /// Returns the total time spent in the `fill_contiguous` operation. + pub fn get_time_fill_contiguous(&self) -> Duration { + self.time_fill_contiguous + } + + /// Returns the total time spent in the `fill_solid` operation. + pub fn get_time_fill_solid(&self) -> Duration { + self.time_fill_solid + } + + /// Returns the total time spent across all profiled draw operations. + pub fn get_time(&self) -> Duration { + self.time_draw + self.time_draw_iter + self.time_fill_contiguous + self.time_fill_solid + } + + /// Resets time tracking to zero. + pub fn reset_time(&mut self) { + self.time_draw = Duration::from_millis(0); + self.time_draw_iter = Duration::from_millis(0); + self.time_fill_contiguous = Duration::from_millis(0); + self.time_fill_solid = Duration::from_millis(0); + } +}