Type Alias CortexMMutex

Source
pub type CortexMMutex<T> = Mutex<RefCell<T>>;
Expand description

Alias for a Cortex-M mutex.

Based on cortex_m::interrupt::Mutex. This mutex works by disabling interrupts while the mutex is locked.

This type is only available with the cortex-m feature.

Aliased Type§

pub struct CortexMMutex<T> { /* private fields */ }

Implementations

Source§

impl<T> Mutex<T>

Source

pub const fn new(value: T) -> Mutex<T>

Creates a new mutex

Source§

impl<T> Mutex<T>

Source

pub fn borrow<'cs>(&'cs self, _cs: &'cs CriticalSection) -> &'cs T

Borrows the data for the duration of the critical section

Trait Implementations§

Source§

impl<T> BusMutex for CortexMMutex<T>

Source§

type Bus = T

The actual bus that is wrapped inside this mutex.
Source§

fn create(v: T) -> Self

Create a new mutex of this type.
Source§

fn lock<R, F: FnOnce(&mut Self::Bus) -> R>(&self, f: F) -> R

Lock the mutex and give a closure access to the bus inside.
Source§

impl<T> Sync for Mutex<T>
where T: Send,