aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathisDerooNXP <[email protected]>2025-11-26 10:05:16 -0800
committerGitHub <[email protected]>2025-11-26 10:05:16 -0800
commitd12bc9785399991065e511efbea34f0138c7645e (patch)
tree47472365383c3a5ad5d4ab0495e655a3418477d9
parent1efaaa4025120413ec17de90106244445208804a (diff)
Add GPIO interrupt support and embedded-hal-async trait implementation (#38)
* Add GPIO interrupt support and embedded-hal-async trait implementation Signed-off-by: Mathis Deroo <[email protected]> * Run cargo fmt * Improve GPIO driver interrupt mechanism and example - GPIO interrupt managed internally at the HAL level, - Renamed and cleaned gpio_interrupt example; now button_async.rs, - Use BitIter instead of simple for loop in the irq handler, - Fix comments and add "rt" wrappen to GPIO IRQ handler. Signed-off-by: Mathis Deroo <[email protected]> * Modify INTERRUPT_DETECTED (AtomicBool to AtomicU32) to work with pin number and not only port number interrupt Signed-off-by: Mathis Deroo <[email protected]> * add embedded_hal_async::digital::* traits Signed-off-by: Mathis Deroo <[email protected]> * Update irq_handler with BitIter loop Co-authored-by: Felipe Balbi <[email protected]> * Add suggested changes Signed-off-by: Mathis Deroo <[email protected]> * cargo fmt Signed-off-by: Felipe Balbi <[email protected]> * WIP: Modify Wakers from AtomicWaker to WaitMap, with pin number (per PORT) as key Signed-off-by: Mathis Deroo <[email protected]> * Tweak maitake-sync usage * Improve docs * refactor a bit * Move all of the async+interrupt stuff into a module * Remove defmt debug traces Signed-off-by: Mathis Deroo <[email protected]> * cargo vet * Move e-hal-async impls into the gated block * "rt", begone! --------- Signed-off-by: Mathis Deroo <[email protected]> Signed-off-by: Felipe Balbi <[email protected]> Co-authored-by: Felipe Balbi <[email protected]> Co-authored-by: Felipe Balbi <[email protected]> Co-authored-by: Felipe Balbi <[email protected]> Co-authored-by: James Munns <[email protected]>
-rw-r--r--Cargo.lock426
-rw-r--r--Cargo.toml6
-rw-r--r--examples/Cargo.lock414
-rw-r--r--examples/Cargo.toml2
-rw-r--r--examples/src/bin/button_async.rs28
-rw-r--r--src/config.rs2
-rw-r--r--src/gpio.rs243
-rw-r--r--src/interrupt.rs193
-rw-r--r--src/lib.rs15
-rw-r--r--supply-chain/audits.toml216
-rw-r--r--supply-chain/config.toml19
-rw-r--r--supply-chain/imports.lock465
12 files changed, 2005 insertions, 24 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a023fa268..747a69c08 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3,6 +3,15 @@
3version = 4 3version = 4
4 4
5[[package]] 5[[package]]
6name = "aho-corasick"
7version = "1.1.4"
8source = "registry+https://github.com/rust-lang/crates.io-index"
9checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
10dependencies = [
11 "memchr",
12]
13
14[[package]]
6name = "autocfg" 15name = "autocfg"
7version = "1.5.0" 16version = "1.5.0"
8source = "registry+https://github.com/rust-lang/crates.io-index" 17source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -36,12 +45,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
36checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 45checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
37 46
38[[package]] 47[[package]]
48name = "cc"
49version = "1.2.47"
50source = "registry+https://github.com/rust-lang/crates.io-index"
51checksum = "cd405d82c84ff7f35739f175f67d8b9fb7687a0e84ccdc78bd3568839827cf07"
52dependencies = [
53 "find-msvc-tools",
54 "shlex",
55]
56
57[[package]]
39name = "cfg-if" 58name = "cfg-if"
40version = "1.0.4" 59version = "1.0.4"
41source = "registry+https://github.com/rust-lang/crates.io-index" 60source = "registry+https://github.com/rust-lang/crates.io-index"
42checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 61checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
43 62
44[[package]] 63[[package]]
64name = "cordyceps"
65version = "0.3.4"
66source = "registry+https://github.com/rust-lang/crates.io-index"
67checksum = "688d7fbb8092b8de775ef2536f36c8c31f2bc4006ece2e8d8ad2d17d00ce0a2a"
68dependencies = [
69 "loom",
70 "tracing",
71]
72
73[[package]]
45name = "cortex-m" 74name = "cortex-m"
46version = "0.7.7" 75version = "0.7.7"
47source = "registry+https://github.com/rust-lang/crates.io-index" 76source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -175,6 +204,7 @@ dependencies = [
175 "embedded-io", 204 "embedded-io",
176 "embedded-io-async", 205 "embedded-io-async",
177 "heapless", 206 "heapless",
207 "maitake-sync",
178 "mcxa-pac", 208 "mcxa-pac",
179 "nb 1.1.0", 209 "nb 1.1.0",
180 "paste", 210 "paste",
@@ -285,6 +315,12 @@ dependencies = [
285] 315]
286 316
287[[package]] 317[[package]]
318name = "find-msvc-tools"
319version = "0.1.5"
320source = "registry+https://github.com/rust-lang/crates.io-index"
321checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"
322
323[[package]]
288name = "futures-core" 324name = "futures-core"
289version = "0.3.31" 325version = "0.3.31"
290source = "registry+https://github.com/rust-lang/crates.io-index" 326source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -297,6 +333,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
297checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 333checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
298 334
299[[package]] 335[[package]]
336name = "generator"
337version = "0.8.7"
338source = "registry+https://github.com/rust-lang/crates.io-index"
339checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2"
340dependencies = [
341 "cc",
342 "cfg-if",
343 "libc",
344 "log",
345 "rustversion",
346 "windows",
347]
348
349[[package]]
300name = "hash32" 350name = "hash32"
301version = "0.3.1" 351version = "0.3.1"
302source = "registry+https://github.com/rust-lang/crates.io-index" 352source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -316,12 +366,68 @@ dependencies = [
316] 366]
317 367
318[[package]] 368[[package]]
369name = "lazy_static"
370version = "1.5.0"
371source = "registry+https://github.com/rust-lang/crates.io-index"
372checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
373
374[[package]]
375name = "libc"
376version = "0.2.177"
377source = "registry+https://github.com/rust-lang/crates.io-index"
378checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
379
380[[package]]
319name = "litrs" 381name = "litrs"
320version = "1.0.0" 382version = "1.0.0"
321source = "registry+https://github.com/rust-lang/crates.io-index" 383source = "registry+https://github.com/rust-lang/crates.io-index"
322checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" 384checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"
323 385
324[[package]] 386[[package]]
387name = "log"
388version = "0.4.28"
389source = "registry+https://github.com/rust-lang/crates.io-index"
390checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
391
392[[package]]
393name = "loom"
394version = "0.7.2"
395source = "registry+https://github.com/rust-lang/crates.io-index"
396checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca"
397dependencies = [
398 "cfg-if",
399 "generator",
400 "scoped-tls",
401 "tracing",
402 "tracing-subscriber",
403]
404
405[[package]]
406name = "maitake-sync"
407version = "0.2.2"
408source = "registry+https://github.com/rust-lang/crates.io-index"
409checksum = "748f86d9befd480b602c3bebc9ef30dbf2f3dfc8acc4a73d07b90f0117e6de3f"
410dependencies = [
411 "cordyceps",
412 "critical-section",
413 "loom",
414 "mutex-traits",
415 "mycelium-bitfield",
416 "pin-project",
417 "portable-atomic",
418 "tracing",
419]
420
421[[package]]
422name = "matchers"
423version = "0.2.0"
424source = "registry+https://github.com/rust-lang/crates.io-index"
425checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
426dependencies = [
427 "regex-automata",
428]
429
430[[package]]
325name = "mcxa-pac" 431name = "mcxa-pac"
326version = "0.1.0" 432version = "0.1.0"
327source = "git+https://github.com/OpenDevicePartnership/mcxa-pac#e18dfb52500ca77b8d8326662b966a80251182ca" 433source = "git+https://github.com/OpenDevicePartnership/mcxa-pac#e18dfb52500ca77b8d8326662b966a80251182ca"
@@ -334,6 +440,24 @@ dependencies = [
334] 440]
335 441
336[[package]] 442[[package]]
443name = "memchr"
444version = "2.7.6"
445source = "registry+https://github.com/rust-lang/crates.io-index"
446checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
447
448[[package]]
449name = "mutex-traits"
450version = "1.0.1"
451source = "registry+https://github.com/rust-lang/crates.io-index"
452checksum = "3929f2b5633d29cf7b6624992e5f3c1e9334f1193423e12d17be4faf678cde3f"
453
454[[package]]
455name = "mycelium-bitfield"
456version = "0.1.5"
457source = "registry+https://github.com/rust-lang/crates.io-index"
458checksum = "24e0cc5e2c585acbd15c5ce911dff71e1f4d5313f43345873311c4f5efd741cc"
459
460[[package]]
337name = "nb" 461name = "nb"
338version = "0.1.3" 462version = "0.1.3"
339source = "registry+https://github.com/rust-lang/crates.io-index" 463source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -349,6 +473,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
349checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" 473checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d"
350 474
351[[package]] 475[[package]]
476name = "nu-ansi-term"
477version = "0.50.3"
478source = "registry+https://github.com/rust-lang/crates.io-index"
479checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
480dependencies = [
481 "windows-sys",
482]
483
484[[package]]
352name = "num-traits" 485name = "num-traits"
353version = "0.2.19" 486version = "0.2.19"
354source = "registry+https://github.com/rust-lang/crates.io-index" 487source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -358,12 +491,53 @@ dependencies = [
358] 491]
359 492
360[[package]] 493[[package]]
494name = "once_cell"
495version = "1.21.3"
496source = "registry+https://github.com/rust-lang/crates.io-index"
497checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
498
499[[package]]
361name = "paste" 500name = "paste"
362version = "1.0.15" 501version = "1.0.15"
363source = "registry+https://github.com/rust-lang/crates.io-index" 502source = "registry+https://github.com/rust-lang/crates.io-index"
364checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 503checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
365 504
366[[package]] 505[[package]]
506name = "pin-project"
507version = "1.1.10"
508source = "registry+https://github.com/rust-lang/crates.io-index"
509checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a"
510dependencies = [
511 "pin-project-internal",
512]
513
514[[package]]
515name = "pin-project-internal"
516version = "1.1.10"
517source = "registry+https://github.com/rust-lang/crates.io-index"
518checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
519dependencies = [
520 "proc-macro2",
521 "quote",
522 "syn",
523]
524
525[[package]]
526name = "pin-project-lite"
527version = "0.2.16"
528source = "registry+https://github.com/rust-lang/crates.io-index"
529checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
530
531[[package]]
532name = "portable-atomic"
533version = "1.11.1"
534source = "registry+https://github.com/rust-lang/crates.io-index"
535checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
536dependencies = [
537 "critical-section",
538]
539
540[[package]]
367name = "proc-macro-error-attr2" 541name = "proc-macro-error-attr2"
368version = "2.0.0" 542version = "2.0.0"
369source = "registry+https://github.com/rust-lang/crates.io-index" 543source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -404,6 +578,23 @@ dependencies = [
404] 578]
405 579
406[[package]] 580[[package]]
581name = "regex-automata"
582version = "0.4.13"
583source = "registry+https://github.com/rust-lang/crates.io-index"
584checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
585dependencies = [
586 "aho-corasick",
587 "memchr",
588 "regex-syntax",
589]
590
591[[package]]
592name = "regex-syntax"
593version = "0.8.8"
594source = "registry+https://github.com/rust-lang/crates.io-index"
595checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
596
597[[package]]
407name = "rustc_version" 598name = "rustc_version"
408version = "0.2.3" 599version = "0.2.3"
409source = "registry+https://github.com/rust-lang/crates.io-index" 600source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -413,6 +604,18 @@ dependencies = [
413] 604]
414 605
415[[package]] 606[[package]]
607name = "rustversion"
608version = "1.0.22"
609source = "registry+https://github.com/rust-lang/crates.io-index"
610checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
611
612[[package]]
613name = "scoped-tls"
614version = "1.0.1"
615source = "registry+https://github.com/rust-lang/crates.io-index"
616checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
617
618[[package]]
416name = "semver" 619name = "semver"
417version = "0.9.0" 620version = "0.9.0"
418source = "registry+https://github.com/rust-lang/crates.io-index" 621source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -428,6 +631,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
428checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 631checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
429 632
430[[package]] 633[[package]]
634name = "sharded-slab"
635version = "0.1.7"
636source = "registry+https://github.com/rust-lang/crates.io-index"
637checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
638dependencies = [
639 "lazy_static",
640]
641
642[[package]]
643name = "shlex"
644version = "1.3.0"
645source = "registry+https://github.com/rust-lang/crates.io-index"
646checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
647
648[[package]]
649name = "smallvec"
650version = "1.15.1"
651source = "registry+https://github.com/rust-lang/crates.io-index"
652checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
653
654[[package]]
431name = "stable_deref_trait" 655name = "stable_deref_trait"
432version = "1.2.1" 656version = "1.2.1"
433source = "registry+https://github.com/rust-lang/crates.io-index" 657source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -465,12 +689,88 @@ dependencies = [
465] 689]
466 690
467[[package]] 691[[package]]
692name = "thread_local"
693version = "1.1.9"
694source = "registry+https://github.com/rust-lang/crates.io-index"
695checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185"
696dependencies = [
697 "cfg-if",
698]
699
700[[package]]
701name = "tracing"
702version = "0.1.41"
703source = "registry+https://github.com/rust-lang/crates.io-index"
704checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
705dependencies = [
706 "pin-project-lite",
707 "tracing-attributes",
708 "tracing-core",
709]
710
711[[package]]
712name = "tracing-attributes"
713version = "0.1.30"
714source = "registry+https://github.com/rust-lang/crates.io-index"
715checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
716dependencies = [
717 "proc-macro2",
718 "quote",
719 "syn",
720]
721
722[[package]]
723name = "tracing-core"
724version = "0.1.34"
725source = "registry+https://github.com/rust-lang/crates.io-index"
726checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
727dependencies = [
728 "once_cell",
729 "valuable",
730]
731
732[[package]]
733name = "tracing-log"
734version = "0.2.0"
735source = "registry+https://github.com/rust-lang/crates.io-index"
736checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
737dependencies = [
738 "log",
739 "once_cell",
740 "tracing-core",
741]
742
743[[package]]
744name = "tracing-subscriber"
745version = "0.3.20"
746source = "registry+https://github.com/rust-lang/crates.io-index"
747checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
748dependencies = [
749 "matchers",
750 "nu-ansi-term",
751 "once_cell",
752 "regex-automata",
753 "sharded-slab",
754 "smallvec",
755 "thread_local",
756 "tracing",
757 "tracing-core",
758 "tracing-log",
759]
760
761[[package]]
468name = "unicode-ident" 762name = "unicode-ident"
469version = "1.0.22" 763version = "1.0.22"
470source = "registry+https://github.com/rust-lang/crates.io-index" 764source = "registry+https://github.com/rust-lang/crates.io-index"
471checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" 765checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
472 766
473[[package]] 767[[package]]
768name = "valuable"
769version = "0.1.1"
770source = "registry+https://github.com/rust-lang/crates.io-index"
771checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
772
773[[package]]
474name = "vcell" 774name = "vcell"
475version = "0.1.3" 775version = "0.1.3"
476source = "registry+https://github.com/rust-lang/crates.io-index" 776source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -490,3 +790,129 @@ checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc"
490dependencies = [ 790dependencies = [
491 "vcell", 791 "vcell",
492] 792]
793
794[[package]]
795name = "windows"
796version = "0.61.3"
797source = "registry+https://github.com/rust-lang/crates.io-index"
798checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
799dependencies = [
800 "windows-collections",
801 "windows-core",
802 "windows-future",
803 "windows-link 0.1.3",
804 "windows-numerics",
805]
806
807[[package]]
808name = "windows-collections"
809version = "0.2.0"
810source = "registry+https://github.com/rust-lang/crates.io-index"
811checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
812dependencies = [
813 "windows-core",
814]
815
816[[package]]
817name = "windows-core"
818version = "0.61.2"
819source = "registry+https://github.com/rust-lang/crates.io-index"
820checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
821dependencies = [
822 "windows-implement",
823 "windows-interface",
824 "windows-link 0.1.3",
825 "windows-result",
826 "windows-strings",
827]
828
829[[package]]
830name = "windows-future"
831version = "0.2.1"
832source = "registry+https://github.com/rust-lang/crates.io-index"
833checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
834dependencies = [
835 "windows-core",
836 "windows-link 0.1.3",
837 "windows-threading",
838]
839
840[[package]]
841name = "windows-implement"
842version = "0.60.2"
843source = "registry+https://github.com/rust-lang/crates.io-index"
844checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
845dependencies = [
846 "proc-macro2",
847 "quote",
848 "syn",
849]
850
851[[package]]
852name = "windows-interface"
853version = "0.59.3"
854source = "registry+https://github.com/rust-lang/crates.io-index"
855checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
856dependencies = [
857 "proc-macro2",
858 "quote",
859 "syn",
860]
861
862[[package]]
863name = "windows-link"
864version = "0.1.3"
865source = "registry+https://github.com/rust-lang/crates.io-index"
866checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
867
868[[package]]
869name = "windows-link"
870version = "0.2.1"
871source = "registry+https://github.com/rust-lang/crates.io-index"
872checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
873
874[[package]]
875name = "windows-numerics"
876version = "0.2.0"
877source = "registry+https://github.com/rust-lang/crates.io-index"
878checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
879dependencies = [
880 "windows-core",
881 "windows-link 0.1.3",
882]
883
884[[package]]
885name = "windows-result"
886version = "0.3.4"
887source = "registry+https://github.com/rust-lang/crates.io-index"
888checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
889dependencies = [
890 "windows-link 0.1.3",
891]
892
893[[package]]
894name = "windows-strings"
895version = "0.4.2"
896source = "registry+https://github.com/rust-lang/crates.io-index"
897checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
898dependencies = [
899 "windows-link 0.1.3",
900]
901
902[[package]]
903name = "windows-sys"
904version = "0.61.2"
905source = "registry+https://github.com/rust-lang/crates.io-index"
906checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
907dependencies = [
908 "windows-link 0.2.1",
909]
910
911[[package]]
912name = "windows-threading"
913version = "0.1.0"
914source = "registry+https://github.com/rust-lang/crates.io-index"
915checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
916dependencies = [
917 "windows-link 0.1.3",
918]
diff --git a/Cargo.toml b/Cargo.toml
index cda340d02..96b7d6b0f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,8 @@ categories = ["embedded", "hardware-support", "no-std"]
9 9
10[dependencies] 10[dependencies]
11cortex-m = { version = "0.7", features = ["critical-section-single-core"] } 11cortex-m = { version = "0.7", features = ["critical-section-single-core"] }
12cortex-m-rt = { version = "0.7" } 12# If you would like "device" to be an optional feature, please open an issue.
13cortex-m-rt = { version = "0.7", features = ["device"] }
13critical-section = "1.2.0" 14critical-section = "1.2.0"
14defmt = { version = "1.0", optional = true } 15defmt = { version = "1.0", optional = true }
15embassy-embedded-hal = "0.5.0" 16embassy-embedded-hal = "0.5.0"
@@ -25,6 +26,7 @@ heapless = "0.8"
25mcxa-pac = { git = "https://github.com/OpenDevicePartnership/mcxa-pac", features = ["rt", "critical-section"], version = "0.1.0" } 26mcxa-pac = { git = "https://github.com/OpenDevicePartnership/mcxa-pac", features = ["rt", "critical-section"], version = "0.1.0" }
26nb = "1.1.0" 27nb = "1.1.0"
27paste = "1.0.15" 28paste = "1.0.15"
29maitake-sync = { version = "0.2.2", default-features = false, features = ["critical-section", "no-cache-pad"] }
28 30
29# `time` dependencies 31# `time` dependencies
30embassy-time = { version = "0.5.0", optional = true } 32embassy-time = { version = "0.5.0", optional = true }
@@ -37,8 +39,6 @@ default = []
37# Use with one logger feature: defmt-rtt (preferred) or defmt-uart (fallback) 39# Use with one logger feature: defmt-rtt (preferred) or defmt-uart (fallback)
38defmt = ["dep:defmt", "mcxa-pac/defmt"] 40defmt = ["dep:defmt", "mcxa-pac/defmt"]
39 41
40rt = ["cortex-m-rt/device"]
41
42unstable-pac = [] 42unstable-pac = []
43 43
44# Embassy time 44# Embassy time
diff --git a/examples/Cargo.lock b/examples/Cargo.lock
index cda1f9ec8..c6e864df2 100644
--- a/examples/Cargo.lock
+++ b/examples/Cargo.lock
@@ -3,6 +3,15 @@
3version = 4 3version = 4
4 4
5[[package]] 5[[package]]
6name = "aho-corasick"
7version = "1.1.4"
8source = "registry+https://github.com/rust-lang/crates.io-index"
9checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
10dependencies = [
11 "memchr",
12]
13
14[[package]]
6name = "anyhow" 15name = "anyhow"
7version = "1.0.100" 16version = "1.0.100"
8source = "registry+https://github.com/rust-lang/crates.io-index" 17source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -97,6 +106,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
97checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 106checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
98 107
99[[package]] 108[[package]]
109name = "cc"
110version = "1.2.47"
111source = "registry+https://github.com/rust-lang/crates.io-index"
112checksum = "cd405d82c84ff7f35739f175f67d8b9fb7687a0e84ccdc78bd3568839827cf07"
113dependencies = [
114 "find-msvc-tools",
115 "shlex",
116]
117
118[[package]]
100name = "cfg-if" 119name = "cfg-if"
101version = "1.0.4" 120version = "1.0.4"
102source = "registry+https://github.com/rust-lang/crates.io-index" 121source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -112,6 +131,16 @@ dependencies = [
112] 131]
113 132
114[[package]] 133[[package]]
134name = "cordyceps"
135version = "0.3.4"
136source = "registry+https://github.com/rust-lang/crates.io-index"
137checksum = "688d7fbb8092b8de775ef2536f36c8c31f2bc4006ece2e8d8ad2d17d00ce0a2a"
138dependencies = [
139 "loom",
140 "tracing",
141]
142
143[[package]]
115name = "cortex-m" 144name = "cortex-m"
116version = "0.7.7" 145version = "0.7.7"
117source = "registry+https://github.com/rust-lang/crates.io-index" 146source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -376,6 +405,7 @@ dependencies = [
376 "embedded-io", 405 "embedded-io",
377 "embedded-io-async", 406 "embedded-io-async",
378 "heapless 0.8.0", 407 "heapless 0.8.0",
408 "maitake-sync",
379 "mcxa-pac", 409 "mcxa-pac",
380 "nb 1.1.0", 410 "nb 1.1.0",
381 "paste", 411 "paste",
@@ -513,6 +543,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
513checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 543checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
514 544
515[[package]] 545[[package]]
546name = "find-msvc-tools"
547version = "0.1.5"
548source = "registry+https://github.com/rust-lang/crates.io-index"
549checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"
550
551[[package]]
516name = "fnv" 552name = "fnv"
517version = "1.0.7" 553version = "1.0.7"
518source = "registry+https://github.com/rust-lang/crates.io-index" 554source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -537,6 +573,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
537checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 573checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
538 574
539[[package]] 575[[package]]
576name = "generator"
577version = "0.8.7"
578source = "registry+https://github.com/rust-lang/crates.io-index"
579checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2"
580dependencies = [
581 "cc",
582 "cfg-if",
583 "libc",
584 "log",
585 "rustversion",
586 "windows",
587]
588
589[[package]]
540name = "hash32" 590name = "hash32"
541version = "0.3.1" 591version = "0.3.1"
542source = "registry+https://github.com/rust-lang/crates.io-index" 592source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -614,12 +664,59 @@ dependencies = [
614] 664]
615 665
616[[package]] 666[[package]]
667name = "lazy_static"
668version = "1.5.0"
669source = "registry+https://github.com/rust-lang/crates.io-index"
670checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
671
672[[package]]
673name = "libc"
674version = "0.2.177"
675source = "registry+https://github.com/rust-lang/crates.io-index"
676checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
677
678[[package]]
617name = "litrs" 679name = "litrs"
618version = "1.0.0" 680version = "1.0.0"
619source = "registry+https://github.com/rust-lang/crates.io-index" 681source = "registry+https://github.com/rust-lang/crates.io-index"
620checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" 682checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"
621 683
622[[package]] 684[[package]]
685name = "log"
686version = "0.4.28"
687source = "registry+https://github.com/rust-lang/crates.io-index"
688checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
689
690[[package]]
691name = "loom"
692version = "0.7.2"
693source = "registry+https://github.com/rust-lang/crates.io-index"
694checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca"
695dependencies = [
696 "cfg-if",
697 "generator",
698 "scoped-tls",
699 "tracing",
700 "tracing-subscriber",
701]
702
703[[package]]
704name = "maitake-sync"
705version = "0.2.2"
706source = "registry+https://github.com/rust-lang/crates.io-index"
707checksum = "748f86d9befd480b602c3bebc9ef30dbf2f3dfc8acc4a73d07b90f0117e6de3f"
708dependencies = [
709 "cordyceps",
710 "critical-section",
711 "loom",
712 "mutex-traits",
713 "mycelium-bitfield",
714 "pin-project",
715 "portable-atomic",
716 "tracing",
717]
718
719[[package]]
623name = "manyhow" 720name = "manyhow"
624version = "0.11.4" 721version = "0.11.4"
625source = "registry+https://github.com/rust-lang/crates.io-index" 722source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -644,6 +741,15 @@ dependencies = [
644] 741]
645 742
646[[package]] 743[[package]]
744name = "matchers"
745version = "0.2.0"
746source = "registry+https://github.com/rust-lang/crates.io-index"
747checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
748dependencies = [
749 "regex-automata",
750]
751
752[[package]]
647name = "maybe-async-cfg" 753name = "maybe-async-cfg"
648version = "0.2.5" 754version = "0.2.5"
649source = "registry+https://github.com/rust-lang/crates.io-index" 755source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -685,6 +791,18 @@ dependencies = [
685] 791]
686 792
687[[package]] 793[[package]]
794name = "mutex-traits"
795version = "1.0.1"
796source = "registry+https://github.com/rust-lang/crates.io-index"
797checksum = "3929f2b5633d29cf7b6624992e5f3c1e9334f1193423e12d17be4faf678cde3f"
798
799[[package]]
800name = "mycelium-bitfield"
801version = "0.1.5"
802source = "registry+https://github.com/rust-lang/crates.io-index"
803checksum = "24e0cc5e2c585acbd15c5ce911dff71e1f4d5313f43345873311c4f5efd741cc"
804
805[[package]]
688name = "nb" 806name = "nb"
689version = "0.1.3" 807version = "0.1.3"
690source = "registry+https://github.com/rust-lang/crates.io-index" 808source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -700,6 +818,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
700checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" 818checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d"
701 819
702[[package]] 820[[package]]
821name = "nu-ansi-term"
822version = "0.50.3"
823source = "registry+https://github.com/rust-lang/crates.io-index"
824checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
825dependencies = [
826 "windows-sys",
827]
828
829[[package]]
703name = "num" 830name = "num"
704version = "0.4.3" 831version = "0.4.3"
705source = "registry+https://github.com/rust-lang/crates.io-index" 832source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -773,6 +900,12 @@ dependencies = [
773] 900]
774 901
775[[package]] 902[[package]]
903name = "once_cell"
904version = "1.21.3"
905source = "registry+https://github.com/rust-lang/crates.io-index"
906checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
907
908[[package]]
776name = "panic-probe" 909name = "panic-probe"
777version = "1.0.0" 910version = "1.0.0"
778source = "registry+https://github.com/rust-lang/crates.io-index" 911source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -795,6 +928,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
795checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" 928checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
796 929
797[[package]] 930[[package]]
931name = "pin-project"
932version = "1.1.10"
933source = "registry+https://github.com/rust-lang/crates.io-index"
934checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a"
935dependencies = [
936 "pin-project-internal",
937]
938
939[[package]]
940name = "pin-project-internal"
941version = "1.1.10"
942source = "registry+https://github.com/rust-lang/crates.io-index"
943checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
944dependencies = [
945 "proc-macro2",
946 "quote",
947 "syn 2.0.110",
948]
949
950[[package]]
951name = "pin-project-lite"
952version = "0.2.16"
953source = "registry+https://github.com/rust-lang/crates.io-index"
954checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
955
956[[package]]
957name = "portable-atomic"
958version = "1.11.1"
959source = "registry+https://github.com/rust-lang/crates.io-index"
960checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
961dependencies = [
962 "critical-section",
963]
964
965[[package]]
798name = "proc-macro-error-attr2" 966name = "proc-macro-error-attr2"
799version = "2.0.0" 967version = "2.0.0"
800source = "registry+https://github.com/rust-lang/crates.io-index" 968source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -863,6 +1031,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
863checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 1031checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
864 1032
865[[package]] 1033[[package]]
1034name = "regex-automata"
1035version = "0.4.13"
1036source = "registry+https://github.com/rust-lang/crates.io-index"
1037checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
1038dependencies = [
1039 "aho-corasick",
1040 "memchr",
1041 "regex-syntax",
1042]
1043
1044[[package]]
1045name = "regex-syntax"
1046version = "0.8.8"
1047source = "registry+https://github.com/rust-lang/crates.io-index"
1048checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
1049
1050[[package]]
866name = "rustc-hash" 1051name = "rustc-hash"
867version = "2.1.1" 1052version = "2.1.1"
868source = "registry+https://github.com/rust-lang/crates.io-index" 1053source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -878,12 +1063,24 @@ dependencies = [
878] 1063]
879 1064
880[[package]] 1065[[package]]
1066name = "rustversion"
1067version = "1.0.22"
1068source = "registry+https://github.com/rust-lang/crates.io-index"
1069checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
1070
1071[[package]]
881name = "ryu" 1072name = "ryu"
882version = "1.0.20" 1073version = "1.0.20"
883source = "registry+https://github.com/rust-lang/crates.io-index" 1074source = "registry+https://github.com/rust-lang/crates.io-index"
884checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 1075checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
885 1076
886[[package]] 1077[[package]]
1078name = "scoped-tls"
1079version = "1.0.1"
1080source = "registry+https://github.com/rust-lang/crates.io-index"
1081checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
1082
1083[[package]]
887name = "semver" 1084name = "semver"
888version = "0.9.0" 1085version = "0.9.0"
889source = "registry+https://github.com/rust-lang/crates.io-index" 1086source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -950,6 +1147,21 @@ dependencies = [
950] 1147]
951 1148
952[[package]] 1149[[package]]
1150name = "sharded-slab"
1151version = "0.1.7"
1152source = "registry+https://github.com/rust-lang/crates.io-index"
1153checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
1154dependencies = [
1155 "lazy_static",
1156]
1157
1158[[package]]
1159name = "shlex"
1160version = "1.3.0"
1161source = "registry+https://github.com/rust-lang/crates.io-index"
1162checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
1163
1164[[package]]
953name = "smallvec" 1165name = "smallvec"
954version = "1.15.1" 1166version = "1.15.1"
955source = "registry+https://github.com/rust-lang/crates.io-index" 1167source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1016,6 +1228,15 @@ dependencies = [
1016] 1228]
1017 1229
1018[[package]] 1230[[package]]
1231name = "thread_local"
1232version = "1.1.9"
1233source = "registry+https://github.com/rust-lang/crates.io-index"
1234checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185"
1235dependencies = [
1236 "cfg-if",
1237]
1238
1239[[package]]
1019name = "tmp108" 1240name = "tmp108"
1020version = "0.4.0" 1241version = "0.4.0"
1021source = "registry+https://github.com/rust-lang/crates.io-index" 1242source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1069,6 +1290,67 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1069checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" 1290checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
1070 1291
1071[[package]] 1292[[package]]
1293name = "tracing"
1294version = "0.1.42"
1295source = "registry+https://github.com/rust-lang/crates.io-index"
1296checksum = "8eb41cbdb933e23b7929f47bb577710643157d7602ef3a2ebd3902b13ac5eda6"
1297dependencies = [
1298 "pin-project-lite",
1299 "tracing-attributes",
1300 "tracing-core",
1301]
1302
1303[[package]]
1304name = "tracing-attributes"
1305version = "0.1.31"
1306source = "registry+https://github.com/rust-lang/crates.io-index"
1307checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
1308dependencies = [
1309 "proc-macro2",
1310 "quote",
1311 "syn 2.0.110",
1312]
1313
1314[[package]]
1315name = "tracing-core"
1316version = "0.1.35"
1317source = "registry+https://github.com/rust-lang/crates.io-index"
1318checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c"
1319dependencies = [
1320 "once_cell",
1321 "valuable",
1322]
1323
1324[[package]]
1325name = "tracing-log"
1326version = "0.2.0"
1327source = "registry+https://github.com/rust-lang/crates.io-index"
1328checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
1329dependencies = [
1330 "log",
1331 "once_cell",
1332 "tracing-core",
1333]
1334
1335[[package]]
1336name = "tracing-subscriber"
1337version = "0.3.20"
1338source = "registry+https://github.com/rust-lang/crates.io-index"
1339checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
1340dependencies = [
1341 "matchers",
1342 "nu-ansi-term",
1343 "once_cell",
1344 "regex-automata",
1345 "sharded-slab",
1346 "smallvec",
1347 "thread_local",
1348 "tracing",
1349 "tracing-core",
1350 "tracing-log",
1351]
1352
1353[[package]]
1072name = "unicase" 1354name = "unicase"
1073version = "2.8.1" 1355version = "2.8.1"
1074source = "registry+https://github.com/rust-lang/crates.io-index" 1356source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1093,6 +1375,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1093checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" 1375checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
1094 1376
1095[[package]] 1377[[package]]
1378name = "valuable"
1379version = "0.1.1"
1380source = "registry+https://github.com/rust-lang/crates.io-index"
1381checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
1382
1383[[package]]
1096name = "vcell" 1384name = "vcell"
1097version = "0.1.3" 1385version = "0.1.3"
1098source = "registry+https://github.com/rust-lang/crates.io-index" 1386source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1114,6 +1402,132 @@ dependencies = [
1114] 1402]
1115 1403
1116[[package]] 1404[[package]]
1405name = "windows"
1406version = "0.61.3"
1407source = "registry+https://github.com/rust-lang/crates.io-index"
1408checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
1409dependencies = [
1410 "windows-collections",
1411 "windows-core",
1412 "windows-future",
1413 "windows-link 0.1.3",
1414 "windows-numerics",
1415]
1416
1417[[package]]
1418name = "windows-collections"
1419version = "0.2.0"
1420source = "registry+https://github.com/rust-lang/crates.io-index"
1421checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
1422dependencies = [
1423 "windows-core",
1424]
1425
1426[[package]]
1427name = "windows-core"
1428version = "0.61.2"
1429source = "registry+https://github.com/rust-lang/crates.io-index"
1430checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
1431dependencies = [
1432 "windows-implement",
1433 "windows-interface",
1434 "windows-link 0.1.3",
1435 "windows-result",
1436 "windows-strings",
1437]
1438
1439[[package]]
1440name = "windows-future"
1441version = "0.2.1"
1442source = "registry+https://github.com/rust-lang/crates.io-index"
1443checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
1444dependencies = [
1445 "windows-core",
1446 "windows-link 0.1.3",
1447 "windows-threading",
1448]
1449
1450[[package]]
1451name = "windows-implement"
1452version = "0.60.2"
1453source = "registry+https://github.com/rust-lang/crates.io-index"
1454checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
1455dependencies = [
1456 "proc-macro2",
1457 "quote",
1458 "syn 2.0.110",
1459]
1460
1461[[package]]
1462name = "windows-interface"
1463version = "0.59.3"
1464source = "registry+https://github.com/rust-lang/crates.io-index"
1465checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
1466dependencies = [
1467 "proc-macro2",
1468 "quote",
1469 "syn 2.0.110",
1470]
1471
1472[[package]]
1473name = "windows-link"
1474version = "0.1.3"
1475source = "registry+https://github.com/rust-lang/crates.io-index"
1476checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
1477
1478[[package]]
1479name = "windows-link"
1480version = "0.2.1"
1481source = "registry+https://github.com/rust-lang/crates.io-index"
1482checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
1483
1484[[package]]
1485name = "windows-numerics"
1486version = "0.2.0"
1487source = "registry+https://github.com/rust-lang/crates.io-index"
1488checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
1489dependencies = [
1490 "windows-core",
1491 "windows-link 0.1.3",
1492]
1493
1494[[package]]
1495name = "windows-result"
1496version = "0.3.4"
1497source = "registry+https://github.com/rust-lang/crates.io-index"
1498checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
1499dependencies = [
1500 "windows-link 0.1.3",
1501]
1502
1503[[package]]
1504name = "windows-strings"
1505version = "0.4.2"
1506source = "registry+https://github.com/rust-lang/crates.io-index"
1507checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
1508dependencies = [
1509 "windows-link 0.1.3",
1510]
1511
1512[[package]]
1513name = "windows-sys"
1514version = "0.61.2"
1515source = "registry+https://github.com/rust-lang/crates.io-index"
1516checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
1517dependencies = [
1518 "windows-link 0.2.1",
1519]
1520
1521[[package]]
1522name = "windows-threading"
1523version = "0.1.0"
1524source = "registry+https://github.com/rust-lang/crates.io-index"
1525checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
1526dependencies = [
1527 "windows-link 0.1.3",
1528]
1529
1530[[package]]
1117name = "winnow" 1531name = "winnow"
1118version = "0.6.24" 1532version = "0.6.24"
1119source = "registry+https://github.com/rust-lang/crates.io-index" 1533source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/examples/Cargo.toml b/examples/Cargo.toml
index 1022e91df..a1092c416 100644
--- a/examples/Cargo.toml
+++ b/examples/Cargo.toml
@@ -12,7 +12,7 @@ defmt = "1.0"
12defmt-rtt = "1.0" 12defmt-rtt = "1.0"
13embassy-embedded-hal = "0.5.0" 13embassy-embedded-hal = "0.5.0"
14embassy-executor = { version = "0.9.0", features = ["arch-cortex-m", "executor-interrupt", "executor-thread"], default-features = false } 14embassy-executor = { version = "0.9.0", features = ["arch-cortex-m", "executor-interrupt", "executor-thread"], default-features = false }
15embassy-mcxa = { path = "../", features = ["defmt", "rt", "unstable-pac", "time"] } 15embassy-mcxa = { path = "../", features = ["defmt", "unstable-pac", "time"] }
16embassy-sync = "0.7.2" 16embassy-sync = "0.7.2"
17embassy-time = "0.5.0" 17embassy-time = "0.5.0"
18embassy-time-driver = "0.2.1" 18embassy-time-driver = "0.2.1"
diff --git a/examples/src/bin/button_async.rs b/examples/src/bin/button_async.rs
new file mode 100644
index 000000000..1ecec2e48
--- /dev/null
+++ b/examples/src/bin/button_async.rs
@@ -0,0 +1,28 @@
1#![no_std]
2#![no_main]
3
4use embassy_executor::Spawner;
5use embassy_time::Timer;
6use hal::gpio::{DriveStrength, Input, Pull, SlewRate};
7use {defmt_rtt as _, embassy_mcxa as hal, panic_probe as _};
8
9#[embassy_executor::main]
10async fn main(_spawner: Spawner) {
11 let p = hal::init(hal::config::Config::default());
12
13 defmt::info!("GPIO interrupt example");
14
15 // This button is labeled "WAKEUP" on the FRDM-MCXA276
16 let mut pin = Input::new(p.P1_7, Pull::Up, DriveStrength::Normal, SlewRate::Fast);
17
18 let mut press_count = 0u32;
19
20 loop {
21 pin.wait_for_falling_edge().await;
22
23 press_count += 1;
24
25 defmt::info!("Button pressed! Count: {}", press_count);
26 Timer::after_millis(50).await;
27 }
28}
diff --git a/src/config.rs b/src/config.rs
index 9c0d47ecb..8d52a1d44 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -9,6 +9,7 @@ pub struct Config {
9 pub time_interrupt_priority: Priority, 9 pub time_interrupt_priority: Priority,
10 pub rtc_interrupt_priority: Priority, 10 pub rtc_interrupt_priority: Priority,
11 pub adc_interrupt_priority: Priority, 11 pub adc_interrupt_priority: Priority,
12 pub gpio_interrupt_priority: Priority,
12 pub clock_cfg: ClocksConfig, 13 pub clock_cfg: ClocksConfig,
13} 14}
14 15
@@ -19,6 +20,7 @@ impl Default for Config {
19 time_interrupt_priority: Priority::from(0), 20 time_interrupt_priority: Priority::from(0),
20 rtc_interrupt_priority: Priority::from(0), 21 rtc_interrupt_priority: Priority::from(0),
21 adc_interrupt_priority: Priority::from(0), 22 adc_interrupt_priority: Priority::from(0),
23 gpio_interrupt_priority: Priority::from(0),
22 clock_cfg: ClocksConfig::default(), 24 clock_cfg: ClocksConfig::default(),
23 } 25 }
24 } 26 }
diff --git a/src/gpio.rs b/src/gpio.rs
index 4f79aff93..332c4c8b2 100644
--- a/src/gpio.rs
+++ b/src/gpio.rs
@@ -3,13 +3,96 @@
3//! concrete pin type. 3//! concrete pin type.
4 4
5use core::convert::Infallible; 5use core::convert::Infallible;
6use core::future::Future;
6use core::marker::PhantomData; 7use core::marker::PhantomData;
8use core::pin::pin;
7 9
8use embassy_hal_internal::{Peri, PeripheralType}; 10use embassy_hal_internal::{Peri, PeripheralType};
11use maitake_sync::WaitMap;
9use paste::paste; 12use paste::paste;
10 13
14use crate::pac::interrupt;
11use crate::pac::port0::pcr0::{Dse, Inv, Mux, Pe, Ps, Sre}; 15use crate::pac::port0::pcr0::{Dse, Inv, Mux, Pe, Ps, Sre};
12 16
17struct BitIter(u32);
18
19impl Iterator for BitIter {
20 type Item = usize;
21
22 fn next(&mut self) -> Option<Self::Item> {
23 match self.0.trailing_zeros() {
24 32 => None,
25 b => {
26 self.0 &= !(1 << b);
27 Some(b as usize)
28 }
29 }
30 }
31}
32
33const PORT_COUNT: usize = 5;
34
35static PORT_WAIT_MAPS: [WaitMap<usize, ()>; PORT_COUNT] = [
36 WaitMap::new(),
37 WaitMap::new(),
38 WaitMap::new(),
39 WaitMap::new(),
40 WaitMap::new(),
41];
42
43fn irq_handler(port_index: usize, gpio_base: *const crate::pac::gpio0::RegisterBlock) {
44 let gpio = unsafe { &*gpio_base };
45 let isfr = gpio.isfr0().read().bits();
46
47 for pin in BitIter(isfr) {
48 // Clear all pending interrupts
49 gpio.isfr0().write(|w| unsafe { w.bits(1 << pin) });
50 gpio.icr(pin).modify(|_, w| w.irqc().irqc0()); // Disable interrupt
51
52 // Wake the corresponding port waker
53 if let Some(w) = PORT_WAIT_MAPS.get(port_index) {
54 w.wake(&pin, ());
55 }
56 }
57}
58
59#[interrupt]
60fn GPIO0() {
61 irq_handler(0, crate::pac::Gpio0::ptr());
62}
63
64#[interrupt]
65fn GPIO1() {
66 irq_handler(1, crate::pac::Gpio1::ptr());
67}
68
69#[interrupt]
70fn GPIO2() {
71 irq_handler(2, crate::pac::Gpio2::ptr());
72}
73
74#[interrupt]
75fn GPIO3() {
76 irq_handler(3, crate::pac::Gpio3::ptr());
77}
78
79#[interrupt]
80fn GPIO4() {
81 irq_handler(4, crate::pac::Gpio4::ptr());
82}
83
84pub(crate) unsafe fn init() {
85 use embassy_hal_internal::interrupt::InterruptExt;
86
87 crate::pac::interrupt::GPIO0.enable();
88 crate::pac::interrupt::GPIO1.enable();
89 crate::pac::interrupt::GPIO2.enable();
90 crate::pac::interrupt::GPIO3.enable();
91 crate::pac::interrupt::GPIO4.enable();
92
93 cortex_m::interrupt::enable();
94}
95
13/// Logical level for GPIO pins. 96/// Logical level for GPIO pins.
14#[derive(Copy, Clone, Eq, PartialEq, Debug)] 97#[derive(Copy, Clone, Eq, PartialEq, Debug)]
15#[cfg_attr(feature = "defmt", derive(defmt::Format))] 98#[cfg_attr(feature = "defmt", derive(defmt::Format))]
@@ -598,6 +681,77 @@ impl<'d> Flex<'d> {
598 } 681 }
599} 682}
600 683
684/// Async methods
685impl<'d> Flex<'d> {
686 /// Helper function that waits for a given interrupt trigger
687 async fn wait_for_inner(&mut self, level: crate::pac::gpio0::icr::Irqc) {
688 // First, ensure that we have a waker that is ready for this port+pin
689 let w = PORT_WAIT_MAPS[self.pin.port].wait(self.pin.pin);
690 let mut w = pin!(w);
691 // Wait for the subscription to occur, which requires polling at least once
692 //
693 // This function returns a result, but can only be an Err if:
694 //
695 // * We call `.close()` on a WaitMap, which we never do
696 // * We have a duplicate key, which can't happen because `wait_for_*` methods
697 // take an &mut ref of their unique port+pin combo
698 //
699 // So we wait for it to complete, but ignore the result.
700 _ = w.as_mut().subscribe().await;
701
702 // Now that our waker is in the map, we can enable the appropriate interrupt
703 //
704 // Clear any existing pending interrupt on this pin
705 self.pin
706 .gpio()
707 .isfr0()
708 .write(|w| unsafe { w.bits(1 << self.pin.pin()) });
709 self.pin.gpio().icr(self.pin.pin()).write(|w| w.isf().isf1());
710
711 // Pin interrupt configuration
712 self.pin
713 .gpio()
714 .icr(self.pin.pin())
715 .modify(|_, w| w.irqc().variant(level));
716
717 // Finally, we can await the matching call to `.wake()` from the interrupt.
718 //
719 // Again, technically, this could return a result, but for the same reasons
720 // as above, this can't be an error in our case, so just wait for it to complete
721 _ = w.await;
722 }
723
724 /// Wait until the pin is high. If it is already high, return immediately.
725 #[inline]
726 pub fn wait_for_high(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
727 self.wait_for_inner(crate::pac::gpio0::icr::Irqc::Irqc12)
728 }
729
730 /// Wait until the pin is low. If it is already low, return immediately.
731 #[inline]
732 pub fn wait_for_low(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
733 self.wait_for_inner(crate::pac::gpio0::icr::Irqc::Irqc8)
734 }
735
736 /// Wait for the pin to undergo a transition from low to high.
737 #[inline]
738 pub fn wait_for_rising_edge(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
739 self.wait_for_inner(crate::pac::gpio0::icr::Irqc::Irqc9)
740 }
741
742 /// Wait for the pin to undergo a transition from high to low.
743 #[inline]
744 pub fn wait_for_falling_edge(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
745 self.wait_for_inner(crate::pac::gpio0::icr::Irqc::Irqc10)
746 }
747
748 /// Wait for the pin to undergo any transition, i.e low to high OR high to low.
749 #[inline]
750 pub fn wait_for_any_edge(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
751 self.wait_for_inner(crate::pac::gpio0::icr::Irqc::Irqc11)
752 }
753}
754
601/// GPIO output driver that owns a `Flex` pin. 755/// GPIO output driver that owns a `Flex` pin.
602pub struct Output<'d> { 756pub struct Output<'d> {
603 flex: Flex<'d>, 757 flex: Flex<'d>,
@@ -691,12 +845,99 @@ impl<'d> Input<'d> {
691 self.flex 845 self.flex
692 } 846 }
693 847
694 // Get the pin level. 848 /// Get the pin level.
695 pub fn get_level(&self) -> Level { 849 pub fn get_level(&self) -> Level {
696 self.flex.get_level() 850 self.flex.get_level()
697 } 851 }
698} 852}
699 853
854/// Async methods
855impl<'d> Input<'d> {
856 /// Wait until the pin is high. If it is already high, return immediately.
857 #[inline]
858 pub fn wait_for_high(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
859 self.flex.wait_for_high()
860 }
861
862 /// Wait until the pin is low. If it is already low, return immediately.
863 #[inline]
864 pub fn wait_for_low(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
865 self.flex.wait_for_low()
866 }
867
868 /// Wait for the pin to undergo a transition from low to high.
869 #[inline]
870 pub fn wait_for_rising_edge(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
871 self.flex.wait_for_rising_edge()
872 }
873
874 /// Wait for the pin to undergo a transition from high to low.
875 #[inline]
876 pub fn wait_for_falling_edge(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
877 self.flex.wait_for_falling_edge()
878 }
879
880 /// Wait for the pin to undergo any transition, i.e low to high OR high to low.
881 #[inline]
882 pub fn wait_for_any_edge(&mut self) -> impl Future<Output = ()> + use<'_, 'd> {
883 self.flex.wait_for_any_edge()
884 }
885}
886
887impl embedded_hal_async::digital::Wait for Input<'_> {
888 async fn wait_for_high(&mut self) -> Result<(), Self::Error> {
889 self.wait_for_high().await;
890 Ok(())
891 }
892
893 async fn wait_for_low(&mut self) -> Result<(), Self::Error> {
894 self.wait_for_low().await;
895 Ok(())
896 }
897
898 async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> {
899 self.wait_for_rising_edge().await;
900 Ok(())
901 }
902
903 async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> {
904 self.wait_for_falling_edge().await;
905 Ok(())
906 }
907
908 async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> {
909 self.wait_for_any_edge().await;
910 Ok(())
911 }
912}
913
914impl embedded_hal_async::digital::Wait for Flex<'_> {
915 async fn wait_for_high(&mut self) -> Result<(), Self::Error> {
916 self.wait_for_high().await;
917 Ok(())
918 }
919
920 async fn wait_for_low(&mut self) -> Result<(), Self::Error> {
921 self.wait_for_low().await;
922 Ok(())
923 }
924
925 async fn wait_for_rising_edge(&mut self) -> Result<(), Self::Error> {
926 self.wait_for_rising_edge().await;
927 Ok(())
928 }
929
930 async fn wait_for_falling_edge(&mut self) -> Result<(), Self::Error> {
931 self.wait_for_falling_edge().await;
932 Ok(())
933 }
934
935 async fn wait_for_any_edge(&mut self) -> Result<(), Self::Error> {
936 self.wait_for_any_edge().await;
937 Ok(())
938 }
939}
940
700// Both embedded_hal 0.2 and 1.0 must be supported by embassy HALs. 941// Both embedded_hal 0.2 and 1.0 must be supported by embassy HALs.
701impl embedded_hal_02::digital::v2::InputPin for Flex<'_> { 942impl embedded_hal_02::digital::v2::InputPin for Flex<'_> {
702 // GPIO operations on this block cannot fail, therefor we set the error type 943 // GPIO operations on this block cannot fail, therefor we set the error type
diff --git a/src/interrupt.rs b/src/interrupt.rs
index f2f1cccac..0490e3a66 100644
--- a/src/interrupt.rs
+++ b/src/interrupt.rs
@@ -8,7 +8,8 @@
8 8
9mod generated { 9mod generated {
10 embassy_hal_internal::interrupt_mod!( 10 embassy_hal_internal::interrupt_mod!(
11 OS_EVENT, LPUART0, LPI2C0, LPI2C1, LPI2C2, LPI2C3, LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, RTC, ADC1, 11 OS_EVENT, RTC, ADC1, GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, LPI2C0, LPI2C1, LPI2C2, LPI2C3, LPUART0, LPUART1,
12 LPUART2, LPUART3, LPUART4, LPUART5,
12 ); 13 );
13} 14}
14 15
@@ -292,6 +293,196 @@ impl InterruptExt for Adc {
292 } 293 }
293} 294}
294 295
296pub struct Gpio0;
297pub const GPIO0: Gpio0 = Gpio0;
298
299impl InterruptExt for Gpio0 {
300 /// Clear any pending GPIO0 in NVIC.
301 #[inline]
302 fn unpend(&self) {
303 cortex_m::peripheral::NVIC::unpend(Interrupt::GPIO0);
304 }
305
306 /// Set NVIC priority for GPIO0.
307 #[inline]
308 fn set_priority(&self, priority: Priority) {
309 unsafe {
310 let mut nvic = cortex_m::peripheral::Peripherals::steal().NVIC;
311 nvic.set_priority(Interrupt::GPIO0, u8::from(priority));
312 }
313 }
314
315 /// Enable GPIO0 in NVIC.
316 #[inline]
317 unsafe fn enable(&self) {
318 cortex_m::peripheral::NVIC::unmask(Interrupt::GPIO0);
319 }
320
321 /// Disable GPIO0 in NVIC.
322 #[inline]
323 unsafe fn disable(&self) {
324 cortex_m::peripheral::NVIC::mask(Interrupt::GPIO0);
325 }
326
327 /// Check if GPIO0 is pending in NVIC.
328 #[inline]
329 fn is_pending(&self) -> bool {
330 cortex_m::peripheral::NVIC::is_pending(Interrupt::GPIO0)
331 }
332}
333
334pub struct Gpio1;
335pub const GPIO1: Gpio1 = Gpio1;
336
337impl InterruptExt for Gpio1 {
338 /// Clear any pending GPIO1 in NVIC.
339 #[inline]
340 fn unpend(&self) {
341 cortex_m::peripheral::NVIC::unpend(Interrupt::GPIO1);
342 }
343
344 /// Set NVIC priority for GPIO1.
345 #[inline]
346 fn set_priority(&self, priority: Priority) {
347 unsafe {
348 let mut nvic = cortex_m::peripheral::Peripherals::steal().NVIC;
349 nvic.set_priority(Interrupt::GPIO1, u8::from(priority));
350 }
351 }
352
353 /// Enable GPIO1 in NVIC.
354 #[inline]
355 unsafe fn enable(&self) {
356 cortex_m::peripheral::NVIC::unmask(Interrupt::GPIO1);
357 }
358
359 /// Disable GPIO1 in NVIC.
360 #[inline]
361 unsafe fn disable(&self) {
362 cortex_m::peripheral::NVIC::mask(Interrupt::GPIO1);
363 }
364
365 /// Check if GPIO1 is pending in NVIC.
366 #[inline]
367 fn is_pending(&self) -> bool {
368 cortex_m::peripheral::NVIC::is_pending(Interrupt::GPIO1)
369 }
370}
371
372pub struct Gpio2;
373pub const GPIO2: Gpio2 = Gpio2;
374
375impl InterruptExt for Gpio2 {
376 /// Clear any pending GPIO2 in NVIC.
377 #[inline]
378 fn unpend(&self) {
379 cortex_m::peripheral::NVIC::unpend(Interrupt::GPIO2);
380 }
381
382 /// Set NVIC priority for GPIO2.
383 #[inline]
384 fn set_priority(&self, priority: Priority) {
385 unsafe {
386 let mut nvic = cortex_m::peripheral::Peripherals::steal().NVIC;
387 nvic.set_priority(Interrupt::GPIO2, u8::from(priority));
388 }
389 }
390
391 /// Enable GPIO2 in NVIC.
392 #[inline]
393 unsafe fn enable(&self) {
394 cortex_m::peripheral::NVIC::unmask(Interrupt::GPIO2);
395 }
396
397 /// Disable GPIO2 in NVIC.
398 #[inline]
399 unsafe fn disable(&self) {
400 cortex_m::peripheral::NVIC::mask(Interrupt::GPIO2);
401 }
402
403 /// Check if GPIO2 is pending in NVIC.
404 #[inline]
405 fn is_pending(&self) -> bool {
406 cortex_m::peripheral::NVIC::is_pending(Interrupt::GPIO2)
407 }
408}
409
410pub struct Gpio3;
411pub const GPIO3: Gpio3 = Gpio3;
412
413impl InterruptExt for Gpio3 {
414 /// Clear any pending GPIO3 in NVIC.
415 #[inline]
416 fn unpend(&self) {
417 cortex_m::peripheral::NVIC::unpend(Interrupt::GPIO3);
418 }
419
420 /// Set NVIC priority for GPIO3.
421 #[inline]
422 fn set_priority(&self, priority: Priority) {
423 unsafe {
424 let mut nvic = cortex_m::peripheral::Peripherals::steal().NVIC;
425 nvic.set_priority(Interrupt::GPIO3, u8::from(priority));
426 }
427 }
428
429 /// Enable GPIO3 in NVIC.
430 #[inline]
431 unsafe fn enable(&self) {
432 cortex_m::peripheral::NVIC::unmask(Interrupt::GPIO3);
433 }
434
435 /// Disable GPIO3 in NVIC.
436 #[inline]
437 unsafe fn disable(&self) {
438 cortex_m::peripheral::NVIC::mask(Interrupt::GPIO3);
439 }
440
441 /// Check if GPIO3 is pending in NVIC.
442 #[inline]
443 fn is_pending(&self) -> bool {
444 cortex_m::peripheral::NVIC::is_pending(Interrupt::GPIO3)
445 }
446}
447
448pub struct Gpio4;
449pub const GPIO4: Gpio4 = Gpio4;
450
451impl InterruptExt for Gpio4 {
452 /// Clear any pending GPIO4 in NVIC.
453 #[inline]
454 fn unpend(&self) {
455 cortex_m::peripheral::NVIC::unpend(Interrupt::GPIO4);
456 }
457
458 /// Set NVIC priority for GPIO4.
459 #[inline]
460 fn set_priority(&self, priority: Priority) {
461 unsafe {
462 let mut nvic = cortex_m::peripheral::Peripherals::steal().NVIC;
463 nvic.set_priority(Interrupt::GPIO4, u8::from(priority));
464 }
465 }
466
467 /// Enable GPIO4 in NVIC.
468 #[inline]
469 unsafe fn enable(&self) {
470 cortex_m::peripheral::NVIC::unmask(Interrupt::GPIO4);
471 }
472
473 /// Disable GPIO4 in NVIC.
474 #[inline]
475 unsafe fn disable(&self) {
476 cortex_m::peripheral::NVIC::mask(Interrupt::GPIO4);
477 }
478
479 /// Check if GPIO4 is pending in NVIC.
480 #[inline]
481 fn is_pending(&self) -> bool {
482 cortex_m::peripheral::NVIC::is_pending(Interrupt::GPIO4)
483 }
484}
485
295/// Set VTOR (Vector Table Offset) to a RAM-based vector table. 486/// Set VTOR (Vector Table Offset) to a RAM-based vector table.
296/// Pass a pointer to the first word in the RAM table (stack pointer slot 0). 487/// Pass a pointer to the first word in the RAM table (stack pointer slot 0).
297/// Safety: Caller must ensure the RAM table is valid and aligned as required by the core. 488/// Safety: Caller must ensure the RAM table is valid and aligned as required by the core.
diff --git a/src/lib.rs b/src/lib.rs
index 7fccc86c5..fb204d27b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,7 +18,6 @@ pub mod lpuart;
18pub mod ostimer; 18pub mod ostimer;
19pub mod rtc; 19pub mod rtc;
20 20
21#[cfg(feature = "rt")]
22pub use crate::pac::NVIC_PRIO_BITS; 21pub use crate::pac::NVIC_PRIO_BITS;
23 22
24#[rustfmt::skip] 23#[rustfmt::skip]
@@ -347,10 +346,24 @@ pub fn init(cfg: crate::config::Config) -> Peripherals {
347 crate::interrupt::RTC.set_priority(cfg.rtc_interrupt_priority); 346 crate::interrupt::RTC.set_priority(cfg.rtc_interrupt_priority);
348 // Apply user-configured priority early; enabling is left to examples/apps 347 // Apply user-configured priority early; enabling is left to examples/apps
349 crate::interrupt::ADC1.set_priority(cfg.adc_interrupt_priority); 348 crate::interrupt::ADC1.set_priority(cfg.adc_interrupt_priority);
349 // Apply user-configured priority early; enabling is left to examples/apps
350 crate::interrupt::GPIO0.set_priority(cfg.gpio_interrupt_priority);
351 // Apply user-configured priority early; enabling is left to examples/apps
352 crate::interrupt::GPIO1.set_priority(cfg.gpio_interrupt_priority);
353 // Apply user-configured priority early; enabling is left to examples/apps
354 crate::interrupt::GPIO2.set_priority(cfg.gpio_interrupt_priority);
355 // Apply user-configured priority early; enabling is left to examples/apps
356 crate::interrupt::GPIO3.set_priority(cfg.gpio_interrupt_priority);
357 // Apply user-configured priority early; enabling is left to examples/apps
358 crate::interrupt::GPIO4.set_priority(cfg.gpio_interrupt_priority);
350 359
351 // Configure clocks 360 // Configure clocks
352 crate::clocks::init(cfg.clock_cfg).unwrap(); 361 crate::clocks::init(cfg.clock_cfg).unwrap();
353 362
363 unsafe {
364 crate::gpio::init();
365 }
366
354 // Initialize embassy-time global driver backed by OSTIMER0 367 // Initialize embassy-time global driver backed by OSTIMER0
355 #[cfg(feature = "time")] 368 #[cfg(feature = "time")]
356 crate::ostimer::time_driver::init(crate::config::Config::default().time_interrupt_priority, 1_000_000); 369 crate::ostimer::time_driver::init(crate::config::Config::default().time_interrupt_priority, 1_000_000);
diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml
index 2aba6b961..871109648 100644
--- a/supply-chain/audits.toml
+++ b/supply-chain/audits.toml
@@ -6,11 +6,21 @@ who = "Felipe Balbi <[email protected]>"
6criteria = "safe-to-deploy" 6criteria = "safe-to-deploy"
7version = "1.5.0" 7version = "1.5.0"
8 8
9[[audits.cc]]
10who = "Felipe Balbi <[email protected]>"
11criteria = "safe-to-deploy"
12version = "1.2.47"
13
9[[audits.cfg-if]] 14[[audits.cfg-if]]
10who = "Felipe Balbi <[email protected]>" 15who = "Felipe Balbi <[email protected]>"
11criteria = "safe-to-deploy" 16criteria = "safe-to-deploy"
12version = "1.0.4" 17version = "1.0.4"
13 18
19[[audits.cordyceps]]
20who = "Felipe Balbi <[email protected]>"
21criteria = "safe-to-deploy"
22version = "0.3.4"
23
14[[audits.darling]] 24[[audits.darling]]
15who = "Felipe Balbi <[email protected]>" 25who = "Felipe Balbi <[email protected]>"
16criteria = "safe-to-deploy" 26criteria = "safe-to-deploy"
@@ -72,6 +82,16 @@ who = "Felipe Balbi <[email protected]>"
72criteria = "safe-to-deploy" 82criteria = "safe-to-deploy"
73version = "0.3.0" 83version = "0.3.0"
74 84
85[[audits.find-msvc-tools]]
86who = "Felipe Balbi <[email protected]>"
87criteria = "safe-to-deploy"
88version = "0.1.5"
89
90[[audits.generator]]
91who = "Felipe Balbi <[email protected]>"
92criteria = "safe-to-deploy"
93version = "0.8.7"
94
75[[audits.ident_case]] 95[[audits.ident_case]]
76who = "Felipe Balbi <[email protected]>" 96who = "Felipe Balbi <[email protected]>"
77criteria = "safe-to-deploy" 97criteria = "safe-to-deploy"
@@ -82,11 +102,46 @@ who = "Felipe Balbi <[email protected]>"
82criteria = "safe-to-deploy" 102criteria = "safe-to-deploy"
83version = "1.0.0" 103version = "1.0.0"
84 104
105[[audits.maitake-sync]]
106who = "Felipe Balbi <[email protected]>"
107criteria = "safe-to-deploy"
108version = "0.2.2"
109
110[[audits.mutex-traits]]
111who = "Felipe Balbi <[email protected]>"
112criteria = "safe-to-deploy"
113version = "1.0.1"
114
115[[audits.mycelium-bitfield]]
116who = "Felipe Balbi <[email protected]>"
117criteria = "safe-to-deploy"
118version = "0.1.5"
119
120[[audits.once_cell]]
121who = "Felipe Balbi <[email protected]>"
122criteria = "safe-to-deploy"
123version = "1.20.1"
124
85[[audits.panic-probe]] 125[[audits.panic-probe]]
86who = "Felipe Balbi <[email protected]>" 126who = "Felipe Balbi <[email protected]>"
87criteria = "safe-to-deploy" 127criteria = "safe-to-deploy"
88version = "1.0.0" 128version = "1.0.0"
89 129
130[[audits.pin-project]]
131who = "Felipe Balbi <[email protected]>"
132criteria = "safe-to-deploy"
133version = "1.1.10"
134
135[[audits.pin-project-internal]]
136who = "Felipe Balbi <[email protected]>"
137criteria = "safe-to-deploy"
138version = "1.1.10"
139
140[[audits.portable-atomic]]
141who = "Felipe Balbi <[email protected]>"
142criteria = "safe-to-deploy"
143version = "1.11.1"
144
90[[audits.proc-macro2]] 145[[audits.proc-macro2]]
91who = "Felipe Balbi <[email protected]>" 146who = "Felipe Balbi <[email protected]>"
92criteria = "safe-to-deploy" 147criteria = "safe-to-deploy"
@@ -131,3 +186,164 @@ version = "2.0.17"
131who = "Felipe Balbi <[email protected]>" 186who = "Felipe Balbi <[email protected]>"
132criteria = "safe-to-deploy" 187criteria = "safe-to-deploy"
133version = "1.0.22" 188version = "1.0.22"
189
190[[audits.valuable]]
191who = "Felipe Balbi <[email protected]>"
192criteria = "safe-to-deploy"
193version = "0.1.1"
194
195[[trusted.aho-corasick]]
196criteria = "safe-to-deploy"
197user-id = 189 # Andrew Gallant (BurntSushi)
198start = "2019-03-28"
199end = "2026-11-26"
200
201[[trusted.cc]]
202criteria = "safe-to-deploy"
203user-id = 55123 # rust-lang-owner
204start = "2022-10-29"
205end = "2026-11-26"
206
207[[trusted.find-msvc-tools]]
208criteria = "safe-to-deploy"
209user-id = 539
210start = "2025-08-29"
211end = "2026-11-26"
212
213[[trusted.libc]]
214criteria = "safe-to-deploy"
215user-id = 55123 # rust-lang-owner
216start = "2024-08-15"
217end = "2026-11-26"
218
219[[trusted.loom]]
220criteria = "safe-to-deploy"
221user-id = 6741 # Alice Ryhl (Darksonn)
222start = "2021-04-12"
223end = "2026-11-26"
224
225[[trusted.memchr]]
226criteria = "safe-to-deploy"
227user-id = 189 # Andrew Gallant (BurntSushi)
228start = "2019-07-07"
229end = "2026-11-26"
230
231[[trusted.paste]]
232criteria = "safe-to-deploy"
233user-id = 3618 # David Tolnay (dtolnay)
234start = "2019-03-19"
235end = "2026-11-26"
236
237[[trusted.regex-automata]]
238criteria = "safe-to-deploy"
239user-id = 189 # Andrew Gallant (BurntSushi)
240start = "2019-02-25"
241end = "2026-11-26"
242
243[[trusted.regex-syntax]]
244criteria = "safe-to-deploy"
245user-id = 189 # Andrew Gallant (BurntSushi)
246start = "2019-03-30"
247end = "2026-11-26"
248
249[[trusted.rustversion]]
250criteria = "safe-to-deploy"
251user-id = 3618 # David Tolnay (dtolnay)
252start = "2019-07-08"
253end = "2026-11-26"
254
255[[trusted.scoped-tls]]
256criteria = "safe-to-deploy"
257user-id = 1 # Alex Crichton (alexcrichton)
258start = "2019-02-26"
259end = "2026-11-26"
260
261[[trusted.thread_local]]
262criteria = "safe-to-deploy"
263user-id = 2915 # Amanieu d'Antras (Amanieu)
264start = "2019-09-07"
265end = "2026-11-26"
266
267[[trusted.tracing-subscriber]]
268criteria = "safe-to-deploy"
269user-id = 10 # Carl Lerche (carllerche)
270start = "2025-08-29"
271end = "2026-11-26"
272
273[[trusted.valuable]]
274criteria = "safe-to-deploy"
275user-id = 10 # Carl Lerche (carllerche)
276start = "2022-01-03"
277end = "2026-11-26"
278
279[[trusted.windows]]
280criteria = "safe-to-deploy"
281user-id = 64539 # Kenny Kerr (kennykerr)
282start = "2021-01-15"
283end = "2026-11-26"
284
285[[trusted.windows-collections]]
286criteria = "safe-to-deploy"
287user-id = 64539 # Kenny Kerr (kennykerr)
288start = "2025-02-06"
289end = "2026-11-26"
290
291[[trusted.windows-core]]
292criteria = "safe-to-deploy"
293user-id = 64539 # Kenny Kerr (kennykerr)
294start = "2021-11-15"
295end = "2026-11-26"
296
297[[trusted.windows-future]]
298criteria = "safe-to-deploy"
299user-id = 64539 # Kenny Kerr (kennykerr)
300start = "2025-02-10"
301end = "2026-11-26"
302
303[[trusted.windows-implement]]
304criteria = "safe-to-deploy"
305user-id = 64539 # Kenny Kerr (kennykerr)
306start = "2022-01-27"
307end = "2026-11-26"
308
309[[trusted.windows-interface]]
310criteria = "safe-to-deploy"
311user-id = 64539 # Kenny Kerr (kennykerr)
312start = "2022-02-18"
313end = "2026-11-26"
314
315[[trusted.windows-link]]
316criteria = "safe-to-deploy"
317user-id = 64539 # Kenny Kerr (kennykerr)
318start = "2024-07-17"
319end = "2026-11-26"
320
321[[trusted.windows-numerics]]
322criteria = "safe-to-deploy"
323user-id = 64539 # Kenny Kerr (kennykerr)
324start = "2023-05-15"
325end = "2026-11-26"
326
327[[trusted.windows-result]]
328criteria = "safe-to-deploy"
329user-id = 64539 # Kenny Kerr (kennykerr)
330start = "2024-02-02"
331end = "2026-11-26"
332
333[[trusted.windows-strings]]
334criteria = "safe-to-deploy"
335user-id = 64539 # Kenny Kerr (kennykerr)
336start = "2024-02-02"
337end = "2026-11-26"
338
339[[trusted.windows-sys]]
340criteria = "safe-to-deploy"
341user-id = 64539 # Kenny Kerr (kennykerr)
342start = "2021-11-15"
343end = "2026-11-26"
344
345[[trusted.windows-threading]]
346criteria = "safe-to-deploy"
347user-id = 64539 # Kenny Kerr (kennykerr)
348start = "2025-04-29"
349end = "2026-11-26"
diff --git a/supply-chain/config.toml b/supply-chain/config.toml
index 173392c16..5682db9ea 100644
--- a/supply-chain/config.toml
+++ b/supply-chain/config.toml
@@ -7,6 +7,9 @@ version = "0.10"
7[imports.OpenDevicePartnership] 7[imports.OpenDevicePartnership]
8url = "https://raw.githubusercontent.com/OpenDevicePartnership/rust-crate-audits/main/audits.toml" 8url = "https://raw.githubusercontent.com/OpenDevicePartnership/rust-crate-audits/main/audits.toml"
9 9
10[imports.bytecode-alliance]
11url = "https://raw.githubusercontent.com/bytecodealliance/wasmtime/main/supply-chain/audits.toml"
12
10[imports.google] 13[imports.google]
11url = "https://raw.githubusercontent.com/google/rust-crate-audits/main/audits.toml" 14url = "https://raw.githubusercontent.com/google/rust-crate-audits/main/audits.toml"
12 15
@@ -89,10 +92,6 @@ criteria = "safe-to-deploy"
89version = "1.0.0" 92version = "1.0.0"
90criteria = "safe-to-deploy" 93criteria = "safe-to-deploy"
91 94
92[[exemptions.embedded-io]]
93version = "0.6.1"
94criteria = "safe-to-deploy"
95
96[[exemptions.embedded-io-async]] 95[[exemptions.embedded-io-async]]
97version = "0.6.1" 96version = "0.6.1"
98criteria = "safe-to-deploy" 97criteria = "safe-to-deploy"
@@ -105,14 +104,6 @@ criteria = "safe-to-deploy"
105version = "0.4.1" 104version = "0.4.1"
106criteria = "safe-to-deploy" 105criteria = "safe-to-deploy"
107 106
108[[exemptions.futures-core]]
109version = "0.3.31"
110criteria = "safe-to-deploy"
111
112[[exemptions.futures-sink]]
113version = "0.3.31"
114criteria = "safe-to-deploy"
115
116[[exemptions.hash32]] 107[[exemptions.hash32]]
117version = "0.3.1" 108version = "0.3.1"
118criteria = "safe-to-deploy" 109criteria = "safe-to-deploy"
@@ -121,10 +112,6 @@ criteria = "safe-to-deploy"
121version = "0.8.0" 112version = "0.8.0"
122criteria = "safe-to-deploy" 113criteria = "safe-to-deploy"
123 114
124[[exemptions.paste]]
125version = "1.0.15"
126criteria = "safe-to-deploy"
127
128[[exemptions.proc-macro-error-attr2]] 115[[exemptions.proc-macro-error-attr2]]
129version = "2.0.0" 116version = "2.0.0"
130criteria = "safe-to-deploy" 117criteria = "safe-to-deploy"
diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock
index aa62839e2..dbd1235b0 100644
--- a/supply-chain/imports.lock
+++ b/supply-chain/imports.lock
@@ -1,8 +1,288 @@
1 1
2# cargo-vet imports lock 2# cargo-vet imports lock
3 3
4[[publisher.aho-corasick]]
5version = "1.1.4"
6when = "2025-10-28"
7user-id = 189
8user-login = "BurntSushi"
9user-name = "Andrew Gallant"
10
11[[publisher.libc]]
12version = "0.2.177"
13when = "2025-10-09"
14user-id = 55123
15user-login = "rust-lang-owner"
16
17[[publisher.loom]]
18version = "0.7.2"
19when = "2024-04-23"
20user-id = 6741
21user-login = "Darksonn"
22user-name = "Alice Ryhl"
23
24[[publisher.memchr]]
25version = "2.7.6"
26when = "2025-09-25"
27user-id = 189
28user-login = "BurntSushi"
29user-name = "Andrew Gallant"
30
31[[publisher.paste]]
32version = "1.0.15"
33when = "2024-05-07"
34user-id = 3618
35user-login = "dtolnay"
36user-name = "David Tolnay"
37
38[[publisher.regex-automata]]
39version = "0.4.13"
40when = "2025-10-13"
41user-id = 189
42user-login = "BurntSushi"
43user-name = "Andrew Gallant"
44
45[[publisher.regex-syntax]]
46version = "0.8.8"
47when = "2025-10-13"
48user-id = 189
49user-login = "BurntSushi"
50user-name = "Andrew Gallant"
51
52[[publisher.rustversion]]
53version = "1.0.22"
54when = "2025-08-08"
55user-id = 3618
56user-login = "dtolnay"
57user-name = "David Tolnay"
58
59[[publisher.scoped-tls]]
60version = "1.0.1"
61when = "2022-10-31"
62user-id = 1
63user-login = "alexcrichton"
64user-name = "Alex Crichton"
65
66[[publisher.thread_local]]
67version = "1.1.9"
68when = "2025-06-12"
69user-id = 2915
70user-login = "Amanieu"
71user-name = "Amanieu d'Antras"
72
73[[publisher.tracing-subscriber]]
74version = "0.3.20"
75when = "2025-08-29"
76user-id = 10
77user-login = "carllerche"
78user-name = "Carl Lerche"
79
80[[publisher.windows]]
81version = "0.61.3"
82when = "2025-06-12"
83user-id = 64539
84user-login = "kennykerr"
85user-name = "Kenny Kerr"
86
87[[publisher.windows-collections]]
88version = "0.2.0"
89when = "2025-03-18"
90user-id = 64539
91user-login = "kennykerr"
92user-name = "Kenny Kerr"
93
94[[publisher.windows-core]]
95version = "0.61.2"
96when = "2025-05-19"
97user-id = 64539
98user-login = "kennykerr"
99user-name = "Kenny Kerr"
100
101[[publisher.windows-future]]
102version = "0.2.1"
103when = "2025-05-15"
104user-id = 64539
105user-login = "kennykerr"
106user-name = "Kenny Kerr"
107
108[[publisher.windows-implement]]
109version = "0.60.2"
110when = "2025-10-06"
111user-id = 64539
112user-login = "kennykerr"
113user-name = "Kenny Kerr"
114
115[[publisher.windows-interface]]
116version = "0.59.3"
117when = "2025-10-06"
118user-id = 64539
119user-login = "kennykerr"
120user-name = "Kenny Kerr"
121
122[[publisher.windows-link]]
123version = "0.1.3"
124when = "2025-06-12"
125user-id = 64539
126user-login = "kennykerr"
127user-name = "Kenny Kerr"
128
129[[publisher.windows-link]]
130version = "0.2.1"
131when = "2025-10-06"
132user-id = 64539
133user-login = "kennykerr"
134user-name = "Kenny Kerr"
135
136[[publisher.windows-numerics]]
137version = "0.2.0"
138when = "2025-03-18"
139user-id = 64539
140user-login = "kennykerr"
141user-name = "Kenny Kerr"
142
143[[publisher.windows-result]]
144version = "0.3.4"
145when = "2025-05-19"
146user-id = 64539
147user-login = "kennykerr"
148user-name = "Kenny Kerr"
149
150[[publisher.windows-strings]]
151version = "0.4.2"
152when = "2025-05-19"
153user-id = 64539
154user-login = "kennykerr"
155user-name = "Kenny Kerr"
156
157[[publisher.windows-sys]]
158version = "0.61.2"
159when = "2025-10-06"
160user-id = 64539
161user-login = "kennykerr"
162user-name = "Kenny Kerr"
163
164[[publisher.windows-threading]]
165version = "0.1.0"
166when = "2025-05-15"
167user-id = 64539
168user-login = "kennykerr"
169user-name = "Kenny Kerr"
170
4[audits.OpenDevicePartnership.audits] 171[audits.OpenDevicePartnership.audits]
5 172
173[[audits.bytecode-alliance.audits.embedded-io]]
174who = "Alex Crichton <[email protected]>"
175criteria = "safe-to-deploy"
176version = "0.4.0"
177notes = "No `unsafe` code and only uses `std` in ways one would expect the crate to do so."
178
179[[audits.bytecode-alliance.audits.embedded-io]]
180who = "Alex Crichton <[email protected]>"
181criteria = "safe-to-deploy"
182delta = "0.4.0 -> 0.6.1"
183notes = "Major updates, but almost all safe code. Lots of pruning/deletions, nothing out of the ordrinary."
184
185[[audits.bytecode-alliance.audits.futures-core]]
186who = "Pat Hickey <[email protected]>"
187criteria = "safe-to-deploy"
188version = "0.3.27"
189notes = "Unsafe used to implement a concurrency primitive AtomicWaker. Well-commented and not obviously incorrect. Like my other audits of these concurrency primitives inside the futures family, I couldn't certify that it is correct without formal methods, but that is out of scope for this vetting."
190
191[[audits.bytecode-alliance.audits.futures-core]]
192who = "Pat Hickey <[email protected]>"
193criteria = "safe-to-deploy"
194delta = "0.3.28 -> 0.3.31"
195
196[[audits.bytecode-alliance.audits.futures-sink]]
197who = "Pat Hickey <[email protected]>"
198criteria = "safe-to-deploy"
199version = "0.3.27"
200
201[[audits.bytecode-alliance.audits.futures-sink]]
202who = "Pat Hickey <[email protected]>"
203criteria = "safe-to-deploy"
204delta = "0.3.28 -> 0.3.31"
205
206[[audits.bytecode-alliance.audits.log]]
207who = "Alex Crichton <[email protected]>"
208criteria = "safe-to-deploy"
209delta = "0.4.22 -> 0.4.27"
210notes = "Lots of minor updates to macros and such, nothing touching `unsafe`"
211
212[[audits.bytecode-alliance.audits.log]]
213who = "Alex Crichton <[email protected]>"
214criteria = "safe-to-deploy"
215delta = "0.4.27 -> 0.4.28"
216notes = "Minor doc updates and lots new tests, nothing out of the ordinary."
217
218[[audits.bytecode-alliance.audits.matchers]]
219who = "Pat Hickey <[email protected]>"
220criteria = "safe-to-deploy"
221version = "0.1.0"
222
223[[audits.bytecode-alliance.audits.matchers]]
224who = "Alex Crichton <[email protected]>"
225criteria = "safe-to-deploy"
226delta = "0.1.0 -> 0.2.0"
227notes = "Some unsafe code, but not more than before. Nothing awry."
228
229[[audits.bytecode-alliance.audits.nu-ansi-term]]
230who = "Pat Hickey <[email protected]>"
231criteria = "safe-to-deploy"
232version = "0.46.0"
233notes = "one use of unsafe to call windows specific api to get console handle."
234
235[[audits.bytecode-alliance.audits.nu-ansi-term]]
236who = "Alex Crichton <[email protected]>"
237criteria = "safe-to-deploy"
238delta = "0.46.0 -> 0.50.1"
239notes = "Lots of stylistic/rust-related chanegs, plus new features, but nothing out of the ordrinary."
240
241[[audits.bytecode-alliance.audits.nu-ansi-term]]
242who = "Alex Crichton <[email protected]>"
243criteria = "safe-to-deploy"
244delta = "0.50.1 -> 0.50.3"
245notes = "CI changes, Rust changes, nothing out of the ordinary."
246
247[[audits.bytecode-alliance.audits.sharded-slab]]
248who = "Pat Hickey <[email protected]>"
249criteria = "safe-to-deploy"
250version = "0.1.4"
251notes = "I always really enjoy reading eliza's code, she left perfect comments at every use of unsafe."
252
253[[audits.bytecode-alliance.audits.shlex]]
254who = "Alex Crichton <[email protected]>"
255criteria = "safe-to-deploy"
256version = "1.1.0"
257notes = "Only minor `unsafe` code blocks which look valid and otherwise does what it says on the tin."
258
259[[audits.bytecode-alliance.audits.tracing-attributes]]
260who = "Alex Crichton <[email protected]>"
261criteria = "safe-to-deploy"
262delta = "0.1.28 -> 0.1.30"
263notes = "Few code changes, a pretty minor update."
264
265[[audits.bytecode-alliance.audits.tracing-core]]
266who = "Alex Crichton <[email protected]>"
267criteria = "safe-to-deploy"
268delta = "0.1.33 -> 0.1.34"
269notes = "Mostly just an update with Rust stylistic conventions changing. Nothing awry."
270
271[[audits.bytecode-alliance.audits.tracing-log]]
272who = "Alex Crichton <[email protected]>"
273criteria = "safe-to-deploy"
274version = "0.1.3"
275notes = """
276This is a standard adapter between the `log` ecosystem and the `tracing`
277ecosystem. There's one `unsafe` block in this crate and it's well-scoped.
278"""
279
280[[audits.bytecode-alliance.audits.tracing-log]]
281who = "Alex Crichton <[email protected]>"
282criteria = "safe-to-deploy"
283delta = "0.1.3 -> 0.2.0"
284notes = "Nothing out of the ordinary, a typical major version update and nothing awry."
285
6[[audits.google.audits.bitflags]] 286[[audits.google.audits.bitflags]]
7who = "Lukasz Anforowicz <[email protected]>" 287who = "Lukasz Anforowicz <[email protected]>"
8criteria = "safe-to-deploy" 288criteria = "safe-to-deploy"
@@ -26,6 +306,39 @@ version = "1.5.0"
26notes = "Unsafe review in https://crrev.com/c/5838022" 306notes = "Unsafe review in https://crrev.com/c/5838022"
27aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" 307aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
28 308
309[[audits.google.audits.lazy_static]]
310who = "Lukasz Anforowicz <[email protected]>"
311criteria = "safe-to-deploy"
312version = "1.4.0"
313notes = '''
314I grepped for \"crypt\", \"cipher\", \"fs\", \"net\" - there were no hits.
315
316There are two places where `unsafe` is used. Unsafe review notes can be found
317in https://crrev.com/c/5347418.
318
319This crate has been added to Chromium in https://crrev.com/c/3321895.
320'''
321aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
322
323[[audits.google.audits.lazy_static]]
324who = "Lukasz Anforowicz <[email protected]>"
325criteria = "safe-to-deploy"
326delta = "1.4.0 -> 1.5.0"
327notes = "Unsafe review notes: https://crrev.com/c/5650836"
328aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
329
330[[audits.google.audits.log]]
331who = "danakj <[email protected]>"
332criteria = "safe-to-deploy"
333version = "0.4.22"
334notes = """
335Unsafe review in https://docs.google.com/document/d/1IXQbD1GhTRqNHIGxq6yy7qHqxeO4CwN5noMFXnqyDIM/edit?usp=sharing
336
337Unsafety is generally very well-documented, with one exception, which we
338describe in the review doc.
339"""
340aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
341
29[[audits.google.audits.nb]] 342[[audits.google.audits.nb]]
30who = "George Burgess IV <[email protected]>" 343who = "George Burgess IV <[email protected]>"
31criteria = "safe-to-deploy" 344criteria = "safe-to-deploy"
@@ -51,10 +364,160 @@ version = "0.2.19"
51notes = "Contains a single line of float-to-int unsafe with decent safety comments" 364notes = "Contains a single line of float-to-int unsafe with decent safety comments"
52aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" 365aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
53 366
367[[audits.google.audits.pin-project-lite]]
368who = "David Koloski <[email protected]>"
369criteria = "safe-to-deploy"
370version = "0.2.9"
371notes = "Reviewed on https://fxrev.dev/824504"
372aggregated-from = "https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT"
373
374[[audits.google.audits.pin-project-lite]]
375who = "David Koloski <[email protected]>"
376criteria = "safe-to-deploy"
377delta = "0.2.9 -> 0.2.13"
378notes = "Audited at https://fxrev.dev/946396"
379aggregated-from = "https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT"
380
381[[audits.google.audits.smallvec]]
382who = "Manish Goregaokar <[email protected]>"
383criteria = "safe-to-deploy"
384version = "1.13.2"
385aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
386
387[[audits.google.audits.smallvec]]
388who = "Jonathan Hao <[email protected]>"
389criteria = "safe-to-deploy"
390delta = "1.13.2 -> 1.14.0"
391notes = """
392WARNING: This certification is a result of a **partial** audit. The
393`malloc_size_of` feature has **not** been audited. This feature does
394not explicitly document its safety requirements.
395See also https://chromium-review.googlesource.com/c/chromium/src/+/6275133/comment/ea0d7a93_98051a2e/
396and https://github.com/servo/malloc_size_of/issues/8.
397This feature is banned in gnrt_config.toml.
398"""
399aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT"
400
54[[audits.google.audits.void]] 401[[audits.google.audits.void]]
55who = "George Burgess IV <[email protected]>" 402who = "George Burgess IV <[email protected]>"
56criteria = "safe-to-deploy" 403criteria = "safe-to-deploy"
57version = "1.0.2" 404version = "1.0.2"
58aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" 405aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT"
59 406
60[audits.mozilla.audits] 407[[audits.mozilla.audits.futures-core]]
408who = "Mike Hommey <[email protected]>"
409criteria = "safe-to-deploy"
410delta = "0.3.27 -> 0.3.28"
411aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
412
413[[audits.mozilla.audits.futures-sink]]
414who = "Mike Hommey <[email protected]>"
415criteria = "safe-to-deploy"
416delta = "0.3.27 -> 0.3.28"
417aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
418
419[[audits.mozilla.audits.once_cell]]
420who = "Erich Gubler <[email protected]>"
421criteria = "safe-to-deploy"
422delta = "1.20.1 -> 1.20.2"
423notes = "This update works around a Cargo bug that forces the addition of `portable-atomic` into a lockfile, which we have never needed to use."
424aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
425
426[[audits.mozilla.audits.once_cell]]
427who = "Erich Gubler <[email protected]>"
428criteria = "safe-to-deploy"
429delta = "1.20.2 -> 1.20.3"
430aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
431
432[[audits.mozilla.audits.once_cell]]
433who = "Erich Gubler <[email protected]>"
434criteria = "safe-to-deploy"
435delta = "1.20.3 -> 1.21.1"
436aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
437
438[[audits.mozilla.audits.once_cell]]
439who = "Erich Gubler <[email protected]>"
440criteria = "safe-to-deploy"
441delta = "1.21.1 -> 1.21.3"
442aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
443
444[[audits.mozilla.audits.pin-project-lite]]
445who = "Mike Hommey <[email protected]>"
446criteria = "safe-to-deploy"
447delta = "0.2.13 -> 0.2.14"
448aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
449
450[[audits.mozilla.audits.pin-project-lite]]
451who = "Nika Layzell <[email protected]>"
452criteria = "safe-to-deploy"
453delta = "0.2.14 -> 0.2.16"
454notes = """
455Only functional change is to work around a bug in the negative_impls feature
456(https://github.com/taiki-e/pin-project/issues/340#issuecomment-2432146009)
457"""
458aggregated-from = "https://raw.githubusercontent.com/mozilla/cargo-vet/main/supply-chain/audits.toml"
459
460[[audits.mozilla.audits.sharded-slab]]
461who = "Mark Hammond <[email protected]>"
462criteria = "safe-to-deploy"
463delta = "0.1.4 -> 0.1.7"
464aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
465
466[[audits.mozilla.audits.shlex]]
467who = "Max Inden <[email protected]>"
468criteria = "safe-to-deploy"
469delta = "1.1.0 -> 1.3.0"
470aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
471
472[[audits.mozilla.audits.smallvec]]
473who = "Erich Gubler <[email protected]>"
474criteria = "safe-to-deploy"
475delta = "1.14.0 -> 1.15.1"
476aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
477
478[[audits.mozilla.audits.tracing]]
479who = "Alex Franchuk <[email protected]>"
480criteria = "safe-to-deploy"
481version = "0.1.37"
482notes = """
483There's only one unsafe impl, and its purpose is to ensure correct behavior by
484creating a non-Send marker type (it has nothing to do with soundness). All
485dependencies make sense, and no side-effectful std functions are used.
486"""
487aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
488
489[[audits.mozilla.audits.tracing]]
490who = "Mark Hammond <[email protected]>"
491criteria = "safe-to-deploy"
492delta = "0.1.37 -> 0.1.41"
493aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
494
495[[audits.mozilla.audits.tracing-attributes]]
496who = "Alex Franchuk <[email protected]>"
497criteria = "safe-to-deploy"
498version = "0.1.24"
499notes = "No unsafe code, macros extensively tested and produce reasonable code."
500aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
501
502[[audits.mozilla.audits.tracing-attributes]]
503who = "Mark Hammond <[email protected]>"
504criteria = "safe-to-deploy"
505delta = "0.1.24 -> 0.1.28"
506aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
507
508[[audits.mozilla.audits.tracing-core]]
509who = "Alex Franchuk <[email protected]>"
510criteria = "safe-to-deploy"
511version = "0.1.30"
512notes = """
513Most unsafe code is in implementing non-std sync primitives. Unsafe impls are
514logically correct and justified in comments, and unsafe code is sound and
515justified in comments.
516"""
517aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"
518
519[[audits.mozilla.audits.tracing-core]]
520who = "Mark Hammond <[email protected]>"
521criteria = "safe-to-deploy"
522delta = "0.1.30 -> 0.1.33"
523aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"