diff --git a/firmware2/.cargo/config.toml b/firmware2/.cargo/config.toml new file mode 100644 index 0000000..cab417d --- /dev/null +++ b/firmware2/.cargo/config.toml @@ -0,0 +1,19 @@ +[target.'cfg(all(any(target_arch = "riscv32", target_arch = "xtensa"), target_os = "none"))'] +runner = "espflash flash --monitor" + +[build] +target = "xtensa-esp32s3-none-elf" +rustflags = [ + # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) + # NOTE: May negatively impact performance of produced code + "-C", "force-frame-pointers", +] + + +[env] +ESP_LOG = "info" + +# Xtensa only: +# Needed for nightly, until llvm upstream has support for Rust Xtensa. +[unstable] +build-std = ["alloc", "core"] \ No newline at end of file diff --git a/firmware2/Cargo.lock b/firmware2/Cargo.lock new file mode 100644 index 0000000..4a7ce2d --- /dev/null +++ b/firmware2/Cargo.lock @@ -0,0 +1,3199 @@ +# 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 2.10.0", + "bt-hci", + "cc", + "const-gen", + "embassy-executor", + "embuild", + "esp-alloc", + "esp-backtrace", + "esp-bootloader-esp-idf", + "esp-hal", + "esp-println", + "esp-radio", + "esp-rtos", + "esp-storage", + "json", + "lazy_static", + "log", + "paste", + "rand_core 0.6.4", + "rmk", + "static_cell", + "xz2", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c583acf993cf4245c4acb0a2cc2ab1f9cc097de73411bb6d3647ff6af2b1013d" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bare-metal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3" +dependencies = [ + "rustc_version 0.2.3", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bitfield" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" + +[[package]] +name = "bitfield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + +[[package]] +name = "bitfield" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21ba6517c6b0f2bf08be60e187ab64b038438f22dd755614d8fe4d4098c46419" +dependencies = [ + "bitfield-macros", +] + +[[package]] +name = "bitfield-macros" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f48d6ace212fdf1b45fd6b566bb40808415344642b76c3224c07c8df9da81e97" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "bitfield-struct" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8769c4854c5ada2852ddf6fd09d15cf43d4c2aaeccb4de6432f5402f08a6003b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +dependencies = [ + "serde_core", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt-hci" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb938a3b4c5cc6c2409275bad789c0346a0495fa071a0acc5d72b9bd3175a2f7" +dependencies = [ + "btuuid", + "embassy-sync 0.7.2", + "embedded-io 0.6.1", + "embedded-io-async 0.6.1", + "futures-intrusive", + "heapless 0.9.2", +] + +[[package]] +name = "btuuid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0acfef8a77a02866e04f7e2ad3f4c7b32d575696c49c4bbad742b4aecb8e4a3" +dependencies = [ + "uuid", +] + +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + +[[package]] +name = "bytemuck" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cargo_toml" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "cc" +version = "1.2.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chrono" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + +[[package]] +name = "cobs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror 2.0.17", +] + +[[package]] +name = "config" +version = "0.15.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30fa8254caad766fc03cb0ccae691e14bf3bd72bfff27f72802ce729551b3d6" +dependencies = [ + "async-trait", + "convert_case 0.6.0", + "json5", + "pathdiff", + "ron", + "rust-ini", + "serde-untagged", + "serde_core", + "serde_json", + "toml", + "winnow", + "yaml-rust2", +] + +[[package]] +name = "const-default" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b396d1f76d455557e1218ec8066ae14bba60b4b36ecd55577ba979f5db7ecaa" + +[[package]] +name = "const-gen" +version = "1.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eeaffdd545c28802c91ce816239dd9951cce0ec83d947f2d09dcfbddcd96f5f" +dependencies = [ + "const-gen-derive", +] + +[[package]] +name = "const-gen-derive" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28bbf64501318336d17ffb2ea6c28c791f2af3975f2c11205228c29e3a232f89" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "convert_case" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cortex-m" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" +dependencies = [ + "bare-metal", + "bitfield 0.13.2", + "embedded-hal 0.2.7", + "volatile-register", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +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.111", +] + +[[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.111", +] + +[[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.111", +] + +[[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.111", +] + +[[package]] +name = "dbl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" +dependencies = [ + "generic-array", +] + +[[package]] +name = "delegate" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "780eb241654bf097afb00fc5f054a09b687dad862e485fdcf8399bb056565370" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dlv-list" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] + +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[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", +] + +[[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.111", +] + +[[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-net-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" + +[[package]] +name = "embassy-net-driver-channel" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7b2739fbcf6cd206ae08779c7d709087b16577d255f2ea4a45bc4bbbf305b3f" +dependencies = [ + "embassy-futures", + "embassy-net-driver", + "embassy-sync 0.7.2", +] + +[[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 0.6.1", + "futures-sink", + "futures-util", + "heapless 0.8.0", +] + +[[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 0.6.1", + "futures-core", + "futures-sink", + "heapless 0.8.0", +] + +[[package]] +name = "embassy-time" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-core", +] + +[[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 0.8.0", +] + +[[package]] +name = "embassy-usb" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc4462e48b19a4f401a11901bdd981aab80c6a826608016a0bdc73cbbab31954" +dependencies = [ + "embassy-futures", + "embassy-net-driver-channel", + "embassy-sync 0.7.2", + "embassy-usb-driver", + "embedded-io-async 0.6.1", + "heapless 0.8.0", + "ssmarshal", + "usbd-hid 0.8.2", +] + +[[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 0.6.1", +] + +[[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" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eb1aa714776b75c7e67e1da744b81a129b3ff919c8712b5e1b32252c1f07cc7" + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io 0.6.1", +] + +[[package]] +name = "embedded-io-async" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564b9f813c544241430e147d8bc454815ef9ac998878d30cc3055449f7fd4c0" +dependencies = [ + "embedded-io 0.7.1", +] + +[[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 = "embuild" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e188ad2bbe82afa841ea4a29880651e53ab86815db036b2cb9f8de3ac32dad75" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "filetime", + "log", + "shlex", + "thiserror 1.0.69", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[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.111", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e8918065695684b2b0702da20382d5ae6065cf3327bc2d6436bd49a71ce9f3" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "esp-alloc" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "641e43d6a60244429117ef2fa7a47182120c7561336ea01f6fb08d634f46bae1" +dependencies = [ + "allocator-api2", + "cfg-if", + "document-features", + "enumset", + "esp-config", + "esp-sync", + "linked_list_allocator", + "rlsf", +] + +[[package]] +name = "esp-backtrace" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3318413fb566c7227387f67736cf70cd74d80a11f2bb31c7b95a9eb48d079669" +dependencies = [ + "cfg-if", + "document-features", + "esp-config", + "esp-metadata-generated", + "esp-println", + "heapless 0.9.2", + "riscv", + "semihosting", + "xtensa-lx", +] + +[[package]] +name = "esp-bootloader-esp-idf" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02a56964ab5479ac20c9cf76fa3b0d3f2233b20b5d8554e81ef5d65f63c20567" +dependencies = [ + "cfg-if", + "document-features", + "embedded-storage", + "esp-config", + "esp-hal-procmacros", + "esp-metadata-generated", + "esp-rom-sys", + "jiff", + "log", + "strum", +] + +[[package]] +name = "esp-config" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102871054f8dd98202177b9890cb4b71d0c6fe1f1413b7a379a8e0841fc2473c" +dependencies = [ + "document-features", + "esp-metadata-generated", + "serde", + "serde_yaml", + "somni-expr", +] + +[[package]] +name = "esp-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54786287c0a61ca0f78cb0c338a39427551d1be229103b4444591796c579e093" +dependencies = [ + "bitfield 0.19.4", + "bitflags 2.10.0", + "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 0.6.1", + "embedded-io 0.7.1", + "embedded-io-async 0.6.1", + "embedded-io-async 0.7.0", + "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", + "nb 1.1.0", + "paste", + "portable-atomic", + "rand_core 0.6.4", + "rand_core 0.9.3", + "riscv", + "strum", + "ufmt-write", + "xtensa-lx", + "xtensa-lx-rt", +] + +[[package]] +name = "esp-hal-procmacros" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e025a7a7a0affdb4ff913b5c4494aef96ee03d085bf83c27453ae3a71d50da6" +dependencies = [ + "document-features", + "object", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.111", + "termcolor", +] + +[[package]] +name = "esp-metadata-generated" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a93e39c8ad8d390d248dc7b9f4b59a873f313bf535218b8e2351356972399e3" + +[[package]] +name = "esp-phy" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1facf348e1e251517278fc0f5dc134e95e518251f5796cfbb532ca226a29bf" +dependencies = [ + "cfg-if", + "document-features", + "esp-config", + "esp-hal", + "esp-metadata-generated", + "esp-sync", + "esp-wifi-sys", +] + +[[package]] +name = "esp-println" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a30e6c9fbcc01c348d46706fef8131c7775ab84c254a3cd65d0cd3f6414d592" +dependencies = [ + "document-features", + "esp-metadata-generated", + "esp-sync", + "log", + "portable-atomic", +] + +[[package]] +name = "esp-radio" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "684c4de2f8907b73c9b891fbda65286a86d34fced4b856f36a7896c211f2f265" +dependencies = [ + "allocator-api2", + "bt-hci", + "cfg-if", + "document-features", + "embedded-io 0.6.1", + "embedded-io 0.7.1", + "embedded-io-async 0.6.1", + "embedded-io-async 0.7.0", + "esp-alloc", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata-generated", + "esp-phy", + "esp-radio-rtos-driver", + "esp-sync", + "esp-wifi-sys", + "heapless 0.9.2", + "instability", + "num-derive", + "num-traits", + "portable-atomic", + "portable_atomic_enum", + "xtensa-lx-rt", +] + +[[package]] +name = "esp-radio-rtos-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "543bc31d1851afd062357e7810c1a9633f282fd3993583499a841ab497cbca6c" + +[[package]] +name = "esp-riscv-rt" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502744a5b1e7268d27fd2a4e56ad45efe42ead517d6c517a6961540de949b0ee" +dependencies = [ + "document-features", + "riscv", + "riscv-rt", +] + +[[package]] +name = "esp-rom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd66cccc6dd2d13e9f33668a57717ab14a6d217180ec112e6be533de93e7ecbf" +dependencies = [ + "cfg-if", + "document-features", + "esp-metadata-generated", +] + +[[package]] +name = "esp-rtos" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ec711c8d06e79c67b75d01595539e86b0aac209643af98ca87a12250428b3" +dependencies = [ + "allocator-api2", + "cfg-if", + "document-features", + "embassy-executor", + "embassy-sync 0.7.2", + "embassy-time-driver", + "embassy-time-queue-utils", + "esp-config", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata-generated", + "esp-radio-rtos-driver", + "esp-sync", + "portable-atomic", +] + +[[package]] +name = "esp-storage" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1495fc1f5549bdd840b52d9ceb201746200e1620d2636f46958c11e765623b80" +dependencies = [ + "document-features", + "embedded-storage", + "esp-hal", + "esp-hal-procmacros", + "esp-metadata-generated", + "esp-rom-sys", + "esp-sync", +] + +[[package]] +name = "esp-sync" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d44974639b4e88914f83fe60d2832c00276657d7d857628fdfc966cc7302e8a8" +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 = "esp-wifi-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b6544f6f0cb86169d1f93ba2101a8d50358a040c5043676ed86b793e09b12c" +dependencies = [ + "anyhow", +] + +[[package]] +name = "esp32" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b76170a463d18f888a1ad258031901036fd827a9ef126733053ba5f8739fb0c8" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32c2" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e62cf8932966b8d445b6f1832977b468178f0a84effb2e9fda89f60c24d45aa3" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32c3" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356af3771d0d6536c735bf71136594f4d1cbb506abf6e0c51a6639e9bf4e7988" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32c6" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f5e511df672d79cd63365c92045135e01ba952b6bddd25b660baff5e1110f6b" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32h2" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed4a50bbd1380931e095e0973b9b12f782a9c481f2edf1f7c42e7eb4ff736d6d" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32s2" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98574d4c577fbe888fe3e6df7fc80d25a05624d9998f7d7de1500ae21fcca78f" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "esp32s3" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1810d8ee4845ef87542af981e38eb80ab531d0ef1061e1486014ab7af74c337a" +dependencies = [ + "critical-section", + "vcell", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "filetime" +version = "0.2.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.60.2", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "fugit" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e639847d312d9a82d2e75b0edcc1e934efcc64e6cb7aa94f0b1fbec0bc231d6" +dependencies = [ + "gcd", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[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-macro", + "futures-sink", + "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", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown 0.15.5", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version 0.4.1", + "serde", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af2455f757db2b292a9b1768c4b70186d443bcb3b316252d6b540aec1cd89ed" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[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.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", +] + +[[package]] +name = "indoc" +version = "2.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" +dependencies = [ + "rustversion", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instability" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6778b0196eefee7df739db78758e5cf9b37412268bfa5650bfeed028aed20d9c" +dependencies = [ + "darling 0.20.11", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[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.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49cce2b81f2098e7e3efc35bc2e0a6b7abec9d34128283d7a26fa8f32a6dbb35" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-static" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "980af8b43c3ad5d8d349ace167ec8170839f753a42d233ba19e08afe1850fa69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "js-sys" +version = "0.3.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" + +[[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + +[[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.178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" + +[[package]] +name = "libredox" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df15f6eac291ed1cf25865b1ee60399f57e7c227e7f51bdbd4c5270396a9ed50" +dependencies = [ + "bitflags 2.10.0", + "libc", + "redox_syscall", +] + +[[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 = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[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-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[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.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "ordered-multimap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" +dependencies = [ + "dlv-list", + "hashbrown 0.14.5", +] + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "elliptic-curve", + "primeorder", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "pest" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbcfd20a6d4eeba40179f05735784ad32bdaef05ce8e8af05f180d45bb3e7e22" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f72981ade67b1ca6adc26ec221be9f463f2b5839c7508998daa17c23d94d7f" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee9efd8cdb50d719a80088b76f81aec7c41ed6d522ee750178f83883d271625" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "pest_meta" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf1d70880e76bdc13ba52eafa6239ce793d85c8e43896507e43dd8984ff05b82" +dependencies = [ + "pest", + "sha2", +] + +[[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 = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[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 = "portable_atomic_enum" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" +dependencies = [ + "portable-atomic", + "portable_atomic_enum_macros", +] + +[[package]] +name = "portable_atomic_enum_macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "postcard" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" +dependencies = [ + "cobs", + "heapless 0.7.17", + "postcard-derive", + "serde", +] + +[[package]] +name = "postcard-derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0232bd009a197ceec9cc881ba46f727fcd8060a2d8d6a9dde7a69030a6fe2bb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.111", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +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" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[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 = "redox_syscall" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96166dafa0886eb81fe1c0a388bece180fbef2135f97c1e2cf8302e74b43b5" +dependencies = [ + "bitflags 2.10.0", +] + +[[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.111", +] + +[[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.111", +] + +[[package]] +name = "riscv-target-parser" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1376b15f3ff160e9b1e8ea564ce427f2f6fcf77528cc0a8bf405cb476f9cea7" + +[[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 = "rmk" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a301e62e9d2d9f2e44922c121a605aa064f2ef96c5d6f3c4d5fb9e177205186" +dependencies = [ + "bitfield-struct", + "bt-hci", + "byteorder", + "chrono", + "const-gen", + "cortex-m", + "crc32fast", + "document-features", + "embassy-embedded-hal", + "embassy-executor", + "embassy-futures", + "embassy-sync 0.7.2", + "embassy-time", + "embassy-usb", + "embedded-hal 1.0.0", + "embedded-hal-async", + "embedded-io-async 0.6.1", + "embedded-storage", + "embedded-storage-async", + "esp-hal", + "futures", + "heapless 0.9.2", + "log", + "paste", + "postcard", + "rand_core 0.6.4", + "rmk-config", + "rmk-macro", + "rmk-types", + "sequential-storage", + "serde", + "serde_derive", + "ssmarshal", + "static_cell", + "strum", + "toml", + "trouble-host", + "usbd-hid 0.9.0", +] + +[[package]] +name = "rmk-config" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3166813f01b6d3a23260d67cc12e31e97affa89812a499872a33f86688629e" +dependencies = [ + "cargo_toml", + "config", + "once_cell", + "paste", + "pest", + "pest_derive", + "serde", + "serde-inline-default", + "serde_derive", + "toml", +] + +[[package]] +name = "rmk-macro" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f1aa766e731010e185ec92f1e1db6b9a0a1b3c42ae712bdadb7c7976fa9539" +dependencies = [ + "cargo_toml", + "darling 0.20.11", + "once_cell", + "pest", + "pest_derive", + "prettyplease", + "proc-macro2", + "quote", + "rmk-config", + "serde", + "serde_derive", + "syn 2.0.111", + "toml", +] + +[[package]] +name = "rmk-types" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ec537c7aebb4079311d27b06ec5e82be34a4c0478642317113627d7c36145ff" +dependencies = [ + "bitfield-struct", + "postcard", + "serde", + "strum", +] + +[[package]] +name = "ron" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd490c5b18261893f14449cbd28cb9c0b637aebf161cd77900bfdedaff21ec32" +dependencies = [ + "bitflags 2.10.0", + "once_cell", + "serde", + "serde_derive", + "typeid", + "unicode-ident", +] + +[[package]] +name = "rust-ini" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "796e8d2b6696392a43bea58116b667fb4c29727dc5abd27d6acf338bb4f688c7" +dependencies = [ + "cfg-if", + "ordered-multimap", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.27", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semihosting" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5669d73a3503b5d34db3359c8c87d1b33ba68b2630c153e340d106c15a8626a7" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "sequential-storage" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f93d860af08a0079f1c596b65176d5ea2bca1f977ba6210d4547aa16865477" +dependencies = [ + "embedded-storage-async", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-inline-default" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d48532bc0781ac622a5fea0f16502d3b4f1af0fcebe56d618120969f35d315" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "serde_spanned" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" +dependencies = [ + "serde_core", +] + +[[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 = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "somni-expr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed9b7648d5e8b2df6c5e49940c54bcdd2b4dd71eafc6e8f1c714eb4581b0f53" +dependencies = [ + "somni-parser", +] + +[[package]] +name = "somni-parser" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0f368519fc6c85fc1afdb769fb5a51123f6158013e143656e25a3485a0d401c" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "ssmarshal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" +dependencies = [ + "encode_unicode", + "serde", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[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.111", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[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.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +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 = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl 2.0.17", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "toml" +version = "0.9.10+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0825052159284a1a8b4d6c0c86cbc801f2da5afd2b225fa548c72f2e74002f48" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.23.10+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_writer" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" + +[[package]] +name = "trouble-host" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2881b4859001fe1f48445145cda5149deac9110b1d707ec0a251b7ff6d8bdfa4" +dependencies = [ + "aes", + "bt-hci", + "cmac", + "embassy-futures", + "embassy-sync 0.7.2", + "embassy-time", + "embedded-io 0.6.1", + "futures", + "heapless 0.9.2", + "log", + "p256", + "rand", + "rand_chacha", + "rand_core 0.6.4", + "static_cell", + "trouble-host-macros", + "zerocopy", +] + +[[package]] +name = "trouble-host-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcb85bec3a8393c22ca1a7c25c82c2d33689ab412f3487c492fd01a033ede7c2" +dependencies = [ + "convert_case 0.8.0", + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.111", + "uuid", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[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.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[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 0.8.0", + "portable-atomic", +] + +[[package]] +name = "usbd-hid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" +dependencies = [ + "serde", + "ssmarshal", + "usb-device", + "usbd-hid-macros 0.8.2", +] + +[[package]] +name = "usbd-hid" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a7cd3bfb2bb57779f2aeab3f679e5ec6c80265adfe77894539792be7c22aaf0" +dependencies = [ + "serde", + "ssmarshal", + "usb-device", + "usbd-hid-macros 0.9.0", +] + +[[package]] +name = "usbd-hid-descriptors" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" +dependencies = [ + "bitfield 0.14.0", +] + +[[package]] +name = "usbd-hid-descriptors" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac781e4d4c61a4d3bea4cda03fb4ed4d13578c55386b29c5cdc70b3bd89c47df" +dependencies = [ + "bitfield 0.14.0", +] + +[[package]] +name = "usbd-hid-macros" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" +dependencies = [ + "byteorder", + "hashbrown 0.13.2", + "log", + "proc-macro2", + "quote", + "serde", + "syn 1.0.109", + "usbd-hid-descriptors 0.8.2", +] + +[[package]] +name = "usbd-hid-macros" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab457064302de0aca303a13cd520dcf035fdfd2aff713fa69d713d0a8e4291d8" +dependencies = [ + "byteorder", + "hashbrown 0.13.2", + "log", + "proc-macro2", + "quote", + "serde", + "syn 1.0.109", + "usbd-hid-descriptors 0.9.0", +] + +[[package]] +name = "uuid" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[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 = "volatile-register" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc" +dependencies = [ + "vcell", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.111", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[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-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +dependencies = [ + "memchr", +] + +[[package]] +name = "xtensa-lx" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e012d667b0aa6d2592ace8ef145a98bff3e76cca7a644f4181ecd7a916ed289b" +dependencies = [ + "critical-section", +] + +[[package]] +name = "xtensa-lx-rt" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8709f037fb123fe7ff146d2bce86f9dc0dfc53045c016bfd9d703317b6502845" +dependencies = [ + "document-features", + "xtensa-lx", + "xtensa-lx-rt-proc-macros", +] + +[[package]] +name = "xtensa-lx-rt-proc-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96fb42cd29c42f8744c74276e9f5bee7b06685bbe5b88df891516d72cb320450" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "yaml-rust2" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2462ea039c445496d8793d052e13787f2b90e750b833afee748e601c17621ed9" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink", +] + +[[package]] +name = "zerocopy" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" diff --git a/firmware2/Cargo.toml b/firmware2/Cargo.toml new file mode 100644 index 0000000..2811ed8 --- /dev/null +++ b/firmware2/Cargo.toml @@ -0,0 +1,73 @@ +[package] +name = "acid-firmware" +version = "0.1.0" +authors = ['Jakub "Limeth" Hlusička'] +description = "Firmware for the ACID keyboard" +homepage = "https://github.com/haobogu/rmk" +repository = "https://github.com/haobogu/rmk" +edition = "2024" + +[features] +no_usb = ["rmk/_no_usb"] + +[dependencies] +rmk = { version = "0.8.2", default-features = false, features = [ + "esp32s3_ble", + "log", + "storage", + "vial", +] } +embassy-executor = { version = "0.9" } +esp-backtrace = { version = "0.18", features = [ + "esp32s3", + "panic-handler", + "println", +] } +esp-hal = { version = "1.0", features = ["esp32s3", "unstable", "psram"] } +esp-storage = { version = "0.8.0", features = ["esp32s3"] } +esp-alloc = { version = "0.9.0" } +esp-println = { version = "0.16.0", features = ["esp32s3", "log-04"] } +esp-radio = { version = "0.17", features = ["esp32s3", "unstable", "ble"] } +esp-rtos = { version = "0.2", features = ["esp32s3", "esp-radio", "embassy"] } +esp-bootloader-esp-idf = { version = "0.4", features = ["esp32s3", "log-04"] } +bt-hci = { version = "0.6" } +rand_core = { version = "0.6", default-features = false } +static_cell = "2" +lazy_static = { version = "1.5.0", features = ["spin_no_std"], default-features = false } +log = "0.4.29" +bitflags = "2.10.0" +paste = "1.0.15" + +[build-dependencies] +xz2 = "0.1.7" +json = "0.12" +const-gen = "1.6" +embuild = "0.33" +cc = "1.2.9" + +[[bin]] +name = "acid-firmware" +test = false +bench = false + +[profile.release-with-debug] +inherits = "release" +debug = true + +[profile.dev.package.esp-storage] +opt-level = 3 + +[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 = 'thin' +opt-level = 3 +overflow-checks = false + diff --git a/firmware2/README.md b/firmware2/README.md new file mode 100644 index 0000000..2e10380 --- /dev/null +++ b/firmware2/README.md @@ -0,0 +1,65 @@ +# esp32s3 BLE example + +To run this example, you should have latest Rust in **esp** channel installed. The full instruction of installing esp Rust toolchain can be found [here](https://docs.esp-rs.org/book/installation/index.html). + +[`espflash`](https://github.com/esp-rs/espflash) should also be installed: + +``` +cargo install cargo-espflash espflash +``` + +After having everything installed, use the following command to run the example: + +``` +cd examples/use_rust/esp32s3_ble +cargo +esp run --release +``` + +If everything is good, you'll see the log as the following: + +```shell +cargo run --release + Compiling ... + ... + ... + Finished `release` profile [optimized + debuginfo] target(s) in 11.70s + Running `espflash flash --monitor --port /dev/cu.usbmodem211401 target/xtensa-esp32s3-none-elf/release/rmk-esp32s3` +[2025-04-10T10:01:23Z INFO ] Serial port: '/dev/cu.usbmodem211401' +[2025-04-10T10:01:23Z INFO ] Connecting... +[2025-04-10T10:01:23Z INFO ] Using flash stub +Chip type: esp32s3 (revision v0.1) +Crystal frequency: 40 MHz +Flash size: 4MB +Features: WiFi 6, BT 5 +MAC address: 40:4c:ca:5b:c7:dc +App/part. size: 768,944/4,128,768 bytes, 18.62% +[2025-04-10T10:01:23Z INFO ] Segment at address '0x0' has not changed, skipping write +[2025-04-10T10:01:23Z INFO ] Segment at address '0x8000' has not changed, skipping write +[00:00:06] [========================================] 411/411 0x10000 [2025-04-10T10:01:31Z INFO ] Flashing has completed! +``` + +If espflash reports the following error: + +``` +Error: espflash::connection_failed + + × Error while connecting to device + ╰─▶ Serial port not found +``` + +You should to identify which serial port are connected to your esp board, and use `--port` to specify the used serial port: + +``` +# Suppose that the esp board are connected to /dev/cu.usbmodem211401 +cargo run --release -- --port /dev/cu.usbmodem211401 +``` + +If you want to get some insight of segments of your binary, [`espsegs`](https://github.com/bjoernQ/espsegs) would help: + +``` +# Install it first +cargo install --git https://github.com/bjoernQ/espsegs + +# Check all segments +espsegs target/xtensa-esp32s3-none-elf/release/rmk-esp32s3 --chip esp32s3 +``` \ No newline at end of file diff --git a/firmware2/build.rs b/firmware2/build.rs new file mode 100644 index 0000000..f172b40 --- /dev/null +++ b/firmware2/build.rs @@ -0,0 +1,47 @@ +use std::fs::File; +use std::io::Read; +use std::path::Path; +use std::{env, fs}; + +use const_gen::*; +use xz2::read::XzEncoder; + +fn main() { + // Generate vial config at the root of project + println!("cargo:rerun-if-changed=vial.json"); + generate_vial_config(); + + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); + + // Set the extra linker script from defmt + // println!("cargo:rustc-link-arg=-Tdefmt.x"); +} + +fn generate_vial_config() { + // Generated vial config file + let out_file = Path::new(&env::var_os("OUT_DIR").unwrap()).join("config_generated.rs"); + + let p = Path::new("vial.json"); + let mut content = String::new(); + match File::open(p) { + Ok(mut file) => { + file.read_to_string(&mut content).expect("Cannot read vial.json"); + } + Err(e) => println!("Cannot find vial.json {p:?}: {e}"), + }; + + let vial_cfg = json::stringify(json::parse(&content).unwrap()); + let mut keyboard_def_compressed: Vec = Vec::new(); + XzEncoder::new(vial_cfg.as_bytes(), 6) + .read_to_end(&mut keyboard_def_compressed) + .unwrap(); + + let keyboard_id: Vec = vec![0xB9, 0xBC, 0x09, 0xB2, 0x9D, 0x37, 0x4C, 0xEA]; + let const_declarations = [ + const_declaration!(pub VIAL_KEYBOARD_DEF = keyboard_def_compressed), + const_declaration!(pub VIAL_KEYBOARD_ID = keyboard_id), + ] + .map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_owned() + s.as_str()) + .join("\n"); + fs::write(out_file, const_declarations).unwrap(); +} diff --git a/firmware2/rust-toolchain.toml b/firmware2/rust-toolchain.toml new file mode 100644 index 0000000..2e27578 --- /dev/null +++ b/firmware2/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "esp" \ No newline at end of file diff --git a/firmware2/src/keymap.rs b/firmware2/src/keymap.rs new file mode 100644 index 0000000..8c45512 --- /dev/null +++ b/firmware2/src/keymap.rs @@ -0,0 +1,19 @@ +use rmk::types::action::KeyAction; +use rmk::{a, k, layer, mo}; + +use crate::matrix::{MATRIX_COLS, MATRIX_ROWS}; + +pub const NUM_LAYER: usize = 1; + +#[rustfmt::skip] +pub const fn get_default_keymap() -> [[[KeyAction; MATRIX_COLS]; MATRIX_ROWS]; NUM_LAYER] { + [ + layer!([ + [k!(Escape), k!(Kc1), k!(Kc2), k!(Kc3), k!(Kc4), k!(Kc5), k!(Kc6), k!(Kc7), k!(Kc8), k!(Kc9), k!(Kc0), k!(Backspace)], + [k!(Tab), k!(Q), k!(W), k!(E), k!(R), k!(T), k!(Z), k!(U), k!(I), k!(O), k!(P), k!(Delete)], + [k!(LCtrl), k!(A), k!(S), k!(D), k!(F), k!(G), k!(H), k!(J), k!(K), k!(L), k!(Comma), k!(Enter)], + [k!(LShift), k!(Y), k!(X), k!(C), k!(V), k!(B), k!(N), k!(M), a!(No), a!(No), k!(Up), k!(RShift)], + [a!(No), a!(No), k!(LGui), k!(LAlt), k!(TriLayerLower), k!(Space), k!(Space), k!(TriLayerLower), k!(RAlt), k!(Left), k!(Down), k!(Right)] + ]) + ] +} diff --git a/firmware2/src/lcd.rs b/firmware2/src/lcd.rs new file mode 100644 index 0000000..b03322e --- /dev/null +++ b/firmware2/src/lcd.rs @@ -0,0 +1,472 @@ +use alloc::{boxed::Box, vec, vec::Vec}; +use core::iter::once; +use esp_hal::{ + delay::Delay, + gpio::{Flex, Level, Output}, +}; +use lazy_static::lazy_static; + +use crate::st7701s::Command; + +fn spi_delay() { + Delay::new().delay_micros(1); // TODO: Async? +} + +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, + ); +} + +pub 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(); +} + +use crate::st7701s::*; + +lazy_static! { + pub 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), + ]; +} diff --git a/firmware2/src/macros.rs b/firmware2/src/macros.rs new file mode 100644 index 0000000..5501345 --- /dev/null +++ b/firmware2/src/macros.rs @@ -0,0 +1,12 @@ +macro_rules! config_matrix_pins_esp { + (peripherals: $p:ident, input: [$($in_pin:ident), *], output: [$($out_pin:ident), +]) => { + { + let mut output_pins = [$(Output::new($p.$out_pin, Level::Low, OutputConfig::default())), +]; + let input_pins = [$(Input::new($p.$in_pin, InputConfig::default().with_pull(Pull::Down))), +]; + output_pins.iter_mut().for_each(|p| { + let _ = p.set_low(); + }); + (input_pins, output_pins) + } + }; +} diff --git a/firmware2/src/main.rs b/firmware2/src/main.rs new file mode 100644 index 0000000..f3414c4 --- /dev/null +++ b/firmware2/src/main.rs @@ -0,0 +1,463 @@ +#![no_std] +#![no_main] +#![feature(macro_metavar_expr)] + +extern crate alloc; + +mod keymap; +#[macro_use] +mod macros; +mod lcd; +mod matrix; +mod st7701s; +mod vial; + +use core::alloc::Layout; +use core::ptr::addr_of_mut; + +use alloc::boxed::Box; +use alloc::vec; +use bt_hci::controller::ExternalController; +use embassy_executor::Spawner; +use esp_alloc::{HeapRegion, MemoryCapability}; +use esp_hal::clock::{CpuClock, RtcClock}; +use esp_hal::delay::Delay; +use esp_hal::dma::{BurstConfig, DmaDescriptor, DmaTxBuf, ExternalBurstConfig}; +use esp_hal::gpio::{Flex, Input, InputConfig, Level, Output, OutputConfig, Pull}; +use esp_hal::i2c::master::{I2c, I2cAddress}; +use esp_hal::lcd_cam::LcdCam; +use esp_hal::lcd_cam::lcd::dpi::{Dpi, Format, FrameTiming}; +use esp_hal::lcd_cam::lcd::{ClockMode, Phase, Polarity}; +use esp_hal::mcpwm::{McPwm, PeripheralClockConfig}; +use esp_hal::otg_fs::Usb; +use esp_hal::otg_fs::asynch::{Config, Driver}; +// use esp_hal::psram::{FlashFreq, PsramConfig, PsramSize, SpiRamFreq, SpiTimingConfigCoreClock}; +use esp_hal::rng::TrngSource; +use esp_hal::rtc_cntl::sleep::RtcSleepConfig; +use esp_hal::rtc_cntl::{Rtc, sleep}; +use esp_hal::time::Rate; +use esp_hal::timer::systimer::SystemTimer; +use esp_hal::timer::timg::TimerGroup; +use esp_radio::Controller; +use esp_radio::ble::controller::BleConnector; +use esp_storage::FlashStorage; +use log::{LevelFilter, info}; +use rmk::ble::build_ble_stack; +use rmk::channel::EVENT_CHANNEL; +use rmk::config::{BehaviorConfig, PositionalConfig, RmkConfig, StorageConfig, VialConfig}; +use rmk::debounce::default_debouncer::DefaultDebouncer; +use rmk::futures::future::join3; +use rmk::input_device::Runnable; +use rmk::keyboard::Keyboard; +use rmk::matrix::Matrix; +use rmk::storage::async_flash_wrapper; +use rmk::{HostResources, initialize_keymap_and_storage, run_devices, run_rmk}; +use static_cell::StaticCell; +use {esp_alloc as _, esp_backtrace as _}; + +use crate::keymap::*; +use crate::lcd::spi_write; +use crate::matrix::IoeMatrix; +use crate::vial::{VIAL_KEYBOARD_DEF, VIAL_KEYBOARD_ID}; + +// 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_rtos::main] +async fn main(spawner: Spawner) { + 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!(#[unsafe(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_caps( + // MemoryCapability::External.into(), + // 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 pull-up on GPIO0 to prevent booting into download mode. + let gpio0 = Output::new( + peripherals.GPIO0, + Level::High, + OutputConfig::default().with_pull(Pull::Up), + ); + + // Enable LDO2 + let _ = Output::new(peripherals.GPIO17, Level::High, OutputConfig::default()); + + // Enable antenna + let _ = Output::new(peripherals.GPIO11, Level::Low, OutputConfig::default()); + + // 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), + ); + + // esp_alloc::heap_allocator!(size: 72 * 1024); + let timg0 = TimerGroup::new(peripherals.TIMG0); + #[cfg(target_arch = "riscv32")] + let software_interrupt = SoftwareInterruptControl::new(peripherals.SW_INTERRUPT); + esp_rtos::start( + timg0.timer0, + #[cfg(target_arch = "riscv32")] + software_interrupt.software_interrupt0, + ); + let _trng_source = TrngSource::new(peripherals.RNG, peripherals.ADC1); + let mut rng = esp_hal::rng::Trng::try_new().unwrap(); + static RADIO: StaticCell> = StaticCell::new(); + let radio = RADIO.init(esp_radio::init().unwrap()); + let bluetooth = peripherals.BT; + let connector = BleConnector::new(radio, bluetooth, Default::default()).unwrap(); + let controller: ExternalController<_, 20> = ExternalController::new(connector); + let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; + let mut host_resources = HostResources::new(); + let stack = build_ble_stack(controller, central_addr, &mut rng, &mut host_resources).await; + + // // Initialize USB + #[cfg(not(feature = "no_usb"))] + let usb_driver = { + static mut EP_MEMORY: [u8; 1024] = [0; 1024]; + let usb = Usb::new(peripherals.USB0, peripherals.GPIO20, peripherals.GPIO19); + // Create the driver, from the HAL. + let config = Config::default(); + Driver::new(usb, unsafe { &mut *addr_of_mut!(EP_MEMORY) }, config) + }; + + // Initialize the flash + let flash = FlashStorage::new(peripherals.FLASH); + let flash = async_flash_wrapper(flash); + + 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"); + + for (subsequence, delay_ms) in &*lcd::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}"); + // } + } + Delay::new().delay_millis(*delay_ms as u32); // TODO: async? + // Timer::after_millis(*delay_ms).await + } + + // info!("init sequence written"); + + let mut lcd = LcdCam::new(peripherals.LCD_CAM).into_async().lcd; + let lcd_config = esp_hal::lcd_cam::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 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(gpio0) + .with_data12(peripherals.GPIO1) + .with_data13(peripherals.GPIO2) + .with_data14(peripherals.GPIO3) + .with_data15(peripherals.GPIO4); + + // RMK config + let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF, &[(0, 0), (1, 1)]); + let storage_config = StorageConfig { + start_addr: 0x3f0000, + num_sectors: 16, + ..Default::default() + }; + let rmk_config = RmkConfig { + vial_config, + storage_config, + ..Default::default() + }; + + // Initialze keyboard stuffs + // Initialize the storage and keymap + let mut default_keymap = keymap::get_default_keymap(); + let mut behavior_config = BehaviorConfig::default(); + let mut per_key_config = PositionalConfig::default(); + let (keymap, mut storage) = initialize_keymap_and_storage( + &mut default_keymap, + flash, + &storage_config, + &mut behavior_config, + &mut per_key_config, + ) + .await; + + // Initialize the matrix and keyboard + const I2C_ADDR_MATRIX_LEFT: I2cAddress = I2cAddress::SevenBit(0b0100000); + const I2C_ADDR_MATRIX_RIGHT: I2cAddress = I2cAddress::SevenBit(0b0100001); + + let i2c = I2c::new(peripherals.I2C0, Default::default()) + .unwrap() + .with_sda(peripherals.GPIO8) + .with_scl(peripherals.GPIO9); + + let mut matrix = IoeMatrix::new( + i2c.into_async(), + DefaultDebouncer::new(), + [I2C_ADDR_MATRIX_LEFT, I2C_ADDR_MATRIX_RIGHT], + ) + .await; + let mut keyboard = Keyboard::new(&keymap); // Initialize the light controller + + join3( + run_devices! ( + (matrix) => EVENT_CHANNEL, + ), + keyboard.run(), // Keyboard is special + run_rmk( + &keymap, + #[cfg(not(feature = "no_usb"))] + usb_driver, + &stack, + &mut storage, + rmk_config, + ), + ) + .await; +} + +// #[esp_rtos::main] +// async fn main(_s: Spawner) { +// // Initialize the peripherals and bluetooth controller +// esp_println::logger::init_logger(LevelFilter::max()); +// let peripherals = esp_hal::init(esp_hal::Config::default().with_cpu_clock(CpuClock::max())); +// esp_alloc::heap_allocator!(size: 72 * 1024); +// let timg0 = TimerGroup::new(peripherals.TIMG0); +// #[cfg(target_arch = "riscv32")] +// let software_interrupt = SoftwareInterruptControl::new(peripherals.SW_INTERRUPT); +// esp_rtos::start( +// timg0.timer0, +// #[cfg(target_arch = "riscv32")] +// software_interrupt.software_interrupt0, +// ); +// let _trng_source = TrngSource::new(peripherals.RNG, peripherals.ADC1); +// let mut rng = esp_hal::rng::Trng::try_new().unwrap(); +// static RADIO: StaticCell> = StaticCell::new(); +// let radio = RADIO.init(esp_radio::init().unwrap()); +// let bluetooth = peripherals.BT; +// let connector = BleConnector::new(radio, bluetooth, Default::default()).unwrap(); +// let controller: ExternalController<_, 20> = ExternalController::new(connector); +// let central_addr = [0x18, 0xe2, 0x21, 0x80, 0xc0, 0xc7]; +// let mut host_resources = HostResources::new(); +// let stack = build_ble_stack(controller, central_addr, &mut rng, &mut host_resources).await; + +// // Initialize the flash +// let flash = FlashStorage::new(peripherals.FLASH); +// let flash = async_flash_wrapper(flash); + +// // Initialize the IO pins +// let (row_pins, col_pins) = config_matrix_pins_esp!(peripherals: peripherals, input: [GPIO6, GPIO7, GPIO21, GPIO35], output: [GPIO3, GPIO4, GPIO5]); + +// // RMK config +// let vial_config = VialConfig::new(VIAL_KEYBOARD_ID, VIAL_KEYBOARD_DEF, &[(0, 0), (1, 1)]); +// let storage_config = StorageConfig { +// start_addr: 0x3f0000, +// num_sectors: 16, +// ..Default::default() +// }; +// let rmk_config = RmkConfig { +// vial_config, +// storage_config, +// ..Default::default() +// }; + +// // Initialze keyboard stuffs +// // Initialize the storage and keymap +// let mut default_keymap = keymap::get_default_keymap(); +// let mut behavior_config = BehaviorConfig::default(); +// let mut per_key_config = PositionalConfig::default(); +// let (keymap, mut storage) = initialize_keymap_and_storage( +// &mut default_keymap, +// flash, +// &storage_config, +// &mut behavior_config, +// &mut per_key_config, +// ) +// .await; + +// // Initialize the matrix and keyboard +// let debouncer = DefaultDebouncer::new(); +// 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); + +// let mut matrix = IoeMatrix::new( +// i2c.into_async(), +// debouncer, +// [I2C_ADDR_MATRIX_LEFT, I2C_ADDR_MATRIX_RIGHT], +// ) +// .await; +// // let mut matrix = Matrix::<_, _, _, ROW, COL, true>::new(row_pins, col_pins, debouncer); +// // let mut matrix = rmk::matrix::TestMatrix::::new(); +// let mut keyboard = Keyboard::new(&keymap); // Initialize the light controller + +// join3( +// run_devices! ( +// (matrix) => EVENT_CHANNEL, +// ), +// keyboard.run(), // Keyboard is special +// run_rmk(&keymap, &stack, &mut storage, rmk_config), +// ) +// .await; +// } diff --git a/firmware2/src/matrix.rs b/firmware2/src/matrix.rs new file mode 100644 index 0000000..8fec4b9 --- /dev/null +++ b/firmware2/src/matrix.rs @@ -0,0 +1,215 @@ +use esp_hal::{ + Async, + i2c::master::{BusTimeout, I2c, I2cAddress, SoftwareTimeout}, + time::Rate, +}; +use log::info; +use rmk::{ + debounce::{DebounceState, DebouncerTrait}, + event::{Event, KeyboardEvent}, + input_device::InputDevice, + matrix::{KeyState, MatrixTrait}, +}; + +pub struct RaiiGuard { + on_drop: Option, +} + +impl RaiiGuard { + pub fn new(on_drop: F) -> Self { + Self { + on_drop: Some(on_drop), + } + } +} + +impl Drop for RaiiGuard { + fn drop(&mut self) { + if let Some(on_drop) = self.on_drop.take() { + (on_drop)(); + } + } +} + +pub const MATRIX_ROWS: usize = 5; +pub const MATRIX_COLS: usize = 12; +pub const MATRIX_AREA: usize = MATRIX_ROWS * MATRIX_COLS; + +/// IO Expander Matrix +pub struct IoeMatrix +where + D: DebouncerTrait, +{ + i2c: I2c<'static, Async>, + /// IO expander addresses. + ioe_addresses: [I2cAddress; 2], + debouncer: D, + /// States of key switches as detected by IO expanders. + input_states: [[bool; MATRIX_ROWS]; MATRIX_COLS], + /// Debounced key states. + key_states: [[KeyState; MATRIX_ROWS]; MATRIX_COLS], + /// Index of the current key switch being processed: row * columns + column + scan_pos: usize, + /// Re-scan needed flag + #[cfg(feature = "async_matrix")] + rescan_needed: bool, +} + +impl IoeMatrix +where + D: DebouncerTrait, +{ + pub async fn new( + mut i2c: I2c<'static, Async>, + debouncer: D, + ioe_addresses: [I2cAddress; 2], + ) -> Self { + i2c.apply_config( + &esp_hal::i2c::master::Config::default() + .with_frequency(Rate::from_khz(400)) + .with_timeout(BusTimeout::Disabled) + .with_software_timeout(SoftwareTimeout::None), + ) + .unwrap(); + + for addr in ioe_addresses { + i2c.write_async(addr, &[0b10010000, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]) + .await + .unwrap(); + } + + Self { + i2c, + ioe_addresses, + debouncer, + input_states: Default::default(), + key_states: Default::default(), + scan_pos: 0, + #[cfg(feature = "async_matrix")] + rescan_needed: false, + } + } +} + +impl InputDevice for IoeMatrix +where + D: DebouncerTrait, +{ + async fn read_event(&mut self) -> Event { + loop { + if self.scan_pos == 0 { + // Load data from IO expanders. + let mut input_register_banks = [0_u8; 10]; + + loop { + let Err(esp_hal::i2c::master::Error::Timeout) = self + .i2c + .write_read_async( + self.ioe_addresses[0], + &[0x80], + &mut input_register_banks[..5], + ) + .await + else { + break; + }; + info!("I2C timed out when reading the left IO expander."); + } + + loop { + let Err(esp_hal::i2c::master::Error::Timeout) = self + .i2c + .write_read_async( + self.ioe_addresses[1], + &[0x80], + &mut input_register_banks[5..], + ) + .await + else { + break; + }; + info!("I2C timed out when reading the right IO expander."); + } + + for (row_idx, (left, right)) in (0..).zip(core::iter::zip( + &input_register_banks[..5], + &input_register_banks[5..], + )) { + for col_idx_half in 0..(MATRIX_COLS / 2) { + self.input_states[col_idx_half][row_idx] = left & (1 << col_idx_half) != 0; + self.input_states[col_idx_half + MATRIX_COLS / 2][row_idx] = + right & (1 << col_idx_half) != 0; + } + } + // info!("rows: {rows:x?}") + } + + let (row_idx, col_idx) = (self.scan_pos / MATRIX_COLS, self.scan_pos % MATRIX_COLS); + let on_iteration_end = RaiiGuard::new(|| { + // Process the next key switch. + self.scan_pos = (self.scan_pos + 1) % MATRIX_AREA; + }); + let debounce_state = self.debouncer.detect_change_with_debounce( + row_idx, + col_idx, + self.input_states[col_idx][row_idx], + &self.key_states[col_idx][row_idx], + ); + + if let DebounceState::Debounced = debounce_state { + self.key_states[col_idx][row_idx].toggle_pressed(); + #[cfg(feature = "async_matrix")] + { + self.rescan_needed = true; + } + return Event::Key(KeyboardEvent::key( + row_idx as u8, + col_idx as u8, + self.key_states[col_idx][row_idx].pressed, + )); + } + + // // Process the next key switch. + // self.scan_pos = (self.scan_pos + 1) % MATRIX_AREA; + + // If there's key still pressed, always refresh the self.scan_start + #[cfg(feature = "async_matrix")] + if self.key_states[col_idx][row_idx].pressed { + self.rescan_needed = true; + } + + #[cfg(feature = "async_matrix")] + { + if !self.rescan_needed { + self.wait_for_key().await; + } + self.rescan_needed = false; + } + + drop(on_iteration_end); + } + } +} + +impl MatrixTrait for IoeMatrix +where + D: DebouncerTrait, +{ + #[cfg(feature = "async_matrix")] + async fn wait_for_key(&mut self) { + // TODO + + // First, set all output pins to high + for out in self.get_output_pins_mut().iter_mut() { + out.set_high().ok(); + } + + // Wait for any key press + self.wait_input_pins().await; + + // Set all output pins back to low + for out in self.get_output_pins_mut().iter_mut() { + out.set_low().ok(); + } + } +} diff --git a/firmware2/src/st7701s.rs b/firmware2/src/st7701s.rs new file mode 100644 index 0000000..587c2cf --- /dev/null +++ b/firmware2/src/st7701s.rs @@ -0,0 +1,1212 @@ +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!() + } +} diff --git a/firmware2/src/vial.rs b/firmware2/src/vial.rs new file mode 100644 index 0000000..7e9b5ab --- /dev/null +++ b/firmware2/src/vial.rs @@ -0,0 +1,3 @@ +// Vial config is automatically generated by `build.rs`, according to `vial.json` +// Please put `vial.json` at your project's root +include!(concat!(env!("OUT_DIR"), "/config_generated.rs")); diff --git a/firmware2/vial.json b/firmware2/vial.json new file mode 100644 index 0000000..4106278 --- /dev/null +++ b/firmware2/vial.json @@ -0,0 +1,84 @@ +{ + "name": "ACID Keyboard", + "vendorId": "0x1209", + "productId": "0x9400", + "lighting": "none", + "matrix": { + "rows": 5, + "cols": 12 + }, + "layouts": { + "keymap": [ + [ + "0,0", + "0,1", + "0,2", + "0,3", + "0,4", + "0,5", + "0,6", + "0,7", + "0,8", + "0,9", + "0,10", + "0,11" + ], + [ + "1,0", + "1,1", + "1,2", + "1,3", + "1,4", + "1,5", + "1,6", + "1,7", + "1,8", + "1,9", + "1,10", + "1,11" + ], + [ + "2,0", + "2,1", + "2,2", + "2,3", + "2,4", + "2,5", + "2,6", + "2,7", + "2,8", + "2,9", + "2,10", + "2,11" + ], + [ + "3,0", + "3,1", + "3,2", + "3,3", + "3,4", + "3,5", + "3,6", + "3,7", + "3,8", + "3,9", + "3,10", + "3,11" + ], + [ + "4,0", + "4,1", + "4,2", + "4,3", + "4,4", + "4,5", + "4,6", + "4,7", + "4,8", + "4,9", + "4,10", + "4,11" + ] + ] + } +}