A personal rust firmware for the Badger 2040 W

working demo with new deps

+301 -94
+178 -70
Cargo.lock
··· 181 181 ] 182 182 183 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]] 184 199 name = "buffered-io" 185 200 version = "0.5.4" 186 201 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 341 356 342 357 [[package]] 343 358 name = "cyw43" 344 - version = "0.1.0" 345 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 359 + version = "0.2.0" 360 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 346 361 dependencies = [ 362 + "bt-hci", 347 363 "cortex-m", 348 364 "cortex-m-rt", 349 365 "defmt", 350 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 351 - "embassy-net-driver-channel 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 352 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 366 + "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 367 + "embassy-net-driver-channel 0.3.0", 368 + "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 353 369 "embassy-time", 354 370 "embedded-hal 1.0.0", 371 + "embedded-io-async", 355 372 "futures", 356 373 "heapless 0.8.0", 357 374 "num_enum", ··· 359 376 360 377 [[package]] 361 378 name = "cyw43-pio" 362 - version = "0.1.0" 363 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 379 + version = "0.2.0" 380 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 364 381 dependencies = [ 365 382 "cyw43", 366 383 "defmt", ··· 554 571 555 572 [[package]] 556 573 name = "embassy-embedded-hal" 557 - version = "0.1.0" 558 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 574 + version = "0.2.0" 575 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 559 576 dependencies = [ 560 577 "defmt", 561 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 562 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 578 + "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 579 + "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 563 580 "embassy-time", 564 581 "embedded-hal 0.2.7", 565 582 "embedded-hal 1.0.0", ··· 571 588 572 589 [[package]] 573 590 name = "embassy-executor" 574 - version = "0.5.0" 575 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 591 + version = "0.6.0" 592 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 576 593 dependencies = [ 577 594 "cortex-m", 578 595 "critical-section", ··· 585 602 586 603 [[package]] 587 604 name = "embassy-executor-macros" 588 - version = "0.4.1" 589 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 605 + version = "0.5.0" 606 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 590 607 dependencies = [ 591 608 "darling", 592 609 "proc-macro2", ··· 597 614 [[package]] 598 615 name = "embassy-futures" 599 616 version = "0.1.1" 600 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 617 + source = "registry+https://github.com/rust-lang/crates.io-index" 618 + checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" 619 + 620 + [[package]] 621 + name = "embassy-futures" 622 + version = "0.1.1" 623 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 601 624 602 625 [[package]] 603 626 name = "embassy-futures" ··· 606 629 607 630 [[package]] 608 631 name = "embassy-hal-internal" 609 - version = "0.1.0" 610 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 632 + version = "0.2.0" 633 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 611 634 dependencies = [ 612 635 "cortex-m", 613 636 "critical-section", ··· 618 641 [[package]] 619 642 name = "embassy-net" 620 643 version = "0.4.0" 621 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 644 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 622 645 dependencies = [ 623 646 "defmt", 624 647 "document-features", 625 - "embassy-net-driver 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 626 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 648 + "embassy-net-driver 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 649 + "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 627 650 "embassy-time", 628 651 "embedded-io-async", 629 652 "embedded-nal-async", ··· 635 658 [[package]] 636 659 name = "embassy-net-driver" 637 660 version = "0.2.0" 638 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 661 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 639 662 dependencies = [ 640 663 "defmt", 641 664 ] ··· 648 671 [[package]] 649 672 name = "embassy-net-driver-channel" 650 673 version = "0.2.0" 651 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 674 + source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 652 675 dependencies = [ 653 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 654 - "embassy-net-driver 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 655 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 676 + "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git)", 677 + "embassy-net-driver 0.2.0 (git+https://github.com/embassy-rs/embassy.git)", 678 + "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git)", 656 679 ] 657 680 658 681 [[package]] 659 682 name = "embassy-net-driver-channel" 660 - version = "0.2.0" 661 - source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 683 + version = "0.3.0" 684 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 662 685 dependencies = [ 663 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git)", 664 - "embassy-net-driver 0.2.0 (git+https://github.com/embassy-rs/embassy.git)", 665 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git)", 686 + "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 687 + "embassy-net-driver 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 688 + "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 666 689 ] 667 690 668 691 [[package]] 669 692 name = "embassy-net-wiznet" 670 693 version = "0.1.0" 671 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 694 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 672 695 dependencies = [ 673 696 "defmt", 674 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 675 - "embassy-net-driver-channel 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 697 + "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 698 + "embassy-net-driver-channel 0.3.0", 676 699 "embassy-time", 677 700 "embedded-hal 1.0.0", 678 701 "embedded-hal-async", ··· 680 703 681 704 [[package]] 682 705 name = "embassy-rp" 683 - version = "0.1.0" 684 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 706 + version = "0.2.0" 707 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 685 708 dependencies = [ 686 709 "atomic-polyfill", 687 710 "cfg-if", ··· 691 714 "defmt", 692 715 "document-features", 693 716 "embassy-embedded-hal", 694 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 717 + "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 695 718 "embassy-hal-internal", 696 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 719 + "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 697 720 "embassy-time", 698 721 "embassy-time-driver", 699 - "embassy-usb-driver 0.1.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 722 + "embassy-usb-driver 0.1.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 700 723 "embedded-hal 0.2.7", 701 724 "embedded-hal 1.0.0", 702 725 "embedded-hal-async", ··· 712 735 "rand_core", 713 736 "rp-pac", 714 737 "rp2040-boot2", 738 + "sha2-const-stable", 715 739 ] 716 740 717 741 [[package]] 718 742 name = "embassy-sync" 719 743 version = "0.6.0" 720 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 744 + source = "registry+https://github.com/rust-lang/crates.io-index" 745 + checksum = "b3e0c49ff02ebe324faf3a8653ba91582e2d0a7fdef5bc88f449d5aa1bfcc05c" 746 + dependencies = [ 747 + "cfg-if", 748 + "critical-section", 749 + "embedded-io-async", 750 + "futures-util", 751 + "heapless 0.8.0", 752 + ] 753 + 754 + [[package]] 755 + name = "embassy-sync" 756 + version = "0.6.0" 757 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 721 758 dependencies = [ 722 759 "cfg-if", 723 760 "critical-section", ··· 741 778 742 779 [[package]] 743 780 name = "embassy-time" 744 - version = "0.3.1" 745 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 781 + version = "0.3.2" 782 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 746 783 dependencies = [ 747 784 "cfg-if", 748 785 "critical-section", ··· 760 797 [[package]] 761 798 name = "embassy-time-driver" 762 799 version = "0.1.0" 763 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 800 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 764 801 dependencies = [ 765 802 "document-features", 766 803 ] ··· 768 805 [[package]] 769 806 name = "embassy-time-queue-driver" 770 807 version = "0.1.0" 771 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 808 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 772 809 773 810 [[package]] 774 811 name = "embassy-usb" 775 812 version = "0.2.0" 776 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 813 + source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 777 814 dependencies = [ 778 - "defmt", 779 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 780 - "embassy-net-driver-channel 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 781 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 782 - "embassy-usb-driver 0.1.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 815 + "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git)", 816 + "embassy-net-driver-channel 0.2.0", 817 + "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git)", 818 + "embassy-usb-driver 0.1.0 (git+https://github.com/embassy-rs/embassy.git)", 783 819 "heapless 0.8.0", 784 820 "ssmarshal", 785 821 "usbd-hid", ··· 787 823 788 824 [[package]] 789 825 name = "embassy-usb" 790 - version = "0.2.0" 791 - source = "git+https://github.com/embassy-rs/embassy.git#2b031756c6d705f58de972de48f7300b4fdc673c" 826 + version = "0.3.0" 827 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 792 828 dependencies = [ 793 - "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git)", 794 - "embassy-net-driver-channel 0.2.0 (git+https://github.com/embassy-rs/embassy.git)", 795 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git)", 796 - "embassy-usb-driver 0.1.0 (git+https://github.com/embassy-rs/embassy.git)", 829 + "defmt", 830 + "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 831 + "embassy-net-driver-channel 0.3.0", 832 + "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 833 + "embassy-usb-driver 0.1.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 797 834 "heapless 0.8.0", 798 835 "ssmarshal", 799 836 "usbd-hid", ··· 802 839 [[package]] 803 840 name = "embassy-usb-driver" 804 841 version = "0.1.0" 805 - source = "git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c#2b031756c6d705f58de972de48f7300b4fdc673c" 842 + source = "git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6#f0a86070512ad739641cee7d9fa39d63f5c8a9f6" 806 843 dependencies = [ 807 844 "defmt", 808 845 ] ··· 819 856 dependencies = [ 820 857 "embassy-futures 0.1.1 (git+https://github.com/embassy-rs/embassy.git)", 821 858 "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git)", 822 - "embassy-usb 0.2.0 (git+https://github.com/embassy-rs/embassy.git)", 859 + "embassy-usb 0.2.0", 823 860 "log", 824 861 ] 825 862 ··· 828 865 version = "0.1.0" 829 866 dependencies = [ 830 867 "assign-resources", 868 + "bt-hci", 831 869 "byte-slice-cast 1.2.2", 832 870 "cortex-m", 833 871 "cortex-m-rt", ··· 844 882 "embassy-net", 845 883 "embassy-net-wiznet", 846 884 "embassy-rp", 847 - "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 885 + "embassy-sync 0.6.0 (git+https://github.com/embassy-rs/embassy.git?rev=f0a86070512ad739641cee7d9fa39d63f5c8a9f6)", 848 886 "embassy-time", 849 - "embassy-usb 0.2.0 (git+https://github.com/embassy-rs/embassy.git?rev=2b031756c6d705f58de972de48f7300b4fdc673c)", 887 + "embassy-usb 0.3.0", 850 888 "embassy-usb-logger", 851 889 "embedded-graphics", 852 890 "embedded-hal 1.0.0", ··· 855 893 "embedded-io-async", 856 894 "embedded-sdmmc", 857 895 "embedded-storage", 896 + "embedded-text", 858 897 "fixed", 859 898 "fixed-macro", 860 899 "heapless 0.8.0", ··· 870 909 "smart-leds", 871 910 "st7789", 872 911 "static_cell", 912 + "trouble-host", 913 + "uc8151", 873 914 "usbd-hid", 874 915 ] 875 916 876 917 [[package]] 877 918 name = "embedded-graphics" 878 - version = "0.7.1" 919 + version = "0.8.1" 879 920 source = "registry+https://github.com/rust-lang/crates.io-index" 880 - checksum = "750082c65094fbcc4baf9ba31583ce9a8bb7f52cadfb96f6164b1bc7f922f32b" 921 + checksum = "0649998afacf6d575d126d83e68b78c0ab0e00ca2ac7e9b3db11b4cbe8274ef0" 881 922 dependencies = [ 882 923 "az", 883 924 "byteorder", 884 - "embedded-graphics-core", 925 + "embedded-graphics-core 0.4.0", 885 926 "float-cmp", 886 927 "micromath", 887 928 ] ··· 891 932 version = "0.3.3" 892 933 source = "registry+https://github.com/rust-lang/crates.io-index" 893 934 checksum = "b8b1239db5f3eeb7e33e35bd10bd014e7b2537b17e071f726a09351431337cfa" 935 + dependencies = [ 936 + "az", 937 + "byteorder", 938 + ] 939 + 940 + [[package]] 941 + name = "embedded-graphics-core" 942 + version = "0.4.0" 943 + source = "registry+https://github.com/rust-lang/crates.io-index" 944 + checksum = "ba9ecd261f991856250d2207f6d8376946cd9f412a2165d3b75bc87a0bc7a044" 894 945 dependencies = [ 895 946 "az", 896 947 "byteorder", ··· 1010 1061 ] 1011 1062 1012 1063 [[package]] 1064 + name = "embedded-text" 1065 + version = "0.7.2" 1066 + source = "registry+https://github.com/rust-lang/crates.io-index" 1067 + checksum = "005680edc0d075af5e02d5788ca291737bd9aba7fc404ae031cc9dfa715e5f7d" 1068 + dependencies = [ 1069 + "az", 1070 + "embedded-graphics", 1071 + "object-chain", 1072 + ] 1073 + 1074 + [[package]] 1013 1075 name = "embedded-tls" 1014 1076 version = "0.17.0" 1015 1077 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1118 1180 1119 1181 [[package]] 1120 1182 name = "float-cmp" 1121 - version = "0.8.0" 1183 + version = "0.9.0" 1122 1184 source = "registry+https://github.com/rust-lang/crates.io-index" 1123 - checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" 1185 + checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" 1124 1186 dependencies = [ 1125 1187 "num-traits", 1126 1188 ] ··· 1160 1222 version = "0.3.30" 1161 1223 source = "registry+https://github.com/rust-lang/crates.io-index" 1162 1224 checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 1225 + 1226 + [[package]] 1227 + name = "futures-intrusive" 1228 + version = "0.5.0" 1229 + source = "registry+https://github.com/rust-lang/crates.io-index" 1230 + checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" 1231 + dependencies = [ 1232 + "futures-core", 1233 + "lock_api", 1234 + ] 1163 1235 1164 1236 [[package]] 1165 1237 name = "futures-io" ··· 1518 1590 1519 1591 [[package]] 1520 1592 name = "micromath" 1521 - version = "1.1.1" 1593 + version = "2.1.0" 1522 1594 source = "registry+https://github.com/rust-lang/crates.io-index" 1523 - checksum = "bc4010833aea396656c2f91ee704d51a6f1329ec2ab56ffd00bfd56f7481ea94" 1595 + checksum = "c3c8dda44ff03a2f238717214da50f65d5a53b45cd213a7370424ffdb6fae815" 1524 1596 1525 1597 [[package]] 1526 1598 name = "nb" ··· 1586 1658 "quote", 1587 1659 "syn 1.0.109", 1588 1660 ] 1661 + 1662 + [[package]] 1663 + name = "object-chain" 1664 + version = "0.1.3" 1665 + source = "registry+https://github.com/rust-lang/crates.io-index" 1666 + checksum = "41af26158b0f5530f7b79955006c2727cd23d0d8e7c3109dc316db0a919784dd" 1589 1667 1590 1668 [[package]] 1591 1669 name = "once_cell" ··· 1919 1997 [[package]] 1920 1998 name = "rp-pac" 1921 1999 version = "6.0.0" 1922 - source = "registry+https://github.com/rust-lang/crates.io-index" 1923 - checksum = "f30f6c4c846269293db805e9c77864ff7b923395b480550df44f0868e3765337" 2000 + source = "git+https://github.com/embassy-rs/rp-pac.git?rev=a7f42d25517f7124ad3b4ed492dec8b0f50a0e6c#a7f42d25517f7124ad3b4ed492dec8b0f50a0e6c" 1924 2001 dependencies = [ 1925 2002 "cortex-m", 1926 2003 "cortex-m-rt", ··· 2048 2125 ] 2049 2126 2050 2127 [[package]] 2128 + name = "sha2-const-stable" 2129 + version = "0.1.0" 2130 + source = "registry+https://github.com/rust-lang/crates.io-index" 2131 + checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" 2132 + 2133 + [[package]] 2051 2134 name = "siphasher" 2052 2135 version = "0.3.11" 2053 2136 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2117 2200 checksum = "cba7306a9ca07ffcafd13ac1eaac2d5cedc8e9fc0d342ef674e0f0d059c8f8a9" 2118 2201 dependencies = [ 2119 2202 "display-interface", 2120 - "embedded-graphics-core", 2203 + "embedded-graphics-core 0.3.3", 2121 2204 "embedded-hal 0.2.7", 2122 2205 "heapless 0.7.17", 2123 2206 "nb 1.1.0", ··· 2235 2318 ] 2236 2319 2237 2320 [[package]] 2321 + name = "trouble-host" 2322 + version = "0.1.0" 2323 + source = "git+https://github.com/embassy-rs/trouble.git?rev=4b8c0f499b34e46ca23a56e2d1640ede371722cf#4b8c0f499b34e46ca23a56e2d1640ede371722cf" 2324 + dependencies = [ 2325 + "bt-hci", 2326 + "defmt", 2327 + "embassy-futures 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 2328 + "embassy-sync 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 2329 + "embassy-time", 2330 + "embedded-io-async", 2331 + "futures", 2332 + "heapless 0.8.0", 2333 + ] 2334 + 2335 + [[package]] 2238 2336 name = "typenum" 2239 2337 version = "1.17.0" 2240 2338 source = "registry+https://github.com/rust-lang/crates.io-index" 2241 2339 checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 2340 + 2341 + [[package]] 2342 + name = "uc8151" 2343 + version = "0.3.0" 2344 + source = "git+https://github.com/9names/uc8151-rs.git#37a7feee23716506b777bd4032327038e7e0786a" 2345 + dependencies = [ 2346 + "embedded-graphics-core 0.4.0", 2347 + "embedded-hal 1.0.0", 2348 + "embedded-hal-async", 2349 + ] 2242 2350 2243 2351 [[package]] 2244 2352 name = "unicode-ident"
+23 -11
Cargo.toml
··· 6 6 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 7 8 8 [dependencies] 9 - embassy-embedded-hal = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 9 + embassy-embedded-hal = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 10 10 "defmt", 11 11 ] } 12 - embassy-sync = { version = "0.6.0", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 12 + embassy-sync = { version = "0.6.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 13 13 "defmt", 14 14 ] } 15 - embassy-executor = { version = "0.5.0", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 15 + embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 16 16 "task-arena-size-98304", 17 17 "arch-cortex-m", 18 18 "executor-thread", ··· 20 20 "defmt", 21 21 "integrated-timers", 22 22 ] } 23 - embassy-time = { version = "0.3.1", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 23 + embassy-time = { version = "0.3.2", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 24 24 "defmt", 25 25 "defmt-timestamp-uptime", 26 26 ] } 27 - embassy-rp = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 27 + embassy-rp = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 28 28 "defmt", 29 29 "unstable-pac", 30 30 "time-driver", 31 31 "critical-section-impl", 32 + "rp2040", 32 33 ] } 33 - embassy-usb = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 34 + embassy-usb = { git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 34 35 "defmt", 35 36 ] } 36 - embassy-net = { version = "0.4.0", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 37 + embassy-net = { version = "0.4.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 37 38 "defmt", 38 39 "tcp", 39 40 "udp", ··· 42 43 "medium-ethernet", 43 44 "dns", 44 45 ] } 45 - embassy-net-wiznet = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 46 + embassy-net-wiznet = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 46 47 "defmt", 47 48 ] } 48 49 embassy-futures = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git" } 49 50 embassy-usb-logger = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git" } 50 - cyw43 = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 51 + cyw43 = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 51 52 "defmt", 52 53 "firmware-logs", 54 + "bluetooth", 53 55 ] } 54 - cyw43-pio = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", rev = "2b031756c6d705f58de972de48f7300b4fdc673c", features = [ 56 + cyw43-pio = { version = "0.2.0", git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6", features = [ 55 57 "defmt", 56 58 "overclock", 57 59 ] } ··· 75 77 critical-section = "1.1" 76 78 panic-probe = { version = "0.3", features = ["print-defmt"] } 77 79 display-interface-spi = "0.4.1" 78 - embedded-graphics = "0.7.1" 80 + embedded-graphics = "0.8.0" 79 81 st7789 = "0.6.1" 80 82 display-interface = "0.4.1" 81 83 byte-slice-cast = { version = "1.2.0", default-features = false } ··· 95 97 pio = "0.2.1" 96 98 rand = { version = "0.8.5", default-features = false } 97 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 + ] } 105 + embedded-text = "0.7.0" 98 106 99 107 [profile.release] 100 108 debug = 2 ··· 102 110 [profile.dev] 103 111 lto = true 104 112 opt-level = "z" 113 + 114 + [patch.crates-io] 115 + trouble-host = { git = "https://github.com/embassy-rs/trouble.git", rev = "4b8c0f499b34e46ca23a56e2d1640ede371722cf" } 116 + embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "f0a86070512ad739641cee7d9fa39d63f5c8a9f6" }
+100 -13
src/main.rs
··· 4 4 5 5 #![no_std] 6 6 #![no_main] 7 - 8 7 use control_driver::setup_control; 9 - use defmt::*; 8 + use embassy_embedded_hal::shared_bus::asynch::spi::SpiDevice; 10 9 use embassy_executor::Spawner; 11 - use embassy_time::{Duration, Timer}; 10 + use embassy_rp::gpio; 11 + use embassy_rp::gpio::Input; 12 + use embassy_rp::spi::Spi; 13 + use embassy_rp::spi::{self}; 14 + use embassy_sync::blocking_mutex::raw::NoopRawMutex; 15 + use embassy_sync::mutex::Mutex; 16 + use embassy_time::Delay; 17 + use embedded_graphics::{ 18 + mono_font::{ascii::*, MonoTextStyle}, 19 + pixelcolor::BinaryColor, 20 + prelude::*, 21 + primitives::{PrimitiveStyle, Rectangle}, 22 + }; 23 + use embedded_text::{ 24 + alignment::HorizontalAlignment, 25 + style::{HeightMode, TextBoxStyleBuilder}, 26 + TextBox, 27 + }; 28 + use gpio::{Level, Output, Pull}; 29 + use uc8151::asynch::Uc8151; 30 + use uc8151::LUT; 31 + use uc8151::WIDTH; 12 32 use {defmt_rtt as _, panic_probe as _}; 33 + mod control_driver; 13 34 14 - mod control_driver; 15 35 #[embassy_executor::main] 16 36 async fn main(spawner: Spawner) { 17 37 let p = embassy_rp::init(Default::default()); ··· 20 40 ) 21 41 .await; 22 42 23 - let delay = Duration::from_secs(1); 43 + let miso = p.PIN_16; 44 + let mosi = p.PIN_19; 45 + let clk = p.PIN_18; 46 + let dc = p.PIN_20; 47 + let cs = p.PIN_17; 48 + let busy = p.PIN_26; 49 + let reset = p.PIN_21; 50 + let power = p.PIN_10; 51 + 52 + let btn_up = p.PIN_15; 53 + let btn_down = p.PIN_11; 54 + let btn_a = p.PIN_12; 55 + let btn_b = p.PIN_13; 56 + let btn_c = p.PIN_14; 57 + 58 + let reset = Output::new(reset, Level::Low); 59 + let _power = Output::new(power, Level::Low); 60 + 61 + let dc = Output::new(dc, Level::Low); 62 + let cs = Output::new(cs, Level::High); 63 + let busy = Input::new(busy, Pull::Up); 64 + 65 + let mut _btn_up = Input::new(btn_up, Pull::Up); 66 + let mut _btn_down = Input::new(btn_down, Pull::Up); 67 + let mut _btn_a = Input::new(btn_a, Pull::Up); 68 + let mut _btn_b = Input::new(btn_b, Pull::Up); 69 + let mut _btn_c = Input::new(btn_c, Pull::Up); 70 + 71 + let spi = Spi::new( 72 + p.SPI0, 73 + clk, 74 + mosi, 75 + miso, 76 + p.DMA_CH1, 77 + p.DMA_CH2, 78 + spi::Config::default(), 79 + ); 80 + let spi_bus: Mutex<NoopRawMutex, _> = Mutex::new(spi); 81 + let spi_dev = SpiDevice::new(&spi_bus, cs); 82 + let mut display = Uc8151::new(spi_dev, dc, busy, reset, Delay); 83 + display.reset().await; 24 84 25 - loop { 26 - info!("led on!"); 27 - control.gpio_set(0, true).await; 28 - Timer::after(delay).await; 85 + // Initialise display. Using the default LUT speed setting 86 + let _ = display.setup(LUT::Internal).await; 29 87 30 - info!("led off!"); 31 - control.gpio_set(0, false).await; 88 + // Note we're setting the Text color to `Off`. The driver is set up to treat Off as Black so that BMPs work as expected. 89 + let character_style = MonoTextStyle::new(&FONT_9X18_BOLD, BinaryColor::Off); 90 + let textbox_style = TextBoxStyleBuilder::new() 91 + .height_mode(HeightMode::FitToText) 92 + .alignment(HorizontalAlignment::Center) 93 + .paragraph_spacing(6) 94 + .build(); 32 95 33 - Timer::after(delay).await; 34 - } 96 + // Bounding box for our text. Fill it with the opposite color so we can read the text. 97 + let bounds = Rectangle::new(Point::new(10, 10), Size::new(WIDTH - 157, 0)); 98 + bounds 99 + .into_styled(PrimitiveStyle::with_fill(BinaryColor::On)) 100 + .draw(&mut display) 101 + .unwrap(); 102 + 103 + // Create the text box and apply styling options. 104 + let text = "Written In\nRust!"; 105 + let text_box = TextBox::with_textbox_style(text, bounds, character_style, textbox_style); 106 + 107 + // Draw the text box. 108 + text_box.draw(&mut display).unwrap(); 109 + let _ = display.update().await; 110 + control.gpio_set(0, true).await; 111 + 112 + // loop { 113 + // info!("led on!"); 114 + // control.gpio_set(0, true).await; 115 + // Timer::after(delay).await; 116 + 117 + // info!("led off!"); 118 + // control.gpio_set(0, false).await; 119 + 120 + // Timer::after(delay).await; 121 + // } 35 122 }