From d1dd4abc065a72112e979314968727c260bb84b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Hlusi=C4=8Dka?= Date: Wed, 21 Jan 2026 23:15:13 +0100 Subject: [PATCH] Delete old firmware crate --- firmware/.cargo/config.toml | 16 - firmware/.github/workflows/rust_ci.yml | 42 - firmware/.gitignore | 19 - firmware/Cargo.lock | 1503 ------------------------ firmware/Cargo.toml | 56 - firmware/README.md | 20 - firmware/build.rs | 52 - firmware/rust-toolchain.toml | 2 - firmware/src/bin/main.rs | 1258 -------------------- firmware/src/lib.rs | 5 - firmware/src/st7701s.rs | 1212 ------------------- 11 files changed, 4185 deletions(-) delete mode 100644 firmware/.cargo/config.toml delete mode 100644 firmware/.github/workflows/rust_ci.yml delete mode 100644 firmware/.gitignore delete mode 100644 firmware/Cargo.lock delete mode 100644 firmware/Cargo.toml delete mode 100644 firmware/README.md delete mode 100644 firmware/build.rs delete mode 100644 firmware/rust-toolchain.toml delete mode 100644 firmware/src/bin/main.rs delete mode 100644 firmware/src/lib.rs delete mode 100644 firmware/src/st7701s.rs diff --git a/firmware/.cargo/config.toml b/firmware/.cargo/config.toml deleted file mode 100644 index 1379ec1..0000000 --- a/firmware/.cargo/config.toml +++ /dev/null @@ -1,16 +0,0 @@ -[target.xtensa-esp32s3-none-elf] -runner = "espflash flash --monitor --chip esp32s3" - -[env] -ESP_LOG="info" - -[build] -rustflags = [ - "-C", "link-arg=-nostartfiles", - "-Z", "stack-protector=all", -] - -target = "xtensa-esp32s3-none-elf" - -[unstable] -build-std = ["alloc", "core"] diff --git a/firmware/.github/workflows/rust_ci.yml b/firmware/.github/workflows/rust_ci.yml deleted file mode 100644 index 5a00805..0000000 --- a/firmware/.github/workflows/rust_ci.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Continuous Integration - -on: - push: - branches: - - main - paths-ignore: - - "**/README.md" - pull_request: - workflow_dispatch: - -env: - CARGO_TERM_COLOR: always - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - rust-checks: - name: Rust Checks - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - action: - - command: build - args: --release - - command: fmt - args: --all -- --check - - command: clippy - args: --all-features --workspace -- -D warnings - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Setup Rust - uses: esp-rs/xtensa-toolchain@v1.5 - with: - default: true - buildtargets: esp32s3 - ldproxy: false - - name: Enable caching - uses: Swatinem/rust-cache@v2 - - name: Run command - run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }} diff --git a/firmware/.gitignore b/firmware/.gitignore deleted file mode 100644 index 234ae30..0000000 --- a/firmware/.gitignore +++ /dev/null @@ -1,19 +0,0 @@ -# will have compiled files and executables -debug/ -target/ -.vscode/ -.zed/ -.helix/ - -# These are backup files generated by rustfmt -**/*.rs.bk - -# MSVC Windows builds of rustc generate these, which store debugging information -*.pdb - -# RustRover -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ diff --git a/firmware/Cargo.lock b/firmware/Cargo.lock deleted file mode 100644 index 5c3846f..0000000 --- a/firmware/Cargo.lock +++ /dev/null @@ -1,1503 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "acid-firmware" -version = "0.1.0" -dependencies = [ - "bitflags", - "critical-section", - "embassy-executor", - "embassy-time", - "esp-alloc", - "esp-backtrace", - "esp-bootloader-esp-idf", - "esp-hal", - "esp-hal-embassy", - "esp-println", - "itertools", - "lazy_static", - "log", - "paste", - "static_cell", -] - -[[package]] -name = "allocator-api2" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78200ac3468a57d333cd0ea5dd398e25111194dcacd49208afca95c629a6311d" - -[[package]] -name = "anyhow" -version = "1.0.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "basic-toml" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" -dependencies = [ - "serde", -] - -[[package]] -name = "bitfield" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62a3a774b2fcac1b726922b921ebba5e9fe36ad37659c822cf8ff2c1e0819892" -dependencies = [ - "bitfield-macros", -] - -[[package]] -name = "bitfield-macros" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52511b09931f7d5fe3a14f23adefbc23e5725b184013e96c8419febb61f14734" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "bitflags" -version = "2.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" - -[[package]] -name = "bytemuck" -version = "1.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677" - -[[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.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" - -[[package]] -name = "const-default" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b396d1f76d455557e1218ec8066ae14bba60b4b36ecd55577ba979f5db7ecaa" - -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "darling" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" -dependencies = [ - "darling_core 0.20.11", - "darling_macro 0.20.11", -] - -[[package]] -name = "darling" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" -dependencies = [ - "darling_core 0.21.3", - "darling_macro 0.21.3", -] - -[[package]] -name = "darling_core" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.106", -] - -[[package]] -name = "darling_core" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "darling_macro" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" -dependencies = [ - "darling_core 0.20.11", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "darling_macro" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" -dependencies = [ - "darling_core 0.21.3", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "delegate" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6178a82cf56c836a3ba61a7935cdb1c49bfaa6fa4327cd5bf554a503087de26b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "crypto-common", -] - -[[package]] -name = "document-features" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" -dependencies = [ - "litrs", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "embassy-embedded-hal" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8" -dependencies = [ - "embassy-futures", - "embassy-hal-internal", - "embassy-sync 0.7.2", - "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.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b" -dependencies = [ - "critical-section", - "document-features", - "embassy-executor-macros", - "embassy-executor-timer-queue", - "log", -] - -[[package]] -name = "embassy-executor-macros" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472" -dependencies = [ - "darling 0.20.11", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "embassy-executor-timer-queue" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c" - -[[package]] -name = "embassy-futures" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01" - -[[package]] -name = "embassy-hal-internal" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95285007a91b619dc9f26ea8f55452aa6c60f7115a4edc05085cd2bd3127cd7a" -dependencies = [ - "num-traits", -] - -[[package]] -name = "embassy-sync" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" -dependencies = [ - "cfg-if", - "critical-section", - "embedded-io-async", - "futures-sink", - "futures-util", - "heapless", -] - -[[package]] -name = "embassy-sync" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b" -dependencies = [ - "cfg-if", - "critical-section", - "embedded-io-async", - "futures-core", - "futures-sink", - "heapless", -] - -[[package]] -name = "embassy-time" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" -dependencies = [ - "cfg-if", - "critical-section", - "document-features", - "embassy-time-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "futures-util", - "log", -] - -[[package]] -name = "embassy-time-driver" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" -dependencies = [ - "document-features", -] - -[[package]] -name = "embassy-time-queue-utils" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454" -dependencies = [ - "embassy-executor-timer-queue", - "heapless", -] - -[[package]] -name = "embassy-usb-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17119855ccc2d1f7470a39756b12068454ae27a3eabb037d940b5c03d9c77b7a" -dependencies = [ - "embedded-io-async", -] - -[[package]] -name = "embassy-usb-synopsys-otg" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "288751f8eaa44a5cf2613f13cee0ca8e06e6638cb96e897e6834702c79084b23" -dependencies = [ - "critical-section", - "embassy-sync 0.7.2", - "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-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-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-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 = "enumset" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b07a8dfbbbfc0064c0a6bdf9edcf966de6b1c33ce344bdeca3b41615452634" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43e744e4ea338060faee68ed933e46e722fb7f3617e722a5772d7e856d8b3ce" -dependencies = [ - "darling 0.21.3", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "esp-alloc" -version = "0.8.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "allocator-api2", - "cfg-if", - "document-features", - "enumset", - "esp-config", - "esp-sync", - "linked_list_allocator", - "rlsf", -] - -[[package]] -name = "esp-backtrace" -version = "0.17.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "cfg-if", - "document-features", - "esp-config", - "esp-metadata-generated", - "esp-println", - "heapless", - "riscv", - "semihosting", - "xtensa-lx", -] - -[[package]] -name = "esp-bootloader-esp-idf" -version = "0.2.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "cfg-if", - "document-features", - "embedded-storage", - "esp-config", - "esp-rom-sys", - "jiff", - "strum", -] - -[[package]] -name = "esp-config" -version = "0.5.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "document-features", - "esp-metadata-generated", - "serde", - "serde_yaml", - "somni-expr", -] - -[[package]] -name = "esp-hal" -version = "1.0.0-rc.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "bitfield", - "bitflags", - "bytemuck", - "cfg-if", - "critical-section", - "delegate", - "digest", - "document-features", - "embassy-embedded-hal", - "embassy-futures", - "embassy-sync 0.7.2", - "embassy-usb-driver", - "embassy-usb-synopsys-otg", - "embedded-can", - "embedded-hal 1.0.0", - "embedded-hal-async", - "embedded-io", - "embedded-io-async", - "enumset", - "esp-config", - "esp-hal-procmacros", - "esp-metadata-generated", - "esp-riscv-rt", - "esp-rom-sys", - "esp-sync", - "esp-synopsys-usb-otg", - "esp32", - "esp32c2", - "esp32c3", - "esp32c6", - "esp32h2", - "esp32s2", - "esp32s3", - "fugit", - "instability", - "log", - "nb 1.1.0", - "paste", - "portable-atomic", - "rand_core 0.6.4", - "rand_core 0.9.3", - "riscv", - "serde", - "strum", - "ufmt-write", - "xtensa-lx", - "xtensa-lx-rt", -] - -[[package]] -name = "esp-hal-embassy" -version = "0.9.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "cfg-if", - "document-features", - "embassy-executor", - "embassy-executor-timer-queue", - "embassy-sync 0.7.2", - "embassy-time-driver", - "embassy-time-queue-utils", - "esp-config", - "esp-hal", - "esp-hal-procmacros", - "esp-metadata-generated", - "esp-sync", - "log", - "portable-atomic", - "riscv", - "static_cell", -] - -[[package]] -name = "esp-hal-procmacros" -version = "0.19.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "document-features", - "litrs", - "object", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.106", - "termcolor", -] - -[[package]] -name = "esp-metadata" -version = "0.8.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "anyhow", - "basic-toml", - "indexmap", - "proc-macro2", - "quote", - "serde", - "strum", -] - -[[package]] -name = "esp-metadata-generated" -version = "0.1.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "esp-metadata", -] - -[[package]] -name = "esp-println" -version = "0.15.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "document-features", - "esp-metadata-generated", - "esp-sync", - "log", - "portable-atomic", -] - -[[package]] -name = "esp-riscv-rt" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "document-features", - "riscv", - "riscv-rt", -] - -[[package]] -name = "esp-rom-sys" -version = "0.1.1" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "cfg-if", - "document-features", - "esp-metadata-generated", -] - -[[package]] -name = "esp-sync" -version = "0.0.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "cfg-if", - "document-features", - "embassy-sync 0.6.2", - "embassy-sync 0.7.2", - "esp-metadata-generated", - "riscv", - "xtensa-lx", -] - -[[package]] -name = "esp-synopsys-usb-otg" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8938451cb19032f13365328ea66ab38c8d16deecdf322067442297110eb74468" -dependencies = [ - "critical-section", - "embedded-hal 0.2.7", - "ral-registers", - "usb-device", - "vcell", -] - -[[package]] -name = "esp32" -version = "0.38.0" -source = "git+https://github.com/esp-rs/esp-pacs?rev=aaacac954c30c19debd1c86fd6bbecf3ae554581#aaacac954c30c19debd1c86fd6bbecf3ae554581" -dependencies = [ - "critical-section", - "vcell", -] - -[[package]] -name = "esp32c2" -version = "0.27.0" -source = "git+https://github.com/esp-rs/esp-pacs?rev=aaacac954c30c19debd1c86fd6bbecf3ae554581#aaacac954c30c19debd1c86fd6bbecf3ae554581" -dependencies = [ - "critical-section", - "vcell", -] - -[[package]] -name = "esp32c3" -version = "0.30.0" -source = "git+https://github.com/esp-rs/esp-pacs?rev=aaacac954c30c19debd1c86fd6bbecf3ae554581#aaacac954c30c19debd1c86fd6bbecf3ae554581" -dependencies = [ - "critical-section", - "vcell", -] - -[[package]] -name = "esp32c6" -version = "0.21.0" -source = "git+https://github.com/esp-rs/esp-pacs?rev=aaacac954c30c19debd1c86fd6bbecf3ae554581#aaacac954c30c19debd1c86fd6bbecf3ae554581" -dependencies = [ - "critical-section", - "vcell", -] - -[[package]] -name = "esp32h2" -version = "0.17.0" -source = "git+https://github.com/esp-rs/esp-pacs?rev=aaacac954c30c19debd1c86fd6bbecf3ae554581#aaacac954c30c19debd1c86fd6bbecf3ae554581" -dependencies = [ - "critical-section", - "vcell", -] - -[[package]] -name = "esp32s2" -version = "0.29.0" -source = "git+https://github.com/esp-rs/esp-pacs?rev=aaacac954c30c19debd1c86fd6bbecf3ae554581#aaacac954c30c19debd1c86fd6bbecf3ae554581" -dependencies = [ - "critical-section", - "vcell", -] - -[[package]] -name = "esp32s3" -version = "0.33.0" -source = "git+https://github.com/esp-rs/esp-pacs?rev=aaacac954c30c19debd1c86fd6bbecf3ae554581#aaacac954c30c19debd1c86fd6bbecf3ae554581" -dependencies = [ - "critical-section", - "vcell", -] - -[[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.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -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 = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[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.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32", - "stable_deref_trait", -] - -[[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.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "indoc" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" - -[[package]] -name = "instability" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435d80800b936787d62688c927b6490e887c7ef5ff9ce922c6c6050fca75eb9a" -dependencies = [ - "darling 0.20.11", - "indoc", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "jiff" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" -dependencies = [ - "jiff-static", - "log", - "portable-atomic", - "portable-atomic-util", - "serde", -] - -[[package]] -name = "jiff-static" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] - -[[package]] -name = "libc" -version = "0.2.176" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" - -[[package]] -name = "linked_list_allocator" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" - -[[package]] -name = "litrs" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "log" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" - -[[package]] -name = "memchr" -version = "2.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" - -[[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 = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[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.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[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.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" - -[[package]] -name = "portable-atomic-util" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "proc-macro-crate" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro2" -version = "1.0.101" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "ral-registers" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46b71a9d9206e8b46714c74255adcaea8b11e0350c1d8456165073c3f75fc81a" - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "rand_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" - -[[package]] -name = "riscv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05cfa3f7b30c84536a9025150d44d26b8e1cc20ddf436448d74cd9591eefb25" -dependencies = [ - "critical-section", - "embedded-hal 1.0.0", - "paste", - "riscv-macros", - "riscv-pac", -] - -[[package]] -name = "riscv-macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d323d13972c1b104aa036bc692cd08b822c8bbf23d79a27c526095856499799" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "riscv-pac" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8188909339ccc0c68cfb5a04648313f09621e8b87dc03095454f1a11f6c5d436" - -[[package]] -name = "riscv-rt" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d07b9f3a0eff773fc4df11f44ada4fa302e529bff4b7fe7e6a4b98a65ce9174" -dependencies = [ - "riscv", - "riscv-pac", - "riscv-rt-macros", - "riscv-target-parser", -] - -[[package]] -name = "riscv-rt-macros" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c3138fdd8d128b2d81829842a3e0ce771b3712f7b6318ed1476b0695e7d330" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "riscv-target-parser" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb12701a0129e07776b285c3fbde53166e6c49c350187adf793c1d7e1dc64355" - -[[package]] -name = "rlsf" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222fb240c3286247ecdee6fa5341e7cdad0ffdf8e7e401d9937f2d58482a20bf" -dependencies = [ - "cfg-if", - "const-default", - "libc", - "svgbobdoc", -] - -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - -[[package]] -name = "semihosting" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e1c7d2b77d80283c750a39c52f1ab4d17234e8f30bca43550f5b2375f41d5f" - -[[package]] -name = "serde" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - -[[package]] -name = "somni-expr" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa2242e96675e71a00281c04d341df3b9912e4968674d713d2e7499802f2aaff" -dependencies = [ - "indexmap", - "somni-parser", -] - -[[package]] -name = "somni-parser" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9ecb2c142aac72bff4d0b35b4907c6625c82d171c7e2f3602f31b614467d88" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_cell" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0530892bb4fa575ee0da4b86f86c667132a94b74bb72160f58ee5a4afec74c23" -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.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "svgbobdoc" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2c04b93fc15d79b39c63218f15e3fdffaa4c227830686e3b7c5f41244eb3e50" -dependencies = [ - "base64", - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-width", -] - -[[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.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" -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_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" - -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] - -[[package]] -name = "typenum" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[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.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - -[[package]] -name = "usb-device" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" -dependencies = [ - "heapless", - "portable-atomic", -] - -[[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.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.53.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" -dependencies = [ - "windows-link", - "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.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - -[[package]] -name = "winnow" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" -dependencies = [ - "memchr", -] - -[[package]] -name = "xtensa-lx" -version = "0.12.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "critical-section", -] - -[[package]] -name = "xtensa-lx-rt" -version = "0.20.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "document-features", - "xtensa-lx", - "xtensa-lx-rt-proc-macros", -] - -[[package]] -name = "xtensa-lx-rt-proc-macros" -version = "0.4.0" -source = "git+https://github.com/esp-rs/esp-hal#caadbbba4171022a73368bdcffc0116249237dd6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] diff --git a/firmware/Cargo.toml b/firmware/Cargo.toml deleted file mode 100644 index 4b570e1..0000000 --- a/firmware/Cargo.toml +++ /dev/null @@ -1,56 +0,0 @@ -[package] -edition = "2021" -name = "acid-firmware" -rust-version = "1.86" -version = "0.1.0" - -[[bin]] -name = "acid-firmware" -path = "./src/bin/main.rs" - -[dependencies] -# TODO: Remove the `git = ...` fields, which are here because IntelliSense is broken in 1.0.0-rc.0 -esp-bootloader-esp-idf = { version = "0.2.0", git = "https://github.com/esp-rs/esp-hal", features = ["esp32s3"] } -esp-hal = { version = "=1.0.0-rc.0", git = "https://github.com/esp-rs/esp-hal", features = [ - "esp32s3", - "log-04", - "unstable", - "psram", -] } -log = "0.4.27" - -critical-section = "1.2.0" -embassy-executor = { version = "0.9.0", features = [ - "log", - # "task-arena-size-20480", -] } -embassy-time = { version = "0.4.0", features = ["log"] } -esp-alloc = { version = "0.8.0", git = "https://github.com/esp-rs/esp-hal" } -esp-backtrace = { version = "0.17.0", git = "https://github.com/esp-rs/esp-hal", features = [ - "esp32s3", - # "exception-handler", - "panic-handler", - "println", -] } -esp-hal-embassy = { version = "0.9.0", git = "https://github.com/esp-rs/esp-hal", features = ["esp32s3", "log-04"] } -esp-println = { version = "0.15.0", git = "https://github.com/esp-rs/esp-hal", features = ["esp32s3", "log-04"] } -static_cell = "2.1.1" -itertools = { version = "0.14.0", default-features = false } -bitflags = "2.9.4" -paste = "1.0.15" -lazy_static = { version = "1.5.0", features = ["spin_no_std"], default-features = false } - - -[profile.dev] -# Rust debug is too slow. -# For debug builds always builds with some optimization -opt-level = "s" - -[profile.release] -codegen-units = 1 # LLVM can perform better optimizations using a single thread -debug = 2 -debug-assertions = false -incremental = false -lto = 'fat' -opt-level = 's' -overflow-checks = false diff --git a/firmware/README.md b/firmware/README.md deleted file mode 100644 index cf10996..0000000 --- a/firmware/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Building and running - -``` -cargo build --release && espflash flash --port COM5 .\target\xtensa-esp32s3-none-elf\release\acid-firmware --monitor -``` - -A different port may need to be chosen. - -# Monitoring - -``` -espflash monitor -p COM5 -``` - -A different port may need to be chosen. - -# Debugging - -Sometimes the firmware keeps crashing. -Pulling GPIO0 high during reset seems to fix this? diff --git a/firmware/build.rs b/firmware/build.rs deleted file mode 100644 index a76b496..0000000 --- a/firmware/build.rs +++ /dev/null @@ -1,52 +0,0 @@ -fn main() { - linker_be_nice(); - // make sure linkall.x is the last linker script (otherwise might cause problems with flip-link) - println!("cargo:rustc-link-arg=-Tlinkall.x"); -} - -fn linker_be_nice() { - let args: Vec = std::env::args().collect(); - if args.len() > 1 { - let kind = &args[1]; - let what = &args[2]; - - match kind.as_str() { - "undefined-symbol" => match what.as_str() { - "_defmt_timestamp" => { - eprintln!(); - eprintln!("💡 `defmt` not found - make sure `defmt.x` is added as a linker script and you have included `use defmt_rtt as _;`"); - eprintln!(); - } - "_stack_start" => { - eprintln!(); - eprintln!("💡 Is the linker script `linkall.x` missing?"); - eprintln!(); - } - "esp_wifi_preempt_enable" - | "esp_wifi_preempt_yield_task" - | "esp_wifi_preempt_task_create" => { - eprintln!(); - eprintln!("💡 `esp-wifi` has no scheduler enabled. Make sure you have the `builtin-scheduler` feature enabled, or that you provide an external scheduler."); - eprintln!(); - } - "embedded_test_linker_file_not_added_to_rustflags" => { - eprintln!(); - eprintln!("💡 `embedded-test` not found - make sure `embedded-test.x` is added as a linker script for tests"); - eprintln!(); - } - _ => (), - }, - // we don't have anything helpful for "missing-lib" yet - _ => { - std::process::exit(1); - } - } - - std::process::exit(0); - } - - println!( - "cargo:rustc-link-arg=-Wl,--error-handling-script={}", - std::env::current_exe().unwrap().display() - ); -} diff --git a/firmware/rust-toolchain.toml b/firmware/rust-toolchain.toml deleted file mode 100644 index a2f5ab5..0000000 --- a/firmware/rust-toolchain.toml +++ /dev/null @@ -1,2 +0,0 @@ -[toolchain] -channel = "esp" diff --git a/firmware/src/bin/main.rs b/firmware/src/bin/main.rs deleted file mode 100644 index 31c0ce6..0000000 --- a/firmware/src/bin/main.rs +++ /dev/null @@ -1,1258 +0,0 @@ -#![no_std] -#![no_main] -#![deny( - clippy::mem_forget, - reason = "mem::forget is generally not safe to do with esp_hal types, especially those \ - holding buffers for the duration of a data transfer." -)] -#![feature(iter_intersperse)] -#![feature(array_windows)] -#![feature(allocator_api)] - -use core::alloc::{GlobalAlloc, Layout}; -use core::future::IntoFuture; -use core::iter::once; - -use acid_firmware::st7701s::{ - CmdCn2bkxsel, CmdCn2bkxselArg0, CmdCn2bkxselArg1, CmdCn2bkxselArg2, CmdCn2bkxselArg3, - CmdCn2bkxselArg4, CmdColmod, CmdColmodArg0, CmdDispon, CmdInvsel, CmdInvselArg0, CmdInvselArg1, - CmdLneset, CmdLnesetArg0, CmdLnesetArg1, CmdMadctl, CmdMadctlArg0, CmdMipiset1, - CmdMipiset1Arg0, CmdNvgamctrl, CmdNvgamctrlArg0, CmdNvgamctrlArg1, CmdNvgamctrlArg10, - CmdNvgamctrlArg11, CmdNvgamctrlArg12, CmdNvgamctrlArg13, CmdNvgamctrlArg14, CmdNvgamctrlArg15, - CmdNvgamctrlArg2, CmdNvgamctrlArg3, CmdNvgamctrlArg4, CmdNvgamctrlArg5, CmdNvgamctrlArg6, - CmdNvgamctrlArg7, CmdNvgamctrlArg8, CmdNvgamctrlArg9, CmdPclks2, CmdPclks2Arg0, CmdPdr1, - CmdPdr1Arg0, CmdPdr2, CmdPdr2Arg0, CmdPorctrl, CmdPorctrlArg0, CmdPorctrlArg1, CmdPvgamctrl, - CmdPvgamctrlArg0, CmdPvgamctrlArg1, CmdPvgamctrlArg10, CmdPvgamctrlArg11, CmdPvgamctrlArg12, - CmdPvgamctrlArg13, CmdPvgamctrlArg14, CmdPvgamctrlArg15, CmdPvgamctrlArg2, CmdPvgamctrlArg3, - CmdPvgamctrlArg4, CmdPvgamctrlArg5, CmdPvgamctrlArg6, CmdPvgamctrlArg7, CmdPvgamctrlArg8, - CmdPvgamctrlArg9, CmdPwctrl1, CmdPwctrl1Arg0, CmdPwctrl2, CmdPwctrl2Arg0, CmdPwctrl3, - CmdPwctrl3Arg0, CmdRgbctrl, CmdRgbctrlArg0, CmdRgbctrlArg1, CmdRgbctrlArg2, CmdSlpout, - CmdTescmd, CmdTescmdArg0, CmdVcoms, CmdVcomsArg0, CmdVghss, CmdVghssArg0, CmdVgls, CmdVglsArg0, - CmdVrhs, CmdVrhsArg0, Command, CustomCommand, -}; -use alloc::boxed::Box; -use alloc::sync::Arc; -use alloc::vec; -use alloc::vec::Vec; -use embassy_executor::Spawner; -use embassy_time::{Duration, Timer}; -use esp_alloc::{EspHeap, HeapRegion, MemoryCapability}; -use esp_backtrace as _; -use esp_hal::clock::CpuClock; -use esp_hal::delay::Delay; -use esp_hal::dma::{ - BurstConfig, Channel, DmaChannel, DmaDescriptor, DmaDescriptorFlags, DmaLoopBuf, DmaRxTxBuf, - DmaTxBuf, ExternalBurstConfig, -}; -use esp_hal::gpio::{ - self, Flex, Input, InputConfig, Level, Output, OutputConfig, OutputPin, Pin, Pull, -}; -use esp_hal::i2c::master::{I2c, I2cAddress}; -use esp_hal::lcd_cam::lcd::dpi::{self, Dpi, Format, FrameTiming}; -use esp_hal::lcd_cam::lcd::i8080::I8080; -use esp_hal::lcd_cam::lcd::{self, ClockMode, DelayMode, Lcd, Phase, Polarity}; -use esp_hal::lcd_cam::{BitOrder, LcdCam}; -use esp_hal::mcpwm::operator::PwmPin; -use esp_hal::mcpwm::{McPwm, PeripheralClockConfig}; -use esp_hal::peripherals::PSRAM; -use esp_hal::psram::{FlashFreq, PsramConfig, PsramSize, SpiRamFreq, SpiTimingConfigCoreClock}; -use esp_hal::rtc_cntl::sleep; -use esp_hal::spi::master::{Address, Command as SpiCommand, DataMode, Spi}; -use esp_hal::time::Rate; -use esp_hal::timer::systimer::SystemTimer; -use esp_hal::{dma_buffers, dma_loop_buffer, dma_tx_buffer, Async}; -use itertools::chain; -use lazy_static::lazy_static; -use log::info; - -extern crate alloc; - -// This creates a default app-descriptor required by the esp-idf bootloader. -// For more information see: -esp_bootloader_esp_idf::esp_app_desc!(); - -static PSRAM_ALLOCATOR: esp_alloc::EspHeap = esp_alloc::EspHeap::empty(); - -#[esp_hal_embassy::main] -async fn main(spawner: Spawner) { - // generator version: 0.5.0 - - esp_println::logger::init_logger_from_env(); - info!("Logger initialized!"); - - let config = esp_hal::Config::default() - .with_cpu_clock(CpuClock::max()) - .with_psram(PsramConfig { - size: PsramSize::AutoDetect, - core_clock: Some(SpiTimingConfigCoreClock::SpiTimingConfigCoreClock80m), - flash_frequency: FlashFreq::default(), - ram_frequency: SpiRamFreq::Freq80m, - }); - let peripherals: esp_hal::peripherals::Peripherals = esp_hal::init(config); - info!("System initialized!"); - - // Use the internal DRAM as the heap. - esp_alloc::heap_allocator!(#[link_section = ".dram2_uninit"] size: 64 * 1024); - info!("Heap initialized! {:#?}", esp_alloc::HEAP.stats()); - - let timer0 = SystemTimer::new(peripherals.SYSTIMER); - esp_hal_embassy::init(timer0.alarm0); - info!("Embassy initialized!"); - - // Initialize the PSRAM allocator. - { - let (psram_offset, psram_size) = esp_hal::psram::psram_raw_parts(&peripherals.PSRAM); - unsafe { - PSRAM_ALLOCATOR.add_region(HeapRegion::new( - psram_offset, - psram_size, - MemoryCapability::External.into(), - )); - } - } - const BUFFER_LEN: usize = core::mem::size_of::() - * (360 + /* TODO: Figure out why more bytes are needed: */ 8) - * 960; - // Note: We just leak this buffer. - let buffer_ptr = unsafe { - // ⚠️ Note: For chips that support DMA to/from PSRAM (ESP32-S3) DMA transfers to/from PSRAM - // have extra alignment requirements. The address and size of the buffer pointed to by each - // descriptor must be a multiple of the cache line (block) size. This is 32 bytes on ESP32-S3. - PSRAM_ALLOCATOR.alloc(Layout::from_size_align(BUFFER_LEN, 32).unwrap()) - }; - let buffer = unsafe { core::slice::from_raw_parts_mut(buffer_ptr, BUFFER_LEN) }; - let burst_config: BurstConfig = ExternalBurstConfig::Size16.into(); - - info!( - "PSRAM SPI burst config: max_compatible_chunk_size={}", - burst_config.max_compatible_chunk_size() - ); - - let dma_buf_descs_len = - esp_hal::dma::descriptor_count(BUFFER_LEN, burst_config.max_compatible_chunk_size(), false); - // Descriptors are initialized by `DmaTxBuf::new`. - let dma_buf_descs = Box::leak(vec![DmaDescriptor::EMPTY; dma_buf_descs_len].into_boxed_slice()); - let mut dma_buf = DmaTxBuf::new(dma_buf_descs, buffer).unwrap(); - // let mut dma_buf = dma_tx_buffer!(BUFFER_LEN).unwrap(); - - // TODO: Spawn some tasks - let _ = spawner; - - // Enable LDO2 - let _ = Output::new(peripherals.GPIO17, Level::High, OutputConfig::default()); - - // let mut x = Spi::new( - // peripherals.SPI2, - // esp_hal::spi::master::Config::default().with_frequency(Rate::from_mhz(1)), // For debugging - // ) - // .unwrap() - // .with_mosi(peripherals.GPIO35) - // .with_sck(peripherals.GPIO36); - - // TODO: Use PWM to control the pwm_pin. - let mut _pwm = McPwm::new(peripherals.MCPWM0, PeripheralClockConfig::with_prescaler(1)); - let mut _pwm_pin = Output::new(peripherals.GPIO21, Level::High, OutputConfig::default()); - - let mut matrix_interrupt = Input::new( - peripherals.GPIO7, - InputConfig::default().with_pull(Pull::Up), - ); - // let mut sda = Flex::new(peripherals.GPIO8); - // let mut scl = Output::new(peripherals.GPIO9, Level::High, OutputConfig::default()); - let mut i2c = I2c::new( - peripherals.I2C0, - esp_hal::i2c::master::Config::default().with_frequency(Rate::from_khz(400)), - ) - .unwrap() - .with_sda(peripherals.GPIO8) - .with_scl(peripherals.GPIO9); - - const I2C_ADDR_MATRIX_LEFT: I2cAddress = I2cAddress::SevenBit(0b0100000); - const I2C_ADDR_MATRIX_RIGHT: I2cAddress = I2cAddress::SevenBit(0b0100001); - - for addr in [I2C_ADDR_MATRIX_LEFT, I2C_ADDR_MATRIX_RIGHT] { - i2c.write(addr, &[0b10010000, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]) - .unwrap(); - } - - let mut sck = Output::new(peripherals.GPIO36, Level::High, OutputConfig::default()); - let mut mosi = Flex::new(peripherals.GPIO35); - let mut cs = Output::new(peripherals.GPIO6, Level::High, OutputConfig::default()); - - mosi.set_input_enable(false); - mosi.set_output_enable(true); - - info!("init sequence writing"); - - // cs.set_low(); - // for op in INIT_SEQUENCE { - // match *op { - // InitOp::WriteComm(data) => spi_write_word(false, data, &mut mosi, &mut sck), - // InitOp::WriteData(data) => spi_write_word(true, data, &mut mosi, &mut sck), - // InitOp::SleepMs(ms) => Timer::after_millis(ms).await, - // _ => panic!(), - // } - // } - // cs.set_high(); - for (subsequence, delay_ms) in &*INIT_SEQUENCE_COMMANDS { - for command in subsequence { - spi_write( - command.address(), - command.args_iter().copied(), - &mut mosi, - &mut sck, - &mut cs, - ); - info!("COMM 0x{:02X}", command.address()); - for arg in command.args_iter() { - info!("DATA 0x{arg:02X}"); - } - } - Timer::after_millis(*delay_ms).await - } - - info!("init sequence written"); - - // Timer::after_secs(1).await; - - // x.half_duplex_write( - // DataMode::Single, - // Command::_9Bit(0xFFFF, DataMode::Single), - // Address::None, - // 0, - // &[], - // ) - // .unwrap(); - - // info!("Derp"); - - let mut lcd = LcdCam::new(peripherals.LCD_CAM).into_async().lcd; - let lcd_config = lcd::dpi::Config::default() - // Internal memory can use the full 16 MHz, but when external PSRAM is used, it cannot keep up with the display. - // For that reason, we choose the highest value for which it doesn't glitch by showing black - // stripes on the screen. - // - // There are three knobs you can turn to improve the bandwidth situation. - // - increase psram frequency - // - decrease the peripheral's frequency - // - prevent flash from being used whilst your program is running. (There's a PR to make - // this easy to do) - // https://github.com/esp-rs/esp-hal/pull/3024 - .with_frequency(Rate::from_mhz(11)) // From Adafruit - .with_clock_mode(ClockMode { - polarity: Polarity::IdleLow, // From Adafruit - phase: Phase::ShiftHigh, // From Adafruit - }) - .with_format(Format { - enable_2byte_mode: true, - ..Default::default() - }) - .with_timing({ - // Adafruit's config for this LCD: - // https://github.com/adafruit/Adafruit_CircuitPython_Qualia/blob/742d336e05e6a4d8bdaa46e15bbf60c9f30d2eba/adafruit_qualia/displays/bar240x960.py#L81-L97 - // https://github.com/adafruit/Adafruit_CircuitPython_Qualia/blob/742d336e05e6a4d8bdaa46e15bbf60c9f30d2eba/adafruit_qualia/displays/__init__.py#L59-L62 - // CircuitPython code handling Adafruit's config - // https://github.com/adafruit/circuitpython/blob/97c6617817e95b1f6aa2ce458778aaa8371de39b/ports/espressif/common-hal/dotclockframebuffer/DotClockFramebuffer.c#L63 - // ESP-IDF peripheral configuration code: - // https://github.com/espressif/esp-idf/blob/800f141f94c0f880c162de476512e183df671307/components/esp_lcd/rgb/esp_lcd_panel_rgb.c#L556 - // Espressif's docs: - // https://docs.espressif.com/projects/esp-idf/en/v5.5.1/esp32s3/api-reference/peripherals/lcd/rgb_lcd.html#structures - - // TODO: Investigate PORCTRL instruction in datasheet of ST7701 - let horizontal_resolution: usize = 240; - let vertical_resolution = 960; - let overscan_left = 120; - let vsync_width = 8; - let hsync_width = 8; - let horizontal_blank_front_porch = 20; - let horizontal_blank_back_porch = 20; - let vertical_blank_front_porch = 20; - let vertical_blank_back_porch = 20; - let hsync_position = 0; - let horizontal_active_width = (horizontal_resolution + overscan_left).div_ceil(16) * 16; // Round up to a multiple of 16. - let vertical_active_height = vertical_resolution; - FrameTiming { - horizontal_total_width: hsync_width - + horizontal_blank_back_porch - + horizontal_active_width - + horizontal_blank_front_porch, - vertical_total_height: vsync_width - + vertical_blank_back_porch - + vertical_active_height - + vertical_blank_front_porch, - horizontal_blank_front_porch: horizontal_blank_front_porch + hsync_width, - vertical_blank_front_porch: vertical_blank_front_porch + vsync_width, - horizontal_active_width, - vertical_active_height, - vsync_width, - hsync_width, - hsync_position, - } - }) - .with_hsync_idle_level(Level::High) - .with_vsync_idle_level(Level::High) - .with_de_idle_level(Level::Low); - - // let mut dma_buf = dma_loop_buffer!(2 * 32); - // let mut dma_buf = dma_tx_buffer!(2 * 960 * 320 / 4).unwrap(); - - // let tx_buf = dma_tx_buffer!(core::mem::size_of::() * 280 * 1000).unwrap(); - // let (c_rx, c_tx) = peripherals.DMA_CH0.split(); - // TODO: https://github.com/esp-rs/esp-hal/blob/main/qa-test/src/bin/lcd_dpi.rs - let mut dpi = Dpi::new(lcd, peripherals.DMA_CH2, lcd_config) - .unwrap() - .with_de(peripherals.GPIO37) - .with_pclk(peripherals.GPIO34) - .with_hsync(peripherals.GPIO44) - .with_vsync(peripherals.GPIO43) - // Blue - .with_data0(peripherals.GPIO38) - .with_data1(peripherals.GPIO39) - .with_data2(peripherals.GPIO40) - .with_data3(peripherals.GPIO41) - .with_data4(peripherals.GPIO42) - // Green - .with_data5(peripherals.GPIO5) - .with_data6(peripherals.GPIO12) - .with_data7(peripherals.GPIO13) - .with_data8(peripherals.GPIO14) - .with_data9(peripherals.GPIO15) - .with_data10(peripherals.GPIO16) - // Red - .with_data11(peripherals.GPIO0) - .with_data12(peripherals.GPIO1) - .with_data13(peripherals.GPIO2) - .with_data14(peripherals.GPIO3) - .with_data15(peripherals.GPIO4); - - const MAX_RED: u8 = (1 << 5) - 1; - const MAX_GREEN: u8 = (1 << 6) - 1; - const MAX_BLUE: u8 = (1 << 5) - 1; - - fn rgb(r: u8, g: u8, b: u8) -> u16 { - (((r & MAX_RED) as u16) << 11) | (((g & MAX_GREEN) as u16) << 5) | ((b & MAX_BLUE) as u16) - } - - // let mut colors = core::iter::empty() - // // Start with red and gradually add green - // .chain((0..=MAX_GREEN).map(|g| rgb(MAX_RED, g, 0))) - // // Then remove the red - // .chain((0..=MAX_RED).rev().map(|r| rgb(r, MAX_GREEN, 0))) - // // Then add blue - // .chain((0..=MAX_BLUE).map(|b| rgb(0, MAX_GREEN, b))) - // // Then remove green - // .chain((0..=MAX_GREEN).rev().map(|g| rgb(0, g, MAX_BLUE))) - // // Then add red - // .chain((0..=MAX_RED).map(|r| rgb(r, 0, MAX_BLUE))) - // // Then remove blue - // .chain((0..=MAX_BLUE).rev().map(|b| rgb(MAX_RED, 0, b))) - // // Once we get we have red, and we can start again. - // .cycle(); - // let mut colors = colors - // .take(len - 10) - // .chain(core::iter::repeat_n(0, 10)) - // .cycle(); - - // This is wrong, only a left padding of 120 should be needed. - // const padding_left: usize = 120; - // const padding_right: usize = 0; - const padding_left: usize = 121; - const padding_right: usize = 7; - - const colors_width: usize = 240; - const colors_height: usize = 960; - - fn row(edge: u16) -> impl Iterator + Clone { - chain![ - core::iter::repeat_n(rgb(0, 0, 0xFF), padding_left), - core::iter::once(rgb(0xFF, 0xFF, 0xFF)), - core::iter::repeat_n(edge, colors_width - 2), - core::iter::once(rgb(0xFF, 0xFF, 0xFF)), - core::iter::repeat_n(rgb(0, 0, 0xFF), padding_right), - ] - }; - - let mut colors = chain![ - row(rgb(0xFF, 0, 0)), - core::iter::repeat_n(row(0), colors_height - 2).flatten(), - row(rgb(0xFF, 0xFF, 0)), - ]; - - // for _ in 0..120 { - // colors.next(); - // } - - // let write = |command: u8, args: &[u8]| { - // // TODO: 3-wire SPI requires 9-bit words, where each 8-bit word is prefixed by 1 bit - // // signifying whether the word is a parameter or not. - // // Interleave into a buffer and terminate with NOP commands. - // x.half_duplex_write( - // DataMode::Single, - // Command::_9Bit(command as u16, DataMode::Single), - // Address::None, - // 0, - // &[], - // ) - // .unwrap(); - // }; - - let mut i = 0; - - loop { - // LCD stuff - { - // let mut buf = [0u8; 3]; - // x.half_duplex_read( - // DataMode::Single, - // Command::_9Bit(0x04, DataMode::Single), - // Address::None, - // 1, - // &mut buf, - // ) - // .unwrap(); - let mut buf = [0_u8, 0, 0]; - spi_read( - 0xDA, - false, - &mut mosi, - &mut sck, - &mut cs, - &mut buf[0..][..1], - ); - spi_read( - 0xDB, - false, - &mut mosi, - &mut sck, - &mut cs, - &mut buf[1..][..1], - ); - spi_read( - 0xDC, - false, - &mut mosi, - &mut sck, - &mut cs, - &mut buf[2..][..1], - ); - let mut buf2 = [0_u8, 0, 0]; - spi_read(0x04, true, &mut mosi, &mut sck, &mut cs, &mut buf2); - // info!("Hello world! {buf:02x?} {buf2:02x?}"); - - if i == 0 { - for (chunk, color) in dma_buf.as_mut_slice().chunks_mut(2).zip(&mut colors) { - chunk.copy_from_slice(&color.to_le_bytes()); - } - - info!("chunk addr: {}", dma_buf.as_slice().as_ptr() as usize); - // colors.next(); // Shift colors - } - - let transfer = dpi.send(false, dma_buf).map_err(|e| e.0).unwrap(); - (_, dpi, dma_buf) = transfer.wait(); - } - - // IO stuff - { - let mut input_register_banks = [0_u8; 10]; - i2c.write_read( - I2C_ADDR_MATRIX_LEFT, - &[0x80], - &mut input_register_banks[..5], - ) - .unwrap(); - i2c.write_read( - I2C_ADDR_MATRIX_RIGHT, - &[0x80], - &mut input_register_banks[5..], - ) - .unwrap(); - let mut rows = [0_u16; 5]; - for (row, (left, right)) in rows.iter_mut().zip(core::iter::zip( - &input_register_banks[..5], - &input_register_banks[5..], - )) { - *row = *left as u16 | ((*right as u16) << 6); - } - info!("rows: {rows:x?}") - } - - i += 1; - - // x.half_duplex_write( - // DataMode::Single, - // Command::_9Bit(0xFFFF, DataMode::Single), - // Address::None, - // 0, - // &[0x77], - // ) - // .unwrap(); - // Timer::after(Duration::from_secs(1)).await; - } - - // for inspiration have a look at the examples at https://github.com/esp-rs/esp-hal/tree/esp-hal-v1.0.0-rc.0/examples/src/bin -} - -fn spi_delay() { - Delay::new().delay_micros(1); -} - -fn spi_dummy_bit(sck: &mut Output) { - sck.set_low(); - spi_delay(); - sck.set_high(); - spi_delay(); -} - -fn spi_write_bit(bit: bool, mosi: &mut Flex, sck: &mut Output) { - mosi.set_level(if bit { Level::High } else { Level::Low }); - sck.set_low(); - spi_delay(); - sck.set_high(); - spi_delay(); -} - -fn spi_read_bit(mosi: &mut Flex, sck: &mut Output) -> bool { - sck.set_low(); - spi_delay(); - sck.set_high(); - spi_delay(); - mosi.is_high() -} - -fn spi_write_bits(bits: impl Iterator, mosi: &mut Flex, sck: &mut Output) { - for bit in bits { - spi_write_bit(bit, mosi, sck); - } -} - -fn spi_write_word(is_param: bool, data: u8, mosi: &mut Flex, sck: &mut Output) { - assert!(sck.is_set_high()); - spi_write_bits( - once(is_param).chain((0..8).map(|i| (data >> i) & 1 != 0).rev()), - mosi, - sck, - ); -} - -fn spi_write( - command: u8, - args: impl IntoIterator, - mosi: &mut Flex, - sck: &mut Output, - cs: &mut Output, -) { - cs.set_low(); - spi_write_word(false, command, mosi, sck); - - for arg in args { - spi_write_word(true, arg, mosi, sck); - } - - cs.set_high(); -} - -fn spi_read( - command: u8, - dummy_cycle: bool, - mosi: &mut Flex, - sck: &mut Output, - cs: &mut Output, - output_buffer: &mut [u8], -) { - output_buffer.fill(0); - - cs.set_low(); - spi_write_word(false, command, mosi, sck); - - mosi.set_output_enable(false); - mosi.set_input_enable(true); - - if dummy_cycle { - spi_dummy_bit(sck); - } - - for output_byte in output_buffer { - for i in (0..8).rev() { - if spi_read_bit(mosi, sck) { - *output_byte |= 1 << i; - } - } - } - - mosi.set_input_enable(false); - mosi.set_output_enable(true); - - cs.set_high(); -} - -#[derive(Clone, Copy)] -enum InitOp { - Command(u8, &'static [u8]), - WriteComm(u8), - WriteData(u8), - SleepMs(u64), -} - -// impl InitOp { -// async fn execute<'a>(&'a self, mosi: &'a mut Output<'a>, sck: &'a mut Output<'a>) { -// match *self { -// InitOp::WriteComm(data) => spi_write(false, data, mosi, sck), -// InitOp::WriteData(data) => spi_write(true, data, mosi, sck), -// InitOp::SleepMs(ms) => Timer::after_millis(ms).await, -// } -// } -// } - -use InitOp::*; - -lazy_static! { - static ref INIT_SEQUENCE_COMMANDS: Vec<(Vec>, u64)> = vec![ - (vec![ - Box::new(CmdCn2bkxsel( - CmdCn2bkxselArg0::new(), - CmdCn2bkxselArg1::new(), - CmdCn2bkxselArg2::new(), - CmdCn2bkxselArg3::new(), - CmdCn2bkxselArg4::new().with_bksel(0x3).with_cn2(true), - )), - Box::new(CustomCommand { - address: 0xEF, - args: &[0x08], - }), - Box::new(CmdCn2bkxsel( - CmdCn2bkxselArg0::new(), - CmdCn2bkxselArg1::new(), - CmdCn2bkxselArg2::new(), - CmdCn2bkxselArg3::new(), - CmdCn2bkxselArg4::new().with_bksel(0x0).with_cn2(true), - )), - Box::new(CmdLneset( - CmdLnesetArg0::new().with_bar(119).with_lde_en(false), - CmdLnesetArg1::new().with_line_delta(0), - )), - Box::new(CmdPorctrl( - CmdPorctrlArg0::new().with_vbp(17), - CmdPorctrlArg1::new().with_vfp(12), - )), - Box::new(CmdInvsel( - CmdInvselArg0::new().with_nlinv(0b111), - CmdInvselArg1::new().with_rtni(2), - )), - Box::new(CustomCommand { - address: 0xCC, - args: &[0x30], - }), - Box::new(CmdPvgamctrl( - CmdPvgamctrlArg0::new().with_vc0p(6).with_aj0p(0), - CmdPvgamctrlArg1::new().with_vc4p(15).with_aj1p(3), - CmdPvgamctrlArg2::new().with_vc8p(14).with_aj2p(0), - CmdPvgamctrlArg3::new().with_vc16p(12), - CmdPvgamctrlArg4::new().with_vc24p(15).with_aj3p(0), - CmdPvgamctrlArg5::new().with_vc52p(3), - CmdPvgamctrlArg6::new().with_vc80p(0), - CmdPvgamctrlArg7::new().with_vc108p(10), - CmdPvgamctrlArg8::new().with_vc147p(7), - CmdPvgamctrlArg9::new().with_vc175p(27), - CmdPvgamctrlArg10::new().with_vc203p(3), - CmdPvgamctrlArg11::new().with_vc231p(18).with_aj4p(0), - CmdPvgamctrlArg12::new().with_vc239p(16), - CmdPvgamctrlArg13::new().with_vc247p(37).with_aj5p(0), - CmdPvgamctrlArg14::new().with_vc251p(54).with_aj6p(0), - CmdPvgamctrlArg15::new().with_vc255p(30).with_aj7p(0), - )), - Box::new(CmdNvgamctrl( - CmdNvgamctrlArg0::new().with_vc0n(12).with_aj0n(0), - CmdNvgamctrlArg1::new().with_vc4n(14).with_aj1n(3), - CmdNvgamctrlArg2::new().with_vc8n(18).with_aj2n(0), - CmdNvgamctrlArg3::new().with_vc16n(12), - CmdNvgamctrlArg4::new().with_vc24n(14).with_aj3n(0), - CmdNvgamctrlArg5::new().with_vc52n(6), - CmdNvgamctrlArg6::new().with_vc80n(3), - CmdNvgamctrlArg7::new().with_vc108n(6), - CmdNvgamctrlArg8::new().with_vc147n(8), - CmdNvgamctrlArg9::new().with_vc175n(35), - CmdNvgamctrlArg10::new().with_vc203n(6), - CmdNvgamctrlArg11::new().with_vc231n(18).with_aj4n(0), - CmdNvgamctrlArg12::new().with_vc239n(16), - CmdNvgamctrlArg13::new().with_vc247n(48).with_aj5n(0), - CmdNvgamctrlArg14::new().with_vc251n(47).with_aj6n(0), - CmdNvgamctrlArg15::new().with_vc255n(31).with_aj7n(0), - )), - Box::new(CmdCn2bkxsel( - CmdCn2bkxselArg0::new(), - CmdCn2bkxselArg1::new(), - CmdCn2bkxselArg2::new(), - CmdCn2bkxselArg3::new(), - CmdCn2bkxselArg4::new().with_bksel(0x1).with_cn2(true), - )), - Box::new(CmdVrhs( - CmdVrhsArg0::new().with_vrha(115), - )), - Box::new(CmdVcoms( - CmdVcomsArg0::new().with_vcom(124), - )), - Box::new(CmdVghss( - // The first bit is set to 1 in the original init code, but not here. - CmdVghssArg0::new().with_vghss(0x3), // 13 V - )), - Box::new(CmdTescmd( - CmdTescmdArg0::new(), - )), - Box::new(CmdVgls( - CmdVglsArg0::new().with_vgls(0x9) // -10.17 V - )), - Box::new(CmdPwctrl1( - CmdPwctrl1Arg0::new() - .with_apos(0x3) // Max - .with_apis(0x1) // Min - .with_ap(0x2) // Middle - )), - Box::new(CmdPwctrl2( - CmdPwctrl2Arg0::new() - .with_avcl(0x3) // -5 V - .with_avdd(0x3) // 6.8 V - )), - Box::new(CmdPwctrl3( - CmdPwctrl3Arg0::new() - .with_svno_pum(0) // Cell setting 4 - .with_svpo_pum(0x1) // Cell setting 5 - )), - Box::new(CmdPclks2( - CmdPclks2Arg0::new().with_sbstcks(0x3) - )), - Box::new(CmdPdr1( - CmdPdr1Arg0::new().with_t2d(8) // 1.6 us - )), - Box::new(CmdPdr2( - CmdPdr2Arg0::new().with_t3d(8) // 6.4 us - )), - Box::new(CmdMipiset1( - CmdMipiset1Arg0::new().with_err_sel(0).with_eotp_en(true), - )), - Box::new(CustomCommand { - address: 0xE0, - args: &[ - 0x00, - 0x00, - 0x02, - 0x00, - 0x00, - 0x0C, - ] - }), - Box::new(CustomCommand { - address: 0xE1, - args: &[ - 0x05, - 0x96, - 0x07, - 0x96, - 0x06, - 0x96, - 0x08, - 0x96, - 0x00, - 0x44, - 0x44, - ] - }), - Box::new(CustomCommand { - address: 0xE2, - args: &[ - 0x00, - 0x00, - 0x03, - 0x03, - 0x00, - 0x00, - 0x02, - 0x00, - 0x00, - 0x00, - 0x02, - 0x00, - ] - }), - Box::new(CustomCommand { - address: 0xE3, - args: &[ - 0x00, - 0x00, - 0x33, - 0x33, - ] - }), - Box::new(CustomCommand { - address: 0xE4, - args: &[ - 0x44, - 0x44, - ] - }), - Box::new(CustomCommand { - address: 0xE5, - args: &[ - 0x0D, - 0xD4, - 0x28, - 0x8C, - 0x0F, - 0xD6, - 0x28, - 0x8C, - 0x09, - 0xD0, - 0x28, - 0x8C, - 0x0B, - 0xD2, - 0x28, - 0x8C, - ] - }), - Box::new(CustomCommand { - address: 0xE6, - args: &[ - 0x00, - 0x00, - 0x33, - 0x33, - ] - }), - Box::new(CustomCommand { - address: 0xE7, - args: &[ - 0x44, - 0x44, - ] - }), - Box::new(CustomCommand { - address: 0xE8, - args: &[ - 0x0E, - 0xD5, - 0x28, - 0x8C, - 0x10, - 0xD7, - 0x28, - 0x8C, - 0x0A, - 0xD1, - 0x28, - 0x8C, - 0x0C, - 0xD3, - 0x28, - 0x8C, - ] - }), - Box::new(CustomCommand { - address: 0xEB, - args: &[ - 0x00, - 0x01, - 0xE4, - 0xE4, - 0x44, - 0x00, - ] - }), - Box::new(CustomCommand { - address: 0xED, - args: &[ - 0xF3, - 0xC1, - 0xBA, - 0x0F, - 0x66, - 0x77, - 0x44, - 0x55, - 0x55, - 0x44, - 0x77, - 0x66, - 0xF0, - 0xAB, - 0x1C, - 0x3F, - ] - }), - Box::new(CustomCommand { - address: 0xEF, - args: &[ - 0x10, - 0x0D, - 0x04, - 0x08, - 0x3F, - 0x1F, - ] - }), - Box::new(CmdCn2bkxsel( - CmdCn2bkxselArg0::new(), - CmdCn2bkxselArg1::new(), - CmdCn2bkxselArg2::new(), - CmdCn2bkxselArg3::new(), - CmdCn2bkxselArg4::new().with_bksel(0x3).with_cn2(true), - )), - Box::new(CustomCommand { - address: 0xE8, - args: &[ - 0x00, - 0x0E, - ], - }), - Box::new(CmdSlpout()), - ], 120), - (vec![ - Box::new(CustomCommand { - address: 0xE8, - args: &[ - 0x00, - 0x0C, - ], - }), - ], 10), - (vec![ - Box::new(CustomCommand { - address: 0xE8, - args: &[ - 0x40, - 0x00, - ], - }), - Box::new(CmdCn2bkxsel( - CmdCn2bkxselArg0::new(), - CmdCn2bkxselArg1::new(), - CmdCn2bkxselArg2::new(), - CmdCn2bkxselArg3::new(), - CmdCn2bkxselArg4::new().with_bksel(0).with_cn2(false), - )), - Box::new(CmdMadctl( - CmdMadctlArg0::new().with_bgr(false).with_ml(false), - )), - Box::new(CmdColmod( - CmdColmodArg0::new().with_vipf(6) // 18-bit pixel - )), - Box::new(CmdDispon()), - ], 20), - // (vec![ - // Box::new(CmdCn2bkxsel( - // CmdCn2bkxselArg0::new(), - // CmdCn2bkxselArg1::new(), - // CmdCn2bkxselArg2::new(), - // CmdCn2bkxselArg3::new(), - // CmdCn2bkxselArg4::new().with_bksel(0).with_cn2(true), - // )), - // Box::new(CmdPorctrl( - // CmdPorctrlArg0::new().with_vbp(0xFF), - // CmdPorctrlArg1::new().with_vfp(0x0), - // )), - // // Box::new(CmdRgbctrl( - // // CmdRgbctrlArg0::new() - // // .with_ep(false) - // // .with_dp(false) - // // .with_hsp(false) - // // .with_vsp(false) - // // .with_de_hv(true), - // // CmdRgbctrlArg1::new() - // // .with_hbp_hvrgb(16), - // // CmdRgbctrlArg2::new() - // // .with_vbp_hvrgb(8), - // // )), - // Box::new(CmdCn2bkxsel( - // CmdCn2bkxselArg0::new(), - // CmdCn2bkxselArg1::new(), - // CmdCn2bkxselArg2::new(), - // CmdCn2bkxselArg3::new(), - // CmdCn2bkxselArg4::new().with_bksel(0).with_cn2(false), - // )), - // ], 20), - ]; -} - -const INIT_SEQUENCE: &[InitOp] = &[ - WriteComm(0xff), - WriteData(0x77), - WriteData(0x01), - WriteData(0x00), - WriteData(0x00), - WriteData(0x13), - WriteComm(0xef), - WriteData(0x08), - WriteComm(0xff), - WriteData(0x77), - WriteData(0x01), - WriteData(0x00), - WriteData(0x00), - WriteData(0x10), - WriteComm(0xc0), - WriteData(0x77), - WriteData(0x00), - WriteComm(0xc1), - WriteData(0x11), - WriteData(0x0c), - WriteComm(0xc2), - WriteData(0x07), - WriteData(0x02), - WriteComm(0xcc), - WriteData(0x30), - // - WriteComm(0xB0), - WriteData(0x06), - WriteData(0xCF), - WriteData(0x14), - WriteData(0x0C), - WriteData(0x0F), - WriteData(0x03), - WriteData(0x00), - WriteData(0x0A), - WriteData(0x07), - WriteData(0x1B), - WriteData(0x03), - WriteData(0x12), - WriteData(0x10), - WriteData(0x25), - WriteData(0x36), - WriteData(0x1E), - // - WriteComm(0xB1), - WriteData(0x0C), - WriteData(0xD4), - WriteData(0x18), - WriteData(0x0C), - WriteData(0x0E), - WriteData(0x06), - WriteData(0x03), - WriteData(0x06), - WriteData(0x08), - WriteData(0x23), - WriteData(0x06), - WriteData(0x12), - WriteData(0x10), - WriteData(0x30), - WriteData(0x2F), - WriteData(0x1F), - // - WriteComm(0xff), - WriteData(0x77), - WriteData(0x01), - WriteData(0x00), - WriteData(0x00), - WriteData(0x11), - // - WriteComm(0xb0), - WriteData(0x73), - // - WriteComm(0xb1), - WriteData(0x7C), - // - WriteComm(0xb2), - WriteData(0x83), - // - WriteComm(0xb3), - WriteData(0x80), - // - WriteComm(0xb5), - WriteData(0x49), - // - WriteComm(0xb7), - WriteData(0x87), - // - WriteComm(0xb8), - WriteData(0x33), - // - WriteComm(0xb9), - WriteData(0x10), - WriteData(0x1f), // ??? - // - WriteComm(0xbb), - WriteData(0x03), - // - WriteComm(0xc1), - WriteData(0x08), - // - WriteComm(0xc2), - WriteData(0x08), - // - WriteComm(0xd0), - WriteData(0x88), - // TODO: Unknown command - WriteComm(0xe0), - WriteData(0x00), - WriteData(0x00), - WriteData(0x02), - WriteData(0x00), - WriteData(0x00), - WriteData(0x0c), - // TODO: Unknown command - WriteComm(0xe1), - WriteData(0x05), - WriteData(0x96), - WriteData(0x07), - WriteData(0x96), - WriteData(0x06), - WriteData(0x96), - WriteData(0x08), - WriteData(0x96), - WriteData(0x00), - WriteData(0x44), - WriteData(0x44), - // TODO: Unknown command - WriteComm(0xe2), - WriteData(0x00), - WriteData(0x00), - WriteData(0x03), - WriteData(0x03), - WriteData(0x00), - WriteData(0x00), - WriteData(0x02), - WriteData(0x00), - WriteData(0x00), - WriteData(0x00), - WriteData(0x02), - WriteData(0x00), - // TODO: Unknown command - WriteComm(0xe3), - WriteData(0x00), - WriteData(0x00), - WriteData(0x33), - WriteData(0x33), - // TODO: Unknown command - WriteComm(0xe4), - WriteData(0x44), - WriteData(0x44), - // TODO: Unknown command - WriteComm(0xe5), - WriteData(0x0d), - WriteData(0xd4), - WriteData(0x28), - WriteData(0x8c), - WriteData(0x0f), - WriteData(0xd6), - WriteData(0x28), - WriteData(0x8c), - WriteData(0x09), - WriteData(0xd0), - WriteData(0x28), - WriteData(0x8c), - WriteData(0x0b), - WriteData(0xd2), - WriteData(0x28), - WriteData(0x8c), - // TODO: Unknown command - WriteComm(0xe6), - WriteData(0x00), - WriteData(0x00), - WriteData(0x33), - WriteData(0x33), - // TODO: Unknown command - WriteComm(0xe7), - WriteData(0x44), - WriteData(0x44), - // TODO: Unknown command - WriteComm(0xe8), - WriteData(0x0e), - WriteData(0xd5), - WriteData(0x28), - WriteData(0x8c), - WriteData(0x10), - WriteData(0xd7), - WriteData(0x28), - WriteData(0x8c), - WriteData(0x0a), - WriteData(0xd1), - WriteData(0x28), - WriteData(0x8c), - WriteData(0x0c), - WriteData(0xd3), - WriteData(0x28), - WriteData(0x8c), - // TODO: Unknown command - WriteComm(0xeb), - WriteData(0x00), - WriteData(0x01), - WriteData(0xe4), - WriteData(0xe4), - WriteData(0x44), - WriteData(0x00), - // TODO: Unknown command - WriteComm(0xed), - WriteData(0xf3), - WriteData(0xc1), - WriteData(0xba), - WriteData(0x0f), - WriteData(0x66), - WriteData(0x77), - WriteData(0x44), - WriteData(0x55), - WriteData(0x55), - WriteData(0x44), - WriteData(0x77), - WriteData(0x66), - WriteData(0xf0), - WriteData(0xab), - WriteData(0x1c), - WriteData(0x3f), - // TODO: Unknown command - WriteComm(0xef), - WriteData(0x10), - WriteData(0x0d), - WriteData(0x04), - WriteData(0x08), - WriteData(0x3f), - WriteData(0x1f), - // - WriteComm(0xff), - WriteData(0x77), - WriteData(0x01), - WriteData(0x00), - WriteData(0x00), - WriteData(0x13), - // TODO: Unknown command - WriteComm(0xe8), - WriteData(0x00), - WriteData(0x0e), - // - WriteComm(0x11), - SleepMs(120), - // TODO: Unknown command - WriteComm(0xe8), - WriteData(0x00), - WriteData(0x0c), - SleepMs(10), - // TODO: Unknown command - WriteComm(0xe8), - WriteData(0x40), - WriteData(0x00), - // - WriteComm(0xff), - WriteData(0x77), - WriteData(0x01), - WriteData(0x00), - WriteData(0x00), - WriteData(0x00), - // - WriteComm(0x36), - WriteData(0x00), - // - WriteComm(0x3A), - WriteData(0x66), - // - WriteComm(0x29), - SleepMs(20), - /* - WriteComm (0xff); - WriteData (0x77); - WriteData (0x01); - WriteData (0x00); - WriteData (0x00); - WriteData (0x10); - WriteComm (0xe5); - WriteData (0x00); - WriteData (0x00); - */ -]; diff --git a/firmware/src/lib.rs b/firmware/src/lib.rs deleted file mode 100644 index 4b08017..0000000 --- a/firmware/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![no_std] -#![deny(clippy::mem_forget)] -#![feature(macro_metavar_expr)] - -pub mod st7701s; diff --git a/firmware/src/st7701s.rs b/firmware/src/st7701s.rs deleted file mode 100644 index 587c2cf..0000000 --- a/firmware/src/st7701s.rs +++ /dev/null @@ -1,1212 +0,0 @@ -use bitflags::bitflags; -use esp_hal::gpio::OutputPin; -use paste::paste; - -pub trait Command { - fn address(&self) -> u8; - fn args_iter(&'_ self) -> core::slice::Iter<'_, u8>; -} - -pub struct CustomCommand { - pub address: u8, - pub args: &'static [u8], -} - -impl Command for CustomCommand { - fn address(&self) -> u8 { - self.address - } - - fn args_iter(&'_ self) -> core::slice::Iter<'_, u8> { - self.args.iter() - } -} - -macro_rules! define_arg { - (@field ($field:ident: $min:literal..=$max:literal)) => { - paste! { - #[allow(unused, clippy::identity_op)] - pub const fn [](mut self, val: u8) -> Self { - const MASK: u8 = ((1 << ($max - $min + 1)) - 1); - self.0 &= !(MASK << $min); // Clear bits - self.0 |= (val & MASK) << $min; // Assign bits - self - } - } - }; - - (@field ($field:ident: $index:literal)) => { - paste! { - #[allow(unused)] - pub const fn [](mut self, val: bool) -> Self { - self.0 &= !(1 << $index); // Clear bit - self.0 |= (val as u8) << $index; // Assign bit - self - } - } - }; - - (@field ($field:ident)) => { - paste! { - #[allow(unused)] - pub const fn [](mut self, val: u8) -> Self { - self.0 = val; - self - } - } - }; - - ($visibility:vis struct $type:ident { - const INIT = $init:literal; - $($field:ident $(: $min:literal$(..=$max:literal)?)?),*$(,)? - }) => { - #[derive(Clone, Copy)] - $visibility struct $type(u8); - - impl Default for $type { - fn default() -> Self { - Self::new() - } - } - - #[allow(unused)] - impl $type { - pub const fn new() -> Self { - Self($init) - } - - pub const fn into_byte(self) -> u8 { - self.0 - } - - $( - define_arg!(@field ($field $(: $min$(..=$max)?)?)); - )* - } - }; - - ($visibility:vis struct $type:ident { - $field:ident $(,)? - }) => { - #[derive(Clone, Copy)] - $visibility struct $type(u8); - - impl Default for $type { - fn default() -> Self { - Self::new() - } - } - - #[allow(unused)] - impl $type { - pub const fn new() -> Self { - Self(0) - } - - pub const fn into_byte(self) -> u8 { - self.0 - } - - define_arg!(@field ($field)); - } - }; -} - -macro_rules! define_commands { - ($( - $(#[$docs:meta])* - $visibility:vis command $command:ident { - const ADDRESS = $address:literal; - $( - arg { - $($body:tt)* - } - )* - } - )*) => { - paste! { - $( - $( - define_arg!($visibility struct [< Cmd $command Arg ${index()}>] { $($body)* }); - )* - - #[repr(C)] - #[derive(Default)] - $(#[$docs])* - $visibility struct [< Cmd $command >]($(pub [< Cmd $command Arg ${index()} >], $(${ignore($body)})*)*); - - impl Command for [< Cmd $command >] { - fn address(&self) -> u8 { - $address - } - - fn args_iter(&'_ self) -> core::slice::Iter<'_, u8> { - self.into_iter() - } - } - - impl<'a> IntoIterator for &'a [< Cmd $command >] { - type Item = &'a u8; - type IntoIter = core::slice::Iter<'a, u8>; - - fn into_iter(self) -> Self::IntoIter { - unsafe { - core::slice::from_raw_parts( - self as *const [< Cmd $command >] as *const u8, - 0 $(+ 1 $(${ignore($body)})*)*, - ) - }.iter() - } - } - )* - } - }; -} - -define_commands! { - // System function command table 1 - - #[doc="No operation"] - pub command Nop { - const ADDRESS = 0x00; - } - - #[doc="Software reset"] - pub command Swreset { - const ADDRESS = 0x01; - } - - #[doc="ID read"] - pub command Rddid { - const ADDRESS = 0x04; - arg { id1 } - arg { id2 } - arg { id3 } - } - - #[doc="ID read"] - pub command Rdnumed { - const ADDRESS = 0x05; - arg { - const INIT = 0b0000_0000; - err: 0..=6, - err_over: 7, - } - } - - #[doc="Read the first pixel of color R"] - pub command Rdred { - const ADDRESS = 0x06; - arg { r_1st } - } - - #[doc="Read the first pixel of color G"] - pub command Rdgreen { - const ADDRESS = 0x07; - arg { g_1st } - } - - #[doc="Read the first pixel of color B"] - pub command Rdblue { - const ADDRESS = 0x08; - arg { b_1st } - } - - #[doc="Read display power mode"] - pub command Rddpm { - const ADDRESS = 0x0A; - arg { - const INIT = 0b0000_1000; - dison: 2, - slpout: 4, - bston: 7, - } - } - - #[doc="Read display MADCTR"] - pub command Rddmadctl { - const ADDRESS = 0x0B; - arg { - const INIT = 0b0000_1000; - bgr: 3, - ml: 4, - } - } - - #[doc="Read display pixel format"] - pub command Rddcolmod { - const ADDRESS = 0x0C; - arg { - const INIT = 0b0000_0000; - vipf: 5..=6, - } - } - - #[doc="Read display image mode"] - pub command Rddim { - const ADDRESS = 0x0D; - arg { - const INIT = 0b0000_0000; - gcs: 0..=2, - alpxloff: 3, - alpxlon: 4, - invon: 5, - } - } - - #[doc="Read display signal mode"] - pub command Rddsm { - const ADDRESS = 0x0E; - arg { - const INIT = 0b0000_0000; - telmd: 6, - teon: 7, - } - } - - #[doc="Read display self-diagnostic result"] - pub command Rddsdr { - const ADDRESS = 0x0F; - arg { - const INIT = 0b0000_0000; - fund: 6, - rld: 7, - } - } - - #[doc="Sleep in"] - pub command Slpin { - const ADDRESS = 0x10; - } - - #[doc="Sleep out"] - pub command Slpout { - const ADDRESS = 0x11; - } - - #[doc="Partial mode on"] - pub command Ptlon { - const ADDRESS = 0x12; - } - - #[doc="Normal display mode on"] - pub command Noron { - const ADDRESS = 0x13; - } - - #[doc="Display inversion off (normal)"] - pub command Invoff { - const ADDRESS = 0x20; - } - - #[doc="Display inversion on"] - pub command Invon { - const ADDRESS = 0x21; - } - - #[doc="All pixel off (black)"] - pub command Allpoff { - const ADDRESS = 0x22; - } - - #[doc="All pixel on (white)"] - pub command Allpon { - const ADDRESS = 0x23; - } - - #[doc="Gamma curve select"] - pub command Gamset { - const ADDRESS = 0x26; - arg { - const INIT = 0b0000_0000; - gc: 0..=3, - } - } - - #[doc="Display off"] - pub command Dispoff { - const ADDRESS = 0x28; - } - - #[doc="Display on"] - pub command Dispon { - const ADDRESS = 0x29; - } - - #[doc="Tearing effect line off"] - pub command Teoff { - const ADDRESS = 0x34; - } - - #[doc="Tearing effect line on"] - pub command Teon { - const ADDRESS = 0x35; - } - - #[doc="Display data access control"] - pub command Madctl { - const ADDRESS = 0x36; - arg { - const INIT = 0b0000_0000; - bgr: 3, - ml: 4, - } - } - - #[doc="Idle mode off"] - pub command Idmoff { - const ADDRESS = 0x38; - } - - #[doc="Idle mode on"] - pub command Idmon { - const ADDRESS = 0x39; - } - - #[doc="Interface pixel format"] - pub command Colmod { - const ADDRESS = 0x3A; - arg { - const INIT = 0b0000_0000; - vipf: 4..=6, - } - } - - #[doc="Read tear line"] - pub command Gsl { - const ADDRESS = 0x45; - arg { tesl_msb } - arg { tesl_lsb } - } - - #[doc="Write display brightness value"] - pub command Wrdibv { - const ADDRESS = 0x51; - arg { dbv } - } - - #[doc="Read display brightness value"] - pub command Rddisbv { - const ADDRESS = 0x52; - arg { dbv } - } - - #[doc="Write control display value"] - pub command Wrctrld { - const ADDRESS = 0x53; - arg { - const INIT = 0b0000_0000; - bl: 2, - dd: 3, - bctrl: 5, - } - } - - #[doc="Read control display value"] - pub command Rrctrld { - const ADDRESS = 0x54; - arg { - const INIT = 0b0000_0000; - bl: 2, - dd: 3, - bctrl: 5, - } - } - - #[doc="Write CABC mode"] - pub command Wrcabc { - const ADDRESS = 0x55; - arg { - const INIT = 0b0000_0000; - cabc_md: 0..=1, - ce_md: 4..=5, - ce_on: 7, - } - } - - #[doc="Read CABC mode"] - pub command Rrcabc { - const ADDRESS = 0x56; - arg { - const INIT = 0b0000_0000; - cabc_md: 0..=1, - ce_md: 4..=5, - ce_on: 7, - } - } - - #[doc="Write CABC minimum brightness"] - pub command Wrcabcmb { - const ADDRESS = 0x5E; - arg { cmb } - } - - #[doc="Read CABC minimum brightness"] - pub command Rrcabcmb { - const ADDRESS = 0x5F; - arg { cmb } - } - - #[doc="Read automatic brightness control self-diagnostic result"] - pub command Rdabcsd { - const ADDRESS = 0x68; - arg { - const INIT = 0b0000_0000; - fund: 6, - rld: 7, - } - } - - #[doc="Read black/white low bits"] - pub command Rdbwlb { - const ADDRESS = 0x70; - arg { - const INIT = 0b0000_0000; - wy: 0..=1, - wx: 2..=3, - bky: 4..=5, - bkx: 6..=7, - } - } - - #[doc="Read Bkx"] - pub command Rdbkx { - const ADDRESS = 0x71; - arg { bkx } - } - - #[doc="Read Bky"] - pub command Rdbky { - const ADDRESS = 0x72; - arg { bky } - } - - #[doc="Read Wx"] - pub command Rdwx { - const ADDRESS = 0x73; - arg { wx } - } - - #[doc="Read Wy"] - pub command Rdwy { - const ADDRESS = 0x74; - arg { wy } - } - - #[doc="Read red/green low bits"] - pub command Rdrglb { - const ADDRESS = 0x75; - arg { - const INIT = 0b0000_0000; - gy: 0..=1, - gx: 2..=3, - ry: 4..=5, - rx: 6..=7, - } - } - - #[doc="Read Rx"] - pub command Rdrx { - const ADDRESS = 0x76; - arg { rx } - } - - #[doc="Read Ry"] - pub command Rdry { - const ADDRESS = 0x77; - arg { ry } - } - - #[doc="Read Gx"] - pub command Rdgx { - const ADDRESS = 0x78; - arg { gx } - } - - #[doc="Read Gy"] - pub command Rdgy { - const ADDRESS = 0x79; - arg { gy } - } - - #[doc="Read blue/a-color low bits"] - pub command Rdbalb { - const ADDRESS = 0x7A; - arg { - const INIT = 0b0000_0000; - ay: 0..=1, - ax: 2..=3, - by: 4..=5, - bx: 6..=7, - } - } - - #[doc="Read Bx"] - pub command Rdbx { - const ADDRESS = 0x7B; - arg { bx } - } - - #[doc="Read By"] - pub command Rdby { - const ADDRESS = 0x7C; - arg { by } - } - - #[doc="Read Ax"] - pub command Rdax { - const ADDRESS = 0x7D; - arg { ax } - } - - #[doc="Read Ay"] - pub command Rday { - const ADDRESS = 0x7E; - arg { ay } - } - - #[doc="Read tthe DDB from the provided location"] - pub command Rdddbs { - const ADDRESS = 0xA1; - arg { const INIT = 0x88; } - arg { const INIT = 0x02; } - arg { mid_msb } - arg { mid_lsb } - arg { const INIT = 0xFF; } - } - - #[doc="Continue reading the DDB from the last read location"] - pub command Rdddbc { - const ADDRESS = 0xA8; - arg { sid_msb } - arg { sid_lsb } - arg { mid_msb } - arg { mid_lsb } - arg { const INIT = 0xFF; } - } - - #[doc="Read first checksum"] - pub command Rdfcs { - const ADDRESS = 0xAA; - arg { fcs } - } - - #[doc="Read continue checksum"] - pub command Rdccs { - const ADDRESS = 0xAF; - arg { ccs } - } - - #[doc="Read ID1"] - pub command Rdid1 { - const ADDRESS = 0xDA; - arg { id1 } - } - - #[doc="Read ID2"] - pub command Rdid2 { - const ADDRESS = 0xDB; - arg { id2 } - } - - #[doc="Read ID3"] - pub command Rdid3 { - const ADDRESS = 0xDC; - arg { id3 } - } - - // System function command table 2 - - #[doc="Command2_BKx function selection"] - pub command Cn2bkxsel { - const ADDRESS = 0xFF; - arg { const INIT = 0b0111_0111; } - arg { const INIT = 0b0000_0001; } - arg { const INIT = 0b0000_0000; } - arg { const INIT = 0b0000_0000; } - arg { - const INIT = 0b0000_0000; - // The spec is ambiguous on the size of this field. - bksel: 0..=1, - cn2: 4, - } - } - - // Command2_BK0 - - #[doc="Positive voltage gamma control"] - pub command Pvgamctrl { - const ADDRESS = 0xB0; - arg { - const INIT = 0b0000_0000; - vc0p: 0..=3, - aj0p: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc4p: 0..=5, - aj1p: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc8p: 0..=5, - aj2p: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc16p: 0..=4, - } - arg { - const INIT = 0b0000_0000; - vc24p: 0..=4, - aj3p: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc52p: 0..=3, - } - arg { - const INIT = 0b0000_0000; - vc80p: 0..=5, - } - arg { - const INIT = 0b0000_0000; - vc108p: 0..=3, - } - arg { - const INIT = 0b0000_0000; - vc147p: 0..=3, - } - arg { - const INIT = 0b0000_0000; - vc175p: 0..=5, - } - arg { - const INIT = 0b0000_0000; - vc203p: 0..=3, - } - arg { - const INIT = 0b0000_0000; - vc231p: 0..=4, - aj4p: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc239p: 0..=4, - } - arg { - const INIT = 0b0000_0000; - vc247p: 0..=5, - aj5p: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc251p: 0..=5, - aj6p: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc255p: 0..=4, - aj7p: 6..=7, - } - } - - #[doc="Negative voltage gamma control"] - pub command Nvgamctrl { - const ADDRESS = 0xB1; - arg { - const INIT = 0b0000_0000; - vc0n: 0..=3, - aj0n: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc4n: 0..=5, - aj1n: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc8n: 0..=5, - aj2n: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc16n: 0..=4, - } - arg { - const INIT = 0b0000_0000; - vc24n: 0..=4, - // TODO: This field is not documented in the spec, - // but it seems like it should be here? - aj3n: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc52n: 0..=3, - } - arg { - const INIT = 0b0000_0000; - vc80n: 0..=5, - } - arg { - const INIT = 0b0000_0000; - vc108n: 0..=3, - } - arg { - const INIT = 0b0000_0000; - vc147n: 0..=3, - } - arg { - const INIT = 0b0000_0000; - vc175n: 0..=5, - } - arg { - const INIT = 0b0000_0000; - vc203n: 0..=3, - } - arg { - const INIT = 0b0000_0000; - vc231n: 0..=4, - aj4n: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc239n: 0..=4, - } - arg { - const INIT = 0b0000_0000; - vc247n: 0..=5, - aj5n: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc251n: 0..=5, - aj6n: 6..=7, - } - arg { - const INIT = 0b0000_0000; - vc255n: 0..=4, - aj7n: 6..=7, - } - } - - #[doc="Digital gamma enable"] - pub command Dgmen { - const ADDRESS = 0xB8; - arg { - const INIT = 0b0000_0000; - dgm_on: 4, - } - } - - // DGMLUTR, DGMLUTB not currently supported, because of its high number of parameters. - // It could be supported with a manual implementation of `Command`. - - #[doc="PWM CLK select"] - pub command Pwmclk { - const ADDRESS = 0xBC; - arg { - const INIT = 0b0001_1000; - pwm_clk_sel: 0..=2, - } - } - - #[doc="Display line setting"] - pub command Lneset { - const ADDRESS = 0xC0; - arg { - const INIT = 0b0000_0000; - bar: 0..=6, - lde_en: 7, - } - arg { - const INIT = 0b0000_0000; - line_delta: 0..=1, - } - } - - #[doc="Porch control"] - pub command Porctrl { - const ADDRESS = 0xC1; - arg { vbp } - arg { vfp } - } - - #[doc="Inversion selection & frame rate control"] - pub command Invsel { - const ADDRESS = 0xC2; - arg { - const INIT = 0b0011_0000; - nlinv: 0..=2, - } - arg { - const INIT = 0b0000_0000; - rtni: 0..=4, - } - } - - #[doc="RGB control"] - pub command Rgbctrl { - const ADDRESS = 0xC3; - arg { - const INIT = 0b0000_0000; - ep: 0, - dp: 1, - hsp: 2, - vsp: 3, - de_hv: 7, - } - arg { hbp_hvrgb } - arg { vbp_hvrgb } - } - - #[doc="Partial mode control"] - pub command Parctrl { - const ADDRESS = 0xC5; - arg { ptsa_lsb } - arg { - const INIT = 0b0000_0000; - ptsa_hsb: 0..=1, - } - arg { ptea_lsb } - arg { - const INIT = 0b0000_0000; - ptea_hsb: 0..=1, - } - } - - #[doc="Source direction control"] - pub command Sdir { - const ADDRESS = 0xC7; - arg { - const INIT = 0b0000_0000; - ss: 2, - } - } - - #[doc="Pseudo-dot inversion driving setting"] - pub command Pdotset { - const ADDRESS = 0xC8; - arg { - const INIT = 0b0000_0000; - z_gltor: 5, - z_sdm1s: 6, - z_en: 7, - } - } - - #[doc="Color control"] - pub command Colctrl { - const ADDRESS = 0xCD; - arg { - const INIT = 0b0000_0000; - epf: 0..=2, - mdt: 3, - inv_led_on: 4, - inv_led_pwm: 5, - } - } - - #[doc="Spread spectrum control"] - pub command Ssctrl { - const ADDRESS = 0xCE; - arg { - const INIT = 0b0000_0100; - dssrg: 4..=5, - dsse: 7, - } - } - - #[doc="Sunlight readable enhancement"] - pub command Sectrl { - const ADDRESS = 0xE0; - arg { - const INIT = 0b0000_0000; - sre_alpha: 0..=3, - sre: 4, - } - } - - #[doc="Noise reduce control"] - pub command Nrctrl { - const ADDRESS = 0xE1; - arg { - const INIT = 0b0000_0000; - nr_md: 0..=1, - nre: 4, - } - } - - #[doc="Sharpness control (originally has a conflicting name SECTRL)"] - pub command Shctrl { - const ADDRESS = 0xE2; - arg { - const INIT = 0b0000_0000; - y_gain: 0..=3, - se: 4, - } - } - - #[doc="Color calibration control"] - pub command Ccctrl { - const ADDRESS = 0xE3; - arg { - const INIT = 0b0000_0000; - cce: 0, - } - } - - #[doc="Skin tone preservation control"] - pub command Skctrl { - const ADDRESS = 0xE4; - arg { - const INIT = 0b0000_0000; - skin_ce_mid: 0..=1, - ske: 4, - } - } - - #[doc="NVM address setting enable"] - pub command Nvmsete { - const ADDRESS = 0xEA; - arg { - const INIT = 0b0000_0000; - aden: 0, - } - } - - #[doc="CABC control"] - pub command Cabcctrl { - const ADDRESS = 0xEE; - arg { - const INIT = 0b0000_0000; - led_en: 0, - ledpwr_sel: 4, - } - } - - // Command2_BK1 - - #[doc="Vop amplitude setting"] - pub command Vrhs { - const ADDRESS = 0xB0; - arg { vrha } - } - - #[doc="VCOM amplitude setting"] - pub command Vcoms { - const ADDRESS = 0xB1; - arg { vcom } - } - - #[doc="VGH voltage setting"] - pub command Vghss { - const ADDRESS = 0xB2; - arg { - const INIT = 0b0000_0000; - vghss: 0..=3, - } - } - - #[doc="TEST command setting"] - pub command Tescmd { - const ADDRESS = 0xB3; - arg { const INIT = 0b1000_0000; } - } - - #[doc="VGL voltage setting"] - pub command Vgls { - const ADDRESS = 0xB5; - arg { - const INIT = 0b0100_0000; - vgls: 0..=3, - } - } - - #[doc="VRH_DV voltage setting"] - pub command Vrhdv { - const ADDRESS = 0xB6; - arg { - const INIT = 0b0000_0000; - vrh_dv: 0..=6, - } - } - - #[doc="Power control 1"] - pub command Pwctrl1 { - const ADDRESS = 0xB7; - arg { - const INIT = 0b0000_0000; - apos: 0..=1, - apis: 2..=3, - ap: 6..=7, - } - } - - #[doc="Power control 2"] - pub command Pwctrl2 { - const ADDRESS = 0xB8; - arg { - const INIT = 0b0000_0000; - avcl: 0..=1, - avdd: 4..=5, - } - } - - #[doc="Power control 3"] - pub command Pwctrl3 { - const ADDRESS = 0xB9; - arg { - const INIT = 0b0000_0000; - svno_pum: 0..=1, - svpo_pum: 4..=5, - } - } - - #[doc="Power pumping clk selection 1"] - pub command Pclks1 { - const ADDRESS = 0xBA; - arg { - const INIT = 0b0000_0000; - stp1cks: 0..=1, - stp4cks: 4..=5, - } - } - - #[doc="Power pumping clk selection 2"] - pub command Pclks2 { - const ADDRESS = 0xBB; - arg { - const INIT = 0b0000_0000; - sbstcks: 0..=1, - } - } - - #[doc="Power pumping clk selection 3"] - pub command Pclks3 { - const ADDRESS = 0xBC; - arg { - const INIT = 0b0000_0000; - stp2scks: 0..=1, - stp2pcks: 0..=1, - stp3cks: 4..=5, - } - } - - #[doc="Source pre_drive timing set1 (also known as SPD1)"] - pub command Pdr1 { - const ADDRESS = 0xC1; - arg { - const INIT = 0b0111_0000; - t2d: 0..=3, - } - } - - #[doc="Source pre_drive timing set2 (also known as SPD2)"] - pub command Pdr2 { - const ADDRESS = 0xC2; - arg { - const INIT = 0b0111_0000; - t3d: 0..=3, - } - } - - #[doc="MIPI setting 1"] - pub command Mipiset1 { - const ADDRESS = 0xD0; - arg { - const INIT = 0b1000_0000; - err_sel: 0..=1, - eotp_en: 3, - } - } - - #[doc="MIPI setting 2"] - pub command Mipiset2 { - const ADDRESS = 0xD1; - arg { - const INIT = 0b0000_0000; - mpc_tlpx0: 0..=3, - mpc_tlpx1: 4..=7, - } - arg { - const INIT = 0b0000_0000; - mpc_tlpx2: 0..=3, - mpc_txtimeadj: 4..=7, - } - arg { - const INIT = 0b0000_0000; - mpc_ttago: 0..=3, - } - arg { - const INIT = 0b0000_0000; - mpc_ttaget: 0..=3, - } - } - - #[doc="MIPI setting 3"] - pub command Mipiset3 { - const ADDRESS = 0xD2; - arg { - const INIT = 0b0011_0000; - phy_ttasure: 0..=3, - } - } - - #[doc="MIPI setting 4"] - pub command Mipiset4 { - const ADDRESS = 0xD3; - arg { - const INIT = 0b0000_0000; - phy_csk: 0..=2, - } - arg { - const INIT = 0b0000_0000; - phy_dsk0: 0..=2, - phy_dsk1: 4..=6, - } - } - - // Command2_BK3 - - #[doc="NVM enable"] - pub command Nvmen { - const ADDRESS = 0xC8; - arg { const INIT = 0b0111_0111; } - arg { const INIT = 0b0000_0001; } - arg { const INIT = 0b1110_1110; } - arg { const INIT = 0b0000_0100; } - } - - #[doc="NVM manual control setting"] - pub command Nvmset { - const ADDRESS = 0xCA; - arg { - const INIT = 0b0000_0000; - pa_msb: 0..=1, - } - arg { pa_lsb } - arg { pdin } - } - - #[doc="NVM program active"] - pub command Promact { - const ADDRESS = 0xCC; - arg { const INIT = 0b1010_1010; } - } -} - -pub struct St7701s {} - -impl St7701s { - pub fn new() -> Self { - let _ = CmdNop::default(); - let x = CmdGsl( - CmdGslArg0::new().with_tesl_msb(1), - CmdGslArg1::new().with_tesl_lsb(0), - ); - x.address(); - x.args_iter(); - todo!() - } -}