embassy-stm32

Crates

git

Versions

stm32wle5jc

Flavors

HardwareSemaphore

Struct HardwareSemaphore 

Source
pub struct HardwareSemaphore<T: Instance> { /* private fields */ }
Expand description

HSEM driver

Implementations§

Source§

impl<T: Instance> HardwareSemaphore<T>

Source

pub fn new<'d>( _peripheral: Peri<'d, T>, _irq: impl Binding<T::Interrupt, HardwareSemaphoreInterruptHandler<T>> + 'd, ) -> Self

Creates a new HardwareSemaphore instance.

Source

pub const fn channel_for<'a>( &'a mut self, number: u8, ) -> HardwareSemaphoreChannel<'a, T>

Get a single channel, and keep the global struct

Source

pub const fn split<'a>(self) -> [HardwareSemaphoreChannel<'a, T>; 6]

Split the global struct into channels

If using low-power mode, channels 3 and 4 will not be returned

Source

pub fn unlock_all(&mut self, key: u16, core_id: u8)

Unlocks all semaphores. All semaphores locked by a COREID can be unlocked at once by using the HSEM_CR register. Write COREID and correct KEY value in HSEM_CR. All locked semaphores with a matching COREID are unlocked, and may generate an interrupt when enabled.

Source

pub fn set_clear_key(&mut self, key: u16)

Sets the clear (unlock) key

Source

pub fn get_clear_key(&mut self) -> u16

Gets the clear (unlock) key

Auto Trait Implementations§

§

impl<T> Freeze for HardwareSemaphore<T>

§

impl<T> RefUnwindSafe for HardwareSemaphore<T>
where T: RefUnwindSafe,

§

impl<T> Send for HardwareSemaphore<T>

§

impl<T> Sync for HardwareSemaphore<T>
where T: Sync,

§

impl<T> Unpin for HardwareSemaphore<T>
where T: Unpin,

§

impl<T> UnwindSafe for HardwareSemaphore<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.