Type Alias rp2040_pac::sio::SPINLOCK

source ·
pub type SPINLOCK = Reg<SPINLOCK_SPEC>;
Expand description

SPINLOCK (rw) register accessor: Reading from a spinlock address will:

  • Return 0 if lock is already locked
  • Otherwise return nonzero, and simultaneously claim the lock

Writing (any value) releases the lock.
If core 0 and core 1 attempt to claim the same lock simultaneously, core 0 wins.
The value returned on success is 0x1 << lock number.

You can read this register and get spinlock::R. You can reset, write, write_with_zero this register using spinlock::W. You can also modify this register. See API.

For information about available fields see spinlock module

Aliased Type§

struct SPINLOCK { /* private fields */ }