pub struct Sram<T, const BANK: u8>where
T: FromBytes,{ /* private fields */ }Available on crate feature
pak only.Expand description
A value at the base of SRAM bank BANK.
Declared by #[sram].
Implementations§
Source§impl<T, const BANK: u8> Sram<T, BANK>where
T: FromBytes,
impl<T, const BANK: u8> Sram<T, BANK>where
T: FromBytes,
Sourcepub fn open<R>(&self, _cs: CriticalSection<'_>, f: impl FnOnce(&T) -> R) -> R
pub fn open<R>(&self, _cs: CriticalSection<'_>, f: impl FnOnce(&T) -> R) -> R
Switch the RAM on, run f, switch it off.
The CriticalSection keeps an interrupt handler from reaching the same
bytes while f runs.
The window holds one thing at a time, so f must not open another scope
or read another peripheral: the rest of f would look at whatever that
left selected.
Trait Implementations§
Auto Trait Implementations§
impl<T, const BANK: u8> BankSafe for Sram<T, BANK>where
T: BankSafe,
impl<T, const BANK: u8> Freeze for Sram<T, BANK>
impl<T, const BANK: u8> RefUnwindSafe for Sram<T, BANK>where
T: RefUnwindSafe,
impl<T, const BANK: u8> Send for Sram<T, BANK>where
T: Send,
impl<T, const BANK: u8> Unpin for Sram<T, BANK>where
T: Unpin,
impl<T, const BANK: u8> UnsafeUnpin for Sram<T, BANK>
impl<T, const BANK: u8> UnwindSafe for Sram<T, BANK>where
T: UnwindSafe,
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