Compare commits
9 Commits
ui
...
keyboard-w
| Author | SHA1 | Date | |
|---|---|---|---|
| 42a3f4c104 | |||
| dd909a7f4a | |||
| c1b49622a3 | |||
| 7f8e10d33d | |||
| a537d9ea69 | |||
| 19b52eb7a9 | |||
| c387b5ebf8 | |||
| a0fb1a0da5 | |||
| 65ad7bab48 |
248
Cargo.lock
generated
248
Cargo.lock
generated
@@ -27,12 +27,6 @@ version = "0.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
|
||||
|
||||
[[package]]
|
||||
name = "arrform"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7cf566ecc5c9d82b973e81d30babf6583c9b497f86295c952d538c3254ef4e6"
|
||||
|
||||
[[package]]
|
||||
name = "ascii-canvas"
|
||||
version = "3.0.0"
|
||||
@@ -48,7 +42,7 @@ version = "4.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ef1e3e699d84ab1b0911a1010c5c106aa34ae89aeac103be5ce0c3859db1e891"
|
||||
dependencies = [
|
||||
"term 1.0.2",
|
||||
"term 1.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -144,6 +138,18 @@ version = "2.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
|
||||
|
||||
[[package]]
|
||||
name = "bitvec"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
|
||||
dependencies = [
|
||||
"funty",
|
||||
"radium",
|
||||
"tap",
|
||||
"wyz",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.4"
|
||||
@@ -453,12 +459,13 @@ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
|
||||
|
||||
[[package]]
|
||||
name = "embassy-embedded-hal"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41fea5ef5bed4d3468dfd44f5c9fa4cda8f54c86d4fb4ae683eacf9d39e2ea12"
|
||||
checksum = "8578db196d74db92efdd5ebc546736dac1685499ee245b22eff92fa5e4b57945"
|
||||
dependencies = [
|
||||
"embassy-futures",
|
||||
"embassy-sync 0.6.2",
|
||||
"embassy-hal-internal 0.3.0",
|
||||
"embassy-sync 0.7.0",
|
||||
"embassy-time",
|
||||
"embedded-hal 0.2.7",
|
||||
"embedded-hal 1.0.0",
|
||||
@@ -511,6 +518,15 @@ dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[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"
|
||||
@@ -519,13 +535,13 @@ checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d"
|
||||
|
||||
[[package]]
|
||||
name = "embassy-net-driver-channel"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4818c32afec43e3cae234f324bad9a976c9aa7501022d26ff60a4017a1a006b7"
|
||||
checksum = "25a567ab50319d866ad5e6c583ed665ba9b07865389644d3d82e45bf1497c934"
|
||||
dependencies = [
|
||||
"embassy-futures",
|
||||
"embassy-net-driver",
|
||||
"embassy-sync 0.6.2",
|
||||
"embassy-sync 0.7.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -542,7 +558,7 @@ dependencies = [
|
||||
"document-features",
|
||||
"embassy-embedded-hal",
|
||||
"embassy-futures",
|
||||
"embassy-hal-internal",
|
||||
"embassy-hal-internal 0.2.0",
|
||||
"embassy-sync 0.6.2",
|
||||
"embassy-time",
|
||||
"embassy-usb-driver",
|
||||
@@ -580,7 +596,7 @@ dependencies = [
|
||||
"document-features",
|
||||
"embassy-embedded-hal",
|
||||
"embassy-futures",
|
||||
"embassy-hal-internal",
|
||||
"embassy-hal-internal 0.2.0",
|
||||
"embassy-sync 0.6.2",
|
||||
"embassy-time",
|
||||
"embassy-time-driver",
|
||||
@@ -672,11 +688,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "embassy-usb-driver"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970"
|
||||
checksum = "340c5ce591ef58c6449e43f51d2c53efe1bf0bb6a40cbf80afa0d259c7d52c76"
|
||||
dependencies = [
|
||||
"defmt 0.3.100",
|
||||
"defmt 1.0.1",
|
||||
"embedded-io-async",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -765,27 +782,6 @@ dependencies = [
|
||||
"embedded-io",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "embedded-layout"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a90553247f2b05c59ac7894ea13d830636c2b1203fa03bff400eddbd1fa9f52"
|
||||
dependencies = [
|
||||
"embedded-graphics",
|
||||
"embedded-layout-macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "embedded-layout-macros"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f6e621fe4c7e05b695274b722dc0a60bacd1c8696b58191baa0154713d52400"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.104",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "embedded-sdmmc"
|
||||
version = "0.8.0"
|
||||
@@ -871,6 +867,12 @@ version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
||||
|
||||
[[package]]
|
||||
name = "funty"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
|
||||
|
||||
[[package]]
|
||||
name = "futures"
|
||||
version = "0.3.31"
|
||||
@@ -1016,15 +1018,6 @@ version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
|
||||
|
||||
[[package]]
|
||||
name = "home"
|
||||
version = "0.5.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf"
|
||||
dependencies = [
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ident_case"
|
||||
version = "1.0.1"
|
||||
@@ -1049,7 +1042,7 @@ checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
"windows-sys",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1128,7 +1121,7 @@ dependencies = [
|
||||
"regex-syntax 0.8.5",
|
||||
"sha3",
|
||||
"string_cache",
|
||||
"term 1.0.2",
|
||||
"term 1.1.0",
|
||||
"unicode-xid",
|
||||
"walkdir",
|
||||
]
|
||||
@@ -1315,7 +1308,7 @@ dependencies = [
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"windows-targets",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1363,7 +1356,6 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
|
||||
name = "picocalc-os-rs"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"arrform",
|
||||
"bitflags 2.9.1",
|
||||
"bt-hci",
|
||||
"cortex-m",
|
||||
@@ -1380,16 +1372,16 @@ dependencies = [
|
||||
"embassy-time",
|
||||
"embedded-graphics",
|
||||
"embedded-hal 0.2.7",
|
||||
"embedded-hal 1.0.0",
|
||||
"embedded-hal-async",
|
||||
"embedded-hal-bus",
|
||||
"embedded-layout",
|
||||
"embedded-sdmmc",
|
||||
"heapless",
|
||||
"panic-probe",
|
||||
"portable-atomic",
|
||||
"spin",
|
||||
"st7365p-lcd",
|
||||
"static_cell",
|
||||
"talc",
|
||||
"trouble-host",
|
||||
]
|
||||
|
||||
@@ -1572,6 +1564,12 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "radium"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.6.4"
|
||||
@@ -1635,9 +1633,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
||||
|
||||
[[package]]
|
||||
name = "rgb"
|
||||
version = "0.8.50"
|
||||
version = "0.8.52"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a"
|
||||
checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
]
|
||||
@@ -1759,12 +1757,24 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "st7365p-lcd"
|
||||
name = "spin"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "st7365p-lcd"
|
||||
version = "0.11.0"
|
||||
source = "git+https://github.com/legitcamper/st7365p-lcd-rs?branch=async#87abf450404865dcb535292e9e1a6a2457fd4599"
|
||||
dependencies = [
|
||||
"bitvec",
|
||||
"embedded-graphics-core",
|
||||
"embedded-hal 1.0.0",
|
||||
"embedded-hal-async",
|
||||
"heapless",
|
||||
"nb 1.1.0",
|
||||
]
|
||||
|
||||
@@ -1823,6 +1833,21 @@ dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "talc"
|
||||
version = "4.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a3ae828aa394de34c7de08f522d1b86bd1c182c668d27da69caadda00590f26d"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tap"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
|
||||
|
||||
[[package]]
|
||||
name = "term"
|
||||
version = "0.7.0"
|
||||
@@ -1836,12 +1861,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "term"
|
||||
version = "1.0.2"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a984c8d058c627faaf5e8e2ed493fa3c51771889196de1016cf9c1c6e90d750"
|
||||
checksum = "a43bddab41f8626c7bdaab872bbba75f8df5847b516d77c569c746e2ae5eb746"
|
||||
dependencies = [
|
||||
"home",
|
||||
"windows-sys",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2092,7 +2116,7 @@ version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
|
||||
dependencies = [
|
||||
"windows-sys",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2107,7 +2131,16 @@ version = "0.59.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
||||
dependencies = [
|
||||
"windows-targets",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.60.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
||||
dependencies = [
|
||||
"windows-targets 0.53.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2116,14 +2149,30 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm",
|
||||
"windows_aarch64_msvc",
|
||||
"windows_i686_gnu",
|
||||
"windows_i686_gnullvm",
|
||||
"windows_i686_msvc",
|
||||
"windows_x86_64_gnu",
|
||||
"windows_x86_64_gnullvm",
|
||||
"windows_x86_64_msvc",
|
||||
"windows_aarch64_gnullvm 0.52.6",
|
||||
"windows_aarch64_msvc 0.52.6",
|
||||
"windows_i686_gnu 0.52.6",
|
||||
"windows_i686_gnullvm 0.52.6",
|
||||
"windows_i686_msvc 0.52.6",
|
||||
"windows_x86_64_gnu 0.52.6",
|
||||
"windows_x86_64_gnullvm 0.52.6",
|
||||
"windows_x86_64_msvc 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.53.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.53.0",
|
||||
"windows_aarch64_msvc 0.53.0",
|
||||
"windows_i686_gnu 0.53.0",
|
||||
"windows_i686_gnullvm 0.53.0",
|
||||
"windows_i686_msvc 0.53.0",
|
||||
"windows_x86_64_gnu 0.53.0",
|
||||
"windows_x86_64_gnullvm 0.53.0",
|
||||
"windows_x86_64_msvc 0.53.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2132,48 +2181,105 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
|
||||
|
||||
[[package]]
|
||||
name = "wyz"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
|
||||
dependencies = [
|
||||
"tap",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.26"
|
||||
|
||||
15
Cargo.toml
15
Cargo.toml
@@ -60,22 +60,21 @@ cyw43-pio = { version = "0.3.0", optional = true }
|
||||
|
||||
embedded-hal-bus = { version = "0.3.0", features = ["async"] }
|
||||
embedded-hal = "0.2.7"
|
||||
embedded-hal-1 = { version = "1.0.0", package = "embedded-hal" }
|
||||
embedded-hal-async = "1.0.0"
|
||||
cortex-m = { version = "0.7.7" }
|
||||
cortex-m-rt = "0.7.5"
|
||||
panic-probe = "0.3"
|
||||
portable-atomic = { version = "1.11", features = ["critical-section"] }
|
||||
static_cell = "2.1.1"
|
||||
bitflags = "2.9.1"
|
||||
heapless = "0.8.0"
|
||||
arrform = "0.1.1"
|
||||
|
||||
defmt = { version = "0.3", optional = true }
|
||||
defmt-rtt = "0.4.2"
|
||||
|
||||
embedded-graphics = { version = "0.8.1" }
|
||||
embedded-layout = "0.4.2"
|
||||
embedded-sdmmc = { git = "https://github.com/Be-ing/embedded-sdmmc-rs", branch = "bisync", default-features = false }
|
||||
# st7365p-lcd = { git = "https://github.com/legitcamper/st7365p-lcd-rs", branch = "async" }
|
||||
st7365p-lcd = { path = "../ST7365P-lcd-rs" }
|
||||
st7365p-lcd = { git = "https://github.com/legitcamper/st7365p-lcd-rs", branch = "async" }
|
||||
|
||||
static_cell = "2.1.1"
|
||||
bitflags = "2.9.1"
|
||||
talc = "4.4.3"
|
||||
spin = "0.10.0"
|
||||
heapless = "0.8.0"
|
||||
|
||||
215
src/display.rs
215
src/display.rs
@@ -1,180 +1,87 @@
|
||||
use arrform::{ArrForm, arrform};
|
||||
use core::fmt::Debug;
|
||||
use core::sync::atomic::Ordering;
|
||||
|
||||
use defmt::info;
|
||||
use embassy_rp::{
|
||||
gpio::{Level, Output},
|
||||
peripherals::{PIN_13, PIN_14, PIN_15, SPI1},
|
||||
spi::{Async, Spi},
|
||||
};
|
||||
use embassy_time::{Delay, Timer};
|
||||
use embassy_sync::{blocking_mutex::raw::ThreadModeRawMutex, signal::Signal};
|
||||
use embassy_time::{Delay, Instant, Timer};
|
||||
use embedded_graphics::{
|
||||
Drawable,
|
||||
draw_target::DrawTarget,
|
||||
mono_font::{
|
||||
MonoTextStyle,
|
||||
ascii::{FONT_6X10, FONT_9X15, FONT_10X20},
|
||||
},
|
||||
mono_font::{MonoTextStyle, ascii::FONT_10X20},
|
||||
pixelcolor::Rgb565,
|
||||
prelude::{Point, RgbColor, Size},
|
||||
primitives::{PrimitiveStyle, Rectangle, StyledDrawable},
|
||||
text::Text,
|
||||
prelude::{Dimensions, Point, RgbColor, Size},
|
||||
primitives::Rectangle,
|
||||
text::{Alignment, Text},
|
||||
};
|
||||
use embedded_hal_1::digital::OutputPin;
|
||||
use embedded_hal_async::spi::SpiDevice;
|
||||
use embedded_hal_bus::spi::{ExclusiveDevice, NoDelay};
|
||||
use embedded_layout::{
|
||||
align::{horizontal, vertical},
|
||||
layout::linear::LinearLayout,
|
||||
object_chain::Chain,
|
||||
prelude::*,
|
||||
};
|
||||
use heapless::{String, Vec};
|
||||
use st7365p_lcd::{FrameBuffer, Orientation, ST7365P};
|
||||
use embedded_hal_bus::spi::ExclusiveDevice;
|
||||
use portable_atomic::AtomicBool;
|
||||
use st7365p_lcd::{FrameBuffer, ST7365P};
|
||||
|
||||
pub const SCREEN_WIDTH: usize = 320;
|
||||
pub const SCREEN_HEIGHT: usize = 320;
|
||||
use crate::LAST_TEXT_RECT;
|
||||
|
||||
pub const STATUS_BAR_WIDTH: usize = 320;
|
||||
pub const STATUS_BAR_HEIGHT: usize = 40;
|
||||
const SCREEN_WIDTH: usize = 320;
|
||||
const SCREEN_HEIGHT: usize = 320;
|
||||
|
||||
pub type FRAMEBUFFER = FrameBuffer<
|
||||
SCREEN_WIDTH,
|
||||
SCREEN_HEIGHT,
|
||||
ExclusiveDevice<Spi<'static, SPI1, Async>, Output<'static>, Delay>,
|
||||
Output<'static>,
|
||||
Output<'static>,
|
||||
>;
|
||||
pub static DISPLAY_SIGNAL: Signal<ThreadModeRawMutex, ()> = Signal::new();
|
||||
|
||||
pub struct UI<const MAX_SELECTIONS: usize, const MAX_STR_LEN: usize> {
|
||||
pub status_bar: StatusBar,
|
||||
pub selections_list: SelectionList<MAX_SELECTIONS, MAX_STR_LEN>,
|
||||
}
|
||||
pub async fn display_handler(
|
||||
spi: Spi<'static, SPI1, Async>,
|
||||
cs: PIN_13,
|
||||
data: PIN_14,
|
||||
reset: PIN_15,
|
||||
) {
|
||||
let spi_device = ExclusiveDevice::new(spi, Output::new(cs, Level::Low), Delay).unwrap();
|
||||
let mut display = ST7365P::new(
|
||||
spi_device,
|
||||
Output::new(data, Level::Low),
|
||||
Some(Output::new(reset, Level::High)),
|
||||
false,
|
||||
true,
|
||||
Delay,
|
||||
);
|
||||
let mut framebuffer: FrameBuffer<
|
||||
SCREEN_WIDTH,
|
||||
SCREEN_HEIGHT,
|
||||
{ SCREEN_WIDTH * SCREEN_HEIGHT },
|
||||
> = FrameBuffer::new();
|
||||
display.init().await.unwrap();
|
||||
display.set_custom_orientation(0x40).await.unwrap();
|
||||
framebuffer.draw(&mut display).await.unwrap();
|
||||
display.set_on().await.unwrap();
|
||||
|
||||
impl<const MAX_SELECTIONS: usize, const MAX_STR_LEN: usize> UI<MAX_SELECTIONS, MAX_STR_LEN> {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
status_bar: StatusBar {
|
||||
battery: 100,
|
||||
backlight: 100,
|
||||
volume: 100,
|
||||
},
|
||||
selections_list: SelectionList::new(Vec::new()),
|
||||
}
|
||||
}
|
||||
DISPLAY_SIGNAL.signal(());
|
||||
|
||||
pub fn draw<D: DrawTarget<Color = Rgb565>>(&mut self, target: &mut D)
|
||||
where
|
||||
<D as DrawTarget>::Error: Debug,
|
||||
{
|
||||
self.draw_status_bar(target);
|
||||
self.draw_selection(target);
|
||||
}
|
||||
loop {
|
||||
DISPLAY_SIGNAL.wait().await;
|
||||
|
||||
fn draw_selection<D: DrawTarget<Color = Rgb565>>(&mut self, target: &mut D) {
|
||||
let text_style = MonoTextStyle::new(&FONT_9X15, Rgb565::WHITE);
|
||||
let text_string = crate::STRING.lock().await.clone();
|
||||
|
||||
let selection = Rectangle::new(
|
||||
Point::new(0, STATUS_BAR_HEIGHT as i32 + 1),
|
||||
Size::new(
|
||||
SCREEN_WIDTH as u32,
|
||||
(SCREEN_HEIGHT - STATUS_BAR_HEIGHT) as u32 - 1,
|
||||
),
|
||||
let text = Text::with_alignment(
|
||||
&text_string,
|
||||
Point::new(160, 160),
|
||||
MonoTextStyle::new(&FONT_10X20, Rgb565::RED),
|
||||
Alignment::Center,
|
||||
);
|
||||
|
||||
let _ = if self.selections_list.selections.is_empty() {
|
||||
LinearLayout::horizontal(Chain::new(Text::new(
|
||||
"No Programs found on SD Card\nEnsure programs end with '.rhai',\nand are located in the root directory",
|
||||
Point::zero(),
|
||||
text_style,
|
||||
)))
|
||||
.arrange()
|
||||
.align_to(&selection, horizontal::Center, vertical::Center).draw(target)
|
||||
} else {
|
||||
LinearLayout::horizontal(
|
||||
Chain::new(Text::new(
|
||||
arrform!(20, "Bat: {}", self.status_bar.battery).as_str(),
|
||||
Point::zero(),
|
||||
text_style,
|
||||
))
|
||||
.append(Text::new(" ", Point::zero(), text_style))
|
||||
.append(Text::new(
|
||||
arrform!(20, "Lght: {}", self.status_bar.backlight).as_str(),
|
||||
Point::zero(),
|
||||
text_style,
|
||||
))
|
||||
.append(Text::new(" ", Point::zero(), text_style))
|
||||
.append(Text::new(
|
||||
arrform!(20, "Vol: {}", self.status_bar.volume).as_str(),
|
||||
Point::zero(),
|
||||
text_style,
|
||||
)),
|
||||
)
|
||||
.arrange()
|
||||
.align_to(&selection, horizontal::Left, vertical::Center)
|
||||
.draw(target)
|
||||
};
|
||||
}
|
||||
|
||||
fn draw_status_bar<D: DrawTarget<Color = Rgb565>>(&mut self, target: &mut D) {
|
||||
let text_style = MonoTextStyle::new(&FONT_9X15, Rgb565::WHITE);
|
||||
|
||||
let status_bar = Rectangle::new(
|
||||
Point::new(0, 0),
|
||||
Size::new(STATUS_BAR_WIDTH as u32, STATUS_BAR_HEIGHT as u32),
|
||||
);
|
||||
let _ = LinearLayout::horizontal(
|
||||
Chain::new(Text::new(
|
||||
arrform!(20, "Bat: {}", self.status_bar.battery).as_str(),
|
||||
Point::zero(),
|
||||
text_style,
|
||||
))
|
||||
.append(Text::new(
|
||||
arrform!(20, "Lght: {}", self.status_bar.backlight).as_str(),
|
||||
Point::zero(),
|
||||
text_style,
|
||||
))
|
||||
.append(Text::new(
|
||||
arrform!(20, "Vol: {}", self.status_bar.volume).as_str(),
|
||||
Point::zero(),
|
||||
text_style,
|
||||
)),
|
||||
)
|
||||
.arrange()
|
||||
.align_to(&status_bar, horizontal::Center, vertical::Center)
|
||||
.draw(target);
|
||||
}
|
||||
}
|
||||
|
||||
pub struct StatusBar {
|
||||
pub battery: u8,
|
||||
pub backlight: u8,
|
||||
pub volume: u8,
|
||||
}
|
||||
|
||||
pub struct SelectionList<const MAX_SELECTION: usize, const MAX_STR_LEN: usize> {
|
||||
current_selection: u16,
|
||||
selections: Vec<String<MAX_STR_LEN>, MAX_SELECTION>,
|
||||
}
|
||||
|
||||
impl<const MAX_SELECTION: usize, const MAX_STR_LEN: usize>
|
||||
SelectionList<MAX_SELECTION, MAX_STR_LEN>
|
||||
{
|
||||
pub fn new(selections: Vec<String<MAX_STR_LEN>, MAX_SELECTION>) -> Self {
|
||||
Self {
|
||||
selections,
|
||||
current_selection: 0,
|
||||
{
|
||||
let rect = LAST_TEXT_RECT.lock().await;
|
||||
if let Some(rect) = *rect.borrow() {
|
||||
framebuffer.fill_solid(&rect, Rgb565::BLACK).unwrap();
|
||||
}
|
||||
*rect.borrow_mut() = Some(text.bounding_box());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn down(&mut self) {
|
||||
if self.current_selection + 1 < self.selections.len() as u16 {
|
||||
self.current_selection += 1
|
||||
}
|
||||
}
|
||||
text.draw(&mut framebuffer).unwrap();
|
||||
|
||||
pub fn up(&mut self) {
|
||||
if self.current_selection > self.selections.len() as u16 {
|
||||
self.current_selection -= 1
|
||||
}
|
||||
let start = Instant::now();
|
||||
framebuffer
|
||||
.partial_draw_batched(&mut display)
|
||||
.await
|
||||
.unwrap();
|
||||
info!("Elapsed {}ms", start.elapsed().as_millis());
|
||||
}
|
||||
}
|
||||
|
||||
153
src/main.rs
153
src/main.rs
@@ -1,111 +1,82 @@
|
||||
#![feature(impl_trait_in_assoc_type)]
|
||||
#![feature(ascii_char)]
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
#[cfg(feature = "defmt")]
|
||||
use defmt::*;
|
||||
use embedded_graphics::{
|
||||
pixelcolor::Rgb565,
|
||||
prelude::{Point, RgbColor, Size},
|
||||
primitives::{PrimitiveStyle, Rectangle, StyledDrawable},
|
||||
use crate::{
|
||||
display::DISPLAY_SIGNAL,
|
||||
peripherals::keyboard::{KeyCode, KeyState, read_keyboard_fifo},
|
||||
};
|
||||
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
use crate::display::{FRAMEBUFFER, SCREEN_HEIGHT, SCREEN_WIDTH, UI};
|
||||
use crate::peripherals::{
|
||||
conf_peripherals,
|
||||
keyboard::{KeyEvent, read_keyboard_fifo},
|
||||
};
|
||||
use core::cell::RefCell;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::peripherals::{I2C1, PIN_13, PIN_14, PIN_15, SPI1};
|
||||
use embassy_rp::spi::Spi;
|
||||
use embassy_rp::{
|
||||
bind_interrupts,
|
||||
gpio::{Level, Output},
|
||||
i2c,
|
||||
i2c::I2c,
|
||||
spi,
|
||||
};
|
||||
use embassy_sync::blocking_mutex::raw::NoopRawMutex;
|
||||
use embassy_sync::channel::Channel;
|
||||
use embassy_time::{Delay, Timer};
|
||||
use embedded_hal_1::spi::SpiDevice;
|
||||
use embedded_hal_bus::spi::ExclusiveDevice;
|
||||
use embedded_sdmmc::asynchronous::{File, SdCard, ShortFileName, VolumeIdx, VolumeManager};
|
||||
use st7365p_lcd::{FrameBuffer, ST7365P};
|
||||
use static_cell::StaticCell;
|
||||
use embassy_futures::join::join;
|
||||
use embassy_rp::peripherals::I2C1;
|
||||
use embassy_rp::{i2c, i2c::I2c, spi};
|
||||
use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex;
|
||||
use embassy_sync::mutex::Mutex;
|
||||
use embassy_time::Timer;
|
||||
use embedded_graphics::primitives::Rectangle;
|
||||
use heapless::String;
|
||||
|
||||
mod display;
|
||||
mod peripherals;
|
||||
use peripherals::conf_peripherals;
|
||||
mod display;
|
||||
use display::display_handler;
|
||||
|
||||
embassy_rp::bind_interrupts!(
|
||||
struct Irqs {
|
||||
I2C1_IRQ => i2c::InterruptHandler<I2C1>;
|
||||
}
|
||||
);
|
||||
embassy_rp::bind_interrupts!(struct Irqs {
|
||||
I2C1_IRQ => i2c::InterruptHandler<I2C1>;
|
||||
});
|
||||
|
||||
static STRING: Mutex<ThreadModeRawMutex, String<25>> = Mutex::new(String::new());
|
||||
static LAST_TEXT_RECT: Mutex<ThreadModeRawMutex, RefCell<Option<Rectangle>>> =
|
||||
Mutex::new(RefCell::new(None));
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(spawner: Spawner) {
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
||||
let mut i2c1_config = i2c::Config::default();
|
||||
i2c1_config.frequency = 100_000;
|
||||
let i2c1 = I2c::new_async(p.I2C1, p.PIN_7, p.PIN_6, Irqs, i2c1_config);
|
||||
STRING.lock().await.push_str("Press Del").unwrap();
|
||||
|
||||
// configure keyboard event handler
|
||||
let mut config = i2c::Config::default();
|
||||
config.frequency = 400_000;
|
||||
let i2c1 = I2c::new_async(p.I2C1, p.PIN_7, p.PIN_6, Irqs, config);
|
||||
conf_peripherals(i2c1).await;
|
||||
|
||||
let mut spi1_config = spi::Config::default();
|
||||
spi1_config.frequency = 16_000_000;
|
||||
let spi1 = Spi::new(
|
||||
p.SPI1,
|
||||
p.PIN_10,
|
||||
p.PIN_11,
|
||||
p.PIN_12,
|
||||
p.DMA_CH0,
|
||||
p.DMA_CH1,
|
||||
spi1_config,
|
||||
let mut config = spi::Config::default();
|
||||
config.frequency = 16_000_000;
|
||||
let spi1 = spi::Spi::new(
|
||||
p.SPI1, p.PIN_10, p.PIN_11, p.PIN_12, p.DMA_CH0, p.DMA_CH1, config,
|
||||
);
|
||||
|
||||
spawner
|
||||
.spawn(main_task(spi1, p.PIN_13, p.PIN_14, p.PIN_15))
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[embassy_executor::task]
|
||||
async fn main_task(
|
||||
spi1: Spi<'static, SPI1, spi::Async>,
|
||||
spi1_cs: PIN_13,
|
||||
spi1_data: PIN_14,
|
||||
spi1_reset: PIN_15,
|
||||
) {
|
||||
let spi_device = ExclusiveDevice::new(spi1, Output::new(spi1_cs, Level::Low), Delay).unwrap();
|
||||
let display = ST7365P::new(
|
||||
spi_device,
|
||||
Output::new(spi1_data, Level::Low),
|
||||
Some(Output::new(spi1_reset, Level::High)),
|
||||
false,
|
||||
true,
|
||||
SCREEN_WIDTH as u32,
|
||||
SCREEN_HEIGHT as u32,
|
||||
);
|
||||
let mut framebuffer: FRAMEBUFFER = FrameBuffer::new(display);
|
||||
framebuffer.init(&mut Delay).await.unwrap();
|
||||
framebuffer
|
||||
.display
|
||||
.set_custom_orientation(0x60)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// let mut ui: UI<50, 25> = UI::new();
|
||||
|
||||
// read_keyboard_fifo().await;
|
||||
Rectangle::new(Point::new(0, 0), Size::new(319, 319))
|
||||
.draw_styled(&PrimitiveStyle::with_fill(Rgb565::RED), &mut framebuffer)
|
||||
.unwrap();
|
||||
// ui.draw(&mut framebuffer);
|
||||
framebuffer.draw().await.unwrap();
|
||||
|
||||
loop {
|
||||
info!("Done");
|
||||
Timer::after_millis(500).await;
|
||||
}
|
||||
join(
|
||||
async {
|
||||
loop {
|
||||
Timer::after_millis(20).await;
|
||||
if let Some(key) = read_keyboard_fifo().await
|
||||
&& key.state == KeyState::Pressed
|
||||
{
|
||||
let mut string = STRING.lock().await;
|
||||
match key.key {
|
||||
KeyCode::Backspace => {
|
||||
string.pop().unwrap();
|
||||
}
|
||||
KeyCode::Del => {
|
||||
string.clear();
|
||||
}
|
||||
KeyCode::Char(c) => {
|
||||
string.push(c).unwrap();
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
DISPLAY_SIGNAL.signal(());
|
||||
}
|
||||
}
|
||||
},
|
||||
display_handler(spi1, p.PIN_13, p.PIN_14, p.PIN_15),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
use defmt::{info, warn};
|
||||
use embassy_rp::{
|
||||
i2c::{Async, I2c},
|
||||
peripherals::I2C1,
|
||||
};
|
||||
use embassy_sync::{
|
||||
blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex},
|
||||
channel::Sender,
|
||||
};
|
||||
|
||||
use crate::peripherals::PERIPHERAL_BUS;
|
||||
|
||||
|
||||
@@ -5,13 +5,10 @@ use embassy_rp::{
|
||||
i2c::{Async, I2c},
|
||||
peripherals::I2C1,
|
||||
};
|
||||
use embassy_sync::{
|
||||
blocking_mutex::raw::NoopRawMutex, channel::Sender, lazy_lock::LazyLock, mutex::Mutex,
|
||||
};
|
||||
use embassy_time::{Duration, Timer};
|
||||
use embassy_sync::{blocking_mutex::raw::NoopRawMutex, lazy_lock::LazyLock, mutex::Mutex};
|
||||
use embassy_time::Timer;
|
||||
|
||||
pub mod keyboard;
|
||||
use keyboard::{KeyCode, KeyEvent, KeyState};
|
||||
|
||||
use crate::peripherals::keyboard::{configure_keyboard, read_keyboard_fifo};
|
||||
|
||||
@@ -31,7 +28,11 @@ pub async fn conf_peripherals(i2c: I2CBUS) {
|
||||
PERIPHERAL_BUS.get().lock().await.replace(i2c);
|
||||
|
||||
configure_keyboard(200, 100).await;
|
||||
set_lcd_backlight(255).await;
|
||||
|
||||
// empty keys
|
||||
while read_keyboard_fifo().await.is_some() {}
|
||||
|
||||
// set_lcd_backlight(255).await;
|
||||
set_key_backlight(0).await;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user