A personal rust firmware for the Badger 2040 W

Compare changes

Choose any two refs to compare.

+2 -1
.gitignore
··· 1 /target 2 .DS_Store 3 - .env
··· 1 /target 2 .DS_Store 3 + .env 4 + .idea
+565 -539
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 = "aead" ··· 38 ] 39 40 [[package]] 41 - name = "ahash" 42 - version = "0.8.11" 43 - source = "registry+https://github.com/rust-lang/crates.io-index" 44 - checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 45 - dependencies = [ 46 - "cfg-if", 47 - "once_cell", 48 - "version_check", 49 - "zerocopy 0.7.35", 50 - ] 51 - 52 - [[package]] 53 name = "aho-corasick" 54 version = "1.1.3" 55 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 82 source = "registry+https://github.com/rust-lang/crates.io-index" 83 checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" 84 dependencies = [ 85 - "term", 86 ] 87 88 [[package]] ··· 138 source = "registry+https://github.com/rust-lang/crates.io-index" 139 checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" 140 dependencies = [ 141 - "bit-vec", 142 ] 143 144 [[package]] ··· 148 checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" 149 150 [[package]] 151 - name = "bitfield" 152 - version = "0.13.2" 153 source = "registry+https://github.com/rust-lang/crates.io-index" 154 - checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" 155 156 [[package]] 157 name = "bitfield" 158 - version = "0.14.0" 159 source = "registry+https://github.com/rust-lang/crates.io-index" 160 - checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" 161 162 [[package]] 163 name = "bitflags" ··· 181 ] 182 183 [[package]] 184 - name = "bt-hci" 185 - version = "0.1.0" 186 - source = "registry+https://github.com/rust-lang/crates.io-index" 187 - checksum = "499d74e90e6b1e61660adc8fb5f17aeac9487bced16f57c1f91a8783736ada53" 188 - dependencies = [ 189 - "defmt", 190 - "embassy-sync 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 191 - "embassy-time", 192 - "embedded-io", 193 - "embedded-io-async", 194 - "futures-intrusive", 195 - "heapless 0.8.0", 196 - ] 197 - 198 - [[package]] 199 name = "buffered-io" 200 version = "0.5.4" 201 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 207 208 [[package]] 209 name = "byte-slice-cast" 210 - version = "0.3.5" 211 - source = "registry+https://github.com/rust-lang/crates.io-index" 212 - checksum = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" 213 - 214 - [[package]] 215 - name = "byte-slice-cast" 216 - version = "1.2.2" 217 source = "registry+https://github.com/rust-lang/crates.io-index" 218 - checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" 219 220 [[package]] 221 name = "bytemuck" ··· 274 checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" 275 dependencies = [ 276 "bare-metal", 277 - "bitfield 0.13.2", 278 "embedded-hal 0.2.7", 279 "volatile-register", 280 ] 281 282 [[package]] 283 name = "cortex-m-rt" 284 - version = "0.7.3" 285 source = "registry+https://github.com/rust-lang/crates.io-index" 286 - checksum = "ee84e813d593101b1723e13ec38b6ab6abbdbaaa4546553f5395ed274079ddb1" 287 dependencies = [ 288 "cortex-m-rt-macros", 289 ] 290 291 [[package]] 292 name = "cortex-m-rt-macros" 293 - version = "0.7.0" 294 source = "registry+https://github.com/rust-lang/crates.io-index" 295 - checksum = "f0f6f3e36f203cfedbc78b357fb28730aa2c6dc1ab060ee5c2405e843988d3c7" 296 dependencies = [ 297 "proc-macro2", 298 "quote", 299 - "syn 1.0.109", 300 ] 301 302 [[package]] ··· 319 320 [[package]] 321 name = "critical-section" 322 - version = "1.1.2" 323 source = "registry+https://github.com/rust-lang/crates.io-index" 324 - checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" 325 326 [[package]] 327 name = "crunchy" ··· 336 checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" 337 dependencies = [ 338 "generic-array 0.14.7", 339 - "rand_core", 340 "subtle", 341 "zeroize", 342 ] ··· 362 363 [[package]] 364 name = "cyw43" 365 - version = "0.2.0" 366 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 367 dependencies = [ 368 - "bt-hci", 369 "cortex-m", 370 "cortex-m-rt", 371 - "defmt", 372 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 373 - "embassy-net-driver-channel 0.3.0", 374 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 375 "embassy-time", 376 "embedded-hal 1.0.0", 377 - "embedded-io-async", 378 "futures", 379 "heapless 0.8.0", 380 - "num_enum", 381 ] 382 383 [[package]] 384 name = "cyw43-pio" 385 - version = "0.2.0" 386 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 387 dependencies = [ 388 "cyw43", 389 - "defmt", 390 "embassy-rp", 391 "fixed", 392 - "pio", 393 - "pio-proc", 394 ] 395 396 [[package]] ··· 414 "proc-macro2", 415 "quote", 416 "strsim", 417 - "syn 2.0.72", 418 ] 419 420 [[package]] ··· 425 dependencies = [ 426 "darling_core", 427 "quote", 428 - "syn 2.0.72", 429 ] 430 431 [[package]] ··· 436 437 [[package]] 438 name = "defmt" 439 - version = "0.3.8" 440 source = "registry+https://github.com/rust-lang/crates.io-index" 441 - checksum = "a99dd22262668b887121d4672af5a64b238f026099f1a2a1b322066c9ecfe9e0" 442 dependencies = [ 443 "bitflags 1.3.2", 444 "defmt-macros", ··· 446 447 [[package]] 448 name = "defmt-macros" 449 - version = "0.3.9" 450 source = "registry+https://github.com/rust-lang/crates.io-index" 451 - checksum = "e3a9f309eff1f79b3ebdf252954d90ae440599c26c2c553fe87a2d17195f2dcb" 452 dependencies = [ 453 "defmt-parser", 454 - "proc-macro-error", 455 "proc-macro2", 456 "quote", 457 - "syn 2.0.72", 458 ] 459 460 [[package]] 461 name = "defmt-parser" 462 - version = "0.3.4" 463 source = "registry+https://github.com/rust-lang/crates.io-index" 464 - checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" 465 dependencies = [ 466 - "thiserror", 467 ] 468 469 [[package]] ··· 473 checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" 474 dependencies = [ 475 "critical-section", 476 - "defmt", 477 ] 478 479 [[package]] ··· 484 dependencies = [ 485 "const-oid", 486 "zeroize", 487 ] 488 489 [[package]] ··· 522 "libc", 523 "redox_users", 524 "winapi", 525 - ] 526 - 527 - [[package]] 528 - name = "display-interface" 529 - version = "0.4.1" 530 - source = "registry+https://github.com/rust-lang/crates.io-index" 531 - checksum = "7517c040926d7b02b111884aa089177db80878533127f7c1b480d852c5fb4112" 532 - 533 - [[package]] 534 - name = "display-interface-spi" 535 - version = "0.4.1" 536 - source = "registry+https://github.com/rust-lang/crates.io-index" 537 - checksum = "489378ad054862146fbd1f09f51d585ccbe4bd1e2feadcda2a13ac33f840e1a5" 538 - dependencies = [ 539 - "byte-slice-cast 0.3.5", 540 - "display-interface", 541 - "embedded-hal 0.2.7", 542 ] 543 544 [[package]] ··· 569 "generic-array 0.14.7", 570 "group", 571 "hkdf", 572 - "rand_core", 573 "sec1", 574 "subtle", 575 "zeroize", ··· 577 578 [[package]] 579 name = "embassy-embedded-hal" 580 - version = "0.2.0" 581 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 582 dependencies = [ 583 - "defmt", 584 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 585 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 586 - "embassy-time", 587 "embedded-hal 0.2.7", 588 "embedded-hal 1.0.0", 589 "embedded-hal-async", ··· 594 595 [[package]] 596 name = "embassy-executor" 597 - version = "0.6.0" 598 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 599 dependencies = [ 600 "cortex-m", 601 "critical-section", 602 - "defmt", 603 "document-features", 604 "embassy-executor-macros", 605 - "embassy-time-driver", 606 - "embassy-time-queue-driver", 607 ] 608 609 [[package]] 610 name = "embassy-executor-macros" 611 - version = "0.5.0" 612 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 613 dependencies = [ 614 "darling", 615 "proc-macro2", 616 "quote", 617 - "syn 2.0.72", 618 ] 619 620 [[package]] 621 - name = "embassy-futures" 622 - version = "0.1.1" 623 source = "registry+https://github.com/rust-lang/crates.io-index" 624 - checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" 625 - 626 - [[package]] 627 - name = "embassy-futures" 628 - version = "0.1.1" 629 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 630 631 [[package]] 632 name = "embassy-futures" 633 - version = "0.1.1" 634 - source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 635 636 [[package]] 637 name = "embassy-hal-internal" 638 - version = "0.2.0" 639 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 640 dependencies = [ 641 "cortex-m", 642 "critical-section", 643 - "defmt", 644 "num-traits", 645 ] 646 647 [[package]] 648 name = "embassy-net" 649 - version = "0.4.0" 650 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 651 dependencies = [ 652 - "defmt", 653 "document-features", 654 - "embassy-net-driver 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 655 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 656 "embassy-time", 657 "embedded-io-async", 658 "embedded-nal-async", ··· 664 [[package]] 665 name = "embassy-net-driver" 666 version = "0.2.0" 667 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 668 dependencies = [ 669 - "defmt", 670 - ] 671 - 672 - [[package]] 673 - name = "embassy-net-driver" 674 - version = "0.2.0" 675 - source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 676 - 677 - [[package]] 678 - name = "embassy-net-driver-channel" 679 - version = "0.2.0" 680 - source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 681 - dependencies = [ 682 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git)", 683 - "embassy-net-driver 0.2.0 (git+https://github.com/embassy-rs/embassy.git)", 684 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git)", 685 ] 686 687 [[package]] 688 name = "embassy-net-driver-channel" 689 - version = "0.3.0" 690 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 691 dependencies = [ 692 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 693 - "embassy-net-driver 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 694 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 695 ] 696 697 [[package]] 698 name = "embassy-net-wiznet" 699 - version = "0.1.0" 700 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 701 dependencies = [ 702 - "defmt", 703 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 704 - "embassy-net-driver-channel 0.3.0", 705 "embassy-time", 706 "embedded-hal 1.0.0", 707 "embedded-hal-async", ··· 709 710 [[package]] 711 name = "embassy-rp" 712 - version = "0.2.0" 713 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 714 dependencies = [ 715 "atomic-polyfill", 716 "cfg-if", 717 "cortex-m", 718 "cortex-m-rt", 719 "critical-section", 720 - "defmt", 721 "document-features", 722 "embassy-embedded-hal", 723 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 724 "embassy-hal-internal", 725 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 726 "embassy-time", 727 "embassy-time-driver", 728 - "embassy-usb-driver 0.1.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 729 "embedded-hal 0.2.7", 730 "embedded-hal 1.0.0", 731 "embedded-hal-async", ··· 736 "embedded-storage-async", 737 "fixed", 738 "nb 1.1.0", 739 - "pio", 740 - "pio-proc", 741 - "rand_core", 742 "rp-pac", 743 "rp2040-boot2", 744 "sha2-const-stable", 745 ] 746 747 [[package]] 748 name = "embassy-sync" 749 - version = "0.6.0" 750 source = "registry+https://github.com/rust-lang/crates.io-index" 751 - checksum = "b3e0c49ff02ebe324faf3a8653ba91582e2d0a7fdef5bc88f449d5aa1bfcc05c" 752 dependencies = [ 753 "cfg-if", 754 "critical-section", 755 "embedded-io-async", 756 - "futures-util", 757 - "heapless 0.8.0", 758 - ] 759 - 760 - [[package]] 761 - name = "embassy-sync" 762 - version = "0.6.0" 763 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 764 - dependencies = [ 765 - "cfg-if", 766 - "critical-section", 767 - "defmt", 768 - "embedded-io-async", 769 - "futures-util", 770 - "heapless 0.8.0", 771 - ] 772 - 773 - [[package]] 774 - name = "embassy-sync" 775 - version = "0.6.0" 776 - source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 777 - dependencies = [ 778 - "cfg-if", 779 - "critical-section", 780 - "embedded-io-async", 781 - "futures-util", 782 "heapless 0.8.0", 783 ] 784 785 [[package]] 786 name = "embassy-time" 787 - version = "0.3.2" 788 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 789 dependencies = [ 790 "cfg-if", 791 "critical-section", 792 - "defmt", 793 "document-features", 794 "embassy-time-driver", 795 - "embassy-time-queue-driver", 796 "embedded-hal 0.2.7", 797 "embedded-hal 1.0.0", 798 "embedded-hal-async", 799 - "futures-util", 800 - "heapless 0.8.0", 801 ] 802 803 [[package]] 804 name = "embassy-time-driver" 805 - version = "0.1.0" 806 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 807 dependencies = [ 808 "document-features", 809 ] 810 811 [[package]] 812 - name = "embassy-time-queue-driver" 813 - version = "0.1.0" 814 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 815 - 816 - [[package]] 817 - name = "embassy-usb" 818 - version = "0.2.0" 819 - source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 820 - dependencies = [ 821 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git)", 822 - "embassy-net-driver-channel 0.2.0", 823 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git)", 824 - "embassy-usb-driver 0.1.0 (git+https://github.com/embassy-rs/embassy.git)", 825 - "heapless 0.8.0", 826 - "ssmarshal", 827 - "usbd-hid", 828 - ] 829 - 830 - [[package]] 831 - name = "embassy-usb" 832 version = "0.3.0" 833 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 834 dependencies = [ 835 - "defmt", 836 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 837 - "embassy-net-driver-channel 0.3.0", 838 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 839 - "embassy-usb-driver 0.1.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 840 "heapless 0.8.0", 841 - "ssmarshal", 842 - "usbd-hid", 843 ] 844 845 [[package]] 846 name = "embassy-usb-driver" 847 - version = "0.1.0" 848 - source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 849 - dependencies = [ 850 - "defmt", 851 - ] 852 - 853 - [[package]] 854 - name = "embassy-usb-driver" 855 - version = "0.1.0" 856 - source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 857 - 858 - [[package]] 859 - name = "embassy-usb-logger" 860 version = "0.2.0" 861 - source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 862 dependencies = [ 863 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git)", 864 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git)", 865 - "embassy-usb 0.2.0", 866 - "log", 867 - ] 868 - 869 - [[package]] 870 - name = "embassy_rp_w_template" 871 - version = "0.1.0" 872 - dependencies = [ 873 - "assign-resources", 874 - "bt-hci", 875 - "byte-slice-cast 1.2.2", 876 - "cortex-m", 877 - "cortex-m-rt", 878 - "critical-section", 879 - "cyw43", 880 - "cyw43-pio", 881 - "defmt", 882 - "defmt-rtt", 883 - "display-interface", 884 - "display-interface-spi", 885 - "embassy-embedded-hal", 886 - "embassy-executor", 887 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git)", 888 - "embassy-net", 889 - "embassy-net-wiznet", 890 - "embassy-rp", 891 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 892 - "embassy-time", 893 - "embassy-usb 0.3.0", 894 - "embassy-usb-logger", 895 - "embedded-graphics", 896 - "embedded-hal 1.0.0", 897 - "embedded-hal-async", 898 - "embedded-hal-bus", 899 "embedded-io-async", 900 - "embedded-sdmmc", 901 - "embedded-storage", 902 - "embedded-text", 903 - "fixed", 904 - "fixed-macro", 905 - "heapless 0.8.0", 906 - "log", 907 - "panic-probe", 908 - "pio", 909 - "pio-proc", 910 - "portable-atomic", 911 - "postcard", 912 - "rand", 913 - "reqwless", 914 - "serde", 915 - "serde-json-core", 916 - "shtcx", 917 - "smart-leds", 918 - "st7789", 919 - "static_cell", 920 - "tinybmp", 921 - "trouble-host", 922 - "uc8151", 923 - "usbd-hid", 924 ] 925 926 [[package]] ··· 931 dependencies = [ 932 "az", 933 "byteorder", 934 - "embedded-graphics-core 0.4.0", 935 "float-cmp", 936 "micromath", 937 - ] 938 - 939 - [[package]] 940 - name = "embedded-graphics-core" 941 - version = "0.3.3" 942 - source = "registry+https://github.com/rust-lang/crates.io-index" 943 - checksum = "b8b1239db5f3eeb7e33e35bd10bd014e7b2537b17e071f726a09351431337cfa" 944 - dependencies = [ 945 - "az", 946 - "byteorder", 947 ] 948 949 [[package]] ··· 1008 source = "registry+https://github.com/rust-lang/crates.io-index" 1009 checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" 1010 dependencies = [ 1011 - "defmt", 1012 ] 1013 1014 [[package]] ··· 1017 source = "registry+https://github.com/rust-lang/crates.io-index" 1018 checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" 1019 dependencies = [ 1020 - "defmt", 1021 "embedded-io", 1022 ] 1023 1024 [[package]] 1025 name = "embedded-nal" 1026 - version = "0.8.0" 1027 source = "registry+https://github.com/rust-lang/crates.io-index" 1028 - checksum = "b8a943fad5ed3d3f8a00f1e80f6bba371f1e7f0df28ec38477535eb318dc19cc" 1029 dependencies = [ 1030 "nb 1.1.0", 1031 - "no-std-net", 1032 ] 1033 1034 [[package]] 1035 name = "embedded-nal-async" 1036 - version = "0.7.1" 1037 source = "registry+https://github.com/rust-lang/crates.io-index" 1038 - checksum = "72229137a4fc12d239b0b7f50f04b30790678da6d782a0f3f1909bf57ec4b759" 1039 dependencies = [ 1040 "embedded-io-async", 1041 "embedded-nal", 1042 - "no-std-net", 1043 ] 1044 1045 [[package]] ··· 1088 dependencies = [ 1089 "aes-gcm", 1090 "atomic-polyfill", 1091 - "defmt", 1092 "digest", 1093 "embedded-io", 1094 "embedded-io-async", ··· 1098 "hkdf", 1099 "hmac", 1100 "p256", 1101 - "rand_core", 1102 "sha2", 1103 "typenum", 1104 ] ··· 1113 ] 1114 1115 [[package]] 1116 - name = "encode_unicode" 1117 - version = "0.3.6" 1118 - source = "registry+https://github.com/rust-lang/crates.io-index" 1119 - checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" 1120 - 1121 - [[package]] 1122 name = "equivalent" 1123 version = "1.0.1" 1124 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1130 source = "registry+https://github.com/rust-lang/crates.io-index" 1131 checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" 1132 dependencies = [ 1133 - "rand_core", 1134 "subtle", 1135 ] 1136 ··· 1188 checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" 1189 1190 [[package]] 1191 name = "float-cmp" 1192 version = "0.9.0" 1193 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1228 1229 [[package]] 1230 name = "futures-core" 1231 - version = "0.3.30" 1232 - source = "registry+https://github.com/rust-lang/crates.io-index" 1233 - checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 1234 - 1235 - [[package]] 1236 - name = "futures-intrusive" 1237 - version = "0.5.0" 1238 source = "registry+https://github.com/rust-lang/crates.io-index" 1239 - checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" 1240 - dependencies = [ 1241 - "futures-core", 1242 - "lock_api", 1243 - ] 1244 1245 [[package]] 1246 name = "futures-io" ··· 1256 dependencies = [ 1257 "proc-macro2", 1258 "quote", 1259 - "syn 2.0.72", 1260 ] 1261 1262 [[package]] ··· 1316 1317 [[package]] 1318 name = "getrandom" 1319 - version = "0.2.15" 1320 source = "registry+https://github.com/rust-lang/crates.io-index" 1321 - checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 1322 dependencies = [ 1323 "cfg-if", 1324 "libc", ··· 1342 checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" 1343 dependencies = [ 1344 "ff", 1345 - "rand_core", 1346 "subtle", 1347 ] 1348 ··· 1385 1386 [[package]] 1387 name = "hashbrown" 1388 - version = "0.13.2" 1389 - source = "registry+https://github.com/rust-lang/crates.io-index" 1390 - checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" 1391 - dependencies = [ 1392 - "ahash", 1393 - ] 1394 - 1395 - [[package]] 1396 - name = "hashbrown" 1397 - version = "0.14.5" 1398 source = "registry+https://github.com/rust-lang/crates.io-index" 1399 - checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 1400 1401 [[package]] 1402 name = "heapless" ··· 1430 source = "registry+https://github.com/rust-lang/crates.io-index" 1431 checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" 1432 dependencies = [ 1433 - "defmt", 1434 "hash32 0.3.1", 1435 "serde", 1436 "stable_deref_trait", ··· 1438 1439 [[package]] 1440 name = "hermit-abi" 1441 - version = "0.3.9" 1442 source = "registry+https://github.com/rust-lang/crates.io-index" 1443 - checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 1444 1445 [[package]] 1446 name = "hex" ··· 1480 1481 [[package]] 1482 name = "indexmap" 1483 - version = "2.3.0" 1484 source = "registry+https://github.com/rust-lang/crates.io-index" 1485 - checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" 1486 dependencies = [ 1487 "equivalent", 1488 - "hashbrown 0.14.5", 1489 ] 1490 1491 [[package]] ··· 1499 1500 [[package]] 1501 name = "is-terminal" 1502 - version = "0.4.12" 1503 source = "registry+https://github.com/rust-lang/crates.io-index" 1504 - checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" 1505 dependencies = [ 1506 "hermit-abi", 1507 "libc", 1508 - "windows-sys", 1509 ] 1510 1511 [[package]] ··· 1518 ] 1519 1520 [[package]] 1521 name = "lalrpop" 1522 version = "0.19.12" 1523 source = "registry+https://github.com/rust-lang/crates.io-index" 1524 checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" 1525 dependencies = [ 1526 - "ascii-canvas", 1527 - "bit-set", 1528 "diff", 1529 "ena", 1530 "is-terminal", 1531 - "itertools", 1532 - "lalrpop-util", 1533 - "petgraph", 1534 "regex", 1535 "regex-syntax 0.6.29", 1536 "string_cache", 1537 - "term", 1538 "tiny-keccak", 1539 "unicode-xid", 1540 ] 1541 1542 [[package]] 1543 name = "lalrpop-util" 1544 version = "0.19.12" 1545 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1549 ] 1550 1551 [[package]] 1552 name = "libc" 1553 version = "0.2.155" 1554 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1556 1557 [[package]] 1558 name = "libredox" 1559 - version = "0.1.3" 1560 source = "registry+https://github.com/rust-lang/crates.io-index" 1561 - checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" 1562 dependencies = [ 1563 "bitflags 2.6.0", 1564 "libc", ··· 1626 checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" 1627 1628 [[package]] 1629 - name = "no-std-net" 1630 - version = "0.6.0" 1631 - source = "registry+https://github.com/rust-lang/crates.io-index" 1632 - checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" 1633 - 1634 - [[package]] 1635 name = "nourl" 1636 version = "0.1.1" 1637 source = "registry+https://github.com/rust-lang/crates.io-index" 1638 checksum = "b3c12edfda65fe16901d81d3bd93fd18ac07078b5007875a1c3b0d35f7725269" 1639 dependencies = [ 1640 - "defmt", 1641 ] 1642 1643 [[package]] 1644 name = "num-traits" ··· 1655 source = "registry+https://github.com/rust-lang/crates.io-index" 1656 checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" 1657 dependencies = [ 1658 - "num_enum_derive", 1659 ] 1660 1661 [[package]] ··· 1670 ] 1671 1672 [[package]] 1673 name = "object-chain" 1674 version = "0.1.3" 1675 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1699 1700 [[package]] 1701 name = "panic-probe" 1702 - version = "0.3.2" 1703 source = "registry+https://github.com/rust-lang/crates.io-index" 1704 - checksum = "4047d9235d1423d66cc97da7d07eddb54d4f154d6c13805c6d0793956f4f25b0" 1705 dependencies = [ 1706 "cortex-m", 1707 - "defmt", 1708 ] 1709 1710 [[package]] ··· 1742 source = "registry+https://github.com/rust-lang/crates.io-index" 1743 checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" 1744 dependencies = [ 1745 - "fixedbitset", 1746 "indexmap", 1747 ] 1748 ··· 1756 ] 1757 1758 [[package]] 1759 name = "pin-project-lite" 1760 version = "0.2.14" 1761 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1774 checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" 1775 dependencies = [ 1776 "arrayvec", 1777 - "num_enum", 1778 "paste", 1779 ] 1780 ··· 1784 source = "registry+https://github.com/rust-lang/crates.io-index" 1785 checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" 1786 dependencies = [ 1787 - "lalrpop", 1788 - "lalrpop-util", 1789 - "pio", 1790 "regex-syntax 0.6.29", 1791 ] 1792 1793 [[package]] 1794 name = "pio-proc" 1795 version = "0.2.2" 1796 source = "registry+https://github.com/rust-lang/crates.io-index" 1797 checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" 1798 dependencies = [ 1799 "codespan-reporting", 1800 - "lalrpop-util", 1801 - "pio", 1802 - "pio-parser", 1803 "proc-macro-error", 1804 "proc-macro2", 1805 "quote", ··· 1808 ] 1809 1810 [[package]] 1811 name = "polyval" 1812 version = "0.6.2" 1813 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1840 ] 1841 1842 [[package]] 1843 name = "ppv-lite86" 1844 version = "0.2.18" 1845 source = "registry+https://github.com/rust-lang/crates.io-index" 1846 checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" 1847 dependencies = [ 1848 - "zerocopy 0.6.6", 1849 ] 1850 1851 [[package]] ··· 1888 ] 1889 1890 [[package]] 1891 name = "proc-macro2" 1892 - version = "1.0.86" 1893 source = "registry+https://github.com/rust-lang/crates.io-index" 1894 - checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" 1895 dependencies = [ 1896 "unicode-ident", 1897 ] ··· 1911 source = "registry+https://github.com/rust-lang/crates.io-index" 1912 checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1913 dependencies = [ 1914 - "rand_core", 1915 ] 1916 1917 [[package]] ··· 1921 checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1922 dependencies = [ 1923 "ppv-lite86", 1924 - "rand_core", 1925 ] 1926 1927 [[package]] ··· 1931 checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1932 1933 [[package]] 1934 name = "redox_syscall" 1935 version = "0.5.3" 1936 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1941 1942 [[package]] 1943 name = "redox_users" 1944 - version = "0.4.5" 1945 source = "registry+https://github.com/rust-lang/crates.io-index" 1946 - checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" 1947 dependencies = [ 1948 "getrandom", 1949 "libredox", 1950 - "thiserror", 1951 ] 1952 1953 [[package]] ··· 1987 1988 [[package]] 1989 name = "reqwless" 1990 - version = "0.12.1" 1991 source = "registry+https://github.com/rust-lang/crates.io-index" 1992 - checksum = "66584b58c3b0cd8cfea750408a932fe86df79ee05ccc87ee745a8e6be4a1abe0" 1993 dependencies = [ 1994 "base64", 1995 "buffered-io", 1996 - "defmt", 1997 "embedded-io", 1998 "embedded-io-async", 1999 "embedded-nal-async", ··· 2003 "httparse", 2004 "nourl", 2005 "rand_chacha", 2006 - "rand_core", 2007 ] 2008 2009 [[package]] 2010 name = "rgb" 2011 - version = "0.8.45" 2012 source = "registry+https://github.com/rust-lang/crates.io-index" 2013 - checksum = "ade4539f42266ded9e755c605bdddf546242b2c961b03b06a7375260788a0523" 2014 - dependencies = [ 2015 - "bytemuck", 2016 - ] 2017 2018 [[package]] 2019 name = "rp-pac" 2020 - version = "6.0.0" 2021 - source = "git+https://github.com/embassy-rs/rp-pac.git?rev=a7f42d25517f7124ad3b4ed492dec8b0f50a0e6c#a7f42d25517f7124ad3b4ed492dec8b0f50a0e6c" 2022 dependencies = [ 2023 "cortex-m", 2024 "cortex-m-rt", ··· 2058 checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" 2059 2060 [[package]] 2061 name = "ryu" 2062 version = "1.0.18" 2063 source = "registry+https://github.com/rust-lang/crates.io-index" 2064 checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 2065 2066 [[package]] 2067 name = "scopeguard" ··· 2131 dependencies = [ 2132 "proc-macro2", 2133 "quote", 2134 - "syn 2.0.72", 2135 ] 2136 2137 [[package]] ··· 2152 checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" 2153 2154 [[package]] 2155 name = "shtcx" 2156 version = "1.0.0" 2157 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2174 2175 [[package]] 2176 name = "smart-leds" 2177 - version = "0.3.0" 2178 source = "registry+https://github.com/rust-lang/crates.io-index" 2179 - checksum = "38dd45fa275f70b4110eac5f5182611ad384f88bb22b68b9a9c3cafd7015290b" 2180 dependencies = [ 2181 "smart-leds-trait", 2182 ] 2183 2184 [[package]] 2185 name = "smart-leds-trait" 2186 - version = "0.2.1" 2187 source = "registry+https://github.com/rust-lang/crates.io-index" 2188 - checksum = "ebf6d833fa93f16a1c1874e62c2aebe8567e5bdd436d59bf543ed258b6f7a8e3" 2189 dependencies = [ 2190 "rgb", 2191 ] 2192 2193 [[package]] 2194 name = "smoltcp" 2195 - version = "0.11.0" 2196 source = "registry+https://github.com/rust-lang/crates.io-index" 2197 - checksum = "5a1a996951e50b5971a2c8c0fa05a381480d70a933064245c4a223ddc87ccc97" 2198 dependencies = [ 2199 "bitflags 1.3.2", 2200 "byteorder", 2201 "cfg-if", 2202 - "defmt", 2203 "heapless 0.8.0", 2204 "managed", 2205 ] ··· 2214 ] 2215 2216 [[package]] 2217 - name = "ssmarshal" 2218 - version = "1.0.0" 2219 - source = "registry+https://github.com/rust-lang/crates.io-index" 2220 - checksum = "f3e6ad23b128192ed337dfa4f1b8099ced0c2bf30d61e551b65fda5916dbb850" 2221 - dependencies = [ 2222 - "encode_unicode", 2223 - "serde", 2224 - ] 2225 - 2226 - [[package]] 2227 - name = "st7789" 2228 - version = "0.6.1" 2229 - source = "registry+https://github.com/rust-lang/crates.io-index" 2230 - checksum = "cba7306a9ca07ffcafd13ac1eaac2d5cedc8e9fc0d342ef674e0f0d059c8f8a9" 2231 - dependencies = [ 2232 - "display-interface", 2233 - "embedded-graphics-core 0.3.3", 2234 - "embedded-hal 0.2.7", 2235 - "heapless 0.7.17", 2236 - "nb 1.1.0", 2237 - ] 2238 - 2239 - [[package]] 2240 name = "stable_deref_trait" 2241 version = "1.2.0" 2242 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2289 2290 [[package]] 2291 name = "syn" 2292 - version = "2.0.72" 2293 source = "registry+https://github.com/rust-lang/crates.io-index" 2294 - checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" 2295 dependencies = [ 2296 "proc-macro2", 2297 "quote", ··· 2310 ] 2311 2312 [[package]] 2313 name = "termcolor" 2314 version = "1.4.1" 2315 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2320 2321 [[package]] 2322 name = "thiserror" 2323 - version = "1.0.63" 2324 source = "registry+https://github.com/rust-lang/crates.io-index" 2325 - checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" 2326 dependencies = [ 2327 - "thiserror-impl", 2328 ] 2329 2330 [[package]] 2331 name = "thiserror-impl" 2332 - version = "1.0.63" 2333 source = "registry+https://github.com/rust-lang/crates.io-index" 2334 - checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" 2335 dependencies = [ 2336 "proc-macro2", 2337 "quote", 2338 - "syn 2.0.72", 2339 ] 2340 2341 [[package]] 2342 name = "tiny-keccak" 2343 version = "2.0.2" 2344 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2357 ] 2358 2359 [[package]] 2360 - name = "trouble-host" 2361 - version = "0.1.0" 2362 - source = "git+https://github.com/embassy-rs/trouble.git?rev=4b8c0f499b34e46ca23a56e2d1640ede371722cf#4b8c0f499b34e46ca23a56e2d1640ede371722cf" 2363 - dependencies = [ 2364 - "bt-hci", 2365 - "defmt", 2366 - "embassy-futures 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 2367 - "embassy-sync 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 2368 - "embassy-time", 2369 - "embedded-io-async", 2370 - "futures", 2371 - "heapless 0.8.0", 2372 - ] 2373 - 2374 - [[package]] 2375 name = "typenum" 2376 version = "1.17.0" 2377 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2382 version = "0.3.0" 2383 source = "git+https://github.com/9names/uc8151-rs.git#37a7feee23716506b777bd4032327038e7e0786a" 2384 dependencies = [ 2385 - "embedded-graphics-core 0.4.0", 2386 "embedded-hal 1.0.0", 2387 "embedded-hal-async", 2388 ] ··· 2416 ] 2417 2418 [[package]] 2419 - name = "usb-device" 2420 - version = "0.3.2" 2421 - source = "registry+https://github.com/rust-lang/crates.io-index" 2422 - checksum = "98816b1accafbb09085168b90f27e93d790b4bfa19d883466b5e53315b5f06a6" 2423 - dependencies = [ 2424 - "heapless 0.8.0", 2425 - "portable-atomic", 2426 - ] 2427 - 2428 - [[package]] 2429 - name = "usbd-hid" 2430 - version = "0.8.2" 2431 - source = "registry+https://github.com/rust-lang/crates.io-index" 2432 - checksum = "e6f291ab53d428685cc780f08a2eb9d5d6ff58622db2b36e239a4f715f1e184c" 2433 - dependencies = [ 2434 - "serde", 2435 - "ssmarshal", 2436 - "usb-device", 2437 - "usbd-hid-macros", 2438 - ] 2439 - 2440 - [[package]] 2441 - name = "usbd-hid-descriptors" 2442 - version = "0.8.2" 2443 - source = "registry+https://github.com/rust-lang/crates.io-index" 2444 - checksum = "0eee54712c5d778d2fb2da43b1ce5a7b5060886ef7b09891baeb4bf36910a3ed" 2445 - dependencies = [ 2446 - "bitfield 0.14.0", 2447 - ] 2448 - 2449 - [[package]] 2450 - name = "usbd-hid-macros" 2451 - version = "0.8.2" 2452 - source = "registry+https://github.com/rust-lang/crates.io-index" 2453 - checksum = "bb573c76e7884035ac5e1ab4a81234c187a82b6100140af0ab45757650ccda38" 2454 - dependencies = [ 2455 - "byteorder", 2456 - "hashbrown 0.13.2", 2457 - "log", 2458 - "proc-macro2", 2459 - "quote", 2460 - "serde", 2461 - "syn 1.0.109", 2462 - "usbd-hid-descriptors", 2463 - ] 2464 - 2465 - [[package]] 2466 name = "vcell" 2467 version = "0.1.3" 2468 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2490 ] 2491 2492 [[package]] 2493 name = "wasi" 2494 - version = "0.11.0+wasi-snapshot-preview1" 2495 source = "registry+https://github.com/rust-lang/crates.io-index" 2496 - checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 2497 2498 [[package]] 2499 name = "winapi" ··· 2517 source = "registry+https://github.com/rust-lang/crates.io-index" 2518 checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" 2519 dependencies = [ 2520 - "windows-sys", 2521 ] 2522 2523 [[package]] ··· 2527 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2528 2529 [[package]] 2530 name = "windows-sys" 2531 version = "0.52.0" 2532 source = "registry+https://github.com/rust-lang/crates.io-index" 2533 checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 2534 dependencies = [ 2535 "windows-targets", 2536 ] 2537 2538 [[package]] ··· 2606 checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" 2607 dependencies = [ 2608 "byteorder", 2609 - "zerocopy-derive 0.6.6", 2610 - ] 2611 - 2612 - [[package]] 2613 - name = "zerocopy" 2614 - version = "0.7.35" 2615 - source = "registry+https://github.com/rust-lang/crates.io-index" 2616 - checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 2617 - dependencies = [ 2618 - "zerocopy-derive 0.7.35", 2619 ] 2620 2621 [[package]] ··· 2626 dependencies = [ 2627 "proc-macro2", 2628 "quote", 2629 - "syn 2.0.72", 2630 - ] 2631 - 2632 - [[package]] 2633 - name = "zerocopy-derive" 2634 - version = "0.7.35" 2635 - source = "registry+https://github.com/rust-lang/crates.io-index" 2636 - checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 2637 - dependencies = [ 2638 - "proc-macro2", 2639 - "quote", 2640 - "syn 2.0.72", 2641 ] 2642 2643 [[package]]
··· 1 # This file is automatically @generated by Cargo. 2 # It is not intended for manual editing. 3 + version = 4 4 5 [[package]] 6 name = "aead" ··· 38 ] 39 40 [[package]] 41 name = "aho-corasick" 42 version = "1.1.3" 43 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 70 source = "registry+https://github.com/rust-lang/crates.io-index" 71 checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" 72 dependencies = [ 73 + "term 0.7.0", 74 + ] 75 + 76 + [[package]] 77 + name = "ascii-canvas" 78 + version = "4.0.0" 79 + source = "registry+https://github.com/rust-lang/crates.io-index" 80 + checksum = "ef1e3e699d84ab1b0911a1010c5c106aa34ae89aeac103be5ce0c3859db1e891" 81 + dependencies = [ 82 + "term 1.2.0", 83 ] 84 85 [[package]] ··· 135 source = "registry+https://github.com/rust-lang/crates.io-index" 136 checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" 137 dependencies = [ 138 + "bit-vec 0.6.3", 139 + ] 140 + 141 + [[package]] 142 + name = "bit-set" 143 + version = "0.8.0" 144 + source = "registry+https://github.com/rust-lang/crates.io-index" 145 + checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" 146 + dependencies = [ 147 + "bit-vec 0.8.0", 148 ] 149 150 [[package]] ··· 154 checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" 155 156 [[package]] 157 + name = "bit-vec" 158 + version = "0.8.0" 159 source = "registry+https://github.com/rust-lang/crates.io-index" 160 + checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" 161 162 [[package]] 163 name = "bitfield" 164 + version = "0.13.2" 165 source = "registry+https://github.com/rust-lang/crates.io-index" 166 + checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" 167 168 [[package]] 169 name = "bitflags" ··· 187 ] 188 189 [[package]] 190 name = "buffered-io" 191 version = "0.5.4" 192 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 198 199 [[package]] 200 name = "byte-slice-cast" 201 + version = "1.2.3" 202 source = "registry+https://github.com/rust-lang/crates.io-index" 203 + checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" 204 205 [[package]] 206 name = "bytemuck" ··· 259 checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9" 260 dependencies = [ 261 "bare-metal", 262 + "bitfield", 263 "embedded-hal 0.2.7", 264 "volatile-register", 265 ] 266 267 [[package]] 268 name = "cortex-m-rt" 269 + version = "0.7.5" 270 source = "registry+https://github.com/rust-lang/crates.io-index" 271 + checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6" 272 dependencies = [ 273 "cortex-m-rt-macros", 274 ] 275 276 [[package]] 277 name = "cortex-m-rt-macros" 278 + version = "0.7.5" 279 source = "registry+https://github.com/rust-lang/crates.io-index" 280 + checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472" 281 dependencies = [ 282 "proc-macro2", 283 "quote", 284 + "syn 2.0.106", 285 ] 286 287 [[package]] ··· 304 305 [[package]] 306 name = "critical-section" 307 + version = "1.2.0" 308 source = "registry+https://github.com/rust-lang/crates.io-index" 309 + checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" 310 311 [[package]] 312 name = "crunchy" ··· 321 checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" 322 dependencies = [ 323 "generic-array 0.14.7", 324 + "rand_core 0.6.4", 325 "subtle", 326 "zeroize", 327 ] ··· 347 348 [[package]] 349 name = "cyw43" 350 + version = "0.5.0" 351 + source = "registry+https://github.com/rust-lang/crates.io-index" 352 + checksum = "85d050df7c6c6d253d1044fd5f011873ec6f434f77c202e7e7e88d5b12a1e943" 353 dependencies = [ 354 "cortex-m", 355 "cortex-m-rt", 356 + "embassy-futures", 357 + "embassy-net-driver-channel", 358 + "embassy-sync", 359 "embassy-time", 360 "embedded-hal 1.0.0", 361 "futures", 362 "heapless 0.8.0", 363 + "num_enum 0.5.11", 364 ] 365 366 [[package]] 367 name = "cyw43-pio" 368 + version = "0.8.0" 369 + source = "registry+https://github.com/rust-lang/crates.io-index" 370 + checksum = "86bd7dea4d32a73557be29bfadaaa916e758115ed8b42cfca4fda0a111f07644" 371 dependencies = [ 372 "cyw43", 373 + "defmt 1.0.1", 374 "embassy-rp", 375 "fixed", 376 ] 377 378 [[package]] ··· 396 "proc-macro2", 397 "quote", 398 "strsim", 399 + "syn 2.0.106", 400 ] 401 402 [[package]] ··· 407 dependencies = [ 408 "darling_core", 409 "quote", 410 + "syn 2.0.106", 411 ] 412 413 [[package]] ··· 418 419 [[package]] 420 name = "defmt" 421 + version = "0.3.100" 422 source = "registry+https://github.com/rust-lang/crates.io-index" 423 + checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" 424 + dependencies = [ 425 + "defmt 1.0.1", 426 + ] 427 + 428 + [[package]] 429 + name = "defmt" 430 + version = "1.0.1" 431 + source = "registry+https://github.com/rust-lang/crates.io-index" 432 + checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78" 433 dependencies = [ 434 "bitflags 1.3.2", 435 "defmt-macros", ··· 437 438 [[package]] 439 name = "defmt-macros" 440 + version = "1.0.1" 441 source = "registry+https://github.com/rust-lang/crates.io-index" 442 + checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e" 443 dependencies = [ 444 "defmt-parser", 445 + "proc-macro-error2", 446 "proc-macro2", 447 "quote", 448 + "syn 2.0.106", 449 ] 450 451 [[package]] 452 name = "defmt-parser" 453 + version = "1.0.0" 454 source = "registry+https://github.com/rust-lang/crates.io-index" 455 + checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" 456 dependencies = [ 457 + "thiserror 2.0.17", 458 ] 459 460 [[package]] ··· 464 checksum = "bab697b3dbbc1750b7c8b821aa6f6e7f2480b47a99bc057a2ed7b170ebef0c51" 465 dependencies = [ 466 "critical-section", 467 + "defmt 0.3.100", 468 ] 469 470 [[package]] ··· 475 dependencies = [ 476 "const-oid", 477 "zeroize", 478 + ] 479 + 480 + [[package]] 481 + name = "deranged" 482 + version = "0.5.4" 483 + source = "registry+https://github.com/rust-lang/crates.io-index" 484 + checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071" 485 + dependencies = [ 486 + "powerfmt", 487 ] 488 489 [[package]] ··· 522 "libc", 523 "redox_users", 524 "winapi", 525 ] 526 527 [[package]] ··· 552 "generic-array 0.14.7", 553 "group", 554 "hkdf", 555 + "rand_core 0.6.4", 556 "sec1", 557 "subtle", 558 "zeroize", ··· 560 561 [[package]] 562 name = "embassy-embedded-hal" 563 + version = "0.5.0" 564 + source = "registry+https://github.com/rust-lang/crates.io-index" 565 + checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8" 566 dependencies = [ 567 + "defmt 1.0.1", 568 + "embassy-futures", 569 + "embassy-hal-internal", 570 + "embassy-sync", 571 "embedded-hal 0.2.7", 572 "embedded-hal 1.0.0", 573 "embedded-hal-async", ··· 578 579 [[package]] 580 name = "embassy-executor" 581 + version = "0.9.1" 582 + source = "registry+https://github.com/rust-lang/crates.io-index" 583 + checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b" 584 dependencies = [ 585 "cortex-m", 586 "critical-section", 587 + "defmt 1.0.1", 588 "document-features", 589 "embassy-executor-macros", 590 + "embassy-executor-timer-queue", 591 ] 592 593 [[package]] 594 name = "embassy-executor-macros" 595 + version = "0.7.0" 596 + source = "registry+https://github.com/rust-lang/crates.io-index" 597 + checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472" 598 dependencies = [ 599 "darling", 600 "proc-macro2", 601 "quote", 602 + "syn 2.0.106", 603 ] 604 605 [[package]] 606 + name = "embassy-executor-timer-queue" 607 + version = "0.1.0" 608 source = "registry+https://github.com/rust-lang/crates.io-index" 609 + checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c" 610 611 [[package]] 612 name = "embassy-futures" 613 + version = "0.1.2" 614 + source = "registry+https://github.com/rust-lang/crates.io-index" 615 + checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01" 616 617 [[package]] 618 name = "embassy-hal-internal" 619 + version = "0.3.0" 620 + source = "registry+https://github.com/rust-lang/crates.io-index" 621 + checksum = "95285007a91b619dc9f26ea8f55452aa6c60f7115a4edc05085cd2bd3127cd7a" 622 dependencies = [ 623 "cortex-m", 624 "critical-section", 625 + "defmt 1.0.1", 626 "num-traits", 627 ] 628 629 [[package]] 630 name = "embassy-net" 631 + version = "0.7.1" 632 + source = "registry+https://github.com/rust-lang/crates.io-index" 633 + checksum = "0558a231a47e7d4a06a28b5278c92e860f1200f24821d2f365a2f40fe3f3c7b2" 634 dependencies = [ 635 + "defmt 1.0.1", 636 "document-features", 637 + "embassy-net-driver", 638 + "embassy-sync", 639 "embassy-time", 640 "embedded-io-async", 641 "embedded-nal-async", ··· 647 [[package]] 648 name = "embassy-net-driver" 649 version = "0.2.0" 650 + source = "registry+https://github.com/rust-lang/crates.io-index" 651 + checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" 652 dependencies = [ 653 + "defmt 0.3.100", 654 ] 655 656 [[package]] 657 name = "embassy-net-driver-channel" 658 + version = "0.3.2" 659 + source = "registry+https://github.com/rust-lang/crates.io-index" 660 + checksum = "b7b2739fbcf6cd206ae08779c7d709087b16577d255f2ea4a45bc4bbbf305b3f" 661 dependencies = [ 662 + "embassy-futures", 663 + "embassy-net-driver", 664 + "embassy-sync", 665 ] 666 667 [[package]] 668 name = "embassy-net-wiznet" 669 + version = "0.2.1" 670 + source = "registry+https://github.com/rust-lang/crates.io-index" 671 + checksum = "3035678b1fcb8322bbcc3ee9a32ea3ed04e6e388528057abd11ee8382a63abdf" 672 dependencies = [ 673 + "defmt 1.0.1", 674 + "embassy-futures", 675 + "embassy-net-driver-channel", 676 "embassy-time", 677 "embedded-hal 1.0.0", 678 "embedded-hal-async", ··· 680 681 [[package]] 682 name = "embassy-rp" 683 + version = "0.8.0" 684 + source = "registry+https://github.com/rust-lang/crates.io-index" 685 + checksum = "1a284935af0a869de3fa14af74b5f932389dd66d7048012f1083b06f38d05399" 686 dependencies = [ 687 "atomic-polyfill", 688 "cfg-if", 689 "cortex-m", 690 "cortex-m-rt", 691 "critical-section", 692 + "defmt 1.0.1", 693 "document-features", 694 "embassy-embedded-hal", 695 + "embassy-futures", 696 "embassy-hal-internal", 697 + "embassy-sync", 698 "embassy-time", 699 "embassy-time-driver", 700 + "embassy-time-queue-utils", 701 + "embassy-usb-driver", 702 "embedded-hal 0.2.7", 703 "embedded-hal 1.0.0", 704 "embedded-hal-async", ··· 709 "embedded-storage-async", 710 "fixed", 711 "nb 1.1.0", 712 + "pio 0.3.0", 713 + "rand_core 0.6.4", 714 + "rand_core 0.9.3", 715 "rp-pac", 716 "rp2040-boot2", 717 "sha2-const-stable", 718 + "smart-leds", 719 ] 720 721 [[package]] 722 name = "embassy-sync" 723 + version = "0.7.2" 724 source = "registry+https://github.com/rust-lang/crates.io-index" 725 + checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b" 726 dependencies = [ 727 "cfg-if", 728 "critical-section", 729 + "defmt 1.0.1", 730 "embedded-io-async", 731 + "futures-core", 732 + "futures-sink", 733 "heapless 0.8.0", 734 ] 735 736 [[package]] 737 name = "embassy-time" 738 + version = "0.5.0" 739 + source = "registry+https://github.com/rust-lang/crates.io-index" 740 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 741 dependencies = [ 742 "cfg-if", 743 "critical-section", 744 + "defmt 1.0.1", 745 "document-features", 746 "embassy-time-driver", 747 "embedded-hal 0.2.7", 748 "embedded-hal 1.0.0", 749 "embedded-hal-async", 750 + "futures-core", 751 ] 752 753 [[package]] 754 name = "embassy-time-driver" 755 + version = "0.2.1" 756 + source = "registry+https://github.com/rust-lang/crates.io-index" 757 + checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" 758 dependencies = [ 759 "document-features", 760 ] 761 762 [[package]] 763 + name = "embassy-time-queue-utils" 764 version = "0.3.0" 765 + source = "registry+https://github.com/rust-lang/crates.io-index" 766 + checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454" 767 dependencies = [ 768 + "embassy-executor-timer-queue", 769 "heapless 0.8.0", 770 ] 771 772 [[package]] 773 name = "embassy-usb-driver" 774 version = "0.2.0" 775 + source = "registry+https://github.com/rust-lang/crates.io-index" 776 + checksum = "17119855ccc2d1f7470a39756b12068454ae27a3eabb037d940b5c03d9c77b7a" 777 dependencies = [ 778 + "defmt 1.0.1", 779 "embedded-io-async", 780 ] 781 782 [[package]] ··· 787 dependencies = [ 788 "az", 789 "byteorder", 790 + "embedded-graphics-core", 791 "float-cmp", 792 "micromath", 793 ] 794 795 [[package]] ··· 854 source = "registry+https://github.com/rust-lang/crates.io-index" 855 checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" 856 dependencies = [ 857 + "defmt 0.3.100", 858 ] 859 860 [[package]] ··· 863 source = "registry+https://github.com/rust-lang/crates.io-index" 864 checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" 865 dependencies = [ 866 + "defmt 0.3.100", 867 "embedded-io", 868 ] 869 870 [[package]] 871 name = "embedded-nal" 872 + version = "0.9.0" 873 source = "registry+https://github.com/rust-lang/crates.io-index" 874 + checksum = "c56a28be191a992f28f178ec338a0bf02f63d7803244add736d026a471e6ed77" 875 dependencies = [ 876 "nb 1.1.0", 877 ] 878 879 [[package]] 880 name = "embedded-nal-async" 881 + version = "0.8.0" 882 source = "registry+https://github.com/rust-lang/crates.io-index" 883 + checksum = "76959917cd2b86f40a98c28dd5624eddd1fa69d746241c8257eac428d83cb211" 884 dependencies = [ 885 "embedded-io-async", 886 "embedded-nal", 887 ] 888 889 [[package]] ··· 932 dependencies = [ 933 "aes-gcm", 934 "atomic-polyfill", 935 + "defmt 0.3.100", 936 "digest", 937 "embedded-io", 938 "embedded-io-async", ··· 942 "hkdf", 943 "hmac", 944 "p256", 945 + "rand_core 0.6.4", 946 "sha2", 947 "typenum", 948 ] ··· 957 ] 958 959 [[package]] 960 name = "equivalent" 961 version = "1.0.1" 962 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 968 source = "registry+https://github.com/rust-lang/crates.io-index" 969 checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" 970 dependencies = [ 971 + "rand_core 0.6.4", 972 "subtle", 973 ] 974 ··· 1026 checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" 1027 1028 [[package]] 1029 + name = "fixedbitset" 1030 + version = "0.5.7" 1031 + source = "registry+https://github.com/rust-lang/crates.io-index" 1032 + checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" 1033 + 1034 + [[package]] 1035 name = "float-cmp" 1036 version = "0.9.0" 1037 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1072 1073 [[package]] 1074 name = "futures-core" 1075 + version = "0.3.31" 1076 source = "registry+https://github.com/rust-lang/crates.io-index" 1077 + checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 1078 1079 [[package]] 1080 name = "futures-io" ··· 1090 dependencies = [ 1091 "proc-macro2", 1092 "quote", 1093 + "syn 2.0.106", 1094 ] 1095 1096 [[package]] ··· 1150 1151 [[package]] 1152 name = "getrandom" 1153 + version = "0.2.16" 1154 source = "registry+https://github.com/rust-lang/crates.io-index" 1155 + checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" 1156 dependencies = [ 1157 "cfg-if", 1158 "libc", ··· 1176 checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" 1177 dependencies = [ 1178 "ff", 1179 + "rand_core 0.6.4", 1180 "subtle", 1181 ] 1182 ··· 1219 1220 [[package]] 1221 name = "hashbrown" 1222 + version = "0.16.0" 1223 source = "registry+https://github.com/rust-lang/crates.io-index" 1224 + checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" 1225 1226 [[package]] 1227 name = "heapless" ··· 1255 source = "registry+https://github.com/rust-lang/crates.io-index" 1256 checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" 1257 dependencies = [ 1258 + "defmt 0.3.100", 1259 "hash32 0.3.1", 1260 "serde", 1261 "stable_deref_trait", ··· 1263 1264 [[package]] 1265 name = "hermit-abi" 1266 + version = "0.5.2" 1267 source = "registry+https://github.com/rust-lang/crates.io-index" 1268 + checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" 1269 1270 [[package]] 1271 name = "hex" ··· 1305 1306 [[package]] 1307 name = "indexmap" 1308 + version = "2.11.4" 1309 source = "registry+https://github.com/rust-lang/crates.io-index" 1310 + checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" 1311 dependencies = [ 1312 "equivalent", 1313 + "hashbrown", 1314 ] 1315 1316 [[package]] ··· 1324 1325 [[package]] 1326 name = "is-terminal" 1327 + version = "0.4.16" 1328 source = "registry+https://github.com/rust-lang/crates.io-index" 1329 + checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" 1330 dependencies = [ 1331 "hermit-abi", 1332 "libc", 1333 + "windows-sys 0.52.0", 1334 ] 1335 1336 [[package]] ··· 1343 ] 1344 1345 [[package]] 1346 + name = "itertools" 1347 + version = "0.14.0" 1348 + source = "registry+https://github.com/rust-lang/crates.io-index" 1349 + checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" 1350 + dependencies = [ 1351 + "either", 1352 + ] 1353 + 1354 + [[package]] 1355 + name = "keccak" 1356 + version = "0.1.5" 1357 + source = "registry+https://github.com/rust-lang/crates.io-index" 1358 + checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" 1359 + dependencies = [ 1360 + "cpufeatures", 1361 + ] 1362 + 1363 + [[package]] 1364 name = "lalrpop" 1365 version = "0.19.12" 1366 source = "registry+https://github.com/rust-lang/crates.io-index" 1367 checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" 1368 dependencies = [ 1369 + "ascii-canvas 3.0.0", 1370 + "bit-set 0.5.3", 1371 "diff", 1372 "ena", 1373 "is-terminal", 1374 + "itertools 0.10.5", 1375 + "lalrpop-util 0.19.12", 1376 + "petgraph 0.6.5", 1377 "regex", 1378 "regex-syntax 0.6.29", 1379 "string_cache", 1380 + "term 0.7.0", 1381 "tiny-keccak", 1382 "unicode-xid", 1383 ] 1384 1385 [[package]] 1386 + name = "lalrpop" 1387 + version = "0.22.2" 1388 + source = "registry+https://github.com/rust-lang/crates.io-index" 1389 + checksum = "ba4ebbd48ce411c1d10fb35185f5a51a7bfa3d8b24b4e330d30c9e3a34129501" 1390 + dependencies = [ 1391 + "ascii-canvas 4.0.0", 1392 + "bit-set 0.8.0", 1393 + "ena", 1394 + "itertools 0.14.0", 1395 + "lalrpop-util 0.22.2", 1396 + "petgraph 0.7.1", 1397 + "pico-args", 1398 + "regex", 1399 + "regex-syntax 0.8.4", 1400 + "sha3", 1401 + "string_cache", 1402 + "term 1.2.0", 1403 + "unicode-xid", 1404 + "walkdir", 1405 + ] 1406 + 1407 + [[package]] 1408 name = "lalrpop-util" 1409 version = "0.19.12" 1410 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1414 ] 1415 1416 [[package]] 1417 + name = "lalrpop-util" 1418 + version = "0.22.2" 1419 + source = "registry+https://github.com/rust-lang/crates.io-index" 1420 + checksum = "b5baa5e9ff84f1aefd264e6869907646538a52147a755d494517a8007fb48733" 1421 + dependencies = [ 1422 + "regex-automata", 1423 + "rustversion", 1424 + ] 1425 + 1426 + [[package]] 1427 name = "libc" 1428 version = "0.2.155" 1429 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1431 1432 [[package]] 1433 name = "libredox" 1434 + version = "0.1.10" 1435 source = "registry+https://github.com/rust-lang/crates.io-index" 1436 + checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" 1437 dependencies = [ 1438 "bitflags 2.6.0", 1439 "libc", ··· 1501 checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" 1502 1503 [[package]] 1504 name = "nourl" 1505 version = "0.1.1" 1506 source = "registry+https://github.com/rust-lang/crates.io-index" 1507 checksum = "b3c12edfda65fe16901d81d3bd93fd18ac07078b5007875a1c3b0d35f7725269" 1508 dependencies = [ 1509 + "defmt 0.3.100", 1510 ] 1511 + 1512 + [[package]] 1513 + name = "num-conv" 1514 + version = "0.1.0" 1515 + source = "registry+https://github.com/rust-lang/crates.io-index" 1516 + checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 1517 1518 [[package]] 1519 name = "num-traits" ··· 1530 source = "registry+https://github.com/rust-lang/crates.io-index" 1531 checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" 1532 dependencies = [ 1533 + "num_enum_derive 0.5.11", 1534 + ] 1535 + 1536 + [[package]] 1537 + name = "num_enum" 1538 + version = "0.7.4" 1539 + source = "registry+https://github.com/rust-lang/crates.io-index" 1540 + checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" 1541 + dependencies = [ 1542 + "num_enum_derive 0.7.4", 1543 + "rustversion", 1544 ] 1545 1546 [[package]] ··· 1555 ] 1556 1557 [[package]] 1558 + name = "num_enum_derive" 1559 + version = "0.7.4" 1560 + source = "registry+https://github.com/rust-lang/crates.io-index" 1561 + checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" 1562 + dependencies = [ 1563 + "proc-macro2", 1564 + "quote", 1565 + "syn 2.0.106", 1566 + ] 1567 + 1568 + [[package]] 1569 name = "object-chain" 1570 version = "0.1.3" 1571 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1595 1596 [[package]] 1597 name = "panic-probe" 1598 + version = "1.0.0" 1599 source = "registry+https://github.com/rust-lang/crates.io-index" 1600 + checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a" 1601 dependencies = [ 1602 "cortex-m", 1603 + "defmt 1.0.1", 1604 ] 1605 1606 [[package]] ··· 1638 source = "registry+https://github.com/rust-lang/crates.io-index" 1639 checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" 1640 dependencies = [ 1641 + "fixedbitset 0.4.2", 1642 + "indexmap", 1643 + ] 1644 + 1645 + [[package]] 1646 + name = "petgraph" 1647 + version = "0.7.1" 1648 + source = "registry+https://github.com/rust-lang/crates.io-index" 1649 + checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" 1650 + dependencies = [ 1651 + "fixedbitset 0.5.7", 1652 "indexmap", 1653 ] 1654 ··· 1662 ] 1663 1664 [[package]] 1665 + name = "pico-args" 1666 + version = "0.5.0" 1667 + source = "registry+https://github.com/rust-lang/crates.io-index" 1668 + checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" 1669 + 1670 + [[package]] 1671 name = "pin-project-lite" 1672 version = "0.2.14" 1673 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1686 checksum = "76e09694b50f89f302ed531c1f2a7569f0be5867aee4ab4f8f729bbeec0078e3" 1687 dependencies = [ 1688 "arrayvec", 1689 + "num_enum 0.5.11", 1690 + "paste", 1691 + ] 1692 + 1693 + [[package]] 1694 + name = "pio" 1695 + version = "0.3.0" 1696 + source = "registry+https://github.com/rust-lang/crates.io-index" 1697 + checksum = "d0ba4153cee9585abc451271aa437d9e8defdea8b468d48ba6b8f098cbe03d7f" 1698 + dependencies = [ 1699 + "pio-core", 1700 + "pio-proc 0.3.0", 1701 + ] 1702 + 1703 + [[package]] 1704 + name = "pio-core" 1705 + version = "0.3.0" 1706 + source = "registry+https://github.com/rust-lang/crates.io-index" 1707 + checksum = "61d90fddc3d67f21bbf93683bc461b05d6a29c708caf3ffb79947d7ff7095406" 1708 + dependencies = [ 1709 + "arrayvec", 1710 + "num_enum 0.7.4", 1711 "paste", 1712 ] 1713 ··· 1717 source = "registry+https://github.com/rust-lang/crates.io-index" 1718 checksum = "77532c2b8279aef98dfc7207ef15298a5a3d6b6cc76ccc8b65913d69f3a8dd6b" 1719 dependencies = [ 1720 + "lalrpop 0.19.12", 1721 + "lalrpop-util 0.19.12", 1722 + "pio 0.2.1", 1723 "regex-syntax 0.6.29", 1724 ] 1725 1726 [[package]] 1727 + name = "pio-parser" 1728 + version = "0.3.0" 1729 + source = "registry+https://github.com/rust-lang/crates.io-index" 1730 + checksum = "825266c1eaddf54f636d06eefa4bf3c99d774c14ec46a4a6c6e5128a0f10d205" 1731 + dependencies = [ 1732 + "lalrpop 0.22.2", 1733 + "lalrpop-util 0.22.2", 1734 + "pio-core", 1735 + ] 1736 + 1737 + [[package]] 1738 name = "pio-proc" 1739 version = "0.2.2" 1740 source = "registry+https://github.com/rust-lang/crates.io-index" 1741 checksum = "6b04dc870fb3a4fd8b3e4ca8c61b53bc8ac4eb78b66805d2b3c2e5c4829e0d7a" 1742 dependencies = [ 1743 "codespan-reporting", 1744 + "lalrpop-util 0.19.12", 1745 + "pio 0.2.1", 1746 + "pio-parser 0.2.2", 1747 "proc-macro-error", 1748 "proc-macro2", 1749 "quote", ··· 1752 ] 1753 1754 [[package]] 1755 + name = "pio-proc" 1756 + version = "0.3.0" 1757 + source = "registry+https://github.com/rust-lang/crates.io-index" 1758 + checksum = "ed4a76571f5fe51af43cc80ac870fe0c79cc0cdd686b9002a6c4c84bfdd0176b" 1759 + dependencies = [ 1760 + "codespan-reporting", 1761 + "lalrpop-util 0.22.2", 1762 + "pio-core", 1763 + "pio-parser 0.3.0", 1764 + "proc-macro-error2", 1765 + "proc-macro2", 1766 + "quote", 1767 + "syn 2.0.106", 1768 + ] 1769 + 1770 + [[package]] 1771 name = "polyval" 1772 version = "0.6.2" 1773 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1800 ] 1801 1802 [[package]] 1803 + name = "powerfmt" 1804 + version = "0.2.0" 1805 + source = "registry+https://github.com/rust-lang/crates.io-index" 1806 + checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 1807 + 1808 + [[package]] 1809 name = "ppv-lite86" 1810 version = "0.2.18" 1811 source = "registry+https://github.com/rust-lang/crates.io-index" 1812 checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" 1813 dependencies = [ 1814 + "zerocopy", 1815 ] 1816 1817 [[package]] ··· 1854 ] 1855 1856 [[package]] 1857 + name = "proc-macro-error-attr2" 1858 + version = "2.0.0" 1859 + source = "registry+https://github.com/rust-lang/crates.io-index" 1860 + checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" 1861 + dependencies = [ 1862 + "proc-macro2", 1863 + "quote", 1864 + ] 1865 + 1866 + [[package]] 1867 + name = "proc-macro-error2" 1868 + version = "2.0.1" 1869 + source = "registry+https://github.com/rust-lang/crates.io-index" 1870 + checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" 1871 + dependencies = [ 1872 + "proc-macro-error-attr2", 1873 + "proc-macro2", 1874 + "quote", 1875 + "syn 2.0.106", 1876 + ] 1877 + 1878 + [[package]] 1879 name = "proc-macro2" 1880 + version = "1.0.101" 1881 source = "registry+https://github.com/rust-lang/crates.io-index" 1882 + checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" 1883 dependencies = [ 1884 "unicode-ident", 1885 ] ··· 1899 source = "registry+https://github.com/rust-lang/crates.io-index" 1900 checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1901 dependencies = [ 1902 + "rand_core 0.6.4", 1903 ] 1904 1905 [[package]] ··· 1909 checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1910 dependencies = [ 1911 "ppv-lite86", 1912 + "rand_core 0.6.4", 1913 ] 1914 1915 [[package]] ··· 1919 checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1920 1921 [[package]] 1922 + name = "rand_core" 1923 + version = "0.9.3" 1924 + source = "registry+https://github.com/rust-lang/crates.io-index" 1925 + checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" 1926 + 1927 + [[package]] 1928 name = "redox_syscall" 1929 version = "0.5.3" 1930 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1935 1936 [[package]] 1937 name = "redox_users" 1938 + version = "0.4.6" 1939 source = "registry+https://github.com/rust-lang/crates.io-index" 1940 + checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" 1941 dependencies = [ 1942 "getrandom", 1943 "libredox", 1944 + "thiserror 1.0.69", 1945 ] 1946 1947 [[package]] ··· 1981 1982 [[package]] 1983 name = "reqwless" 1984 + version = "0.13.0" 1985 source = "registry+https://github.com/rust-lang/crates.io-index" 1986 + checksum = "fb1be74cb817fa6dbda417110f575d9b9ad5488817f1eb65f2f6468fe6d5d663" 1987 dependencies = [ 1988 "base64", 1989 "buffered-io", 1990 + "defmt 0.3.100", 1991 "embedded-io", 1992 "embedded-io-async", 1993 "embedded-nal-async", ··· 1997 "httparse", 1998 "nourl", 1999 "rand_chacha", 2000 + "rand_core 0.6.4", 2001 ] 2002 2003 [[package]] 2004 name = "rgb" 2005 + version = "0.8.52" 2006 source = "registry+https://github.com/rust-lang/crates.io-index" 2007 + checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce" 2008 2009 [[package]] 2010 name = "rp-pac" 2011 + version = "7.0.0" 2012 + source = "registry+https://github.com/rust-lang/crates.io-index" 2013 + checksum = "8af65855c40b2c35079514c5489abffc0429347fef25d8467ff98ad84b4322d3" 2014 dependencies = [ 2015 "cortex-m", 2016 "cortex-m-rt", ··· 2050 checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" 2051 2052 [[package]] 2053 + name = "rusty_badger" 2054 + version = "0.1.0" 2055 + dependencies = [ 2056 + "assign-resources", 2057 + "byte-slice-cast", 2058 + "cortex-m", 2059 + "cortex-m-rt", 2060 + "critical-section", 2061 + "cyw43", 2062 + "cyw43-pio", 2063 + "defmt 0.3.100", 2064 + "defmt-rtt", 2065 + "embassy-embedded-hal", 2066 + "embassy-executor", 2067 + "embassy-net", 2068 + "embassy-net-wiznet", 2069 + "embassy-rp", 2070 + "embassy-sync", 2071 + "embassy-time", 2072 + "embedded-graphics", 2073 + "embedded-hal 1.0.0", 2074 + "embedded-hal-async", 2075 + "embedded-hal-bus", 2076 + "embedded-io-async", 2077 + "embedded-sdmmc", 2078 + "embedded-storage", 2079 + "embedded-text", 2080 + "fixed", 2081 + "fixed-macro", 2082 + "heapless 0.8.0", 2083 + "log", 2084 + "panic-probe", 2085 + "pio 0.2.1", 2086 + "pio-proc 0.2.2", 2087 + "portable-atomic", 2088 + "postcard", 2089 + "rand", 2090 + "reqwless", 2091 + "serde", 2092 + "serde-json-core", 2093 + "shtcx", 2094 + "static_cell", 2095 + "time", 2096 + "tinybmp", 2097 + "uc8151", 2098 + ] 2099 + 2100 + [[package]] 2101 name = "ryu" 2102 version = "1.0.18" 2103 source = "registry+https://github.com/rust-lang/crates.io-index" 2104 checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 2105 + 2106 + [[package]] 2107 + name = "same-file" 2108 + version = "1.0.6" 2109 + source = "registry+https://github.com/rust-lang/crates.io-index" 2110 + checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 2111 + dependencies = [ 2112 + "winapi-util", 2113 + ] 2114 2115 [[package]] 2116 name = "scopeguard" ··· 2180 dependencies = [ 2181 "proc-macro2", 2182 "quote", 2183 + "syn 2.0.106", 2184 ] 2185 2186 [[package]] ··· 2201 checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" 2202 2203 [[package]] 2204 + name = "sha3" 2205 + version = "0.10.8" 2206 + source = "registry+https://github.com/rust-lang/crates.io-index" 2207 + checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" 2208 + dependencies = [ 2209 + "digest", 2210 + "keccak", 2211 + ] 2212 + 2213 + [[package]] 2214 name = "shtcx" 2215 version = "1.0.0" 2216 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2233 2234 [[package]] 2235 name = "smart-leds" 2236 + version = "0.4.0" 2237 source = "registry+https://github.com/rust-lang/crates.io-index" 2238 + checksum = "66df34e571fa9993fa6f99131a374d58ca3d694b75f9baac93458fe0d6057bf0" 2239 dependencies = [ 2240 "smart-leds-trait", 2241 ] 2242 2243 [[package]] 2244 name = "smart-leds-trait" 2245 + version = "0.3.2" 2246 source = "registry+https://github.com/rust-lang/crates.io-index" 2247 + checksum = "a7f4441a131924d58da6b83a7ad765c460e64630cce504376c3a87a2558c487f" 2248 dependencies = [ 2249 "rgb", 2250 ] 2251 2252 [[package]] 2253 name = "smoltcp" 2254 + version = "0.12.0" 2255 source = "registry+https://github.com/rust-lang/crates.io-index" 2256 + checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb" 2257 dependencies = [ 2258 "bitflags 1.3.2", 2259 "byteorder", 2260 "cfg-if", 2261 + "defmt 0.3.100", 2262 "heapless 0.8.0", 2263 "managed", 2264 ] ··· 2273 ] 2274 2275 [[package]] 2276 name = "stable_deref_trait" 2277 version = "1.2.0" 2278 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2325 2326 [[package]] 2327 name = "syn" 2328 + version = "2.0.106" 2329 source = "registry+https://github.com/rust-lang/crates.io-index" 2330 + checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" 2331 dependencies = [ 2332 "proc-macro2", 2333 "quote", ··· 2346 ] 2347 2348 [[package]] 2349 + name = "term" 2350 + version = "1.2.0" 2351 + source = "registry+https://github.com/rust-lang/crates.io-index" 2352 + checksum = "2111ef44dae28680ae9752bb89409e7310ca33a8c621ebe7b106cf5c928b3ac0" 2353 + dependencies = [ 2354 + "windows-sys 0.61.1", 2355 + ] 2356 + 2357 + [[package]] 2358 name = "termcolor" 2359 version = "1.4.1" 2360 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2365 2366 [[package]] 2367 name = "thiserror" 2368 + version = "1.0.69" 2369 source = "registry+https://github.com/rust-lang/crates.io-index" 2370 + checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 2371 dependencies = [ 2372 + "thiserror-impl 1.0.69", 2373 + ] 2374 + 2375 + [[package]] 2376 + name = "thiserror" 2377 + version = "2.0.17" 2378 + source = "registry+https://github.com/rust-lang/crates.io-index" 2379 + checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" 2380 + dependencies = [ 2381 + "thiserror-impl 2.0.17", 2382 ] 2383 2384 [[package]] 2385 name = "thiserror-impl" 2386 + version = "1.0.69" 2387 source = "registry+https://github.com/rust-lang/crates.io-index" 2388 + checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" 2389 dependencies = [ 2390 "proc-macro2", 2391 "quote", 2392 + "syn 2.0.106", 2393 ] 2394 2395 [[package]] 2396 + name = "thiserror-impl" 2397 + version = "2.0.17" 2398 + source = "registry+https://github.com/rust-lang/crates.io-index" 2399 + checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" 2400 + dependencies = [ 2401 + "proc-macro2", 2402 + "quote", 2403 + "syn 2.0.106", 2404 + ] 2405 + 2406 + [[package]] 2407 + name = "time" 2408 + version = "0.3.44" 2409 + source = "registry+https://github.com/rust-lang/crates.io-index" 2410 + checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" 2411 + dependencies = [ 2412 + "deranged", 2413 + "num-conv", 2414 + "powerfmt", 2415 + "time-core", 2416 + ] 2417 + 2418 + [[package]] 2419 + name = "time-core" 2420 + version = "0.1.6" 2421 + source = "registry+https://github.com/rust-lang/crates.io-index" 2422 + checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" 2423 + 2424 + [[package]] 2425 name = "tiny-keccak" 2426 version = "2.0.2" 2427 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2440 ] 2441 2442 [[package]] 2443 name = "typenum" 2444 version = "1.17.0" 2445 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2450 version = "0.3.0" 2451 source = "git+https://github.com/9names/uc8151-rs.git#37a7feee23716506b777bd4032327038e7e0786a" 2452 dependencies = [ 2453 + "embedded-graphics-core", 2454 "embedded-hal 1.0.0", 2455 "embedded-hal-async", 2456 ] ··· 2484 ] 2485 2486 [[package]] 2487 name = "vcell" 2488 version = "0.1.3" 2489 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2511 ] 2512 2513 [[package]] 2514 + name = "walkdir" 2515 + version = "2.5.0" 2516 + source = "registry+https://github.com/rust-lang/crates.io-index" 2517 + checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 2518 + dependencies = [ 2519 + "same-file", 2520 + "winapi-util", 2521 + ] 2522 + 2523 + [[package]] 2524 name = "wasi" 2525 + version = "0.11.1+wasi-snapshot-preview1" 2526 source = "registry+https://github.com/rust-lang/crates.io-index" 2527 + checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 2528 2529 [[package]] 2530 name = "winapi" ··· 2548 source = "registry+https://github.com/rust-lang/crates.io-index" 2549 checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" 2550 dependencies = [ 2551 + "windows-sys 0.52.0", 2552 ] 2553 2554 [[package]] ··· 2558 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2559 2560 [[package]] 2561 + name = "windows-link" 2562 + version = "0.2.0" 2563 + source = "registry+https://github.com/rust-lang/crates.io-index" 2564 + checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" 2565 + 2566 + [[package]] 2567 name = "windows-sys" 2568 version = "0.52.0" 2569 source = "registry+https://github.com/rust-lang/crates.io-index" 2570 checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 2571 dependencies = [ 2572 "windows-targets", 2573 + ] 2574 + 2575 + [[package]] 2576 + name = "windows-sys" 2577 + version = "0.61.1" 2578 + source = "registry+https://github.com/rust-lang/crates.io-index" 2579 + checksum = "6f109e41dd4a3c848907eb83d5a42ea98b3769495597450cf6d153507b166f0f" 2580 + dependencies = [ 2581 + "windows-link", 2582 ] 2583 2584 [[package]] ··· 2652 checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" 2653 dependencies = [ 2654 "byteorder", 2655 + "zerocopy-derive", 2656 ] 2657 2658 [[package]] ··· 2663 dependencies = [ 2664 "proc-macro2", 2665 "quote", 2666 + "syn 2.0.106", 2667 ] 2668 2669 [[package]]
+30 -37
Cargo.toml
··· 1 [package] 2 - name = "embassy_rp_w_template" 3 version = "0.1.0" 4 - edition = "2021" 5 6 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 8 [dependencies] 9 - embassy-embedded-hal = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 10 "defmt", 11 ] } 12 - embassy-sync = { version = "0.6.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 13 "defmt", 14 ] } 15 - embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 16 - "task-arena-size-98304", 17 "arch-cortex-m", 18 "executor-thread", 19 "executor-interrupt", 20 "defmt", 21 - "integrated-timers", 22 ] } 23 - embassy-time = { version = "0.3.2", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 24 "defmt", 25 "defmt-timestamp-uptime", 26 ] } 27 - embassy-rp = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 28 "defmt", 29 "unstable-pac", 30 "time-driver", 31 "critical-section-impl", 32 "rp2040", 33 ] } 34 - embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 35 - "defmt", 36 - ] } 37 - embassy-net = { version = "0.4.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 38 "defmt", 39 "tcp", 40 "udp", ··· 43 "medium-ethernet", 44 "dns", 45 ] } 46 - embassy-net-wiznet = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 47 "defmt", 48 ] } 49 - embassy-futures = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git" } 50 - embassy-usb-logger = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git" } 51 - cyw43 = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 52 - "defmt", 53 - "firmware-logs", 54 - "bluetooth", 55 ] } 56 - cyw43-pio = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 57 "defmt", 58 - "overclock", 59 ] } 60 61 defmt = "0.3" ··· 64 fixed-macro = "1.2" 65 66 # for web request example 67 - reqwless = { version = "0.12.0", features = ["defmt"] } 68 serde = { version = "1.0.203", default-features = false, features = ["derive"] } 69 serde-json-core = "0.5.1" 70 ··· 73 # for assign resources example 74 #cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } 75 cortex-m = { version = "0.7.6", features = ["inline-asm"] } 76 - cortex-m-rt = "0.7.0" 77 critical-section = "1.1" 78 - panic-probe = { version = "0.3", features = ["print-defmt"] } 79 - display-interface-spi = "0.4.1" 80 - embedded-graphics = "0.8.0" 81 - st7789 = "0.6.1" 82 - display-interface = "0.4.1" 83 byte-slice-cast = { version = "1.2.0", default-features = false } 84 - smart-leds = "0.3.0" 85 heapless = { version = "0.8", features = ["serde"] } 86 - usbd-hid = "0.8.1" 87 88 embedded-hal-1 = { package = "embedded-hal", version = "1.0" } 89 embedded-hal-async = "1.0" ··· 97 pio = "0.2.1" 98 rand = { version = "0.8.5", default-features = false } 99 embedded-sdmmc = "0.7.0" 100 - bt-hci = { version = "0.1.0", default-features = false, features = ["defmt"] } 101 - trouble-host = { version = "0.1.0", features = ["defmt", "gatt"] } 102 uc8151 = { git = "https://github.com/9names/uc8151-rs.git", features = [ 103 "graphics", 104 ] } ··· 106 tinybmp = "0.5.0" 107 shtcx = "1.0.0" 108 postcard = "1.0.8" 109 110 [profile.release] 111 debug = 2 112 113 [profile.dev] 114 - debug = 1 115 lto = true 116 opt-level = "z" 117 118 - [patch.crates-io] 119 - trouble-host = { git = "https://github.com/embassy-rs/trouble.git", rev = "4b8c0f499b34e46ca23a56e2d1640ede371722cf" } 120 - embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6" }
··· 1 [package] 2 + name = "rusty_badger" 3 version = "0.1.0" 4 + edition = "2024" 5 6 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 8 [dependencies] 9 + embassy-embedded-hal = { version = "0.5.0", features = [ 10 "defmt", 11 ] } 12 + embassy-sync = { version = "0.7.2", features = [ 13 "defmt", 14 ] } 15 + embassy-executor = { version = "0.9.1", features = [ 16 "arch-cortex-m", 17 "executor-thread", 18 "executor-interrupt", 19 "defmt", 20 ] } 21 + embassy-time = { version = "0.5.0", features = [ 22 "defmt", 23 "defmt-timestamp-uptime", 24 ] } 25 + embassy-rp = { version = "0.8.0", features = [ 26 "defmt", 27 "unstable-pac", 28 "time-driver", 29 "critical-section-impl", 30 "rp2040", 31 ] } 32 + #embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 33 + # "defmt", 34 + #] } 35 + embassy-net = { version = "0.7.1", features = [ 36 "defmt", 37 "tcp", 38 "udp", ··· 41 "medium-ethernet", 42 "dns", 43 ] } 44 + embassy-net-wiznet = { version = "0.2.1", features = [ 45 "defmt", 46 ] } 47 + #embassy-futures = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git" } 48 + #embassy-usb-logger = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git" } 49 + cyw43 = { version = "0.5.0", features = [ 50 + # "defmt", 51 + # "firmware-logs", 52 + # "bluetooth", 53 ] } 54 + cyw43-pio = { version = "0.8.0", features = [ 55 "defmt", 56 ] } 57 58 defmt = "0.3" ··· 61 fixed-macro = "1.2" 62 63 # for web request example 64 + reqwless = { version = "0.13.0", features = ["defmt"] } 65 serde = { version = "1.0.203", default-features = false, features = ["derive"] } 66 serde-json-core = "0.5.1" 67 ··· 70 # for assign resources example 71 #cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } 72 cortex-m = { version = "0.7.6", features = ["inline-asm"] } 73 + cortex-m-rt = "0.7.5" 74 critical-section = "1.1" 75 + panic-probe = { version = "1.0.0", features = ["print-defmt"] } 76 + 77 + embedded-graphics = "0.8.1" 78 byte-slice-cast = { version = "1.2.0", default-features = false } 79 + 80 heapless = { version = "0.8", features = ["serde"] } 81 + 82 83 embedded-hal-1 = { package = "embedded-hal", version = "1.0" } 84 embedded-hal-async = "1.0" ··· 92 pio = "0.2.1" 93 rand = { version = "0.8.5", default-features = false } 94 embedded-sdmmc = "0.7.0" 95 uc8151 = { git = "https://github.com/9names/uc8151-rs.git", features = [ 96 "graphics", 97 ] } ··· 99 tinybmp = "0.5.0" 100 shtcx = "1.0.0" 101 postcard = "1.0.8" 102 + time = { version = "0.3.17", default-features = false } 103 + #pcf85063a = "0.1.1" 104 105 [profile.release] 106 debug = 2 107 108 [profile.dev] 109 + debug = 2 110 lto = true 111 opt-level = "z" 112 113 +
images/mtras_logo.bmp

This is a binary file and will not be displayed.

+4
rust-toolchain-nightly.toml
···
··· 1 + [toolchain] 2 + channel = "nightly" 3 + components = ["rust-src", "rustfmt", "llvm-tools", "miri"] 4 + targets = ["thumbv6m-none-eabi"]
+7 -1
src/badge_display/display_image.rs
··· 2 3 use super::CURRENT_IMAGE; 4 5 - static NUMBER_OF_IMAGES: u8 = 2; 6 static FERRIS_IMG: &[u8; 15722] = include_bytes!("../../images/ferris_w_a_knife.bmp"); 7 static REPO_IMG: &[u8; 11262] = include_bytes!("../../images/repo.bmp"); 8 9 pub enum DisplayImage { 10 Ferris = 0, 11 Repo = 1, 12 } 13 14 pub fn get_current_image() -> DisplayImage { ··· 20 match value { 21 0 => Some(Self::Ferris), 22 1 => Some(Self::Repo), 23 _ => None, 24 } 25 } ··· 28 match self { 29 Self::Ferris => 0, 30 Self::Repo => 1, 31 } 32 } 33 ··· 35 match self { 36 Self::Ferris => FERRIS_IMG, 37 Self::Repo => REPO_IMG, 38 } 39 } 40 ··· 57 match self { 58 Self::Ferris => Point::new(150, 26), 59 Self::Repo => Point::new(190, 26), 60 } 61 } 62 }
··· 2 3 use super::CURRENT_IMAGE; 4 5 + static NUMBER_OF_IMAGES: u8 = 3; 6 static FERRIS_IMG: &[u8; 15722] = include_bytes!("../../images/ferris_w_a_knife.bmp"); 7 static REPO_IMG: &[u8; 11262] = include_bytes!("../../images/repo.bmp"); 8 + static MTRAS_LOGO: &[u8; 11162] = include_bytes!("../../images/mtras_logo.bmp"); 9 10 pub enum DisplayImage { 11 Ferris = 0, 12 Repo = 1, 13 + MtrasLogo = 2, 14 } 15 16 pub fn get_current_image() -> DisplayImage { ··· 22 match value { 23 0 => Some(Self::Ferris), 24 1 => Some(Self::Repo), 25 + 2 => Some(Self::MtrasLogo), 26 _ => None, 27 } 28 } ··· 31 match self { 32 Self::Ferris => 0, 33 Self::Repo => 1, 34 + Self::MtrasLogo => 2, 35 } 36 } 37 ··· 39 match self { 40 Self::Ferris => FERRIS_IMG, 41 Self::Repo => REPO_IMG, 42 + Self::MtrasLogo => MTRAS_LOGO, 43 } 44 } 45 ··· 62 match self { 63 Self::Ferris => Point::new(150, 26), 64 Self::Repo => Point::new(190, 26), 65 + Self::MtrasLogo => Point::new(190, 26), 66 } 67 } 68 }
+205 -108
src/badge_display/mod.rs
··· 25 TextBox, 26 }; 27 use gpio::Output; 28 - use heapless::String; 29 use tinybmp::Bmp; 30 - use uc8151::asynch::Uc8151; 31 use uc8151::LUT; 32 use uc8151::WIDTH; 33 use {defmt_rtt as _, panic_probe as _}; 34 35 - use crate::{env::env_value, helpers::easy_format, Spi0Bus}; 36 37 //Display state 38 pub static CURRENT_IMAGE: AtomicU8 = AtomicU8::new(0); 39 pub static CHANGE_IMAGE: AtomicBool = AtomicBool::new(true); 40 pub static WIFI_COUNT: AtomicU32 = AtomicU32::new(0); ··· 42 blocking_mutex::Mutex::new(RefCell::new(String::<8>::new())); 43 pub static TEMP: AtomicU8 = AtomicU8::new(0); 44 pub static HUMIDITY: AtomicU8 = AtomicU8::new(0); 45 46 #[embassy_executor::task] 47 pub async fn run_the_display( ··· 74 .into_styled(PrimitiveStyle::with_fill(BinaryColor::On)) 75 .draw(&mut display) 76 .unwrap(); 77 78 - // Create the text box and apply styling options. 79 - let display_text = easy_format::<29>(format_args!( 80 - "{}\n{}", 81 - env_value("NAME"), 82 - env_value("DETAILS") 83 - )); 84 - 85 - // \nWritten in rust\nRunning on a pico w"; 86 let name_and_detail_box = TextBox::with_textbox_style( 87 - &display_text, 88 name_and_detail_bounds, 89 character_style, 90 textbox_style, 91 ); 92 93 - // Draw the text box. 94 - name_and_detail_box.draw(&mut display).unwrap(); 95 - 96 // let _ = display.update().await; 97 98 //Each cycle is half a second 99 let cycle: Duration = Duration::from_millis(500); 100 101 - let mut first_run = true; 102 //New start every 120 cycles or 60 seconds 103 let cycles_to_clear_at: i32 = 120; 104 let mut cycles_since_last_clear = 0; 105 - 106 loop { 107 //Timed based display events 108 109 - //Runs every second; 110 - if cycles_since_last_clear % 2 == 0 { 111 - // update_time_values_from_cycles(); 112 - } 113 114 - //Updates the top bar 115 - //Runs every 60 cycles/30 seconds and first run 116 - if cycles_since_last_clear % 60 == 0 || first_run { 117 - let count = WIFI_COUNT.load(core::sync::atomic::Ordering::Relaxed); 118 - let temp = TEMP.load(core::sync::atomic::Ordering::Relaxed); 119 - let humidity = HUMIDITY.load(core::sync::atomic::Ordering::Relaxed); 120 - let top_text: String<64> = easy_format::<64>(format_args!( 121 - "{}F {}% Wifi found: {}", 122 - temp, humidity, count 123 - )); 124 - let top_bounds = Rectangle::new(Point::new(0, 0), Size::new(WIDTH, 24)); 125 - top_bounds 126 - .into_styled( 127 - PrimitiveStyleBuilder::default() 128 - .stroke_color(BinaryColor::Off) 129 - .fill_color(BinaryColor::On) 130 - .stroke_width(1) 131 - .build(), 132 - ) 133 - .draw(&mut display) 134 - .unwrap(); 135 136 - Text::new(top_text.as_str(), Point::new(8, 16), character_style) 137 - .draw(&mut display) 138 - .unwrap(); 139 140 - // Draw the text box. 141 - let result = display.partial_update(top_bounds.try_into().unwrap()).await; 142 - match result { 143 - Ok(_) => {} 144 - Err(_) => { 145 - info!("Error updating display"); 146 } 147 } 148 - } 149 150 - //Runs every 120 cycles/60 seconds and first run 151 - if cycles_since_last_clear == 0 { 152 - let mut time_text: String<8> = String::<8>::new(); 153 154 - let time_box_rectangle_location = Point::new(0, 96); 155 - RTC_TIME_STRING.lock(|x| { 156 - time_text.push_str(x.borrow().as_str()).unwrap(); 157 - }); 158 159 - //The bounds of the box for time and refresh area 160 - let time_bounds = Rectangle::new(time_box_rectangle_location, Size::new(88, 24)); 161 - time_bounds 162 - .into_styled( 163 - PrimitiveStyleBuilder::default() 164 - .stroke_color(BinaryColor::Off) 165 - .fill_color(BinaryColor::On) 166 - .stroke_width(1) 167 - .build(), 168 ) 169 .draw(&mut display) 170 .unwrap(); 171 172 - //Adding a y offset to the box location to fit inside the box 173 - Text::new( 174 - time_text.as_str(), 175 - ( 176 - time_box_rectangle_location.x + 8, 177 - time_box_rectangle_location.y + 16, 178 - ) 179 - .into(), 180 - character_style, 181 - ) 182 - .draw(&mut display) 183 - .unwrap(); 184 - 185 - let result = display 186 - .partial_update(time_bounds.try_into().unwrap()) 187 - .await; 188 - match result { 189 - Ok(_) => {} 190 - Err(_) => { 191 - info!("Error updating display"); 192 } 193 } 194 - } 195 196 - //Manually triggered display events 197 198 - if CHANGE_IMAGE.load(core::sync::atomic::Ordering::Relaxed) { 199 - let current_image = get_current_image(); 200 - let tga: Bmp<BinaryColor> = Bmp::from_slice(&current_image.image()).unwrap(); 201 - let image = Image::new(&tga, current_image.image_location()); 202 - //clear image location by writing a white rectangle over previous image location 203 - let clear_rectangle = Rectangle::new( 204 - current_image.previous().image_location(), 205 - Size::new(157, 101), 206 - ); 207 - clear_rectangle 208 - .into_styled(PrimitiveStyle::with_fill(BinaryColor::On)) 209 - .draw(&mut display) 210 - .unwrap(); 211 212 - let _ = image.draw(&mut display); 213 - //TODO need to look up the reginal area display 214 - let _ = display.update().await; 215 - CHANGE_IMAGE.store(false, core::sync::atomic::Ordering::Relaxed); 216 } 217 218 cycles_since_last_clear += 1; 219 if cycles_since_last_clear >= cycles_to_clear_at { 220 cycles_since_last_clear = 0; 221 } 222 - first_run = false; 223 // info!("Display Cycle: {}", cycles_since_last_clear); 224 Timer::after(cycle).await; 225 }
··· 25 TextBox, 26 }; 27 use gpio::Output; 28 + use heapless::{String, Vec}; 29 use tinybmp::Bmp; 30 use uc8151::LUT; 31 use uc8151::WIDTH; 32 + use uc8151::{asynch::Uc8151, HEIGHT}; 33 use {defmt_rtt as _, panic_probe as _}; 34 35 + use crate::{ 36 + env::env_value, 37 + helpers::{easy_format, easy_format_str}, 38 + Spi0Bus, 39 + }; 40 + 41 + pub type RecentWifiNetworksVec = Vec<String<32>, 4>; 42 43 //Display state 44 + pub static SCREEN_TO_SHOW: blocking_mutex::Mutex<CriticalSectionRawMutex, RefCell<Screen>> = 45 + blocking_mutex::Mutex::new(RefCell::new(Screen::Badge)); 46 + pub static RECENT_WIFI_NETWORKS: blocking_mutex::Mutex< 47 + CriticalSectionRawMutex, 48 + RefCell<RecentWifiNetworksVec>, 49 + > = blocking_mutex::Mutex::new(RefCell::new(RecentWifiNetworksVec::new())); 50 + 51 + pub static FORCE_SCREEN_REFRESH: AtomicBool = AtomicBool::new(true); 52 + pub static DISPLAY_CHANGED: AtomicBool = AtomicBool::new(false); 53 pub static CURRENT_IMAGE: AtomicU8 = AtomicU8::new(0); 54 pub static CHANGE_IMAGE: AtomicBool = AtomicBool::new(true); 55 pub static WIFI_COUNT: AtomicU32 = AtomicU32::new(0); ··· 57 blocking_mutex::Mutex::new(RefCell::new(String::<8>::new())); 58 pub static TEMP: AtomicU8 = AtomicU8::new(0); 59 pub static HUMIDITY: AtomicU8 = AtomicU8::new(0); 60 + 61 + #[derive(Debug, Clone, Copy, PartialEq, defmt::Format)] 62 + pub enum Screen { 63 + Badge, 64 + WifiList, 65 + } 66 67 #[embassy_executor::task] 68 pub async fn run_the_display( ··· 95 .into_styled(PrimitiveStyle::with_fill(BinaryColor::On)) 96 .draw(&mut display) 97 .unwrap(); 98 + info!("Name: {}", env_value("NAME")); 99 + info!("Details: {}", env_value("DETAILS")); 100 + let mut name_and_details_buffer = [0; 128]; 101 + let name_and_details = easy_format_str( 102 + format_args!("{}\n{}", env_value("NAME"), env_value("DETAILS")), 103 + &mut name_and_details_buffer, 104 + ); 105 106 let name_and_detail_box = TextBox::with_textbox_style( 107 + &name_and_details.unwrap(), 108 name_and_detail_bounds, 109 character_style, 110 textbox_style, 111 ); 112 113 // let _ = display.update().await; 114 115 //Each cycle is half a second 116 let cycle: Duration = Duration::from_millis(500); 117 118 //New start every 120 cycles or 60 seconds 119 let cycles_to_clear_at: i32 = 120; 120 let mut cycles_since_last_clear = 0; 121 + let mut current_screen = Screen::Badge; 122 loop { 123 + let mut force_screen_refresh = 124 + FORCE_SCREEN_REFRESH.load(core::sync::atomic::Ordering::Relaxed); 125 //Timed based display events 126 + if DISPLAY_CHANGED.load(core::sync::atomic::Ordering::Relaxed) { 127 + let clear_rectangle = Rectangle::new(Point::new(0, 0), Size::new(WIDTH, HEIGHT)); 128 + clear_rectangle 129 + .into_styled(PrimitiveStyle::with_fill(BinaryColor::On)) 130 + .draw(&mut display) 131 + .unwrap(); 132 + let _ = display.update().await; 133 + DISPLAY_CHANGED.store(false, core::sync::atomic::Ordering::Relaxed); 134 + force_screen_refresh = true; 135 + } 136 137 + SCREEN_TO_SHOW.lock(|x| current_screen = *x.borrow()); 138 + // info!("Current Screen: {:?}", current_screen); 139 + if current_screen == Screen::Badge { 140 + if force_screen_refresh { 141 + // Draw the text box. 142 + name_and_detail_box.draw(&mut display).unwrap(); 143 + } 144 145 + //Updates the top bar 146 + //Runs every 60 cycles/30 seconds and first run 147 + if cycles_since_last_clear % 60 == 0 || force_screen_refresh { 148 + let count = WIFI_COUNT.load(core::sync::atomic::Ordering::Relaxed); 149 + info!("Wifi count: {}", count); 150 + let temp = TEMP.load(core::sync::atomic::Ordering::Relaxed); 151 + let humidity = HUMIDITY.load(core::sync::atomic::Ordering::Relaxed); 152 + let top_text: String<64> = easy_format::<64>(format_args!( 153 + "{}F {}% Wifi found: {}", 154 + temp, humidity, count 155 + )); 156 + let top_bounds = Rectangle::new(Point::new(0, 0), Size::new(WIDTH, 24)); 157 + top_bounds 158 + .into_styled( 159 + PrimitiveStyleBuilder::default() 160 + .stroke_color(BinaryColor::Off) 161 + .fill_color(BinaryColor::On) 162 + .stroke_width(1) 163 + .build(), 164 + ) 165 + .draw(&mut display) 166 + .unwrap(); 167 168 + Text::new(top_text.as_str(), Point::new(8, 16), character_style) 169 + .draw(&mut display) 170 + .unwrap(); 171 172 + // Draw the text box. 173 + let result = display.partial_update(top_bounds.try_into().unwrap()).await; 174 + match result { 175 + Ok(_) => {} 176 + Err(_) => { 177 + info!("Error updating display"); 178 + } 179 } 180 } 181 + 182 + //Runs every 120 cycles/60 seconds and first run 183 + if cycles_since_last_clear == 0 || force_screen_refresh { 184 + let mut time_text: String<8> = String::<8>::new(); 185 186 + let time_box_rectangle_location = Point::new(0, 96); 187 + RTC_TIME_STRING.lock(|x| { 188 + time_text.push_str(x.borrow().as_str()).unwrap(); 189 + }); 190 191 + //The bounds of the box for time and refresh area 192 + let time_bounds = Rectangle::new(time_box_rectangle_location, Size::new(88, 24)); 193 + time_bounds 194 + .into_styled( 195 + PrimitiveStyleBuilder::default() 196 + .stroke_color(BinaryColor::Off) 197 + .fill_color(BinaryColor::On) 198 + .stroke_width(1) 199 + .build(), 200 + ) 201 + .draw(&mut display) 202 + .unwrap(); 203 204 + //Adding a y offset to the box location to fit inside the box 205 + Text::new( 206 + time_text.as_str(), 207 + ( 208 + time_box_rectangle_location.x + 8, 209 + time_box_rectangle_location.y + 16, 210 + ) 211 + .into(), 212 + character_style, 213 ) 214 .draw(&mut display) 215 .unwrap(); 216 217 + let result = display 218 + .partial_update(time_bounds.try_into().unwrap()) 219 + .await; 220 + match result { 221 + Ok(_) => {} 222 + Err(_) => { 223 + info!("Error updating display"); 224 + } 225 } 226 } 227 228 + //Manually triggered display events 229 230 + if CHANGE_IMAGE.load(core::sync::atomic::Ordering::Relaxed) || force_screen_refresh { 231 + let current_image = get_current_image(); 232 + let tga: Bmp<BinaryColor> = Bmp::from_slice(&current_image.image()).unwrap(); 233 + let image = Image::new(&tga, current_image.image_location()); 234 + //clear image location by writing a white rectangle over previous image location 235 + let clear_rectangle = Rectangle::new( 236 + current_image.previous().image_location(), 237 + Size::new(157, 101), 238 + ); 239 + clear_rectangle 240 + .into_styled(PrimitiveStyle::with_fill(BinaryColor::On)) 241 + .draw(&mut display) 242 + .unwrap(); 243 244 + let _ = image.draw(&mut display); 245 + //TODO need to look up the reginal area display 246 + let _ = display.update().await; 247 + CHANGE_IMAGE.store(false, core::sync::atomic::Ordering::Relaxed); 248 + } 249 + } else { 250 + if force_screen_refresh { 251 + let top_bounds = Rectangle::new(Point::new(0, 0), Size::new(WIDTH, 24)); 252 + top_bounds 253 + .into_styled( 254 + PrimitiveStyleBuilder::default() 255 + .stroke_color(BinaryColor::Off) 256 + .fill_color(BinaryColor::On) 257 + .stroke_width(1) 258 + .build(), 259 + ) 260 + .draw(&mut display) 261 + .unwrap(); 262 + 263 + let top_text: String<64> = easy_format::<64>(format_args!( 264 + "Wifi found: {}", 265 + WIFI_COUNT.load(core::sync::atomic::Ordering::Relaxed) 266 + )); 267 + 268 + Text::new(top_text.as_str(), Point::new(8, 16), character_style) 269 + .draw(&mut display) 270 + .unwrap(); 271 + 272 + let result = display.partial_update(top_bounds.try_into().unwrap()).await; 273 + match result { 274 + Ok(_) => {} 275 + Err(_) => { 276 + info!("Error updating display"); 277 + } 278 + } 279 + 280 + //write the wifi list 281 + let mut y_offset = 24; 282 + let wifi_list = RECENT_WIFI_NETWORKS.lock(|x| x.borrow().clone()); 283 + for wifi in wifi_list.iter() { 284 + // let wifi_text: String<64> = easy_format::<64>(format_args!("{}", wifi)); 285 + let wifi_bounds = Rectangle::new(Point::new(0, y_offset), Size::new(WIDTH, 24)); 286 + wifi_bounds 287 + .into_styled( 288 + PrimitiveStyleBuilder::default() 289 + .stroke_color(BinaryColor::Off) 290 + .fill_color(BinaryColor::On) 291 + .stroke_width(1) 292 + .build(), 293 + ) 294 + .draw(&mut display) 295 + .unwrap(); 296 + 297 + Text::new(wifi.trim(), Point::new(8, y_offset + 16), character_style) 298 + .draw(&mut display) 299 + .unwrap(); 300 + 301 + let result = display 302 + .partial_update(wifi_bounds.try_into().unwrap()) 303 + .await; 304 + match result { 305 + Ok(_) => {} 306 + Err(_) => { 307 + info!("Error updating display"); 308 + } 309 + } 310 + y_offset += 24; 311 + } 312 + } 313 } 314 315 cycles_since_last_clear += 1; 316 if cycles_since_last_clear >= cycles_to_clear_at { 317 cycles_since_last_clear = 0; 318 } 319 + FORCE_SCREEN_REFRESH.store(false, core::sync::atomic::Ordering::Relaxed); 320 // info!("Display Cycle: {}", cycles_since_last_clear); 321 Timer::after(cycle).await; 322 }
-63
src/cyw43_driver.rs
··· 1 - use cyw43::Control; 2 - use cyw43_pio::PioSpi; 3 - use defmt::unwrap; 4 - use embassy_executor::Spawner; 5 - use embassy_net_wiznet::Device; 6 - use embassy_rp::bind_interrupts; 7 - use embassy_rp::gpio::{Level, Output}; 8 - use embassy_rp::peripherals::{DMA_CH0, PIO0}; 9 - use embassy_rp::peripherals::{PIN_23, PIN_24, PIN_25, PIN_29}; 10 - use embassy_rp::pio::{InterruptHandler, Pio}; 11 - use static_cell::StaticCell; 12 - 13 - bind_interrupts!(struct Irqs { 14 - PIO0_IRQ_0 => InterruptHandler<PIO0>; 15 - }); 16 - 17 - #[embassy_executor::task] 18 - async fn cyw43_task( 19 - runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>, 20 - ) -> ! { 21 - runner.run().await 22 - } 23 - 24 - pub async fn setup_cyw43<'a>( 25 - pio0: PIO0, 26 - p_23: PIN_23, 27 - p_24: PIN_24, 28 - p_25: PIN_25, 29 - p_29: PIN_29, 30 - dma_ch0: DMA_CH0, 31 - spawner: Spawner, 32 - ) -> (Device<'a>, Control<'a>) { 33 - let fw = include_bytes!("../cyw43-firmware/43439A0.bin"); 34 - let clm = include_bytes!("../cyw43-firmware/43439A0_clm.bin"); 35 - let btfw = include_bytes!("../cyw43-firmware/43439A0_btfw.bin"); 36 - 37 - // To make flashing faster for development, you may want to flash the firmwares independently 38 - // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: 39 - // probe-rs download 43439A0.bin --binary-format bin --chip RP2040 --base-address 0x10100000 40 - // probe-rs download 43439A0_clm.bin --binary-format bin --chip RP2040 --base-address 0x10140000 41 - // probe-rs download 43439A0_btfw.bin --binary-format bin --chip RP2040 --base-address 0x10141400 42 - // let fw = unsafe { core::slice::from_raw_parts(0x10100000 as *const u8, 224190) }; 43 - // let clm = unsafe { core::slice::from_raw_parts(0x10140000 as *const u8, 4752) }; 44 - // let btfw = unsafe { core::slice::from_raw_parts(0x10141400 as *const u8, 6164) }; 45 - 46 - let pwr = Output::new(p_23, Level::Low); 47 - let cs = Output::new(p_25, Level::High); 48 - let mut pio = Pio::new(pio0, Irqs); 49 - let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p_24, p_29, dma_ch0); 50 - // let input = Input::new(p_29, Pull::Up); 51 - 52 - static STATE: StaticCell<cyw43::State> = StaticCell::new(); 53 - let state = STATE.init(cyw43::State::new()); 54 - let (net_device, _bt_device, mut control, runner) = 55 - cyw43::new_with_bluetooth(state, pwr, spi, fw, btfw).await; 56 - unwrap!(spawner.spawn(cyw43_task(runner))); 57 - 58 - control.init(clm).await; 59 - control 60 - .set_power_management(cyw43::PowerManagementMode::PowerSave) 61 - .await; 62 - (net_device, control) 63 - }
···
+48
src/helpers.rs
··· 12 } 13 } 14 }
··· 12 } 13 } 14 } 15 + 16 + pub fn easy_format_str<'a>( 17 + args: Arguments<'_>, 18 + buffer: &'a mut [u8], 19 + ) -> Result<&'a str, core::fmt::Error> { 20 + let mut writer = BufWriter::new(buffer); 21 + let result = core::fmt::write(&mut writer, args); 22 + 23 + match result { 24 + Ok(_) => { 25 + let len = writer.len(); 26 + let response_str = core::str::from_utf8(&buffer[..len]).unwrap(); 27 + Ok(response_str) 28 + } 29 + Err(_) => { 30 + panic!("Error formatting the string") 31 + } 32 + } 33 + } 34 + 35 + // A simple wrapper struct to use core::fmt::Write on a [u8] buffer 36 + pub struct BufWriter<'a> { 37 + buf: &'a mut [u8], 38 + pos: usize, 39 + } 40 + 41 + impl<'a> BufWriter<'a> { 42 + pub fn new(buf: &'a mut [u8]) -> Self { 43 + BufWriter { buf, pos: 0 } 44 + } 45 + 46 + pub fn len(&self) -> usize { 47 + self.pos 48 + } 49 + } 50 + 51 + impl<'a> core::fmt::Write for BufWriter<'a> { 52 + fn write_str(&mut self, s: &str) -> core::fmt::Result { 53 + let bytes = s.as_bytes(); 54 + if self.pos + bytes.len() > self.buf.len() { 55 + return Err(core::fmt::Error); // Buffer overflow 56 + } 57 + 58 + self.buf[self.pos..self.pos + bytes.len()].copy_from_slice(bytes); 59 + self.pos += bytes.len(); 60 + Ok(()) 61 + } 62 + }
+333 -126
src/main.rs
··· 1 - //! This example test the RP Pico W on board LED. 2 - //! 3 - //! It does not work with the RP Pico board. 4 - 5 #![no_std] 6 #![no_main] 7 use badge_display::display_image::DisplayImage; 8 - use badge_display::{run_the_display, CHANGE_IMAGE, CURRENT_IMAGE, RTC_TIME_STRING, WIFI_COUNT}; 9 use core::fmt::Write; 10 use core::str::from_utf8; 11 - use cyw43_driver::setup_cyw43; 12 use defmt::info; 13 use defmt::*; 14 use embassy_executor::Spawner; 15 use embassy_net::dns::DnsSocket; 16 use embassy_net::tcp::client::{TcpClient, TcpClientState}; 17 - use embassy_net::{Stack, StackResources}; 18 use embassy_rp::clocks::RoscRng; 19 use embassy_rp::flash::Async; 20 - use embassy_rp::gpio; 21 use embassy_rp::gpio::Input; 22 - use embassy_rp::peripherals::SPI0; 23 use embassy_rp::rtc::{DateTime, DayOfWeek}; 24 use embassy_rp::spi::Spi; 25 use embassy_rp::spi::{self}; 26 use embassy_sync::blocking_mutex::raw::NoopRawMutex; 27 use embassy_sync::mutex::Mutex; 28 use embassy_time::{Duration, Timer}; ··· 30 use gpio::{Level, Output, Pull}; 31 use heapless::{String, Vec}; 32 use helpers::easy_format; 33 - use rand::RngCore; 34 use reqwless::client::{HttpClient, TlsConfig, TlsVerify}; 35 use reqwless::request::Method; 36 - use save::{read_postcard_from_flash, save_postcard_to_flash, Save}; 37 use serde::Deserialize; 38 use static_cell::StaticCell; 39 use temp_sensor::run_the_temp_sensor; 40 use {defmt_rtt as _, panic_probe as _}; 41 42 mod badge_display; 43 - mod cyw43_driver; 44 mod env; 45 mod helpers; 46 mod save; 47 mod temp_sensor; 48 49 type Spi0Bus = Mutex<NoopRawMutex, Spi<'static, SPI0, spi::Async>>; 50 51 const BSSID_LEN: usize = 1_000; 52 const ADDR_OFFSET: u32 = 0x100000; ··· 54 55 const FLASH_SIZE: usize = 2 * 1024 * 1024; 56 57 #[embassy_executor::main] 58 async fn main(spawner: Spawner) { 59 let p = embassy_rp::init(Default::default()); 60 let mut user_led = Output::new(p.PIN_22, Level::High); 61 user_led.set_high(); 62 63 - let (net_device, mut control) = setup_cyw43( 64 - p.PIO0, p.PIN_23, p.PIN_24, p.PIN_25, p.PIN_29, p.DMA_CH0, spawner, 65 - ) 66 - .await; 67 68 let miso = p.PIN_16; 69 let mosi = p.PIN_19; ··· 75 let power = p.PIN_10; 76 77 let reset = Output::new(reset, Level::Low); 78 - let _power = Output::new(power, Level::Low); 79 80 let dc = Output::new(dc, Level::Low); 81 let cs = Output::new(cs, Level::High); 82 let busy = Input::new(busy, Pull::Up); 83 84 - let _btn_up = Input::new(p.PIN_15, Pull::Down); 85 - let _btn_down = Input::new(p.PIN_11, Pull::Down); 86 - let _btn_a = Input::new(p.PIN_12, Pull::Down); 87 let btn_b = Input::new(p.PIN_13, Pull::Down); 88 let btn_c = Input::new(p.PIN_14, Pull::Down); 89 90 let spi = Spi::new( 91 p.SPI0, ··· 111 let seed = rng.next_u64(); 112 113 // Init network stack 114 - static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new(); 115 static RESOURCES: StaticCell<StackResources<5>> = StaticCell::new(); 116 - let stack = &*STACK.init(Stack::new( 117 net_device, 118 config, 119 - RESOURCES.init(StackResources::<5>::new()), 120 seed, 121 - )); 122 - //rtc setup 123 - let mut rtc = embassy_rp::rtc::Rtc::new(p.RTC); 124 125 - spawner.must_spawn(net_task(stack)); 126 //Attempt to connect to wifi to get RTC time loop for 2 minutes 127 let mut wifi_connection_attempts = 0; 128 let mut connected_to_wifi = false; ··· 130 let wifi_ssid = env_value("WIFI_SSID"); 131 let wifi_password = env_value("WIFI_PASSWORD"); 132 while wifi_connection_attempts < 30 { 133 - match control.join_wpa2(wifi_ssid, &wifi_password).await { 134 Ok(_) => { 135 connected_to_wifi = true; 136 info!("join successful"); ··· 144 wifi_connection_attempts += 1; 145 } 146 147 - let mut time_was_set = false; 148 if connected_to_wifi { 149 info!("waiting for DHCP..."); 150 while !stack.is_config_up() { 151 Timer::after_millis(100).await; ··· 176 TlsVerify::None, 177 ); 178 179 let mut http_client = HttpClient::new_with_tls(&tcp_client, &dns_client, tls_config); 180 let url = env_value("TIME_API"); 181 info!("connecting to {}", &url); 182 183 - let mut request = match http_client.request(Method::GET, &url).await { 184 - Ok(req) => req, 185 - Err(e) => { 186 - error!("Failed to make HTTP request: {:?}", e); 187 - return; // handle the error 188 - } 189 - }; 190 191 - let response = match request.send(&mut rx_buffer).await { 192 - Ok(resp) => resp, 193 - Err(_e) => { 194 - error!("Failed to send HTTP request"); 195 - return; // handle the error; 196 - } 197 - }; 198 199 - let body = match from_utf8(response.body().read_to_end().await.unwrap()) { 200 - Ok(b) => b, 201 - Err(_e) => { 202 - error!("Failed to read response body"); 203 - return; // handle the error 204 - } 205 - }; 206 - info!("Response body: {:?}", &body); 207 208 - let bytes = body.as_bytes(); 209 - match serde_json_core::de::from_slice::<TimeApiResponse>(bytes) { 210 - Ok((output, _used)) => { 211 - //Deadlines am i right? 212 - info!("Datetime: {:?}", output.datetime); 213 - //split at T 214 - let datetime = output.datetime.split('T').collect::<Vec<&str, 2>>(); 215 - //split at - 216 - let date = datetime[0].split('-').collect::<Vec<&str, 3>>(); 217 - let year = date[0].parse::<u16>().unwrap(); 218 - let month = date[1].parse::<u8>().unwrap(); 219 - let day = date[2].parse::<u8>().unwrap(); 220 - //split at : 221 - let time = datetime[1].split(':').collect::<Vec<&str, 4>>(); 222 - let hour = time[0].parse::<u8>().unwrap(); 223 - let minute = time[1].parse::<u8>().unwrap(); 224 - //split at . 225 - let second_split = time[2].split('.').collect::<Vec<&str, 2>>(); 226 - let second = second_split[0].parse::<f64>().unwrap(); 227 - let rtc_time = DateTime { 228 - year: year, 229 - month: month, 230 - day: day, 231 - day_of_week: match output.day_of_week { 232 - 0 => DayOfWeek::Sunday, 233 - 1 => DayOfWeek::Monday, 234 - 2 => DayOfWeek::Tuesday, 235 - 3 => DayOfWeek::Wednesday, 236 - 4 => DayOfWeek::Thursday, 237 - 5 => DayOfWeek::Friday, 238 - 6 => DayOfWeek::Saturday, 239 - _ => DayOfWeek::Sunday, 240 - }, 241 - hour, 242 - minute, 243 - second: second as u8, 244 - }; 245 - rtc.set_datetime(rtc_time).unwrap(); 246 - time_was_set = true; 247 } 248 - Err(_e) => { 249 - error!("Failed to parse response body"); 250 - return; // handle the error 251 } 252 - } 253 } 254 255 //Set up saving 256 let mut flash = embassy_rp::flash::Flash::<_, Async, FLASH_SIZE>::new(p.FLASH, p.DMA_CH3); 257 - let mut save: Save = read_postcard_from_flash(ADDR_OFFSET, &mut flash, SAVE_OFFSET).unwrap(); 258 WIFI_COUNT.store(save.wifi_counted, core::sync::atomic::Ordering::Relaxed); 259 //Task spawning 260 - spawner.must_spawn(run_the_temp_sensor(p.I2C0, p.PIN_5, p.PIN_4)); 261 spawner.must_spawn(run_the_display(spi_bus, cs, dc, busy, reset)); 262 263 //Input loop 264 let cycle = Duration::from_millis(100); 265 let mut current_cycle = 0; 266 - //5 minutes 267 - let reset_cycle = 300_000; 268 //Turn off led to signify that the badge is ready 269 - user_led.set_low(); 270 271 loop { 272 //Change Image Button 273 if btn_c.is_high() { 274 info!("Button C pressed"); 275 let current_image = CURRENT_IMAGE.load(core::sync::atomic::Ordering::Relaxed); 276 let new_image = DisplayImage::from_u8(current_image).unwrap().next(); 277 CURRENT_IMAGE.store(new_image.as_u8(), core::sync::atomic::Ordering::Relaxed); 278 CHANGE_IMAGE.store(true, core::sync::atomic::Ordering::Relaxed); 279 Timer::after(Duration::from_millis(500)).await; 280 - current_cycle += 500; 281 continue; 282 } 283 284 - if btn_b.is_high() { 285 - info!("Button B pressed"); 286 user_led.toggle(); 287 Timer::after(Duration::from_millis(500)).await; 288 - current_cycle += 500; 289 continue; 290 } 291 292 - if time_was_set { 293 - let now = rtc.now(); 294 - match now { 295 - Ok(time) => set_display_time(time), 296 - Err(_) => { 297 - info!("Error getting time"); 298 } 299 } 300 - } else { 301 - RTC_TIME_STRING.lock(|rtc_time_string| { 302 - rtc_time_string.borrow_mut().clear(); 303 - rtc_time_string.borrow_mut().push_str("No Wifi").unwrap(); 304 }); 305 } 306 - if current_cycle == 0 { 307 let mut scanner = control.scan(Default::default()).await; 308 while let Some(bss) = scanner.next().await { 309 process_bssid(bss.bssid, &mut save.wifi_counted, &mut save.bssid); 310 - let ssid = core::str::from_utf8(&bss.ssid).unwrap(); 311 - info!("ssid: {}", ssid); 312 } 313 - save_postcard_to_flash(ADDR_OFFSET, &mut flash, SAVE_OFFSET, &save).unwrap(); 314 WIFI_COUNT.store(save.wifi_counted, core::sync::atomic::Ordering::Relaxed); 315 info!("wifi_counted: {}", save.wifi_counted); 316 } 317 if current_cycle >= reset_cycle { 318 current_cycle = 0; 319 } 320 current_cycle += 1; 321 Timer::after(cycle).await; 322 } 323 } 324 325 - fn set_display_time(time: DateTime) { 326 let mut am = true; 327 - let twelve_hour = if time.hour > 12 { 328 am = false; 329 - time.hour - 12 330 - } else if time.hour == 0 { 331 12 332 } else { 333 - time.hour 334 }; 335 336 let am_pm = if am { "AM" } else { "PM" }; 337 338 let formatted_time = easy_format::<8>(format_args!( 339 "{:02}:{:02} {}", 340 - twelve_hour, time.minute, am_pm 341 )); 342 343 RTC_TIME_STRING.lock(|rtc_time_string| { ··· 350 } 351 352 #[embassy_executor::task] 353 - async fn net_task(stack: &'static Stack<cyw43::NetDriver<'static>>) -> ! { 354 - stack.run().await 355 } 356 357 #[derive(Deserialize)] ··· 364 let bssid_str = format_bssid(bssid); 365 if !bssids.contains(&bssid_str) { 366 *wifi_counted += 1; 367 - info!("bssid: {:x}", bssid_str); 368 let result = bssids.push(bssid_str); 369 if result.is_err() { 370 info!("bssid list full");
··· 1 #![no_std] 2 #![no_main] 3 + 4 + use crate::pcf85063a::{Control, Error}; 5 use badge_display::display_image::DisplayImage; 6 + use badge_display::{ 7 + CHANGE_IMAGE, CURRENT_IMAGE, DISPLAY_CHANGED, FORCE_SCREEN_REFRESH, RECENT_WIFI_NETWORKS, 8 + RTC_TIME_STRING, RecentWifiNetworksVec, SCREEN_TO_SHOW, Screen, WIFI_COUNT, run_the_display, 9 + }; 10 + use core::cell::RefCell; 11 use core::fmt::Write; 12 use core::str::from_utf8; 13 + use cyw43::JoinOptions; 14 + use cyw43_pio::{DEFAULT_CLOCK_DIVIDER, PioSpi}; 15 use defmt::info; 16 use defmt::*; 17 + use embassy_embedded_hal::shared_bus::I2cDeviceError; 18 + use embassy_embedded_hal::shared_bus::blocking::i2c::I2cDevice; 19 use embassy_executor::Spawner; 20 + use embassy_net::StackResources; 21 use embassy_net::dns::DnsSocket; 22 use embassy_net::tcp::client::{TcpClient, TcpClientState}; 23 use embassy_rp::clocks::RoscRng; 24 use embassy_rp::flash::Async; 25 use embassy_rp::gpio::Input; 26 + use embassy_rp::i2c::I2c; 27 + use embassy_rp::peripherals::{DMA_CH0, I2C0, PIO0, SPI0}; 28 + use embassy_rp::pio::{InterruptHandler, Pio}; 29 use embassy_rp::rtc::{DateTime, DayOfWeek}; 30 use embassy_rp::spi::Spi; 31 use embassy_rp::spi::{self}; 32 + use embassy_rp::watchdog::Watchdog; 33 + use embassy_rp::{bind_interrupts, gpio, i2c}; 34 + use embassy_sync::blocking_mutex::NoopMutex; 35 use embassy_sync::blocking_mutex::raw::NoopRawMutex; 36 use embassy_sync::mutex::Mutex; 37 use embassy_time::{Duration, Timer}; ··· 39 use gpio::{Level, Output, Pull}; 40 use heapless::{String, Vec}; 41 use helpers::easy_format; 42 + use pcf85063a::PCF85063; 43 use reqwless::client::{HttpClient, TlsConfig, TlsVerify}; 44 use reqwless::request::Method; 45 + use save::{Save, read_postcard_from_flash, save_postcard_to_flash}; 46 use serde::Deserialize; 47 use static_cell::StaticCell; 48 use temp_sensor::run_the_temp_sensor; 49 + use time::PrimitiveDateTime; 50 use {defmt_rtt as _, panic_probe as _}; 51 52 mod badge_display; 53 mod env; 54 mod helpers; 55 + mod pcf85063a; 56 mod save; 57 mod temp_sensor; 58 59 type Spi0Bus = Mutex<NoopRawMutex, Spi<'static, SPI0, spi::Async>>; 60 + type I2c0Bus = NoopMutex<RefCell<I2c<'static, I2C0, i2c::Blocking>>>; 61 62 const BSSID_LEN: usize = 1_000; 63 const ADDR_OFFSET: u32 = 0x100000; ··· 65 66 const FLASH_SIZE: usize = 2 * 1024 * 1024; 67 68 + bind_interrupts!(struct Irqs { 69 + PIO0_IRQ_0 => InterruptHandler<PIO0>; 70 + }); 71 + 72 #[embassy_executor::main] 73 async fn main(spawner: Spawner) { 74 let p = embassy_rp::init(Default::default()); 75 let mut user_led = Output::new(p.PIN_22, Level::High); 76 user_led.set_high(); 77 78 + //Wifi driver and cyw43 setup 79 + let fw = include_bytes!("../cyw43-firmware/43439A0.bin"); 80 + let clm = include_bytes!("../cyw43-firmware/43439A0_clm.bin"); 81 + 82 + let pwr = Output::new(p.PIN_23, Level::Low); 83 + let cs = Output::new(p.PIN_25, Level::High); 84 + let mut pio = Pio::new(p.PIO0, Irqs); 85 + let spi = PioSpi::new( 86 + &mut pio.common, 87 + pio.sm0, 88 + DEFAULT_CLOCK_DIVIDER, 89 + pio.irq0, 90 + cs, 91 + p.PIN_24, 92 + p.PIN_29, 93 + p.DMA_CH0, 94 + ); 95 + static STATE: StaticCell<cyw43::State> = StaticCell::new(); 96 + let state = STATE.init(cyw43::State::new()); 97 + let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; 98 + spawner.must_spawn(cyw43_task(runner)); 99 + 100 + control.init(clm).await; 101 + control 102 + .set_power_management(cyw43::PowerManagementMode::PowerSave) 103 + .await; 104 105 let miso = p.PIN_16; 106 let mosi = p.PIN_19; ··· 112 let power = p.PIN_10; 113 114 let reset = Output::new(reset, Level::Low); 115 + let mut power = Output::new(power, Level::Low); 116 + power.set_high(); 117 118 let dc = Output::new(dc, Level::Low); 119 let cs = Output::new(cs, Level::High); 120 let busy = Input::new(busy, Pull::Up); 121 122 + let btn_up = Input::new(p.PIN_15, Pull::Down); 123 + let btn_down = Input::new(p.PIN_11, Pull::Down); 124 + let btn_a = Input::new(p.PIN_12, Pull::Down); 125 let btn_b = Input::new(p.PIN_13, Pull::Down); 126 let btn_c = Input::new(p.PIN_14, Pull::Down); 127 + let rtc_alarm = Input::new(p.PIN_8, Pull::Down); 128 + let mut watchdog = Watchdog::new(p.WATCHDOG); 129 + 130 + //Setup i2c bus 131 + let config = embassy_rp::i2c::Config::default(); 132 + let i2c = i2c::I2c::new_blocking(p.I2C0, p.PIN_5, p.PIN_4, config); 133 + static I2C_BUS: StaticCell<I2c0Bus> = StaticCell::new(); 134 + let i2c_bus = NoopMutex::new(RefCell::new(i2c)); 135 + let i2c_bus = I2C_BUS.init(i2c_bus); 136 + 137 + let i2c_dev = I2cDevice::new(i2c_bus); 138 + let mut rtc_device = PCF85063::new(i2c_dev); 139 + 140 + if btn_a.is_high() { 141 + //Clears the alarm on start if A button is pressed (manual start) 142 + _ = rtc_device.disable_all_alarms(); 143 + _ = rtc_device.clear_alarm_flag(); 144 + } 145 + 146 + // //RTC alarm stuff 147 + // let mut go_to_sleep = false; 148 + // let mut reset_cycles_till_sleep = 0; 149 + // //Like 15ish mins?? 150 + // let sleep_after_cycles = 2; 151 + // 152 + // if rtc_alarm.is_high() { 153 + // //sleep happened 154 + // go_to_sleep = true; 155 + // info!("Alarm went off"); 156 + // _ = rtc_device.disable_all_alarms(); 157 + // _ = rtc_device.clear_alarm_flag(); 158 + // } else { 159 + // info!("Alarm was clear") 160 + // } 161 162 let spi = Spi::new( 163 p.SPI0, ··· 183 let seed = rng.next_u64(); 184 185 // Init network stack 186 static RESOURCES: StaticCell<StackResources<5>> = StaticCell::new(); 187 + let (stack, runner) = embassy_net::new( 188 net_device, 189 config, 190 + RESOURCES.init(StackResources::new()), 191 seed, 192 + ); 193 + 194 + //If the watch dog isn't fed in 8 seconds reboot to help with hang up 195 + watchdog.start(Duration::from_secs(8)); 196 197 + spawner.must_spawn(net_task(runner)); 198 //Attempt to connect to wifi to get RTC time loop for 2 minutes 199 let mut wifi_connection_attempts = 0; 200 let mut connected_to_wifi = false; ··· 202 let wifi_ssid = env_value("WIFI_SSID"); 203 let wifi_password = env_value("WIFI_PASSWORD"); 204 while wifi_connection_attempts < 30 { 205 + watchdog.feed(); 206 + match control 207 + .join(wifi_ssid, JoinOptions::new(wifi_password.as_bytes())) 208 + .await 209 + { 210 Ok(_) => { 211 connected_to_wifi = true; 212 info!("join successful"); ··· 220 wifi_connection_attempts += 1; 221 } 222 223 if connected_to_wifi { 224 + //Feed the dog if it makes it this far 225 + watchdog.feed(); 226 info!("waiting for DHCP..."); 227 while !stack.is_config_up() { 228 Timer::after_millis(100).await; ··· 253 TlsVerify::None, 254 ); 255 256 + Timer::after(Duration::from_millis(500)).await; 257 + // let mut http_client = HttpClient::new(&tcp_client, &dns_client); 258 let mut http_client = HttpClient::new_with_tls(&tcp_client, &dns_client, tls_config); 259 + 260 let url = env_value("TIME_API"); 261 info!("connecting to {}", &url); 262 263 + // Feeds the dog again for one last time 264 + watchdog.feed(); 265 + 266 + //If the call goes through set the rtc 267 + match http_client.request(Method::GET, &url).await { 268 + Ok(mut request) => { 269 + let response = match request.send(&mut rx_buffer).await { 270 + Ok(resp) => resp, 271 + Err(e) => { 272 + error!("Failed to send HTTP request: {:?}", e); 273 + // error!("Failed to send HTTP request"); 274 + return; // handle the error; 275 + } 276 + }; 277 278 + let body = match from_utf8(response.body().read_to_end().await.unwrap()) { 279 + Ok(b) => b, 280 + Err(_e) => { 281 + error!("Failed to read response body"); 282 + return; // handle the error 283 + } 284 + }; 285 + info!("Response body: {:?}", &body); 286 287 + let bytes = body.as_bytes(); 288 + match serde_json_core::de::from_slice::<TimeApiResponse>(bytes) { 289 + Ok((output, _used)) => { 290 + //Deadlines am i right? 291 + info!("Datetime: {:?}", output.datetime); 292 + //split at T 293 + let datetime = output.datetime.split('T').collect::<Vec<&str, 2>>(); 294 + //split at - 295 + let date = datetime[0].split('-').collect::<Vec<&str, 3>>(); 296 + let year = date[0].parse::<u16>().unwrap(); 297 + let month = date[1].parse::<u8>().unwrap(); 298 + let day = date[2].parse::<u8>().unwrap(); 299 + //split at : 300 + let time = datetime[1].split(':').collect::<Vec<&str, 4>>(); 301 + let hour = time[0].parse::<u8>().unwrap(); 302 + let minute = time[1].parse::<u8>().unwrap(); 303 + //split at . 304 + let second_split = time[2].split('.').collect::<Vec<&str, 2>>(); 305 + let second = second_split[0].parse::<f64>().unwrap(); 306 + let rtc_time = DateTime { 307 + year: year, 308 + month: month, 309 + day: day, 310 + day_of_week: match output.day_of_week { 311 + 0 => DayOfWeek::Sunday, 312 + 1 => DayOfWeek::Monday, 313 + 2 => DayOfWeek::Tuesday, 314 + 3 => DayOfWeek::Wednesday, 315 + 4 => DayOfWeek::Thursday, 316 + 5 => DayOfWeek::Friday, 317 + 6 => DayOfWeek::Saturday, 318 + _ => DayOfWeek::Sunday, 319 + }, 320 + hour, 321 + minute, 322 + second: second as u8, 323 + }; 324 325 + rtc_device 326 + .set_datetime(&rtc_time) 327 + .expect("TODO: panic message"); 328 + } 329 + Err(_e) => { 330 + error!("Failed to parse response body"); 331 + // return; // handle the error 332 + } 333 + } 334 } 335 + Err(e) => { 336 + error!("Failed to make HTTP request: {:?}", e); 337 + // return; // handle the error 338 } 339 + }; 340 + //leave the wifi no longer needed 341 + let _ = control.leave().await; 342 } 343 344 //Set up saving 345 let mut flash = embassy_rp::flash::Flash::<_, Async, FLASH_SIZE>::new(p.FLASH, p.DMA_CH3); 346 + let mut save = 347 + read_postcard_from_flash(ADDR_OFFSET, &mut flash, SAVE_OFFSET).unwrap_or_else(|err| { 348 + error!("Error getting the save from the flash: {:?}", err); 349 + Save::new() 350 + }); 351 WIFI_COUNT.store(save.wifi_counted, core::sync::atomic::Ordering::Relaxed); 352 + 353 //Task spawning 354 + spawner.must_spawn(run_the_temp_sensor(i2c_bus)); 355 spawner.must_spawn(run_the_display(spi_bus, cs, dc, busy, reset)); 356 357 //Input loop 358 let cycle = Duration::from_millis(100); 359 let mut current_cycle = 0; 360 + let mut time_to_scan = true; 361 + //5 minutes(ish) idk it's late and my math is so bad rn 362 + let reset_cycle = 3_000; 363 + 364 //Turn off led to signify that the badge is ready 365 + // user_led.set_low(); 366 367 loop { 368 + //Keep feeding the dog 369 + watchdog.feed(); 370 + 371 //Change Image Button 372 if btn_c.is_high() { 373 info!("Button C pressed"); 374 + // reset_cycles_till_sleep = 0; 375 let current_image = CURRENT_IMAGE.load(core::sync::atomic::Ordering::Relaxed); 376 let new_image = DisplayImage::from_u8(current_image).unwrap().next(); 377 CURRENT_IMAGE.store(new_image.as_u8(), core::sync::atomic::Ordering::Relaxed); 378 CHANGE_IMAGE.store(true, core::sync::atomic::Ordering::Relaxed); 379 Timer::after(Duration::from_millis(500)).await; 380 continue; 381 } 382 383 + if btn_a.is_high() { 384 + println!("{:?}", current_cycle); 385 + info!("Button A pressed"); 386 + // reset_cycles_till_sleep = 0; 387 user_led.toggle(); 388 Timer::after(Duration::from_millis(500)).await; 389 + continue; 390 + } 391 + 392 + if btn_down.is_high() { 393 + info!("Button Down pressed"); 394 + // reset_cycles_till_sleep = 0; 395 + SCREEN_TO_SHOW.lock(|screen| { 396 + screen.replace(Screen::WifiList); 397 + }); 398 + DISPLAY_CHANGED.store(true, core::sync::atomic::Ordering::Relaxed); 399 + Timer::after(Duration::from_millis(500)).await; 400 + continue; 401 + } 402 + 403 + if btn_up.is_high() { 404 + info!("Button Up pressed"); 405 + // reset_cycles_till_sleep = 0; 406 + SCREEN_TO_SHOW.lock(|screen| { 407 + screen.replace(Screen::Badge); 408 + }); 409 + DISPLAY_CHANGED.store(true, core::sync::atomic::Ordering::Relaxed); 410 + Timer::after(Duration::from_millis(500)).await; 411 continue; 412 } 413 414 + if btn_b.is_high() { 415 + info!("Button B pressed"); 416 + // reset_cycles_till_sleep = 0; 417 + SCREEN_TO_SHOW.lock(|screen| { 418 + if *screen.borrow() == Screen::Badge { 419 + //IF on badge screen and b pressed reset wifi count 420 + save.wifi_counted = 0; 421 + save.bssid.clear(); 422 + WIFI_COUNT.store(0, core::sync::atomic::Ordering::Relaxed); 423 + current_cycle = 0; 424 + } 425 + }); 426 + 427 + let mut recent_networks = RecentWifiNetworksVec::new(); 428 + let mut scanner = control.scan(Default::default()).await; 429 + 430 + while let Some(bss) = scanner.next().await { 431 + process_bssid(bss.bssid, &mut save.wifi_counted, &mut save.bssid); 432 + if recent_networks.len() < 8 { 433 + let possible_ssid = core::str::from_utf8(&bss.ssid); 434 + match possible_ssid { 435 + Ok(ssid) => { 436 + let removed_zeros = ssid.trim_end_matches(char::from(0)); 437 + let ssid_string: String<32> = 438 + easy_format::<32>(format_args!("{}", removed_zeros)); 439 + 440 + if recent_networks.contains(&ssid_string) { 441 + continue; 442 + } 443 + if ssid_string != "" { 444 + let _ = recent_networks.push(ssid_string); 445 + } 446 + } 447 + Err(_) => { 448 + continue; 449 + } 450 + } 451 } 452 } 453 + RECENT_WIFI_NETWORKS.lock(|recent_networks_vec| { 454 + recent_networks_vec.replace(recent_networks); 455 }); 456 + 457 + FORCE_SCREEN_REFRESH.store(true, core::sync::atomic::Ordering::Relaxed); 458 + Timer::after(Duration::from_millis(500)).await; 459 + 460 + continue; 461 } 462 + 463 + match rtc_device.get_datetime() { 464 + Ok(now) => set_display_time(now), 465 + Err(_err) => { 466 + error!("Error getting time"); 467 + RTC_TIME_STRING.lock(|rtc_time_string| { 468 + rtc_time_string.borrow_mut().clear(); 469 + rtc_time_string.borrow_mut().push_str("Error").unwrap(); 470 + }); 471 + } 472 + }; 473 + 474 + if time_to_scan { 475 + info!("Scanning for wifi networks"); 476 + // reset_cycles_till_sleep += 1; 477 + time_to_scan = false; 478 let mut scanner = control.scan(Default::default()).await; 479 while let Some(bss) = scanner.next().await { 480 process_bssid(bss.bssid, &mut save.wifi_counted, &mut save.bssid); 481 } 482 WIFI_COUNT.store(save.wifi_counted, core::sync::atomic::Ordering::Relaxed); 483 + save_postcard_to_flash(ADDR_OFFSET, &mut flash, SAVE_OFFSET, &save).unwrap(); 484 info!("wifi_counted: {}", save.wifi_counted); 485 } 486 if current_cycle >= reset_cycle { 487 current_cycle = 0; 488 + time_to_scan = true; 489 } 490 + 491 + // if reset_cycles_till_sleep >= sleep_after_cycles { 492 + // info!("Going to sleep"); 493 + // reset_cycles_till_sleep = 0; 494 + // go_to_sleep = true; 495 + // } 496 + // 497 + // if go_to_sleep { 498 + // info!("going to sleep"); 499 + // //SO i need to wait for 25 seconds to make sure the display updates fully...But i need to keep feeding the dog atleast every 8 seconds 500 + // for _ in 0..25 { 501 + // //watchdog.feed(); 502 + // Timer::after(Duration::from_secs(1)).await; 503 + // } 504 + // //Set the rtc and sleep for 15 minutes 505 + // //goes to sleep for 15 mins 506 + // _ = rtc_device.disable_all_alarms(); 507 + // _ = rtc_device.clear_alarm_flag(); 508 + // _ = rtc_device.set_alarm_minutes(5); 509 + // _ = rtc_device.control_alarm_minutes(Control::On); 510 + // _ = rtc_device.control_alarm_interrupt(Control::On); 511 + // power.set_low(); 512 + // } 513 + 514 current_cycle += 1; 515 Timer::after(cycle).await; 516 } 517 } 518 519 + fn set_display_time(time: PrimitiveDateTime) { 520 let mut am = true; 521 + let twelve_hour = if time.hour() == 0 { 522 + 12 523 + } else if time.hour() == 12 { 524 am = false; 525 12 526 + } else if time.hour() > 12 { 527 + am = false; 528 + time.hour() - 12 529 } else { 530 + time.hour() 531 }; 532 533 let am_pm = if am { "AM" } else { "PM" }; 534 535 let formatted_time = easy_format::<8>(format_args!( 536 "{:02}:{:02} {}", 537 + twelve_hour, 538 + time.minute(), 539 + am_pm 540 )); 541 542 RTC_TIME_STRING.lock(|rtc_time_string| { ··· 549 } 550 551 #[embassy_executor::task] 552 + async fn net_task(mut runner: embassy_net::Runner<'static, cyw43::NetDriver<'static>>) -> ! { 553 + runner.run().await 554 + } 555 + 556 + #[embassy_executor::task] 557 + async fn cyw43_task( 558 + runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>, 559 + ) -> ! { 560 + runner.run().await 561 } 562 563 #[derive(Deserialize)] ··· 570 let bssid_str = format_bssid(bssid); 571 if !bssids.contains(&bssid_str) { 572 *wifi_counted += 1; 573 + WIFI_COUNT.store(*wifi_counted, core::sync::atomic::Ordering::Relaxed); 574 + // info!("bssid: {:x}", bssid_str); 575 let result = bssids.push(bssid_str); 576 if result.is_err() { 577 info!("bssid list full");
+227
src/pcf85063a/alarm.rs
···
··· 1 + use super::{BitFlags, Control, DEVICE_ADDRESS, Error, PCF85063, Register, decode_bcd, encode_bcd}; 2 + use embedded_hal_1::i2c::I2c; 3 + use time::Time; 4 + 5 + impl<I2C, E> PCF85063<I2C> 6 + where 7 + I2C: I2c<Error = E>, 8 + { 9 + /// Set the alarm seconds, minutes and hours, keeping the AE bit unchanged. 10 + pub fn set_alarm_time(&mut self, time: Time) -> Result<(), Error<E>> { 11 + self.set_alarm_seconds(time.second())?; 12 + self.set_alarm_minutes(time.minute())?; 13 + self.set_alarm_hours(time.hour())?; 14 + Ok(()) 15 + } 16 + 17 + /// Set the alarm seconds [0-59], keeping the AE bit unchanged. 18 + pub fn set_alarm_seconds(&mut self, seconds: u8) -> Result<(), Error<E>> { 19 + if seconds > 59 { 20 + return Err(Error::InvalidInputData); 21 + } 22 + let data: u8 = self.read_register(Register::SECOND_ALARM)?; // read current value 23 + let data: u8 = data & BitFlags::AE; // keep the AE bit as is 24 + let setting: u8 = encode_bcd(seconds); 25 + let data: u8 = data | setting; 26 + self.write_register(Register::SECOND_ALARM, data) 27 + } 28 + 29 + /// Set the alarm minutes [0-59], keeping the AE bit unchanged. 30 + pub fn set_alarm_minutes(&mut self, minutes: u8) -> Result<(), Error<E>> { 31 + if minutes > 59 { 32 + return Err(Error::InvalidInputData); 33 + } 34 + let data: u8 = self.read_register(Register::MINUTE_ALARM)?; // read current value 35 + let data: u8 = data & BitFlags::AE; // keep the AE bit as is 36 + let setting: u8 = encode_bcd(minutes); 37 + let data: u8 = data | setting; 38 + self.write_register(Register::MINUTE_ALARM, data) 39 + } 40 + 41 + /// Set the alarm hours [0-23], keeping the AE bit unchanged. 42 + pub fn set_alarm_hours(&mut self, hours: u8) -> Result<(), Error<E>> { 43 + if hours > 23 { 44 + return Err(Error::InvalidInputData); 45 + } 46 + let data: u8 = self.read_register(Register::HOUR_ALARM)?; // read current value 47 + let data: u8 = data & BitFlags::AE; // keep the AE bit as is 48 + let setting: u8 = encode_bcd(hours); 49 + let data: u8 = data | setting; 50 + self.write_register(Register::HOUR_ALARM, data) 51 + } 52 + 53 + /// Set the alarm day [1-31], keeping the AE bit unchanged. 54 + pub fn set_alarm_day(&mut self, day: u8) -> Result<(), Error<E>> { 55 + if !(1..=31).contains(&day) { 56 + return Err(Error::InvalidInputData); 57 + } 58 + let data: u8 = self.read_register(Register::DAY_ALARM)?; // read current value 59 + let data: u8 = data & BitFlags::AE; // keep the AE bit as is 60 + let setting: u8 = encode_bcd(day); 61 + let data: u8 = data | setting; 62 + self.write_register(Register::DAY_ALARM, data) 63 + } 64 + 65 + /// Set the alarm weekday [0-6], keeping the AE bit unchanged. 66 + pub fn set_alarm_weekday(&mut self, weekday: u8) -> Result<(), Error<E>> { 67 + if weekday > 6 { 68 + return Err(Error::InvalidInputData); 69 + } 70 + let data: u8 = self.read_register(Register::WEEKDAY_ALARM)?; // read current value 71 + let data: u8 = data & BitFlags::AE; // keep the AE bit as is 72 + let setting: u8 = encode_bcd(weekday); 73 + let data: u8 = data | setting; 74 + self.write_register(Register::WEEKDAY_ALARM, data) 75 + } 76 + 77 + /// Control alarm seconds (On: alarm enabled, Off: alarm disabled). 78 + pub fn control_alarm_seconds(&mut self, status: Control) -> Result<(), Error<E>> { 79 + match status { 80 + Control::Off => self.set_register_bit_flag(Register::SECOND_ALARM, BitFlags::AE), 81 + Control::On => self.clear_register_bit_flag(Register::SECOND_ALARM, BitFlags::AE), 82 + } 83 + } 84 + 85 + /// Is alarm seconds enabled? 86 + pub fn is_alarm_seconds_enabled(&mut self) -> Result<bool, Error<E>> { 87 + Ok(!self.is_register_bit_flag_high(Register::SECOND_ALARM, BitFlags::AE)?) 88 + } 89 + 90 + /// Control alarm minutes (On: alarm enabled, Off: alarm disabled). 91 + pub fn control_alarm_minutes(&mut self, status: Control) -> Result<(), Error<E>> { 92 + match status { 93 + Control::Off => self.set_register_bit_flag(Register::MINUTE_ALARM, BitFlags::AE), 94 + Control::On => self.clear_register_bit_flag(Register::MINUTE_ALARM, BitFlags::AE), 95 + } 96 + } 97 + 98 + /// Is alarm minutes enabled? 99 + pub fn is_alarm_minutes_enabled(&mut self) -> Result<bool, Error<E>> { 100 + Ok(!self.is_register_bit_flag_high(Register::MINUTE_ALARM, BitFlags::AE)?) 101 + } 102 + 103 + /// Control alarm hours (On: alarm enabled, Off: alarm disabled). 104 + pub fn control_alarm_hours(&mut self, status: Control) -> Result<(), Error<E>> { 105 + match status { 106 + Control::Off => self.set_register_bit_flag(Register::HOUR_ALARM, BitFlags::AE), 107 + Control::On => self.clear_register_bit_flag(Register::HOUR_ALARM, BitFlags::AE), 108 + } 109 + } 110 + 111 + /// Is alarm hours enabled? 112 + pub fn is_alarm_hours_enabled(&mut self) -> Result<bool, Error<E>> { 113 + Ok(!self.is_register_bit_flag_high(Register::HOUR_ALARM, BitFlags::AE)?) 114 + } 115 + 116 + /// Control alarm day (On: alarm enabled, Off: alarm disabled). 117 + pub fn control_alarm_day(&mut self, status: Control) -> Result<(), Error<E>> { 118 + match status { 119 + Control::Off => self.set_register_bit_flag(Register::DAY_ALARM, BitFlags::AE), 120 + Control::On => self.clear_register_bit_flag(Register::DAY_ALARM, BitFlags::AE), 121 + } 122 + } 123 + 124 + /// Is alarm day enabled? 125 + pub fn is_alarm_day_enabled(&mut self) -> Result<bool, Error<E>> { 126 + Ok(!self.is_register_bit_flag_high(Register::DAY_ALARM, BitFlags::AE)?) 127 + } 128 + 129 + /// Control alarm weekday (On: alarm enabled, Off: alarm disabled). 130 + pub fn control_alarm_weekday(&mut self, status: Control) -> Result<(), Error<E>> { 131 + match status { 132 + Control::Off => self.set_register_bit_flag(Register::WEEKDAY_ALARM, BitFlags::AE), 133 + Control::On => self.clear_register_bit_flag(Register::WEEKDAY_ALARM, BitFlags::AE), 134 + } 135 + } 136 + 137 + /// Is alarm weekday enabled? 138 + pub fn is_alarm_weekday_enabled(&mut self) -> Result<bool, Error<E>> { 139 + Ok(!self.is_register_bit_flag_high(Register::WEEKDAY_ALARM, BitFlags::AE)?) 140 + } 141 + 142 + /// Enable or disable alarm interrupt. 143 + pub fn control_alarm_interrupt(&mut self, status: Control) -> Result<(), Error<E>> { 144 + match status { 145 + Control::On => self.set_register_bit_flag(Register::CONTROL_2, BitFlags::AIE), 146 + Control::Off => self.clear_register_bit_flag(Register::CONTROL_2, BitFlags::AIE), 147 + } 148 + } 149 + 150 + pub fn get_alarm_time(&mut self) -> Result<Time, Error<E>> { 151 + Ok(Time::from_hms( 152 + self.get_alarm_hours()?, 153 + self.get_alarm_minutes()?, 154 + self.get_alarm_seconds()?, 155 + )?) 156 + } 157 + 158 + /// Read the alarm seconds setting. 159 + pub fn get_alarm_seconds(&mut self) -> Result<u8, Error<E>> { 160 + let mut data = [0]; 161 + self.i2c 162 + .write_read(DEVICE_ADDRESS, &[Register::SECOND_ALARM], &mut data) 163 + .map_err(Error::I2C)?; 164 + Ok(decode_bcd(data[0])) 165 + } 166 + 167 + /// Read the alarm minutes setting. 168 + pub fn get_alarm_minutes(&mut self) -> Result<u8, Error<E>> { 169 + let mut data = [0]; 170 + self.i2c 171 + .write_read(DEVICE_ADDRESS, &[Register::MINUTE_ALARM], &mut data) 172 + .map_err(Error::I2C)?; 173 + Ok(decode_bcd(data[0])) 174 + } 175 + 176 + /// Read the alarm hours setting. 177 + pub fn get_alarm_hours(&mut self) -> Result<u8, Error<E>> { 178 + let mut data = [0]; 179 + self.i2c 180 + .write_read(DEVICE_ADDRESS, &[Register::HOUR_ALARM], &mut data) 181 + .map_err(Error::I2C)?; 182 + Ok(decode_bcd(data[0])) 183 + } 184 + 185 + /// Read the alarm day setting. 186 + pub fn get_alarm_day(&mut self) -> Result<u8, Error<E>> { 187 + let mut data = [0]; 188 + self.i2c 189 + .write_read(DEVICE_ADDRESS, &[Register::DAY_ALARM], &mut data) 190 + .map_err(Error::I2C)?; 191 + Ok(decode_bcd(data[0])) 192 + } 193 + 194 + /// Read the alarm weekday setting. 195 + pub fn get_alarm_weekday(&mut self) -> Result<u8, Error<E>> { 196 + let mut data = [0]; 197 + self.i2c 198 + .write_read(DEVICE_ADDRESS, &[Register::WEEKDAY_ALARM], &mut data) 199 + .map_err(Error::I2C)?; 200 + Ok(decode_bcd(data[0])) 201 + } 202 + 203 + /// Get the alarm flag (if true, alarm event happened). 204 + pub fn get_alarm_flag(&mut self) -> Result<bool, Error<E>> { 205 + self.is_register_bit_flag_high(Register::CONTROL_2, BitFlags::AF) 206 + } 207 + 208 + /// Clear the alarm flag. 209 + pub fn clear_alarm_flag(&mut self) -> Result<(), Error<E>> { 210 + self.clear_register_bit_flag(Register::CONTROL_2, BitFlags::AF) 211 + } 212 + 213 + /// Check if alarm interrupt is enabled. 214 + pub fn is_alarm_interrupt_enabled(&mut self) -> Result<bool, Error<E>> { 215 + self.is_register_bit_flag_high(Register::CONTROL_2, BitFlags::AIE) 216 + } 217 + 218 + /// Shut off the alarms at once. 219 + pub fn disable_all_alarms(&mut self) -> Result<(), Error<E>> { 220 + self.control_alarm_seconds(Control::Off)?; 221 + self.control_alarm_minutes(Control::Off)?; 222 + self.control_alarm_hours(Control::Off)?; 223 + self.control_alarm_day(Control::Off)?; 224 + self.control_alarm_weekday(Control::Off)?; 225 + Ok(()) 226 + } 227 + }
+67
src/pcf85063a/datetime.rs
···
··· 1 + //! All date and time-related functions will be defined here. 2 + //! 3 + //! Reading and setting single elements (seconds, hours, months) will NOT be implemented 4 + //! following the recommendations in the NXP datasheet to set and read all the seven date and time registers in one go. 5 + //! 6 + //! TO DO: As the chip may be used for devices that are clocks only, without the calendar function 7 + //! a convenient set_time() function could be added (sets only seconds, minutes and hours) 8 + 9 + use super::{DEVICE_ADDRESS, Error, PCF85063, Register, decode_bcd, encode_bcd}; 10 + use embassy_rp::rtc::DateTime; 11 + use embedded_hal_1::i2c::I2c; 12 + use time::{Date, PrimitiveDateTime, Time}; 13 + 14 + impl<I2C, E> PCF85063<I2C> 15 + where 16 + I2C: I2c<Error = E>, 17 + { 18 + /// Read date and time all at once. 19 + pub fn get_datetime(&mut self) -> Result<PrimitiveDateTime, Error<E>> { 20 + let mut data = [0; 7]; 21 + self.i2c 22 + .write_read(DEVICE_ADDRESS, &[Register::SECONDS], &mut data) 23 + .map_err(Error::I2C)?; 24 + 25 + Ok(PrimitiveDateTime::new( 26 + Date::from_calendar_date( 27 + 2000 + decode_bcd(data[6]) as i32, 28 + decode_bcd(data[5] & 0x1f).try_into()?, 29 + decode_bcd(data[3] & 0x3f), 30 + )?, 31 + Time::from_hms( 32 + decode_bcd(data[2] & 0x3f), 33 + decode_bcd(data[1] & 0b0111_1111), 34 + decode_bcd(data[0] & 0b0111_1111), 35 + )?, 36 + )) 37 + } 38 + 39 + /// Set date and time all at once. 40 + pub fn set_datetime(&mut self, datetime: &DateTime) -> Result<(), Error<E>> { 41 + let payload = [ 42 + Register::SECONDS, //first register 43 + encode_bcd(datetime.second), 44 + encode_bcd(datetime.minute), 45 + encode_bcd(datetime.hour), 46 + encode_bcd(datetime.day), 47 + //Not sure if this is correct 48 + encode_bcd(datetime.day_of_week as u8), 49 + encode_bcd(datetime.month), 50 + encode_bcd((datetime.year - 2000) as u8), 51 + ]; 52 + self.i2c.write(DEVICE_ADDRESS, &payload).map_err(Error::I2C) 53 + } 54 + 55 + /// Set only the time, date remains unchanged. 56 + /// 57 + /// Will return an 'Error::InvalidInputData' if any of the parameters is out of range. 58 + pub fn set_time(&mut self, time: &Time) -> Result<(), Error<E>> { 59 + let payload = [ 60 + Register::SECONDS, //first register 61 + encode_bcd(time.second()), 62 + encode_bcd(time.minute()), 63 + encode_bcd(time.hour()), 64 + ]; 65 + self.i2c.write(DEVICE_ADDRESS, &payload).map_err(Error::I2C) 66 + } 67 + }
+253
src/pcf85063a/mod.rs
···
··· 1 + #![allow(dead_code)] 2 + 3 + ///None of this code is mine. It's https://crates.io/crates/pcf85063a 4 + /// I just needed a synchronous version so did a local clone and pulled the async and awaits 5 + pub mod alarm; 6 + pub mod datetime; 7 + 8 + use embedded_hal_1::i2c::I2c; 9 + 10 + /// All possible errors in this crate 11 + #[derive(Debug, defmt::Format)] 12 + pub enum Error<E> { 13 + /// I2C bus error 14 + I2C(E), 15 + /// Invalid input data 16 + InvalidInputData, 17 + /// A time component was out of range 18 + ComponentRange, 19 + } 20 + 21 + impl<E> From<time::error::ComponentRange> for Error<E> { 22 + fn from(_: time::error::ComponentRange) -> Self { 23 + Self::ComponentRange 24 + } 25 + } 26 + 27 + pub struct Register; 28 + 29 + impl Register { 30 + // control and status registers 31 + pub const CONTROL_1: u8 = 0x00; 32 + pub const CONTROL_2: u8 = 0x01; 33 + pub const OFFSET: u8 = 0x02; 34 + pub const RAM_BYTE: u8 = 0x03; 35 + 36 + // time and date registers 37 + pub const SECONDS: u8 = 0x04; 38 + pub const MINUTES: u8 = 0x05; 39 + pub const HOURS: u8 = 0x06; 40 + pub const DAYS: u8 = 0x07; 41 + pub const WEEKDAYS: u8 = 0x08; 42 + pub const MONTHS: u8 = 0x09; 43 + pub const YEARS: u8 = 0x0A; 44 + 45 + // alarm registers 46 + pub const SECOND_ALARM: u8 = 0x0B; 47 + pub const MINUTE_ALARM: u8 = 0x0C; 48 + pub const HOUR_ALARM: u8 = 0x0D; 49 + pub const DAY_ALARM: u8 = 0x0E; 50 + pub const WEEKDAY_ALARM: u8 = 0x0F; 51 + 52 + // timer registers 53 + pub const TIMER_VALUE: u8 = 0x10; 54 + pub const TIMER_MODE: u8 = 0x11; 55 + } 56 + 57 + pub struct BitFlags; 58 + 59 + impl BitFlags { 60 + // control 1 61 + pub const CAP_SEL: u8 = 0b0000_0001; // internal oscillator capacitor selection 62 + pub const MODE_12_24: u8 = 0b0000_0010; // 12 or 24-hour mode 63 + pub const CIE: u8 = 0b0000_0100; // connection interrupt enable 64 + // 3: UNUSED 65 + pub const SR: u8 = 0b0001_0000; // software reset 66 + pub const STOP: u8 = 0b0010_0000; // RTC clock stop bit 67 + // 6: UNUSED 68 + pub const EXT_TEST: u8 = 0b1000_0000; // external clock test mode 69 + 70 + // control 2 71 + pub const COF: u8 = 0b0000_0111; // clkout control 72 + pub const TF: u8 = 0b0000_1000; // timer flag 73 + pub const HMI: u8 = 0b0001_0000; // half minute interrupt 74 + pub const MI: u8 = 0b0010_0000; // minute interrupt 75 + pub const AF: u8 = 0b0100_0000; // alarm flag 76 + pub const AIE: u8 = 0b1000_0000; // alarm interrupt enabled 77 + 78 + pub const AE: u8 = 0b1000_0000; // alarm enable/disable for all five (s/m/h/d/wd) settings 79 + } 80 + 81 + const DEVICE_ADDRESS: u8 = 0b1010001; 82 + 83 + /// Two possible choices, used for various enable/disable bit flags 84 + #[allow(non_camel_case_types)] 85 + #[derive(Copy, Clone, Debug, defmt::Format)] 86 + pub enum Control { 87 + /// Enable some feature, eg. timer 88 + On, 89 + /// Disable some feature, eg. timer 90 + Off, 91 + } 92 + 93 + /// PCF8563 driver 94 + #[derive(Debug, Default, defmt::Format)] 95 + pub struct PCF85063<I2C> { 96 + /// The concrete I2C device implementation. 97 + i2c: I2C, 98 + } 99 + 100 + impl<I2C, E> PCF85063<I2C> 101 + where 102 + I2C: I2c<Error = E>, 103 + { 104 + /// Create a new instance of the PCF8563 driver. 105 + pub fn new(i2c: I2C) -> Self { 106 + PCF85063 { i2c } 107 + } 108 + 109 + /// Reset the RTC 110 + pub fn reset(&mut self) -> Result<(), Error<E>> { 111 + self.set_register_bit_flag(Register::CONTROL_1, BitFlags::SR) 112 + } 113 + 114 + /// Destroy driver instance, return I2C bus instance. 115 + pub fn destroy(self) -> I2C { 116 + self.i2c 117 + } 118 + 119 + /// Let the device reset itself 120 + pub fn perform_software_reset(&mut self) -> Result<(), Error<E>> { 121 + self.write_register(Register::CONTROL_1, 0b01011000) 122 + } 123 + 124 + /// Write to a register. 125 + pub fn write_register(&mut self, register: u8, data: u8) -> Result<(), Error<E>> { 126 + let payload: [u8; 2] = [register, data]; 127 + self.i2c.write(DEVICE_ADDRESS, &payload).map_err(Error::I2C) 128 + } 129 + 130 + /// Read from a register. 131 + pub fn read_register(&mut self, register: u8) -> Result<u8, Error<E>> { 132 + let mut data = [0]; 133 + self.i2c 134 + .write_read(DEVICE_ADDRESS, &[register], &mut data) 135 + .map_err(Error::I2C) 136 + .and(Ok(data[0])) 137 + } 138 + 139 + /// Check if specific bits are set. 140 + pub fn is_register_bit_flag_high( 141 + &mut self, 142 + address: u8, 143 + bitmask: u8, 144 + ) -> Result<bool, Error<E>> { 145 + let data = self.read_register(address)?; 146 + Ok((data & bitmask) != 0) 147 + } 148 + 149 + /// Set specific bits. 150 + pub fn set_register_bit_flag(&mut self, address: u8, bitmask: u8) -> Result<(), Error<E>> { 151 + let data = self.read_register(address)?; 152 + if (data & bitmask) == 0 { 153 + self.write_register(address, data | bitmask) 154 + } else { 155 + Ok(()) 156 + } 157 + } 158 + 159 + /// Clear specific bits. 160 + pub fn clear_register_bit_flag(&mut self, address: u8, bitmask: u8) -> Result<(), Error<E>> { 161 + let data = self.read_register(address)?; 162 + if (data & bitmask) != 0 { 163 + self.write_register(address, data & !bitmask) 164 + } else { 165 + Ok(()) 166 + } 167 + } 168 + } 169 + 170 + impl<I2C, E> PCF85063<I2C> 171 + where 172 + I2C: I2c<Error = E>, 173 + { 174 + pub fn read_ram_byte(&mut self) -> Result<u8, Error<E>> { 175 + self.read_register(Register::RAM_BYTE) 176 + } 177 + 178 + pub fn write_ram_byte(&mut self, byte: u8) -> Result<(), Error<E>> { 179 + self.write_register(Register::RAM_BYTE, byte) 180 + } 181 + } 182 + 183 + impl<I2C, E> PCF85063<I2C> 184 + where 185 + I2C: I2c<Error = E>, 186 + { 187 + pub fn stop_clock(&mut self) -> Result<(), Error<E>> { 188 + self.set_register_bit_flag(Register::CONTROL_1, BitFlags::STOP) 189 + } 190 + 191 + pub fn start_clock(&mut self) -> Result<(), Error<E>> { 192 + self.clear_register_bit_flag(Register::CONTROL_1, BitFlags::STOP) 193 + } 194 + } 195 + 196 + #[derive(Debug, Clone, Copy, PartialEq, Eq, defmt::Format)] 197 + #[repr(u8)] 198 + pub enum OutputFrequency { 199 + Hz32768 = 0b000, 200 + Hz16384 = 0b001, 201 + Hz8192 = 0b010, 202 + Hz4096 = 0b011, 203 + Hz2048 = 0b100, 204 + Hz1024 = 0b101, 205 + Hz1 = 0b110, 206 + Hz0 = 0b111, 207 + } 208 + 209 + impl Default for OutputFrequency { 210 + fn default() -> Self { 211 + OutputFrequency::Hz32768 212 + } 213 + } 214 + 215 + impl OutputFrequency { 216 + pub const fn bits(self) -> u8 { 217 + self as u8 218 + } 219 + } 220 + 221 + impl<I2C, E> PCF85063<I2C> 222 + where 223 + I2C: I2c<Error = E>, 224 + { 225 + pub fn read_clock_output_frequency(&mut self) -> Result<OutputFrequency, Error<E>> { 226 + let value = self.read_register(Register::CONTROL_2)? & BitFlags::COF; 227 + 228 + Ok(unsafe { core::mem::transmute(value) }) 229 + } 230 + 231 + pub fn write_clock_output_frequency(&mut self, freq: OutputFrequency) -> Result<(), Error<E>> { 232 + let value = self.read_register(Register::CONTROL_2)?; 233 + let cleared = value ^ BitFlags::COF; 234 + let set = cleared | freq as u8; 235 + 236 + self.write_register(Register::CONTROL_2, set) 237 + } 238 + } 239 + 240 + /// Convert the Binary Coded Decimal value to decimal (only the lowest 7 bits). 241 + fn decode_bcd(input: u8) -> u8 { 242 + let digits: u8 = input & 0xf; 243 + let tens: u8 = (input >> 4) & 0x7; 244 + 10 * tens + digits 245 + } 246 + 247 + /// Convert the decimal value to Binary Coded Decimal. 248 + fn encode_bcd(input: u8) -> u8 { 249 + let digits: u8 = input % 10; 250 + let tens: u8 = input / 10; 251 + let tens = tens << 4; 252 + tens + digits 253 + }
+9
src/save.rs
··· 60 pub wifi_counted: u32, 61 pub bssid: Vec<String<17>, BSSID_LEN>, 62 }
··· 60 pub wifi_counted: u32, 61 pub bssid: Vec<String<17>, BSSID_LEN>, 62 } 63 + 64 + impl Save { 65 + pub fn new() -> Self { 66 + Self { 67 + wifi_counted: 0, 68 + bssid: Vec::new(), 69 + } 70 + } 71 + }
+6 -12
src/temp_sensor.rs
··· 1 use defmt::*; 2 - use embassy_rp::i2c::{I2c, SclPin, SdaPin}; 3 - use embassy_rp::peripherals::I2C0; 4 - use embassy_rp::{i2c, Peripheral}; 5 use embassy_time::Timer; 6 use shtcx::{self, PowerMode}; 7 8 - use crate::badge_display::{HUMIDITY, TEMP}; // Import the necessary items from shtcx 9 - 10 #[embassy_executor::task] 11 - pub async fn run_the_temp_sensor( 12 - i2c0: I2C0, 13 - scl: impl Peripheral<P = impl SclPin<I2C0>> + 'static, 14 - sda: impl Peripheral<P = impl SdaPin<I2C0>> + 'static, 15 - ) { 16 - let i2c = I2c::new_blocking(i2c0, scl, sda, i2c::Config::default()); 17 18 - let mut sht = shtcx::shtc3(i2c); 19 let mut sht_delay = embassy_time::Delay; // Create a delay instance 20 21 loop {
··· 1 + use crate::I2c0Bus; 2 + use crate::badge_display::{HUMIDITY, TEMP}; 3 use defmt::*; 4 + use embassy_embedded_hal::shared_bus::blocking::i2c::I2cDevice; 5 use embassy_time::Timer; 6 use shtcx::{self, PowerMode}; 7 8 #[embassy_executor::task] 9 + pub async fn run_the_temp_sensor(i2c_bus: &'static I2c0Bus) { 10 + let i2c_dev = I2cDevice::new(i2c_bus); 11 12 + let mut sht = shtcx::shtc3(i2c_dev); 13 let mut sht_delay = embassy_time::Delay; // Create a delay instance 14 15 loop {