diff --git a/rp2040-hal/src/pio.rs b/rp2040-hal/src/pio.rs index 986370a..85e3bbd 100644 --- a/rp2040-hal/src/pio.rs +++ b/rp2040-hal/src/pio.rs @@ -516,6 +516,9 @@ impl StateMachine { } } +/// Safety: All shared register accesses are atomic. +unsafe impl Send for StateMachine {} + impl StateMachine { /// Starts execution of the selected program. pub fn start(mut self) -> StateMachine { @@ -676,6 +679,9 @@ pub struct Rx { _phantom: core::marker::PhantomData, } +/// Safety: All shared register access is atomic. +unsafe impl Send for Rx {} + impl Rx { fn register_block(&self) -> &pac::pio0::RegisterBlock { // Safety: The register is unique to this Tx instance. @@ -713,6 +719,9 @@ pub struct Tx { _phantom: core::marker::PhantomData, } +/// Safety: All shared register access is atomic. +unsafe impl Send for Tx {} + impl Tx { fn register_block(&self) -> &pac::pio0::RegisterBlock { // Safety: The register is unique to this Tx instance.