Function stm32ral::stm32f3::stm32f373::spi::SPI1::take [−][src]
pub fn take() -> Option<Instance>
Expand description
Safe access to SPI1
This function returns Some(Instance)
if this instance is not
currently taken, and None
if it is. This ensures that if you
do get Some(Instance)
, you are ensured unique access to
the peripheral and there cannot be data races (unless other
code uses unsafe
, of course). You can then pass the
Instance
around to other functions as required. When you’re
done with it, you can call release(instance)
to return it.
Instance
itself dereferences to a RegisterBlock
, which
provides access to the peripheral’s registers.