├── .cargo └── config.toml ├── .github └── workflows │ └── rust_ci.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── rust-toolchain.toml └── src └── main.rs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.riscv32imc-unknown-none-elf] 2 | runner = "espflash flash --monitor" 3 | 4 | 5 | [build] 6 | rustflags = [ 7 | "-C", "link-arg=-Tlinkall.x", 8 | "-C", "link-arg=-Trom_functions.x", 9 | ] 10 | 11 | target = "riscv32imc-unknown-none-elf" 12 | 13 | [unstable] 14 | build-std = ["core"] 15 | -------------------------------------------------------------------------------- /.github/workflows/rust_ci.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Integration 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - "**/README.md" 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | env: 11 | CARGO_TERM_COLOR: always 12 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 13 | 14 | jobs: 15 | rust-checks: 16 | name: Rust Checks 17 | runs-on: ubuntu-latest 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | action: 22 | - command: build 23 | args: --release 24 | - command: fmt 25 | args: --all -- --check --color always 26 | - command: clippy 27 | args: --all-features --workspace -- -D warnings 28 | steps: 29 | - name: Checkout repository 30 | uses: actions/checkout@v4 31 | - name: Enable caching 32 | uses: Swatinem/rust-cache@v2 33 | - name: Setup Rust 34 | uses: dtolnay/rust-toolchain@v1 35 | with: 36 | target: riscv32imc-unknown-none-elf 37 | toolchain: nightly 38 | components: rust-src, rustfmt, clippy 39 | - name: Run command 40 | run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }} 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # These are backup files generated by rustfmt 7 | **/*.rs.bk 8 | 9 | # MSVC Windows builds of rustc generate these, which store debugging information 10 | *.pdb 11 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aes" 7 | version = "0.8.4" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" 10 | dependencies = [ 11 | "cfg-if", 12 | "cipher", 13 | "cpufeatures", 14 | ] 15 | 16 | [[package]] 17 | name = "aho-corasick" 18 | version = "1.1.3" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 21 | dependencies = [ 22 | "memchr", 23 | ] 24 | 25 | [[package]] 26 | name = "anyhow" 27 | version = "1.0.81" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" 30 | 31 | [[package]] 32 | name = "atomic-waker" 33 | version = "1.1.2" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" 36 | dependencies = [ 37 | "portable-atomic", 38 | ] 39 | 40 | [[package]] 41 | name = "autocfg" 42 | version = "1.2.0" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" 45 | 46 | [[package]] 47 | name = "bare-metal" 48 | version = "1.0.0" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603" 51 | 52 | [[package]] 53 | name = "base16ct" 54 | version = "0.2.0" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" 57 | 58 | [[package]] 59 | name = "basic-toml" 60 | version = "0.1.9" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" 63 | dependencies = [ 64 | "serde", 65 | ] 66 | 67 | [[package]] 68 | name = "bitfield" 69 | version = "0.14.0" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" 72 | 73 | [[package]] 74 | name = "bitflags" 75 | version = "2.5.0" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 78 | 79 | [[package]] 80 | name = "bleps" 81 | version = "0.1.0" 82 | source = "git+https://github.com/bjoernQ/bleps.git?rev=1e35e76352dc37459bdf97d3dd266ca88741207e#1e35e76352dc37459bdf97d3dd266ca88741207e" 83 | dependencies = [ 84 | "aes", 85 | "bitfield", 86 | "bleps-dedup", 87 | "bleps-macros", 88 | "cmac", 89 | "critical-section", 90 | "embedded-io", 91 | "embedded-io-async", 92 | "futures", 93 | "log", 94 | "p256", 95 | "rand_core", 96 | ] 97 | 98 | [[package]] 99 | name = "bleps-dedup" 100 | version = "0.1.0" 101 | source = "git+https://github.com/bjoernQ/bleps.git?rev=1e35e76352dc37459bdf97d3dd266ca88741207e#1e35e76352dc37459bdf97d3dd266ca88741207e" 102 | dependencies = [ 103 | "darling", 104 | "proc-macro-error", 105 | "proc-macro2", 106 | "quote", 107 | "syn 2.0.55", 108 | ] 109 | 110 | [[package]] 111 | name = "bleps-macros" 112 | version = "0.1.0" 113 | source = "git+https://github.com/bjoernQ/bleps.git?rev=1e35e76352dc37459bdf97d3dd266ca88741207e#1e35e76352dc37459bdf97d3dd266ca88741207e" 114 | dependencies = [ 115 | "litrs 0.2.3", 116 | "proc-macro2", 117 | "quote", 118 | "syn 1.0.109", 119 | "uuid", 120 | ] 121 | 122 | [[package]] 123 | name = "block-buffer" 124 | version = "0.10.4" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 127 | dependencies = [ 128 | "generic-array", 129 | ] 130 | 131 | [[package]] 132 | name = "byteorder" 133 | version = "1.5.0" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 136 | 137 | [[package]] 138 | name = "cfg-if" 139 | version = "1.0.0" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 142 | 143 | [[package]] 144 | name = "cipher" 145 | version = "0.4.4" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" 148 | dependencies = [ 149 | "crypto-common", 150 | "inout", 151 | ] 152 | 153 | [[package]] 154 | name = "cmac" 155 | version = "0.7.2" 156 | source = "registry+https://github.com/rust-lang/crates.io-index" 157 | checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" 158 | dependencies = [ 159 | "cipher", 160 | "dbl", 161 | "digest", 162 | ] 163 | 164 | [[package]] 165 | name = "const-oid" 166 | version = "0.9.6" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" 169 | 170 | [[package]] 171 | name = "core-isa-parser" 172 | version = "0.2.0" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "23ec98e54b735872e54b2335c2e5a5c7fa7d9c3bfd45500f75280f84089a0083" 175 | dependencies = [ 176 | "anyhow", 177 | "enum-as-inner", 178 | "regex", 179 | "strum 0.24.1", 180 | "strum_macros 0.24.3", 181 | ] 182 | 183 | [[package]] 184 | name = "cpufeatures" 185 | version = "0.2.12" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" 188 | dependencies = [ 189 | "libc", 190 | ] 191 | 192 | [[package]] 193 | name = "critical-section" 194 | version = "1.1.2" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" 197 | 198 | [[package]] 199 | name = "crypto-bigint" 200 | version = "0.5.5" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" 203 | dependencies = [ 204 | "generic-array", 205 | "rand_core", 206 | "subtle", 207 | "zeroize", 208 | ] 209 | 210 | [[package]] 211 | name = "crypto-common" 212 | version = "0.1.6" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 215 | dependencies = [ 216 | "generic-array", 217 | "typenum", 218 | ] 219 | 220 | [[package]] 221 | name = "darling" 222 | version = "0.20.8" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" 225 | dependencies = [ 226 | "darling_core", 227 | "darling_macro", 228 | ] 229 | 230 | [[package]] 231 | name = "darling_core" 232 | version = "0.20.8" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" 235 | dependencies = [ 236 | "fnv", 237 | "ident_case", 238 | "proc-macro2", 239 | "quote", 240 | "strsim", 241 | "syn 2.0.55", 242 | ] 243 | 244 | [[package]] 245 | name = "darling_macro" 246 | version = "0.20.8" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" 249 | dependencies = [ 250 | "darling_core", 251 | "quote", 252 | "syn 2.0.55", 253 | ] 254 | 255 | [[package]] 256 | name = "dbl" 257 | version = "0.3.2" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" 260 | dependencies = [ 261 | "generic-array", 262 | ] 263 | 264 | [[package]] 265 | name = "der" 266 | version = "0.7.8" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" 269 | dependencies = [ 270 | "const-oid", 271 | "zeroize", 272 | ] 273 | 274 | [[package]] 275 | name = "digest" 276 | version = "0.10.7" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 279 | dependencies = [ 280 | "block-buffer", 281 | "crypto-common", 282 | "subtle", 283 | ] 284 | 285 | [[package]] 286 | name = "document-features" 287 | version = "0.2.8" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" 290 | dependencies = [ 291 | "litrs 0.4.1", 292 | ] 293 | 294 | [[package]] 295 | name = "elliptic-curve" 296 | version = "0.13.8" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" 299 | dependencies = [ 300 | "base16ct", 301 | "crypto-bigint", 302 | "digest", 303 | "ff", 304 | "generic-array", 305 | "group", 306 | "hkdf", 307 | "rand_core", 308 | "sec1", 309 | "subtle", 310 | "zeroize", 311 | ] 312 | 313 | [[package]] 314 | name = "embassy-executor" 315 | version = "0.5.0" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "ec648daedd2143466eff4b3e8002024f9f6c1de4ab7666bb679688752624c925" 318 | dependencies = [ 319 | "critical-section", 320 | "document-features", 321 | "embassy-executor-macros", 322 | "embassy-time-driver", 323 | "embassy-time-queue-driver", 324 | "portable-atomic", 325 | ] 326 | 327 | [[package]] 328 | name = "embassy-executor-macros" 329 | version = "0.4.1" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | checksum = "ad454accf80050e9cf7a51e994132ba0e56286b31f9317b68703897c328c59b5" 332 | dependencies = [ 333 | "darling", 334 | "proc-macro2", 335 | "quote", 336 | "syn 2.0.55", 337 | ] 338 | 339 | [[package]] 340 | name = "embassy-futures" 341 | version = "0.1.1" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" 344 | 345 | [[package]] 346 | name = "embassy-sync" 347 | version = "0.5.0" 348 | source = "registry+https://github.com/rust-lang/crates.io-index" 349 | checksum = "dd938f25c0798db4280fcd8026bf4c2f48789aebf8f77b6e5cf8a7693ba114ec" 350 | dependencies = [ 351 | "cfg-if", 352 | "critical-section", 353 | "embedded-io-async", 354 | "futures-util", 355 | "heapless", 356 | ] 357 | 358 | [[package]] 359 | name = "embassy-time" 360 | version = "0.3.0" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "a9c844070d9f80dc66ee739299183312baee2e1cdeb6e90b4ea2af44f4676da5" 363 | dependencies = [ 364 | "cfg-if", 365 | "critical-section", 366 | "document-features", 367 | "embassy-time-driver", 368 | "embassy-time-queue-driver", 369 | "embedded-hal 0.2.7", 370 | "embedded-hal 1.0.0", 371 | "embedded-hal-async", 372 | "futures-util", 373 | "heapless", 374 | ] 375 | 376 | [[package]] 377 | name = "embassy-time-driver" 378 | version = "0.1.0" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "6e0c214077aaa9206958b16411c157961fb7990d4ea628120a78d1a5a28aed24" 381 | dependencies = [ 382 | "document-features", 383 | ] 384 | 385 | [[package]] 386 | name = "embassy-time-queue-driver" 387 | version = "0.1.0" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "f1177859559ebf42cd24ae7ba8fe6ee707489b01d0bf471f8827b7b12dcb0bc0" 390 | 391 | [[package]] 392 | name = "embedded-can" 393 | version = "0.4.1" 394 | source = "registry+https://github.com/rust-lang/crates.io-index" 395 | checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" 396 | dependencies = [ 397 | "nb 1.1.0", 398 | ] 399 | 400 | [[package]] 401 | name = "embedded-dma" 402 | version = "0.2.0" 403 | source = "registry+https://github.com/rust-lang/crates.io-index" 404 | checksum = "994f7e5b5cb23521c22304927195f236813053eb9c065dd2226a32ba64695446" 405 | dependencies = [ 406 | "stable_deref_trait", 407 | ] 408 | 409 | [[package]] 410 | name = "embedded-hal" 411 | version = "0.2.7" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" 414 | dependencies = [ 415 | "nb 0.1.3", 416 | "void", 417 | ] 418 | 419 | [[package]] 420 | name = "embedded-hal" 421 | version = "1.0.0" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" 424 | 425 | [[package]] 426 | name = "embedded-hal-async" 427 | version = "1.0.0" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" 430 | dependencies = [ 431 | "embedded-hal 1.0.0", 432 | ] 433 | 434 | [[package]] 435 | name = "embedded-hal-nb" 436 | version = "1.0.0" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" 439 | dependencies = [ 440 | "embedded-hal 1.0.0", 441 | "nb 1.1.0", 442 | ] 443 | 444 | [[package]] 445 | name = "embedded-io" 446 | version = "0.6.1" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" 449 | 450 | [[package]] 451 | name = "embedded-io-async" 452 | version = "0.6.1" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" 455 | dependencies = [ 456 | "embedded-io", 457 | ] 458 | 459 | [[package]] 460 | name = "enum-as-inner" 461 | version = "0.4.0" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" 464 | dependencies = [ 465 | "heck", 466 | "proc-macro2", 467 | "quote", 468 | "syn 1.0.109", 469 | ] 470 | 471 | [[package]] 472 | name = "enumset" 473 | version = "1.1.3" 474 | source = "registry+https://github.com/rust-lang/crates.io-index" 475 | checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" 476 | dependencies = [ 477 | "enumset_derive", 478 | ] 479 | 480 | [[package]] 481 | name = "enumset_derive" 482 | version = "0.8.1" 483 | source = "registry+https://github.com/rust-lang/crates.io-index" 484 | checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" 485 | dependencies = [ 486 | "darling", 487 | "proc-macro2", 488 | "quote", 489 | "syn 2.0.55", 490 | ] 491 | 492 | [[package]] 493 | name = "equivalent" 494 | version = "1.0.1" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 497 | 498 | [[package]] 499 | name = "esp-backtrace" 500 | version = "0.11.1" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | checksum = "dda6c53c50ed96cce44e8565bd7659f8884d55bac3262184c3a77f748553e3ff" 503 | dependencies = [ 504 | "esp-println", 505 | ] 506 | 507 | [[package]] 508 | name = "esp-hal" 509 | version = "0.16.1" 510 | source = "registry+https://github.com/rust-lang/crates.io-index" 511 | checksum = "cc3e9b3333d2ae42f5c9b4890e162cb756fb1b067ab5f642b89fc9f29be424fa" 512 | dependencies = [ 513 | "basic-toml", 514 | "bitfield", 515 | "bitflags", 516 | "cfg-if", 517 | "critical-section", 518 | "document-features", 519 | "embassy-executor", 520 | "embassy-futures", 521 | "embassy-sync", 522 | "embassy-time-driver", 523 | "embedded-can", 524 | "embedded-dma", 525 | "embedded-hal 0.2.7", 526 | "embedded-hal 1.0.0", 527 | "embedded-hal-async", 528 | "embedded-hal-nb", 529 | "embedded-io", 530 | "embedded-io-async", 531 | "enumset", 532 | "esp-hal-procmacros", 533 | "esp-riscv-rt", 534 | "esp32", 535 | "esp32c2", 536 | "esp32c3", 537 | "esp32c6", 538 | "esp32h2", 539 | "esp32p4", 540 | "esp32s2", 541 | "esp32s3", 542 | "fugit", 543 | "log", 544 | "nb 1.1.0", 545 | "paste", 546 | "portable-atomic", 547 | "rand_core", 548 | "riscv", 549 | "serde", 550 | "strum 0.26.2", 551 | "void", 552 | "xtensa-lx-rt", 553 | ] 554 | 555 | [[package]] 556 | name = "esp-hal-procmacros" 557 | version = "0.9.0" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "05084ecf8446fe60e0aff6c3873c96dca56dc383a449324ca555edbb80ae60c0" 560 | dependencies = [ 561 | "darling", 562 | "document-features", 563 | "litrs 0.4.1", 564 | "proc-macro-crate", 565 | "proc-macro-error", 566 | "proc-macro2", 567 | "quote", 568 | "syn 2.0.55", 569 | ] 570 | 571 | [[package]] 572 | name = "esp-println" 573 | version = "0.9.1" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "e98f0f58453dd2ce08d99228fc8757fad39d05dfd26643665d1093b8844f42cc" 576 | dependencies = [ 577 | "critical-section", 578 | "log", 579 | ] 580 | 581 | [[package]] 582 | name = "esp-riscv-rt" 583 | version = "0.7.0" 584 | source = "registry+https://github.com/rust-lang/crates.io-index" 585 | checksum = "e599762d31156fa2322db4d5a0784c13b6122b79c1fa7bed70953de2f7d731f1" 586 | dependencies = [ 587 | "document-features", 588 | "riscv", 589 | "riscv-rt-macros", 590 | ] 591 | 592 | [[package]] 593 | name = "esp-wifi" 594 | version = "0.4.0" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "4bdfa4a39424472e5412fb2c7783f2cd42c7780893f440b34958a2df1b48628b" 597 | dependencies = [ 598 | "atomic-waker", 599 | "cfg-if", 600 | "critical-section", 601 | "embassy-futures", 602 | "embassy-sync", 603 | "embedded-io", 604 | "embedded-io-async", 605 | "esp-hal", 606 | "esp-wifi-sys", 607 | "fugit", 608 | "futures-util", 609 | "heapless", 610 | "libm", 611 | "linked_list_allocator", 612 | "log", 613 | "num-derive", 614 | "num-traits", 615 | "portable-atomic", 616 | "portable_atomic_enum", 617 | "toml-cfg", 618 | ] 619 | 620 | [[package]] 621 | name = "esp-wifi-sys" 622 | version = "0.3.0" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | checksum = "551b510b3944844675fcefa1301b3610fe56faa419bcc05dd0dd0056745c6654" 625 | dependencies = [ 626 | "anyhow", 627 | ] 628 | 629 | [[package]] 630 | name = "esp32" 631 | version = "0.29.0" 632 | source = "registry+https://github.com/rust-lang/crates.io-index" 633 | checksum = "343ac30c4537d3f8526490db4264091a9785a55bcdfc22fc34482751a501d8d2" 634 | dependencies = [ 635 | "critical-section", 636 | "vcell", 637 | "xtensa-lx", 638 | ] 639 | 640 | [[package]] 641 | name = "esp32c2" 642 | version = "0.18.0" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "55e30c9147b7a1f388887dfd2fe7da4d6159a0248603674af5f3a5282a46cd11" 645 | dependencies = [ 646 | "critical-section", 647 | "vcell", 648 | ] 649 | 650 | [[package]] 651 | name = "esp32c3" 652 | version = "0.21.0" 653 | source = "registry+https://github.com/rust-lang/crates.io-index" 654 | checksum = "4a7ee710c1e4f16b5e840cdfec3f4e7642b7517a877c5c4b7e1cafa9a14117c5" 655 | dependencies = [ 656 | "critical-section", 657 | "vcell", 658 | ] 659 | 660 | [[package]] 661 | name = "esp32c3-ble-hid" 662 | version = "0.1.0" 663 | dependencies = [ 664 | "bleps", 665 | "embassy-executor", 666 | "embassy-sync", 667 | "embassy-time", 668 | "embedded-hal-async", 669 | "esp-backtrace", 670 | "esp-hal", 671 | "esp-println", 672 | "esp-wifi", 673 | "rand_core", 674 | "static_cell", 675 | ] 676 | 677 | [[package]] 678 | name = "esp32c6" 679 | version = "0.12.0" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | checksum = "ff0275425ea3a7675b7b5903163a93b65e8ce5b9c8a7749ed397279ed2ade3e3" 682 | dependencies = [ 683 | "critical-section", 684 | "vcell", 685 | ] 686 | 687 | [[package]] 688 | name = "esp32h2" 689 | version = "0.8.0" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "e606c8e60d3e68afda997fa9fcc8d8fe1d2e3c172505bb03eb9ab79b4bca4d6a" 692 | dependencies = [ 693 | "critical-section", 694 | "vcell", 695 | ] 696 | 697 | [[package]] 698 | name = "esp32p4" 699 | version = "0.1.0" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "c03c0bc7973e6805e3c3c3c979e9418ba30380d8c16989a477440dbce8cf1965" 702 | dependencies = [ 703 | "critical-section", 704 | "vcell", 705 | ] 706 | 707 | [[package]] 708 | name = "esp32s2" 709 | version = "0.20.0" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "0fbcb8e9a4097fbf1c455fc776ad46a4bb7861d5bad3c3cd4549b666ad906ce4" 712 | dependencies = [ 713 | "critical-section", 714 | "vcell", 715 | "xtensa-lx", 716 | ] 717 | 718 | [[package]] 719 | name = "esp32s3" 720 | version = "0.24.0" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "044e216560a33aa5d6c98163c8ae4278845ec3bae7b9cab520da0697be4f23a6" 723 | dependencies = [ 724 | "critical-section", 725 | "vcell", 726 | "xtensa-lx", 727 | ] 728 | 729 | [[package]] 730 | name = "ff" 731 | version = "0.13.0" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" 734 | dependencies = [ 735 | "rand_core", 736 | "subtle", 737 | ] 738 | 739 | [[package]] 740 | name = "fnv" 741 | version = "1.0.7" 742 | source = "registry+https://github.com/rust-lang/crates.io-index" 743 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 744 | 745 | [[package]] 746 | name = "fugit" 747 | version = "0.3.7" 748 | source = "registry+https://github.com/rust-lang/crates.io-index" 749 | checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" 750 | dependencies = [ 751 | "gcd", 752 | ] 753 | 754 | [[package]] 755 | name = "futures" 756 | version = "0.3.30" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" 759 | dependencies = [ 760 | "futures-channel", 761 | "futures-core", 762 | "futures-io", 763 | "futures-sink", 764 | "futures-task", 765 | "futures-util", 766 | ] 767 | 768 | [[package]] 769 | name = "futures-channel" 770 | version = "0.3.30" 771 | source = "registry+https://github.com/rust-lang/crates.io-index" 772 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 773 | dependencies = [ 774 | "futures-core", 775 | "futures-sink", 776 | ] 777 | 778 | [[package]] 779 | name = "futures-core" 780 | version = "0.3.30" 781 | source = "registry+https://github.com/rust-lang/crates.io-index" 782 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 783 | dependencies = [ 784 | "portable-atomic", 785 | ] 786 | 787 | [[package]] 788 | name = "futures-io" 789 | version = "0.3.30" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" 792 | 793 | [[package]] 794 | name = "futures-sink" 795 | version = "0.3.30" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" 798 | 799 | [[package]] 800 | name = "futures-task" 801 | version = "0.3.30" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 804 | 805 | [[package]] 806 | name = "futures-util" 807 | version = "0.3.30" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 810 | dependencies = [ 811 | "futures-core", 812 | "futures-sink", 813 | "futures-task", 814 | "pin-project-lite", 815 | "pin-utils", 816 | ] 817 | 818 | [[package]] 819 | name = "gcd" 820 | version = "2.3.0" 821 | source = "registry+https://github.com/rust-lang/crates.io-index" 822 | checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" 823 | 824 | [[package]] 825 | name = "generic-array" 826 | version = "0.14.7" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 829 | dependencies = [ 830 | "typenum", 831 | "version_check", 832 | "zeroize", 833 | ] 834 | 835 | [[package]] 836 | name = "group" 837 | version = "0.13.0" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" 840 | dependencies = [ 841 | "ff", 842 | "rand_core", 843 | "subtle", 844 | ] 845 | 846 | [[package]] 847 | name = "hash32" 848 | version = "0.3.1" 849 | source = "registry+https://github.com/rust-lang/crates.io-index" 850 | checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" 851 | dependencies = [ 852 | "byteorder", 853 | ] 854 | 855 | [[package]] 856 | name = "hashbrown" 857 | version = "0.14.3" 858 | source = "registry+https://github.com/rust-lang/crates.io-index" 859 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 860 | 861 | [[package]] 862 | name = "heapless" 863 | version = "0.8.0" 864 | source = "registry+https://github.com/rust-lang/crates.io-index" 865 | checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" 866 | dependencies = [ 867 | "hash32", 868 | "portable-atomic", 869 | "stable_deref_trait", 870 | ] 871 | 872 | [[package]] 873 | name = "heck" 874 | version = "0.4.1" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 877 | 878 | [[package]] 879 | name = "hkdf" 880 | version = "0.12.4" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" 883 | dependencies = [ 884 | "hmac", 885 | ] 886 | 887 | [[package]] 888 | name = "hmac" 889 | version = "0.12.1" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 892 | dependencies = [ 893 | "digest", 894 | ] 895 | 896 | [[package]] 897 | name = "ident_case" 898 | version = "1.0.1" 899 | source = "registry+https://github.com/rust-lang/crates.io-index" 900 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 901 | 902 | [[package]] 903 | name = "indexmap" 904 | version = "2.2.6" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" 907 | dependencies = [ 908 | "equivalent", 909 | "hashbrown", 910 | ] 911 | 912 | [[package]] 913 | name = "inout" 914 | version = "0.1.3" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" 917 | dependencies = [ 918 | "generic-array", 919 | ] 920 | 921 | [[package]] 922 | name = "libc" 923 | version = "0.2.153" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 926 | 927 | [[package]] 928 | name = "libm" 929 | version = "0.2.8" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" 932 | 933 | [[package]] 934 | name = "linked_list_allocator" 935 | version = "0.10.5" 936 | source = "registry+https://github.com/rust-lang/crates.io-index" 937 | checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" 938 | 939 | [[package]] 940 | name = "litrs" 941 | version = "0.2.3" 942 | source = "registry+https://github.com/rust-lang/crates.io-index" 943 | checksum = "f9275e0933cf8bb20f008924c0cb07a0692fe54d8064996520bf998de9eb79aa" 944 | dependencies = [ 945 | "proc-macro2", 946 | ] 947 | 948 | [[package]] 949 | name = "litrs" 950 | version = "0.4.1" 951 | source = "registry+https://github.com/rust-lang/crates.io-index" 952 | checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" 953 | dependencies = [ 954 | "proc-macro2", 955 | ] 956 | 957 | [[package]] 958 | name = "lock_api" 959 | version = "0.4.11" 960 | source = "registry+https://github.com/rust-lang/crates.io-index" 961 | checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" 962 | dependencies = [ 963 | "autocfg", 964 | "scopeguard", 965 | ] 966 | 967 | [[package]] 968 | name = "log" 969 | version = "0.4.21" 970 | source = "registry+https://github.com/rust-lang/crates.io-index" 971 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 972 | 973 | [[package]] 974 | name = "memchr" 975 | version = "2.7.1" 976 | source = "registry+https://github.com/rust-lang/crates.io-index" 977 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" 978 | 979 | [[package]] 980 | name = "minijinja" 981 | version = "1.0.15" 982 | source = "registry+https://github.com/rust-lang/crates.io-index" 983 | checksum = "57be929672ea2de446d39b3626c1cd1e55bd1db40f90ebee28d242a3d6baa65f" 984 | dependencies = [ 985 | "serde", 986 | ] 987 | 988 | [[package]] 989 | name = "mutex-trait" 990 | version = "0.2.0" 991 | source = "registry+https://github.com/rust-lang/crates.io-index" 992 | checksum = "b4bb1638d419e12f8b1c43d9e639abd0d1424285bdea2f76aa231e233c63cd3a" 993 | 994 | [[package]] 995 | name = "nb" 996 | version = "0.1.3" 997 | source = "registry+https://github.com/rust-lang/crates.io-index" 998 | checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" 999 | dependencies = [ 1000 | "nb 1.1.0", 1001 | ] 1002 | 1003 | [[package]] 1004 | name = "nb" 1005 | version = "1.1.0" 1006 | source = "registry+https://github.com/rust-lang/crates.io-index" 1007 | checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" 1008 | 1009 | [[package]] 1010 | name = "num-derive" 1011 | version = "0.4.2" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" 1014 | dependencies = [ 1015 | "proc-macro2", 1016 | "quote", 1017 | "syn 2.0.55", 1018 | ] 1019 | 1020 | [[package]] 1021 | name = "num-traits" 1022 | version = "0.2.18" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 1025 | dependencies = [ 1026 | "autocfg", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "p256" 1031 | version = "0.13.2" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" 1034 | dependencies = [ 1035 | "elliptic-curve", 1036 | "primeorder", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "paste" 1041 | version = "1.0.14" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" 1044 | 1045 | [[package]] 1046 | name = "pin-project-lite" 1047 | version = "0.2.13" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 1050 | 1051 | [[package]] 1052 | name = "pin-utils" 1053 | version = "0.1.0" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1056 | 1057 | [[package]] 1058 | name = "portable-atomic" 1059 | version = "1.6.0" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" 1062 | 1063 | [[package]] 1064 | name = "portable_atomic_enum" 1065 | version = "0.3.1" 1066 | source = "registry+https://github.com/rust-lang/crates.io-index" 1067 | checksum = "30d48f60c43e0120bb2bb48589a16d4bed2f4b911be41e299f2d0fc0e0e20885" 1068 | dependencies = [ 1069 | "portable-atomic", 1070 | "portable_atomic_enum_macros", 1071 | ] 1072 | 1073 | [[package]] 1074 | name = "portable_atomic_enum_macros" 1075 | version = "0.2.1" 1076 | source = "registry+https://github.com/rust-lang/crates.io-index" 1077 | checksum = "a33fa6ec7f2047f572d49317cca19c87195de99c6e5b6ee492da701cfe02b053" 1078 | dependencies = [ 1079 | "proc-macro2", 1080 | "quote", 1081 | "syn 2.0.55", 1082 | ] 1083 | 1084 | [[package]] 1085 | name = "primeorder" 1086 | version = "0.13.6" 1087 | source = "registry+https://github.com/rust-lang/crates.io-index" 1088 | checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" 1089 | dependencies = [ 1090 | "elliptic-curve", 1091 | ] 1092 | 1093 | [[package]] 1094 | name = "proc-macro-crate" 1095 | version = "3.1.0" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" 1098 | dependencies = [ 1099 | "toml_edit 0.21.1", 1100 | ] 1101 | 1102 | [[package]] 1103 | name = "proc-macro-error" 1104 | version = "1.0.4" 1105 | source = "registry+https://github.com/rust-lang/crates.io-index" 1106 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 1107 | dependencies = [ 1108 | "proc-macro-error-attr", 1109 | "proc-macro2", 1110 | "quote", 1111 | "syn 1.0.109", 1112 | "version_check", 1113 | ] 1114 | 1115 | [[package]] 1116 | name = "proc-macro-error-attr" 1117 | version = "1.0.4" 1118 | source = "registry+https://github.com/rust-lang/crates.io-index" 1119 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 1120 | dependencies = [ 1121 | "proc-macro2", 1122 | "quote", 1123 | "version_check", 1124 | ] 1125 | 1126 | [[package]] 1127 | name = "proc-macro2" 1128 | version = "1.0.79" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" 1131 | dependencies = [ 1132 | "unicode-ident", 1133 | ] 1134 | 1135 | [[package]] 1136 | name = "quote" 1137 | version = "1.0.35" 1138 | source = "registry+https://github.com/rust-lang/crates.io-index" 1139 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 1140 | dependencies = [ 1141 | "proc-macro2", 1142 | ] 1143 | 1144 | [[package]] 1145 | name = "r0" 1146 | version = "1.0.0" 1147 | source = "registry+https://github.com/rust-lang/crates.io-index" 1148 | checksum = "bd7a31eed1591dcbc95d92ad7161908e72f4677f8fabf2a32ca49b4237cbf211" 1149 | 1150 | [[package]] 1151 | name = "rand_core" 1152 | version = "0.6.4" 1153 | source = "registry+https://github.com/rust-lang/crates.io-index" 1154 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1155 | 1156 | [[package]] 1157 | name = "regex" 1158 | version = "1.10.4" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" 1161 | dependencies = [ 1162 | "aho-corasick", 1163 | "memchr", 1164 | "regex-automata", 1165 | "regex-syntax", 1166 | ] 1167 | 1168 | [[package]] 1169 | name = "regex-automata" 1170 | version = "0.4.6" 1171 | source = "registry+https://github.com/rust-lang/crates.io-index" 1172 | checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" 1173 | dependencies = [ 1174 | "aho-corasick", 1175 | "memchr", 1176 | "regex-syntax", 1177 | ] 1178 | 1179 | [[package]] 1180 | name = "regex-syntax" 1181 | version = "0.8.3" 1182 | source = "registry+https://github.com/rust-lang/crates.io-index" 1183 | checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" 1184 | 1185 | [[package]] 1186 | name = "riscv" 1187 | version = "0.11.1" 1188 | source = "registry+https://github.com/rust-lang/crates.io-index" 1189 | checksum = "2f5c1b8bf41ea746266cdee443d1d1e9125c86ce1447e1a2615abd34330d33a9" 1190 | dependencies = [ 1191 | "critical-section", 1192 | "embedded-hal 1.0.0", 1193 | ] 1194 | 1195 | [[package]] 1196 | name = "riscv-rt-macros" 1197 | version = "0.2.1" 1198 | source = "registry+https://github.com/rust-lang/crates.io-index" 1199 | checksum = "a8d100d466dbb76681ef6a9386f3da9abc570d57394e86da0ba5af8c4408486d" 1200 | dependencies = [ 1201 | "proc-macro2", 1202 | "quote", 1203 | "syn 1.0.109", 1204 | ] 1205 | 1206 | [[package]] 1207 | name = "rustversion" 1208 | version = "1.0.14" 1209 | source = "registry+https://github.com/rust-lang/crates.io-index" 1210 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 1211 | 1212 | [[package]] 1213 | name = "scopeguard" 1214 | version = "1.2.0" 1215 | source = "registry+https://github.com/rust-lang/crates.io-index" 1216 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1217 | 1218 | [[package]] 1219 | name = "sec1" 1220 | version = "0.7.3" 1221 | source = "registry+https://github.com/rust-lang/crates.io-index" 1222 | checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" 1223 | dependencies = [ 1224 | "base16ct", 1225 | "der", 1226 | "generic-array", 1227 | "subtle", 1228 | "zeroize", 1229 | ] 1230 | 1231 | [[package]] 1232 | name = "serde" 1233 | version = "1.0.197" 1234 | source = "registry+https://github.com/rust-lang/crates.io-index" 1235 | checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" 1236 | dependencies = [ 1237 | "serde_derive", 1238 | ] 1239 | 1240 | [[package]] 1241 | name = "serde_derive" 1242 | version = "1.0.197" 1243 | source = "registry+https://github.com/rust-lang/crates.io-index" 1244 | checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" 1245 | dependencies = [ 1246 | "proc-macro2", 1247 | "quote", 1248 | "syn 2.0.55", 1249 | ] 1250 | 1251 | [[package]] 1252 | name = "serde_spanned" 1253 | version = "0.6.5" 1254 | source = "registry+https://github.com/rust-lang/crates.io-index" 1255 | checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" 1256 | dependencies = [ 1257 | "serde", 1258 | ] 1259 | 1260 | [[package]] 1261 | name = "spin" 1262 | version = "0.9.8" 1263 | source = "registry+https://github.com/rust-lang/crates.io-index" 1264 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 1265 | dependencies = [ 1266 | "lock_api", 1267 | ] 1268 | 1269 | [[package]] 1270 | name = "stable_deref_trait" 1271 | version = "1.2.0" 1272 | source = "registry+https://github.com/rust-lang/crates.io-index" 1273 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1274 | 1275 | [[package]] 1276 | name = "static_cell" 1277 | version = "2.0.0" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "fa6ba4cf83bf80d3eb25f098ea5e790a0a1fcb5e357442259b231e412c2d3ca0" 1280 | dependencies = [ 1281 | "portable-atomic", 1282 | ] 1283 | 1284 | [[package]] 1285 | name = "strsim" 1286 | version = "0.10.0" 1287 | source = "registry+https://github.com/rust-lang/crates.io-index" 1288 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 1289 | 1290 | [[package]] 1291 | name = "strum" 1292 | version = "0.24.1" 1293 | source = "registry+https://github.com/rust-lang/crates.io-index" 1294 | checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" 1295 | 1296 | [[package]] 1297 | name = "strum" 1298 | version = "0.26.2" 1299 | source = "registry+https://github.com/rust-lang/crates.io-index" 1300 | checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" 1301 | dependencies = [ 1302 | "strum_macros 0.26.2", 1303 | ] 1304 | 1305 | [[package]] 1306 | name = "strum_macros" 1307 | version = "0.24.3" 1308 | source = "registry+https://github.com/rust-lang/crates.io-index" 1309 | checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" 1310 | dependencies = [ 1311 | "heck", 1312 | "proc-macro2", 1313 | "quote", 1314 | "rustversion", 1315 | "syn 1.0.109", 1316 | ] 1317 | 1318 | [[package]] 1319 | name = "strum_macros" 1320 | version = "0.26.2" 1321 | source = "registry+https://github.com/rust-lang/crates.io-index" 1322 | checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" 1323 | dependencies = [ 1324 | "heck", 1325 | "proc-macro2", 1326 | "quote", 1327 | "rustversion", 1328 | "syn 2.0.55", 1329 | ] 1330 | 1331 | [[package]] 1332 | name = "subtle" 1333 | version = "2.5.0" 1334 | source = "registry+https://github.com/rust-lang/crates.io-index" 1335 | checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" 1336 | 1337 | [[package]] 1338 | name = "syn" 1339 | version = "1.0.109" 1340 | source = "registry+https://github.com/rust-lang/crates.io-index" 1341 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1342 | dependencies = [ 1343 | "proc-macro2", 1344 | "quote", 1345 | "unicode-ident", 1346 | ] 1347 | 1348 | [[package]] 1349 | name = "syn" 1350 | version = "2.0.55" 1351 | source = "registry+https://github.com/rust-lang/crates.io-index" 1352 | checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" 1353 | dependencies = [ 1354 | "proc-macro2", 1355 | "quote", 1356 | "unicode-ident", 1357 | ] 1358 | 1359 | [[package]] 1360 | name = "toml" 1361 | version = "0.8.12" 1362 | source = "registry+https://github.com/rust-lang/crates.io-index" 1363 | checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" 1364 | dependencies = [ 1365 | "serde", 1366 | "serde_spanned", 1367 | "toml_datetime", 1368 | "toml_edit 0.22.9", 1369 | ] 1370 | 1371 | [[package]] 1372 | name = "toml-cfg" 1373 | version = "0.2.0" 1374 | source = "registry+https://github.com/rust-lang/crates.io-index" 1375 | checksum = "68c587298ddd135c156e92e8c3eae69614d6eecea8e2d8a09daab011e5e6a21d" 1376 | dependencies = [ 1377 | "heck", 1378 | "proc-macro2", 1379 | "quote", 1380 | "serde", 1381 | "syn 2.0.55", 1382 | "toml", 1383 | ] 1384 | 1385 | [[package]] 1386 | name = "toml_datetime" 1387 | version = "0.6.5" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" 1390 | dependencies = [ 1391 | "serde", 1392 | ] 1393 | 1394 | [[package]] 1395 | name = "toml_edit" 1396 | version = "0.21.1" 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" 1398 | checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" 1399 | dependencies = [ 1400 | "indexmap", 1401 | "toml_datetime", 1402 | "winnow 0.5.40", 1403 | ] 1404 | 1405 | [[package]] 1406 | name = "toml_edit" 1407 | version = "0.22.9" 1408 | source = "registry+https://github.com/rust-lang/crates.io-index" 1409 | checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" 1410 | dependencies = [ 1411 | "indexmap", 1412 | "serde", 1413 | "serde_spanned", 1414 | "toml_datetime", 1415 | "winnow 0.6.5", 1416 | ] 1417 | 1418 | [[package]] 1419 | name = "typenum" 1420 | version = "1.17.0" 1421 | source = "registry+https://github.com/rust-lang/crates.io-index" 1422 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 1423 | 1424 | [[package]] 1425 | name = "unicode-ident" 1426 | version = "1.0.12" 1427 | source = "registry+https://github.com/rust-lang/crates.io-index" 1428 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1429 | 1430 | [[package]] 1431 | name = "uuid" 1432 | version = "1.8.0" 1433 | source = "registry+https://github.com/rust-lang/crates.io-index" 1434 | checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" 1435 | 1436 | [[package]] 1437 | name = "vcell" 1438 | version = "0.1.3" 1439 | source = "registry+https://github.com/rust-lang/crates.io-index" 1440 | checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" 1441 | 1442 | [[package]] 1443 | name = "version_check" 1444 | version = "0.9.4" 1445 | source = "registry+https://github.com/rust-lang/crates.io-index" 1446 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1447 | 1448 | [[package]] 1449 | name = "void" 1450 | version = "1.0.2" 1451 | source = "registry+https://github.com/rust-lang/crates.io-index" 1452 | checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 1453 | 1454 | [[package]] 1455 | name = "winnow" 1456 | version = "0.5.40" 1457 | source = "registry+https://github.com/rust-lang/crates.io-index" 1458 | checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" 1459 | dependencies = [ 1460 | "memchr", 1461 | ] 1462 | 1463 | [[package]] 1464 | name = "winnow" 1465 | version = "0.6.5" 1466 | source = "registry+https://github.com/rust-lang/crates.io-index" 1467 | checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" 1468 | dependencies = [ 1469 | "memchr", 1470 | ] 1471 | 1472 | [[package]] 1473 | name = "xtensa-lx" 1474 | version = "0.9.0" 1475 | source = "registry+https://github.com/rust-lang/crates.io-index" 1476 | checksum = "e758f94e1a1f71758f94052a2766dcb12604998eb372b8b2e30576e3ab1ba1e6" 1477 | dependencies = [ 1478 | "bare-metal", 1479 | "mutex-trait", 1480 | "spin", 1481 | ] 1482 | 1483 | [[package]] 1484 | name = "xtensa-lx-rt" 1485 | version = "0.16.0" 1486 | source = "registry+https://github.com/rust-lang/crates.io-index" 1487 | checksum = "904102108b780c9a5e3275c5f3c63dc348ec43ae5da5237868515498b447d51a" 1488 | dependencies = [ 1489 | "bare-metal", 1490 | "core-isa-parser", 1491 | "minijinja", 1492 | "r0", 1493 | "xtensa-lx-rt-proc-macros", 1494 | ] 1495 | 1496 | [[package]] 1497 | name = "xtensa-lx-rt-proc-macros" 1498 | version = "0.2.1" 1499 | source = "registry+https://github.com/rust-lang/crates.io-index" 1500 | checksum = "082cdede098bbec9af15b0e74085e5f3d16f2923597de7aed7b8112003af2da7" 1501 | dependencies = [ 1502 | "darling", 1503 | "proc-macro2", 1504 | "quote", 1505 | "syn 2.0.55", 1506 | ] 1507 | 1508 | [[package]] 1509 | name = "zeroize" 1510 | version = "1.7.0" 1511 | source = "registry+https://github.com/rust-lang/crates.io-index" 1512 | checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" 1513 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "esp32c3-ble-hid" 3 | version = "0.1.0" 4 | authors = ["bjoernQ "] 5 | edition = "2021" 6 | license = "MIT OR Apache-2.0" 7 | 8 | [dependencies] 9 | hal = { package = "esp-hal", version = "0.16.0", features = [ 10 | "esp32c3", 11 | "embassy", 12 | "embassy-time-timg0", 13 | "embassy-executor-thread", 14 | ] } 15 | esp-backtrace = { version = "0.11.1", features = [ 16 | "esp32c3", 17 | "panic-handler", 18 | "exception-handler", 19 | "println", 20 | ] } 21 | esp-println = { version = "0.9.1", features = ["esp32c3", "log", "uart"] } 22 | esp-wifi = { version = "0.4.0", features = ["esp32c3", "ble", "async", "dump-packets"] } 23 | embassy-executor = { version = "0.5.0", features = [ 24 | "nightly", 25 | "integrated-timers", 26 | "arch-riscv32", 27 | ] } 28 | embassy-sync = { version = "0.5.0" } 29 | bleps = { git = "https://github.com/bjoernQ/bleps.git", rev = "1e35e76352dc37459bdf97d3dd266ca88741207e", package = "bleps", features = [ 30 | "macros", 31 | "async", 32 | "crypto", 33 | ] } 34 | rand_core = { version = "0.6.4" } 35 | embedded-hal-async = { version = "1.0.0-rc.2" } 36 | static_cell = { version = "2.0.0", features = ["nightly"] } 37 | embassy-time = { version = "0.3.0" } 38 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright [year] [fullname] 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ESP32-C3 BLE HID Keyboard 2 | 3 | Example/experiment using bare-metal Rust to simulate a BLE HID keyboard on ESP32-C3. 4 | 5 | Tested on Android and Windows 11. 6 | 7 | When paired, pressing the boot button should enter 'esp32'. 8 | 9 | Currently the LTK isn't persisted - when you reboot the ESP32-C3 it won't be paired anymore. 10 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly" 3 | components = ["rust-src"] 4 | targets = ["riscv32imc-unknown-none-elf"] 5 | 6 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #![no_std] 2 | #![no_main] 3 | #![feature(type_alias_impl_trait)] 4 | #![feature(async_closure)] 5 | 6 | use bleps::{ 7 | ad_structure::{ 8 | create_advertising_data, AdStructure, BR_EDR_NOT_SUPPORTED, LE_GENERAL_DISCOVERABLE, 9 | }, 10 | async_attribute_server::AttributeServer, 11 | asynch::Ble, 12 | attribute_server::NotificationData, 13 | gatt, Addr, 14 | }; 15 | use embassy_executor::Spawner; 16 | use embassy_sync::{ 17 | blocking_mutex::raw::NoopRawMutex, 18 | channel::{Channel, Sender}, 19 | }; 20 | use embassy_time::{Duration, Timer}; 21 | use embedded_hal_async::digital::Wait; 22 | use esp_backtrace as _; 23 | use esp_println::println; 24 | use esp_wifi::{ble::controller::asynch::BleConnector, initialize, EspWifiInitFor}; 25 | use hal::{ 26 | clock::ClockControl, 27 | embassy, 28 | gpio::{GpioPin, Input, PullDown}, 29 | macros::main, 30 | peripherals::*, 31 | prelude::*, 32 | timer::TimerGroup, 33 | Rng, IO, 34 | }; 35 | use static_cell::make_static; 36 | 37 | macro_rules! count { 38 | () => { 0u8 }; 39 | ($x:tt $($xs:tt)*) => {1u8 + count!($($xs)*)}; 40 | } 41 | 42 | macro_rules! hid { 43 | ($(( $($xs:tt),*)),+ $(,)?) => { &[ $( (count!($($xs)*)-1) | $($xs),* ),* ] }; 44 | } 45 | 46 | // Main items 47 | pub const HIDINPUT: u8 = 0x80; 48 | pub const HIDOUTPUT: u8 = 0x90; 49 | pub const FEATURE: u8 = 0xb0; 50 | pub const COLLECTION: u8 = 0xa0; 51 | pub const END_COLLECTION: u8 = 0xc0; 52 | 53 | // Global items 54 | pub const USAGE_PAGE: u8 = 0x04; 55 | pub const LOGICAL_MINIMUM: u8 = 0x14; 56 | pub const LOGICAL_MAXIMUM: u8 = 0x24; 57 | pub const PHYSICAL_MINIMUM: u8 = 0x34; 58 | pub const PHYSICAL_MAXIMUM: u8 = 0x44; 59 | pub const UNIT_EXPONENT: u8 = 0x54; 60 | pub const UNIT: u8 = 0x64; 61 | pub const REPORT_SIZE: u8 = 0x74; //bits 62 | pub const REPORT_ID: u8 = 0x84; 63 | pub const REPORT_COUNT: u8 = 0x94; //bytes 64 | pub const PUSH: u8 = 0xa4; 65 | pub const POP: u8 = 0xb4; 66 | 67 | // Local items 68 | pub const USAGE: u8 = 0x08; 69 | pub const USAGE_MINIMUM: u8 = 0x18; 70 | pub const USAGE_MAXIMUM: u8 = 0x28; 71 | pub const DESIGNATOR_INDEX: u8 = 0x38; 72 | pub const DESIGNATOR_MINIMUM: u8 = 0x48; 73 | pub const DESIGNATOR_MAXIMUM: u8 = 0x58; 74 | pub const STRING_INDEX: u8 = 0x78; 75 | pub const STRING_MINIMUM: u8 = 0x88; 76 | pub const STRING_MAXIMUM: u8 = 0x98; 77 | pub const DELIMITER: u8 = 0xa8; 78 | 79 | const KEYBOARD_ID: u8 = 0x01; 80 | 81 | const REPORT_MAP: &[u8] = hid!( 82 | (USAGE_PAGE, 0x01), // USAGE_PAGE (Generic Desktop Ctrls) 83 | (USAGE, 0x06), // USAGE (Keyboard) 84 | (COLLECTION, 0x01), // COLLECTION (Application) 85 | // ------------------------------------------------- Keyboard 86 | (REPORT_ID, KEYBOARD_ID), // REPORT_ID (1) 87 | (USAGE_PAGE, 0x07), // USAGE_PAGE (Kbrd/Keypad) 88 | (USAGE_MINIMUM, 0xE0), // USAGE_MINIMUM (0xE0) 89 | (USAGE_MAXIMUM, 0xE7), // USAGE_MAXIMUM (0xE7) 90 | (LOGICAL_MINIMUM, 0x00), // LOGICAL_MINIMUM (0) 91 | (LOGICAL_MAXIMUM, 0x01), // Logical Maximum (1) 92 | (REPORT_SIZE, 0x01), // REPORT_SIZE (1) 93 | (REPORT_COUNT, 0x08), // REPORT_COUNT (8) 94 | (HIDINPUT, 0x02), // INPUT (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) 95 | (REPORT_COUNT, 0x01), // REPORT_COUNT (1) ; 1 byte (Reserved) 96 | (REPORT_SIZE, 0x08), // REPORT_SIZE (8) 97 | (HIDINPUT, 0x01), // INPUT (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) 98 | (REPORT_COUNT, 0x05), // REPORT_COUNT (5) ; 5 bits (Num lock, Caps lock, Scroll lock, Compose, Kana) 99 | (REPORT_SIZE, 0x01), // REPORT_SIZE (1) 100 | (USAGE_PAGE, 0x08), // USAGE_PAGE (LEDs) 101 | (USAGE_MINIMUM, 0x01), // USAGE_MINIMUM (0x01) ; Num Lock 102 | (USAGE_MAXIMUM, 0x05), // USAGE_MAXIMUM (0x05) ; Kana 103 | (HIDOUTPUT, 0x02), // OUTPUT (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) 104 | (REPORT_COUNT, 0x01), // REPORT_COUNT (1) ; 3 bits (Padding) 105 | (REPORT_SIZE, 0x03), // REPORT_SIZE (3) 106 | (HIDOUTPUT, 0x01), // OUTPUT (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) 107 | (REPORT_COUNT, 0x06), // REPORT_COUNT (6) ; 6 bytes (Keys) 108 | (REPORT_SIZE, 0x08), // REPORT_SIZE(8) 109 | (LOGICAL_MINIMUM, 0x00), // LOGICAL_MINIMUM(0) 110 | (LOGICAL_MAXIMUM, 0x65), // LOGICAL_MAXIMUM(0x65) ; 101 keys 111 | (USAGE_PAGE, 0x07), // USAGE_PAGE (Kbrd/Keypad) 112 | (USAGE_MINIMUM, 0x00), // USAGE_MINIMUM (0) 113 | (USAGE_MAXIMUM, 0x65), // USAGE_MAXIMUM (0x65) 114 | (HIDINPUT, 0x00), // INPUT (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) 115 | (END_COLLECTION), // END_COLLECTION 116 | ); 117 | 118 | struct KeyboardReport { 119 | modifiers: u8, 120 | reserved: u8, 121 | key_codes: [u8; 6], 122 | } 123 | 124 | impl KeyboardReport { 125 | fn to_bytes(&self) -> [u8; 8] { 126 | [ 127 | self.modifiers, 128 | self.reserved, 129 | self.key_codes[0], 130 | self.key_codes[1], 131 | self.key_codes[2], 132 | self.key_codes[3], 133 | self.key_codes[4], 134 | self.key_codes[5], 135 | ] 136 | } 137 | } 138 | 139 | #[main] 140 | async fn main(spawner: Spawner) -> ! { 141 | esp_println::logger::init_logger_from_env(); 142 | 143 | let peripherals = Peripherals::take(); 144 | 145 | let system = peripherals.SYSTEM.split(); 146 | let clocks = ClockControl::max(system.clock_control).freeze(); 147 | 148 | let rng = Rng::new(peripherals.RNG); 149 | let timer = hal::systimer::SystemTimer::new(peripherals.SYSTIMER).alarm0; 150 | let init = initialize( 151 | EspWifiInitFor::Ble, 152 | timer, 153 | rng.clone(), 154 | system.radio_clock_control, 155 | &clocks, 156 | ) 157 | .unwrap(); 158 | 159 | let mut rng_wrap = RngWrapper { rng: rng }; 160 | 161 | let io = IO::new(peripherals.GPIO, peripherals.IO_MUX); 162 | let button = io.pins.gpio9.into_pull_down_input(); 163 | 164 | // Async requires the GPIO interrupt to wake futures 165 | hal::interrupt::enable( 166 | hal::peripherals::Interrupt::GPIO, 167 | hal::interrupt::Priority::Priority1, 168 | ) 169 | .unwrap(); 170 | 171 | let timer_group0 = TimerGroup::new(peripherals.TIMG0, &clocks); 172 | embassy::init(&clocks, timer_group0); 173 | 174 | let channel: Channel = Channel::new(); 175 | let channel = make_static!(channel); 176 | 177 | let receiver = channel.receiver(); 178 | let sender = channel.sender(); 179 | 180 | spawner.spawn(key_reader(button, sender)).ok(); 181 | 182 | let mut bluetooth = peripherals.BT; 183 | 184 | let connector = BleConnector::new(&init, &mut bluetooth); 185 | let mut ble = Ble::new(connector, esp_wifi::current_millis); 186 | println!("Connector created"); 187 | 188 | let mut ltk = None; 189 | 190 | loop { 191 | println!("{:?}", ble.init().await); 192 | println!("{:?}", ble.cmd_set_le_advertising_parameters().await); 193 | println!( 194 | "{:?}", 195 | ble.cmd_set_le_advertising_data( 196 | create_advertising_data(&[ 197 | AdStructure::Flags(LE_GENERAL_DISCOVERABLE | BR_EDR_NOT_SUPPORTED), 198 | AdStructure::Unknown { 199 | ty: 0x03, 200 | data: &[0x12, 0x18] 201 | }, // HID 202 | AdStructure::CompleteLocalName("ESP32-C3"), 203 | AdStructure::Unknown { 204 | ty: 0x19, 205 | data: &[0xc1, 0x03] 206 | }, // Appearance (0x03C1 = Keyboard) 207 | ]) 208 | .unwrap() 209 | ) 210 | .await 211 | ); 212 | println!("{:?}", ble.cmd_set_le_advertise_enable(true).await); 213 | let local_addr = Addr::from_le_bytes(false, ble.cmd_read_br_addr().await.unwrap()); 214 | 215 | println!("started advertising"); 216 | 217 | let mut read_hid_information = |_offset: usize, data: &mut [u8]| { 218 | data[..4].copy_from_slice(&[0x11, 0x1, 0x00, 0x01]); 219 | 4 220 | }; 221 | 222 | let mut read_hid_report_map = |offset: usize, data: &mut [u8]| { 223 | println!("read hid report map {offset} {}", data.len()); 224 | 225 | let val = REPORT_MAP; 226 | let off = offset; 227 | if off < val.len() { 228 | let len = data.len().min(val.len() - off); 229 | data[..len].copy_from_slice(&val[off..off + len]); 230 | len 231 | } else { 232 | 0 233 | } 234 | }; 235 | 236 | let mut write_hid_control_point = |offset: usize, data: &[u8]| { 237 | println!("write hid control point: {} {:?}", offset, data); 238 | }; 239 | 240 | let mut read_hid_report = |_offset: usize, data: &mut [u8]| { 241 | println!("read hid report"); 242 | let resp = KeyboardReport { 243 | modifiers: 0, 244 | reserved: 0, 245 | key_codes: [0u8; 6], 246 | }; 247 | 248 | data[..8].copy_from_slice(&resp.to_bytes()); 249 | 8 250 | }; 251 | 252 | let mut read_protocol_mode = |_offset: usize, data: &mut [u8]| { 253 | data[..1].copy_from_slice(&[0x01]); 254 | 1 255 | }; 256 | 257 | let mut write_protocol_mode = |offset: usize, data: &[u8]| { 258 | println!("write_protocol_mode: Offset {}, data {:?}", offset, data); 259 | }; 260 | 261 | let mut read_device_info = |_offset: usize, data: &mut [u8]| { 262 | data[..7].copy_from_slice(&[0x02, 0x8a, 0x24, 0x66, 0x82, 0x34, 0x36]); 263 | 7 264 | }; 265 | 266 | let mut read_battery_level = |_offset: usize, data: &mut [u8]| { 267 | data[..1].copy_from_slice(&[100]); 268 | 1 269 | }; 270 | 271 | let desc_value = &[KEYBOARD_ID, 1]; 272 | 273 | gatt!([ 274 | // BLE HID Service 275 | service { 276 | uuid: "00001812-0000-1000-8000-00805f9b34fb", 277 | characteristics: [ 278 | // BLE HID_information 279 | characteristic { 280 | uuid: "00002a4a-0000-1000-8000-00805f9b34fb", 281 | read: read_hid_information, 282 | }, 283 | // BLE HID Report Map characteristic 284 | characteristic { 285 | uuid: "00002a4b-0000-1000-8000-00805f9b34fb", 286 | read: read_hid_report_map, 287 | }, 288 | // BLE HID control point characteristic 289 | characteristic { 290 | uuid: "00002a4c-0000-1000-8000-00805f9b34fb", 291 | write: write_hid_control_point, 292 | }, 293 | // BLE HID Report characteristic 294 | characteristic { 295 | uuid: "00002a4d-0000-1000-8000-00805f9b34fb", 296 | name: "hid_report", 297 | notify: true, 298 | read: read_hid_report, 299 | descriptors: [descriptor { 300 | uuid: "2908", 301 | value: desc_value, 302 | },], 303 | }, 304 | // BLE HID protocol mode characteristic 305 | characteristic { 306 | uuid: "00002a4e-0000-1000-8000-00805f9b34fb", 307 | write: write_protocol_mode, 308 | read: read_protocol_mode, 309 | }, 310 | ], 311 | }, 312 | // BLE device information 313 | service { 314 | uuid: "0000180a-0000-1000-8000-00805f9b34fb", 315 | characteristics: [ 316 | // BLE Device Information characteristic 317 | characteristic { 318 | uuid: "00002a50-0000-1000-8000-00805f9b34fb", 319 | read: read_device_info, 320 | }, 321 | ], 322 | }, 323 | // BLE HID Battery Service 324 | service { 325 | uuid: "0000180f-0000-1000-8000-00805f9b34fb", 326 | // BLE HID battery level characteristic 327 | characteristics: [characteristic { 328 | uuid: "00002a19-0000-1000-8000-00805f9b34fb", 329 | read: read_battery_level, 330 | notify: true, 331 | },], 332 | }, 333 | ]); 334 | 335 | let mut srv = AttributeServer::new_with_ltk( 336 | &mut ble, 337 | &mut gatt_attributes, 338 | local_addr, 339 | ltk, 340 | &mut rng_wrap, 341 | ); 342 | 343 | let mut notifier = || async { 344 | let received = receiver.receive().await; 345 | 346 | println!("notify hid report"); 347 | let resp = KeyboardReport { 348 | modifiers: 0, 349 | reserved: 0, 350 | key_codes: [received, 0, 0, 0, 0, 0], 351 | }; 352 | 353 | NotificationData::new(hid_report_handle, &resp.to_bytes()) 354 | }; 355 | 356 | srv.run(&mut notifier).await.unwrap(); 357 | 358 | // TODO persist the LTK 359 | ltk = srv.get_ltk(); 360 | } 361 | } 362 | 363 | #[embassy_executor::task] 364 | async fn key_reader( 365 | mut button: GpioPin, 9>, 366 | sender: Sender<'static, NoopRawMutex, u8, 3>, 367 | ) { 368 | loop { 369 | button.wait_for_rising_edge().await.ok(); 370 | 371 | sender.send(0x08).await; // 'e' 372 | Timer::after(Duration::from_millis(200)).await; 373 | sender.send(0x0).await; 374 | 375 | sender.send(0x16).await; // 's' 376 | Timer::after(Duration::from_millis(200)).await; 377 | sender.send(0x0).await; 378 | 379 | sender.send(0x13).await; // 'p' 380 | Timer::after(Duration::from_millis(200)).await; 381 | sender.send(0x0).await; 382 | 383 | sender.send(0x20).await; // '3' 384 | Timer::after(Duration::from_millis(200)).await; 385 | sender.send(0x0).await; 386 | 387 | sender.send(0x1f).await; // '2' 388 | Timer::after(Duration::from_millis(200)).await; 389 | sender.send(0x0).await; 390 | } 391 | } 392 | 393 | struct RngWrapper { 394 | rng: Rng, 395 | } 396 | 397 | impl rand_core::RngCore for RngWrapper { 398 | fn next_u32(&mut self) -> u32 { 399 | self.rng.random() 400 | } 401 | 402 | fn next_u64(&mut self) -> u64 { 403 | (self.rng.random() as u64) << 32 | self.rng.random() as u64 404 | } 405 | 406 | fn fill_bytes(&mut self, dest: &mut [u8]) { 407 | for b in dest { 408 | *b = (self.rng.random() & 0xff) as u8; 409 | } 410 | } 411 | 412 | fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), rand_core::Error> { 413 | self.fill_bytes(dest); 414 | Ok(()) 415 | } 416 | } 417 | 418 | impl rand_core::CryptoRng for RngWrapper {} 419 | --------------------------------------------------------------------------------