pub struct HardwareSemaphoreChannel<'a, T: Instance> { /* private fields */ }Expand description
Hardware semaphore channel
Implementations§
Source§impl<'a, T: Instance> HardwareSemaphoreChannel<'a, T>
impl<'a, T: Instance> HardwareSemaphoreChannel<'a, T>
Sourcepub async fn lock(&mut self, process_id: u8) -> HardwareSemaphoreMutex<'a, T>
pub async fn lock(&mut self, process_id: u8) -> HardwareSemaphoreMutex<'a, T>
Locks the semaphore. The 2-step lock procedure consists in a write to lock the semaphore, followed by a read to check if the lock has been successful, carried out from the HSEM_Rx register.
Sourcepub fn try_lock(
&mut self,
process_id: u8,
) -> Option<HardwareSemaphoreMutex<'a, T>>
pub fn try_lock( &mut self, process_id: u8, ) -> Option<HardwareSemaphoreMutex<'a, T>>
Try to lock the semaphor The 2-step lock procedure consists in a write to lock the semaphore, followed by a read to check if the lock has been successful, carried out from the HSEM_Rx register.
Sourcepub fn two_step_lock(&mut self, process_id: u8) -> Result<(), HsemError>
pub fn two_step_lock(&mut self, process_id: u8) -> Result<(), HsemError>
Locks the semaphore. The 2-step lock procedure consists in a write to lock the semaphore, followed by a read to check if the lock has been successful, carried out from the HSEM_Rx register.
Sourcepub fn one_step_lock(&mut self) -> Result<(), HsemError>
pub fn one_step_lock(&mut self) -> Result<(), HsemError>
Locks the semaphore. The 1-step procedure consists in a read to lock and check the semaphore in a single step, carried out from the HSEM_RLRx register.
Auto Trait Implementations§
impl<'a, T> Freeze for HardwareSemaphoreChannel<'a, T>
impl<'a, T> RefUnwindSafe for HardwareSemaphoreChannel<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for HardwareSemaphoreChannel<'a, T>
impl<'a, T> Sync for HardwareSemaphoreChannel<'a, T>where
T: Sync,
impl<'a, T> Unpin for HardwareSemaphoreChannel<'a, T>
impl<'a, T> !UnwindSafe for HardwareSemaphoreChannel<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more