Skip to main content

UartRegisterGate

Struct UartRegisterGate 

Source
pub struct UartRegisterGate<E = dyn UartEmergencyTx>
where E: ?Sized,
{ /* private fields */ }
Expand description

Non-blocking exclusion for aliases of one UART register block.

Normal task and IRQ endpoints use same-CPU IRQ exclusion. This additional gate serializes cross-CPU normal and emergency register access. Emergency takeover is terminal, but each emergency pass still obtains exclusive access so two fatal writers cannot touch the registers concurrently.

Implementations§

Source§

impl<E> UartRegisterGate<E>

Source

pub const fn new(emergency_tx: E) -> UartRegisterGate<E>

Creates a free register gate that owns emergency_tx.

Source§

impl<E> UartRegisterGate<E>
where E: ?Sized,

Source

pub fn try_enter(&self) -> Option<UartRegisterGuard<'_, E>>

Attempts to claim the register block without waiting.

Source

pub fn emergency_active(&self) -> bool

Returns whether emergency output permanently owns the register block.

Source§

impl<E> UartRegisterGate<E>
where E: UartEmergencyTx + ?Sized,

Source

pub fn try_begin_emergency(&self) -> Option<UartEmergencyAccess<'_, E>>

Claims the terminal emergency endpoint and quiesces this UART.

The first successful claim permanently excludes normal task and IRQ endpoints. Every successful claim masks all device-local interrupt sources before returning a writable access proof. Later emergency claims remain possible, but concurrent emergency register access is rejected.

Auto Trait Implementations§

§

impl<E = dyn UartEmergencyTx> !Freeze for UartRegisterGate<E>

§

impl<E> RefUnwindSafe for UartRegisterGate<E>
where E: RefUnwindSafe + ?Sized,

§

impl<E> Send for UartRegisterGate<E>
where E: Send + ?Sized,

§

impl<E> Sync for UartRegisterGate<E>
where E: Sync + ?Sized,

§

impl<E> Unpin for UartRegisterGate<E>
where E: Unpin + ?Sized,

§

impl<E> UnsafeUnpin for UartRegisterGate<E>
where E: UnsafeUnpin + ?Sized,

§

impl<E> UnwindSafe for UartRegisterGate<E>
where E: UnwindSafe + ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.