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>
impl<E> UartRegisterGate<E>
Sourcepub const fn new(emergency_tx: E) -> UartRegisterGate<E>
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,
impl<E> UartRegisterGate<E>where
E: ?Sized,
Sourcepub fn try_enter(&self) -> Option<UartRegisterGuard<'_, E>>
pub fn try_enter(&self) -> Option<UartRegisterGuard<'_, E>>
Attempts to claim the register block without waiting.
Sourcepub fn emergency_active(&self) -> bool
pub fn emergency_active(&self) -> bool
Returns whether emergency output permanently owns the register block.
Source§impl<E> UartRegisterGate<E>where
E: UartEmergencyTx + ?Sized,
impl<E> UartRegisterGate<E>where
E: UartEmergencyTx + ?Sized,
Sourcepub fn try_begin_emergency(&self) -> Option<UartEmergencyAccess<'_, E>>
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.